import{S as Ri,i as Gi,s as Xi,e as o,k as c,w as v,t as a,M as Yi,c as r,d as n,m as p,a as s,x as b,h as i,b as l,G as e,g as f,y as w,q as y,o as T,B as S,v as Zi,L as Po}from"../../chunks/vendor-hf-doc-builder.js";import{T as La}from"../../chunks/Tip-hf-doc-builder.js";import{D as A}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ao}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Fe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Eo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function el(z){let h,k,u,g,$;return g=new Ao({props:{code:`from transformers import SplinterModel, SplinterConfig

# Initializing a Splinter tau/splinter-base style configuration
configuration = SplinterConfig()

# Initializing a model from the tau/splinter-base style configuration
model = SplinterModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SplinterModel, SplinterConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Splinter tau/splinter-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SplinterConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the tau/splinter-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SplinterModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=o("p"),k=a("Example:"),u=c(),v(g.$$.fragment)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Example:"),_.forEach(n),u=p(d),b(g.$$.fragment,d)},m(d,_){f(d,h,_),e(h,k),f(d,u,_),w(g,d,_),$=!0},p:Po,i(d){$||(y(g.$$.fragment,d),$=!0)},o(d){T(g.$$.fragment,d),$=!1},d(d){d&&n(h),d&&n(u),S(g,d)}}}function tl(z){let h,k,u,g,$;return{c(){h=o("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),g=a("Module"),$=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var x=s(u);g=i(x,"Module"),x.forEach(n),$=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(n)},m(d,_){f(d,h,_),e(h,k),e(h,u),e(u,g),e(h,$)},d(d){d&&n(h)}}}function nl(z){let h,k,u,g,$;return g=new Ao({props:{code:`from transformers import SplinterTokenizer, SplinterModel
import torch

tokenizer = SplinterTokenizer.from_pretrained("tau/splinter-base")
model = SplinterModel.from_pretrained("tau/splinter-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SplinterTokenizer, SplinterModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SplinterTokenizer.from_pretrained(<span class="hljs-string">&quot;tau/splinter-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SplinterModel.from_pretrained(<span class="hljs-string">&quot;tau/splinter-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){h=o("p"),k=a("Example:"),u=c(),v(g.$$.fragment)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Example:"),_.forEach(n),u=p(d),b(g.$$.fragment,d)},m(d,_){f(d,h,_),e(h,k),f(d,u,_),w(g,d,_),$=!0},p:Po,i(d){$||(y(g.$$.fragment,d),$=!0)},o(d){T(g.$$.fragment,d),$=!1},d(d){d&&n(h),d&&n(u),S(g,d)}}}function ol(z){let h,k,u,g,$;return{c(){h=o("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),g=a("Module"),$=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var x=s(u);g=i(x,"Module"),x.forEach(n),$=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(n)},m(d,_){f(d,h,_),e(h,k),e(h,u),e(u,g),e(h,$)},d(d){d&&n(h)}}}function rl(z){let h,k,u,g,$;return g=new Ao({props:{code:`from transformers import SplinterTokenizer, SplinterForQuestionAnswering
import torch

tokenizer = SplinterTokenizer.from_pretrained("tau/splinter-base")
model = SplinterForQuestionAnswering.from_pretrained("tau/splinter-base")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SplinterTokenizer, SplinterForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = SplinterTokenizer.from_pretrained(<span class="hljs-string">&quot;tau/splinter-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SplinterForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;tau/splinter-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens)
`}}),{c(){h=o("p"),k=a("Example:"),u=c(),v(g.$$.fragment)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Example:"),_.forEach(n),u=p(d),b(g.$$.fragment,d)},m(d,_){f(d,h,_),e(h,k),f(d,u,_),w(g,d,_),$=!0},p:Po,i(d){$||(y(g.$$.fragment,d),$=!0)},o(d){T(g.$$.fragment,d),$=!1},d(d){d&&n(h),d&&n(u),S(g,d)}}}function sl(z){let h,k;return h=new Ao({props:{code:`# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)
`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
`}}),{c(){v(h.$$.fragment)},l(u){b(h.$$.fragment,u)},m(u,g){w(h,u,g),k=!0},p:Po,i(u){k||(y(h.$$.fragment,u),k=!0)},o(u){T(h.$$.fragment,u),k=!1},d(u){S(h,u)}}}function al(z){let h,k,u,g,$;return{c(){h=o("p"),k=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=o("code"),g=a("Module"),$=a(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){h=r(d,"P",{});var _=s(h);k=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(_,"CODE",{});var x=s(u);g=i(x,"Module"),x.forEach(n),$=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(n)},m(d,_){f(d,h,_),e(h,k),e(h,u),e(u,g),e(h,$)},d(d){d&&n(h)}}}function il(z){let h,k,u,g,$,d,_,x,Fo,Wn,K,ie,en,Me,Mo,tn,Io,Bn,le,Co,Ie,Lo,Oo,Un,Tt,No,Vn,St,Do,Hn,$t,jo,Jn,N,Ce,Qo,qt,Wo,Bo,Uo,Q,Vo,zt,Ho,Jo,xt,Ko,Ro,nn,Go,Xo,Yo,Le,Zo,on,er,tr,nr,F,or,rn,rr,sr,sn,ar,ir,an,lr,dr,ln,cr,pr,Kn,D,hr,Oe,mr,ur,Ne,fr,gr,De,_r,kr,Rn,R,de,dn,je,vr,cn,br,Gn,M,Qe,wr,G,yr,Et,Tr,Sr,We,$r,qr,zr,X,xr,Pt,Er,Pr,At,Ar,Fr,Mr,ce,Xn,Y,pe,pn,Be,Ir,hn,Cr,Yn,q,Ue,Lr,mn,Or,Nr,Ve,Dr,Ft,jr,Qr,Wr,W,He,Br,un,Ur,Vr,Je,Mt,Hr,fn,Jr,Kr,It,Rr,gn,Gr,Xr,he,Ke,Yr,Re,Zr,_n,es,ts,ns,B,Ge,os,Ct,rs,Lt,ss,as,kn,is,ls,Ot,Xe,Zn,Z,me,vn,Ye,ds,bn,cs,eo,I,Ze,ps,et,hs,wn,ms,us,fs,tt,gs,Nt,_s,ks,vs,U,nt,bs,yn,ws,ys,ot,Dt,Ts,Tn,Ss,$s,jt,qs,Sn,zs,to,ee,ue,$n,rt,xs,qn,Es,no,C,st,Ps,at,As,it,Fs,Ms,Is,lt,Cs,dt,Ls,Os,Ns,j,ct,Ds,te,js,Qt,Qs,Ws,zn,Bs,Us,Vs,fe,Hs,ge,oo,ne,_e,xn,pt,Js,En,Ks,ro,L,ht,Rs,oe,Gs,Pn,Xs,Ys,An,Zs,ea,ta,mt,na,ut,oa,ra,sa,E,ft,aa,re,ia,Wt,la,da,Fn,ca,pa,ha,ke,ma,ve,ua,be,so,se,we,Mn,gt,fa,In,ga,ao,O,_t,_a,Cn,ka,va,kt,ba,vt,wa,ya,Ta,V,bt,Sa,ae,$a,Bt,qa,za,Ln,xa,Ea,Pa,ye,io;return d=new Fe({}),Me=new Fe({}),je=new Fe({}),Qe=new A({props:{name:"class transformers.SplinterConfig",anchor:"transformers.SplinterConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"question_token_id",val:" = 104"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SplinterConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the Splinter model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterModel">SplinterModel</a>.`,name:"vocab_size"},{anchor:"transformers.SplinterConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.SplinterConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.SplinterConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.SplinterConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.SplinterConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SplinterConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SplinterConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.SplinterConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.SplinterConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterModel">SplinterModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.SplinterConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.SplinterConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.SplinterConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.SplinterConfig.question_token_id",description:`<strong>question_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 104) &#x2014;
The id of the <code>[QUESTION]</code> token.`,name:"question_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/configuration_splinter.py#L32"}}),ce=new Eo({props:{anchor:"transformers.SplinterConfig.example",$$slots:{default:[el]},$$scope:{ctx:z}}}),Be=new Fe({}),Ue=new A({props:{name:"class transformers.SplinterTokenizer",anchor:"transformers.SplinterTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"question_token",val:" = '[QUESTION]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SplinterTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SplinterTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.SplinterTokenizer.do_basic_tokenize",description:`<strong>do_basic_tokenize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to do basic tokenization before WordPiece.`,name:"do_basic_tokenize"},{anchor:"transformers.SplinterTokenizer.never_split",description:`<strong>never_split</strong> (<code>Iterable</code>, <em>optional</em>) &#x2014;
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>`,name:"never_split"},{anchor:"transformers.SplinterTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.SplinterTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.SplinterTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.SplinterTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.SplinterTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.SplinterTokenizer.question_token",description:`<strong>question_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[QUESTION]&quot;</code>) &#x2014;
The token used for constructing question representations.`,name:"question_token"},{anchor:"transformers.SplinterTokenizer.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters.</p>
<p>This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).
strip_accents &#x2014; (<code>bool</code>, <em>optional</em>):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"tokenize_chinese_chars"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter.py#L75"}}),He=new A({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SplinterTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SplinterTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
The question token IDs if pad_on_right, else context tokens IDs`,name:"token_ids_0"},{anchor:"transformers.SplinterTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
The context token IDs if pad_on_right, else question token IDs`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter.py#L218",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ke=new A({props:{name:"get_special_tokens_mask",anchor:"transformers.SplinterTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.SplinterTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.SplinterTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.SplinterTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter.py#L250",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ge=new A({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.SplinterTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SplinterTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.SplinterTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter.py#L278",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Xe=new A({props:{name:"save_vocabulary",anchor:"transformers.SplinterTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter.py#L307"}}),Ye=new Fe({}),Ze=new A({props:{name:"class transformers.SplinterTokenizerFast",anchor:"transformers.SplinterTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"question_token",val:" = '[QUESTION]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SplinterTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.SplinterTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.SplinterTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.SplinterTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.SplinterTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.SplinterTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.SplinterTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.SplinterTokenizerFast.question_token",description:`<strong>question_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[QUESTION]&quot;</code>) &#x2014;
The token used for constructing question representations.`,name:"question_token"},{anchor:"transformers.SplinterTokenizerFast.clean_text",description:`<strong>clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to clean the text before tokenization by removing any control characters and replacing all
whitespaces by the classic one.`,name:"clean_text"},{anchor:"transformers.SplinterTokenizerFast.tokenize_chinese_chars",description:`<strong>tokenize_chinese_chars</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see <a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">this
issue</a>).
strip_accents &#x2014; (<code>bool</code>, <em>optional</em>):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).
wordpieces_prefix &#x2014; (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>):
The prefix for subwords.`,name:"tokenize_chinese_chars"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter_fast.py#L55"}}),nt=new A({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.SplinterTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.SplinterTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
The question token IDs if pad_on_right, else context tokens IDs`,name:"token_ids_0"},{anchor:"transformers.SplinterTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
The context token IDs if pad_on_right, else question token IDs`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/tokenization_splinter_fast.py#L153",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),rt=new Fe({}),st=new A({props:{name:"class transformers.SplinterModel",anchor:"transformers.SplinterModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SplinterModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterConfig">SplinterConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L609"}}),ct=new A({props:{name:"forward",anchor:"transformers.SplinterModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.SplinterModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterTokenizer">SplinterTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SplinterModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SplinterModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SplinterModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SplinterModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SplinterModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SplinterModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SplinterModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SplinterModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SplinterModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.SplinterModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.SplinterModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.SplinterModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L640",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterConfig"
>SplinterConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_17548/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new La({props:{$$slots:{default:[tl]},$$scope:{ctx:z}}}),ge=new Eo({props:{anchor:"transformers.SplinterModel.forward.example",$$slots:{default:[nl]},$$scope:{ctx:z}}}),pt=new Fe({}),ht=new A({props:{name:"class transformers.SplinterForQuestionAnswering",anchor:"transformers.SplinterForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SplinterForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterConfig">SplinterConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L831"}}),ft=new A({props:{name:"forward",anchor:"transformers.SplinterForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"question_positions",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.SplinterForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterTokenizer">SplinterTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SplinterForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SplinterForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SplinterForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, sequence_length</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SplinterForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SplinterForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SplinterForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SplinterForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SplinterForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SplinterForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.SplinterForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"},{anchor:"transformers.SplinterForQuestionAnswering.forward.question_positions",description:`<strong>question_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_questions)</code>, <em>optional</em>) &#x2014;
The positions of all question tokens. If given, start_logits and end_logits will be of shape <code>(batch_size, num_questions, sequence_length)</code>. If None, the first question token in each sequence in the batch will be
the only one for which start_logits and end_logits are calculated and they will be of shape <code>(batch_size, sequence_length)</code>.`,name:"question_positions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L842",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterConfig"
>SplinterConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_17548/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new La({props:{$$slots:{default:[ol]},$$scope:{ctx:z}}}),ve=new Eo({props:{anchor:"transformers.SplinterForQuestionAnswering.forward.example",$$slots:{default:[rl]},$$scope:{ctx:z}}}),be=new Eo({props:{anchor:"transformers.SplinterForQuestionAnswering.forward.example-2",$$slots:{default:[sl]},$$scope:{ctx:z}}}),gt=new Fe({}),_t=new A({props:{name:"class transformers.SplinterForPreTraining",anchor:"transformers.SplinterForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.SplinterForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterConfig">SplinterConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L986"}}),bt=new A({props:{name:"forward",anchor:"transformers.SplinterForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"question_positions",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.SplinterForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_questions, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterTokenizer">SplinterTokenizer</a>. See <a href="/docs/transformers/pr_17548/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_17548/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.SplinterForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>batch_size, num_questions, sequence_length</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.SplinterForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, num_questions, sequence_length</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.SplinterForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>batch_size, num_questions, sequence_length</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.SplinterForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.SplinterForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_questions, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.SplinterForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SplinterForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SplinterForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SplinterForPreTraining.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_questions)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.SplinterForPreTraining.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_questions)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"},{anchor:"transformers.SplinterForPreTraining.forward.question_positions",description:`<strong>question_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_questions)</code>, <em>optional</em>) &#x2014;
The positions of all question tokens. If given, start_logits and end_logits will be of shape <code>(batch_size, num_questions, sequence_length)</code>. If None, the first question token in each sequence in the batch will be
the only one for which start_logits and end_logits are calculated and they will be of shape <code>(batch_size, sequence_length)</code>.`,name:"question_positions"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/splinter/modeling_splinter.py#L997"}}),ye=new La({props:{$$slots:{default:[al]},$$scope:{ctx:z}}}),{c(){h=o("meta"),k=c(),u=o("h1"),g=o("a"),$=o("span"),v(d.$$.fragment),_=c(),x=o("span"),Fo=a("Splinter"),Wn=c(),K=o("h2"),ie=o("a"),en=o("span"),v(Me.$$.fragment),Mo=c(),tn=o("span"),Io=a("Overview"),Bn=c(),le=o("p"),Co=a("The Splinter model was proposed in "),Ie=o("a"),Lo=a("Few-Shot Question Answering by Pretraining Span Selection"),Oo=a(` by Ori Ram, Yuval Kirstain, Jonathan Berant, Amir Globerson, Omer Levy. Splinter
is an encoder-only transformer (similar to BERT) pretrained using the recurring span selection task on a large corpus
comprising Wikipedia and the Toronto Book Corpus.`),Un=c(),Tt=o("p"),No=a("The abstract from the paper is the following:"),Vn=c(),St=o("p"),Do=a(`In several question answering benchmarks, pretrained models have reached human parity through fine-tuning on an order
of 100,000 annotated questions and answers. We explore the more realistic few-shot setting, where only a few hundred
training examples are available, and observe that standard models perform poorly, highlighting the discrepancy between
current pretraining objectives and question answering. We propose a new pretraining scheme tailored for question
answering: recurring span selection. Given a passage with multiple sets of recurring spans, we mask in each set all
recurring spans but one, and ask the model to select the correct span in the passage for each masked span. Masked spans
are replaced with a special token, viewed as a question representation, that is later used during fine-tuning to select
the answer span. The resulting model obtains surprisingly good results on multiple benchmarks (e.g., 72.7 F1 on SQuAD
with only 128 training examples), while maintaining competitive performance in the high-resource setting.`),Hn=c(),$t=o("p"),jo=a("Tips:"),Jn=c(),N=o("ul"),Ce=o("li"),Qo=a(`Splinter was trained to predict answers spans conditioned on a special [QUESTION] token. These tokens contextualize
to question representations which are used to predict the answers. This layer is called QASS, and is the default
behaviour in the `),qt=o("a"),Wo=a("SplinterForQuestionAnswering"),Bo=a(" class. Therefore:"),Uo=c(),Q=o("li"),Vo=a("Use "),zt=o("a"),Ho=a("SplinterTokenizer"),Jo=a(" (rather than "),xt=o("a"),Ko=a("BertTokenizer"),Ro=a(`), as it already
contains this special token. Also, its default behavior is to use this token when two sequences are given (for
example, in the `),nn=o("em"),Go=a("run_qa.py"),Xo=a(" script)."),Yo=c(),Le=o("li"),Zo=a("If you plan on using Splinter outside "),on=o("em"),er=a("run_qa.py"),tr=a(`, please keep in mind the question token - it might be important for
the success of your model, especially in a few-shot setting.`),nr=c(),F=o("li"),or=a(`Please note there are two different checkpoints for each size of Splinter. Both are basically the same, except that
one also has the pretrained wights of the QASS layer (`),rn=o("em"),rr=a("tau/splinter-base-qass"),sr=a(" and "),sn=o("em"),ar=a("tau/splinter-large-qass"),ir=a(`) and one
doesn\u2019t (`),an=o("em"),lr=a("tau/splinter-base"),dr=a(" and "),ln=o("em"),cr=a("tau/splinter-large"),pr=a(`). This is done to support randomly initializing this layer at
fine-tuning, as it is shown to yield better results for some cases in the paper.`),Kn=c(),D=o("p"),hr=a("This model was contributed by "),Oe=o("a"),mr=a("yuvalkirstain"),ur=a(" and "),Ne=o("a"),fr=a("oriram"),gr=a(". The original code can be found "),De=o("a"),_r=a("here"),kr=a("."),Rn=c(),R=o("h2"),de=o("a"),dn=o("span"),v(je.$$.fragment),vr=c(),cn=o("span"),br=a("SplinterConfig"),Gn=c(),M=o("div"),v(Qe.$$.fragment),wr=c(),G=o("p"),yr=a("This is the configuration class to store the configuration of a "),Et=o("a"),Tr=a("SplinterModel"),Sr=a(`. It is used to instantiate an
Splinter model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Splinter
`),We=o("a"),$r=a("tau/splinter-base"),qr=a(" architecture."),zr=c(),X=o("p"),xr=a("Configuration objects inherit from "),Pt=o("a"),Er=a("PretrainedConfig"),Pr=a(` and can be used to control the model outputs. Read the
documentation from `),At=o("a"),Ar=a("PretrainedConfig"),Fr=a(" for more information."),Mr=c(),v(ce.$$.fragment),Xn=c(),Y=o("h2"),pe=o("a"),pn=o("span"),v(Be.$$.fragment),Ir=c(),hn=o("span"),Cr=a("SplinterTokenizer"),Yn=c(),q=o("div"),v(Ue.$$.fragment),Lr=c(),mn=o("p"),Or=a("Construct a Splinter tokenizer. Based on WordPiece."),Nr=c(),Ve=o("p"),Dr=a("This tokenizer inherits from "),Ft=o("a"),jr=a("PreTrainedTokenizer"),Qr=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Wr=c(),W=o("div"),v(He.$$.fragment),Br=c(),un=o("p"),Ur=a(`Build model inputs from a pair of sequence for question answering tasks by concatenating and adding special
tokens. A Splinter sequence has the following format:`),Vr=c(),Je=o("ul"),Mt=o("li"),Hr=a("single sequence: "),fn=o("code"),Jr=a("[CLS] X [SEP]"),Kr=c(),It=o("li"),Rr=a("pair of sequences for question answering: "),gn=o("code"),Gr=a("[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),Xr=c(),he=o("div"),v(Ke.$$.fragment),Yr=c(),Re=o("p"),Zr=a(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),_n=o("code"),es=a("prepare_for_model"),ts=a(" method."),ns=c(),B=o("div"),v(Ge.$$.fragment),os=c(),Ct=o("p"),rs=a("Create the token type IDs corresponding to the sequences passed. "),Lt=o("a"),ss=a(`What are token type
IDs?`),as=c(),kn=o("p"),is=a("Should be overridden in a subclass if the model has a special way of building those."),ls=c(),Ot=o("div"),v(Xe.$$.fragment),Zn=c(),Z=o("h2"),me=o("a"),vn=o("span"),v(Ye.$$.fragment),ds=c(),bn=o("span"),cs=a("SplinterTokenizerFast"),eo=c(),I=o("div"),v(Ze.$$.fragment),ps=c(),et=o("p"),hs=a("Construct a \u201Cfast\u201D Splinter tokenizer (backed by HuggingFace\u2019s "),wn=o("em"),ms=a("tokenizers"),us=a(" library). Based on WordPiece."),fs=c(),tt=o("p"),gs=a("This tokenizer inherits from "),Nt=o("a"),_s=a("PreTrainedTokenizerFast"),ks=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),vs=c(),U=o("div"),v(nt.$$.fragment),bs=c(),yn=o("p"),ws=a(`Build model inputs from a pair of sequence for question answering tasks by concatenating and adding special
tokens. A Splinter sequence has the following format:`),ys=c(),ot=o("ul"),Dt=o("li"),Ts=a("single sequence: "),Tn=o("code"),Ss=a("[CLS] X [SEP]"),$s=c(),jt=o("li"),qs=a("pair of sequences for question answering: "),Sn=o("code"),zs=a("[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),to=c(),ee=o("h2"),ue=o("a"),$n=o("span"),v(rt.$$.fragment),xs=c(),qn=o("span"),Es=a("SplinterModel"),no=c(),C=o("div"),v(st.$$.fragment),Ps=c(),at=o("p"),As=a(`The bare Splinter Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),it=o("a"),Fs=a("torch.nn.Module"),Ms=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Is=c(),lt=o("p"),Cs=a("The model is an encoder (with only self-attention) following the architecture described in "),dt=o("a"),Ls=a(`Attention is all you
need`),Os=a(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Ns=c(),j=o("div"),v(ct.$$.fragment),Ds=c(),te=o("p"),js=a("The "),Qt=o("a"),Qs=a("SplinterModel"),Ws=a(" forward method, overrides the "),zn=o("code"),Bs=a("__call__"),Us=a(" special method."),Vs=c(),v(fe.$$.fragment),Hs=c(),v(ge.$$.fragment),oo=c(),ne=o("h2"),_e=o("a"),xn=o("span"),v(pt.$$.fragment),Js=c(),En=o("span"),Ks=a("SplinterForQuestionAnswering"),ro=c(),L=o("div"),v(ht.$$.fragment),Rs=c(),oe=o("p"),Gs=a(`Splinter Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),Pn=o("code"),Xs=a("span start logits"),Ys=a(" and "),An=o("code"),Zs=a("span end logits"),ea=a(")."),ta=c(),mt=o("p"),na=a("This model is a PyTorch "),ut=o("a"),oa=a("torch.nn.Module"),ra=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sa=c(),E=o("div"),v(ft.$$.fragment),aa=c(),re=o("p"),ia=a("The "),Wt=o("a"),la=a("SplinterForQuestionAnswering"),da=a(" forward method, overrides the "),Fn=o("code"),ca=a("__call__"),pa=a(" special method."),ha=c(),v(ke.$$.fragment),ma=c(),v(ve.$$.fragment),ua=c(),v(be.$$.fragment),so=c(),se=o("h2"),we=o("a"),Mn=o("span"),v(gt.$$.fragment),fa=c(),In=o("span"),ga=a("SplinterForPreTraining"),ao=c(),O=o("div"),v(_t.$$.fragment),_a=c(),Cn=o("p"),ka=a(`Splinter Model for the recurring span selection task as done during the pretraining. The difference to the QA task
is that we do not have a question, but multiple question tokens that replace the occurrences of recurring spans
instead.`),va=c(),kt=o("p"),ba=a("This model is a PyTorch "),vt=o("a"),wa=a("torch.nn.Module"),ya=a(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ta=c(),V=o("div"),v(bt.$$.fragment),Sa=c(),ae=o("p"),$a=a("The "),Bt=o("a"),qa=a("SplinterForPreTraining"),za=a(" forward method, overrides the "),Ln=o("code"),xa=a("__call__"),Ea=a(" special method."),Pa=c(),v(ye.$$.fragment),this.h()},l(t){const m=Yi('[data-svelte="svelte-1phssyn"]',document.head);h=r(m,"META",{name:!0,content:!0}),m.forEach(n),k=p(t),u=r(t,"H1",{class:!0});var wt=s(u);g=r(wt,"A",{id:!0,class:!0,href:!0});var On=s(g);$=r(On,"SPAN",{});var Nn=s($);b(d.$$.fragment,Nn),Nn.forEach(n),On.forEach(n),_=p(wt),x=r(wt,"SPAN",{});var Dn=s(x);Fo=i(Dn,"Splinter"),Dn.forEach(n),wt.forEach(n),Wn=p(t),K=r(t,"H2",{class:!0});var yt=s(K);ie=r(yt,"A",{id:!0,class:!0,href:!0});var jn=s(ie);en=r(jn,"SPAN",{});var Qn=s(en);b(Me.$$.fragment,Qn),Qn.forEach(n),jn.forEach(n),Mo=p(yt),tn=r(yt,"SPAN",{});var Oa=s(tn);Io=i(Oa,"Overview"),Oa.forEach(n),yt.forEach(n),Bn=p(t),le=r(t,"P",{});var lo=s(le);Co=i(lo,"The Splinter model was proposed in "),Ie=r(lo,"A",{href:!0,rel:!0});var Na=s(Ie);Lo=i(Na,"Few-Shot Question Answering by Pretraining Span Selection"),Na.forEach(n),Oo=i(lo,` by Ori Ram, Yuval Kirstain, Jonathan Berant, Amir Globerson, Omer Levy. Splinter
is an encoder-only transformer (similar to BERT) pretrained using the recurring span selection task on a large corpus
comprising Wikipedia and the Toronto Book Corpus.`),lo.forEach(n),Un=p(t),Tt=r(t,"P",{});var Da=s(Tt);No=i(Da,"The abstract from the paper is the following:"),Da.forEach(n),Vn=p(t),St=r(t,"P",{});var ja=s(St);Do=i(ja,`In several question answering benchmarks, pretrained models have reached human parity through fine-tuning on an order
of 100,000 annotated questions and answers. We explore the more realistic few-shot setting, where only a few hundred
training examples are available, and observe that standard models perform poorly, highlighting the discrepancy between
current pretraining objectives and question answering. We propose a new pretraining scheme tailored for question
answering: recurring span selection. Given a passage with multiple sets of recurring spans, we mask in each set all
recurring spans but one, and ask the model to select the correct span in the passage for each masked span. Masked spans
are replaced with a special token, viewed as a question representation, that is later used during fine-tuning to select
the answer span. The resulting model obtains surprisingly good results on multiple benchmarks (e.g., 72.7 F1 on SQuAD
with only 128 training examples), while maintaining competitive performance in the high-resource setting.`),ja.forEach(n),Hn=p(t),$t=r(t,"P",{});var Qa=s($t);jo=i(Qa,"Tips:"),Qa.forEach(n),Jn=p(t),N=r(t,"UL",{});var Te=s(N);Ce=r(Te,"LI",{});var co=s(Ce);Qo=i(co,`Splinter was trained to predict answers spans conditioned on a special [QUESTION] token. These tokens contextualize
to question representations which are used to predict the answers. This layer is called QASS, and is the default
behaviour in the `),qt=r(co,"A",{href:!0});var Wa=s(qt);Wo=i(Wa,"SplinterForQuestionAnswering"),Wa.forEach(n),Bo=i(co," class. Therefore:"),co.forEach(n),Uo=p(Te),Q=r(Te,"LI",{});var Se=s(Q);Vo=i(Se,"Use "),zt=r(Se,"A",{href:!0});var Ba=s(zt);Ho=i(Ba,"SplinterTokenizer"),Ba.forEach(n),Jo=i(Se," (rather than "),xt=r(Se,"A",{href:!0});var Ua=s(xt);Ko=i(Ua,"BertTokenizer"),Ua.forEach(n),Ro=i(Se,`), as it already
contains this special token. Also, its default behavior is to use this token when two sequences are given (for
example, in the `),nn=r(Se,"EM",{});var Va=s(nn);Go=i(Va,"run_qa.py"),Va.forEach(n),Xo=i(Se," script)."),Se.forEach(n),Yo=p(Te),Le=r(Te,"LI",{});var po=s(Le);Zo=i(po,"If you plan on using Splinter outside "),on=r(po,"EM",{});var Ha=s(on);er=i(Ha,"run_qa.py"),Ha.forEach(n),tr=i(po,`, please keep in mind the question token - it might be important for
the success of your model, especially in a few-shot setting.`),po.forEach(n),nr=p(Te),F=r(Te,"LI",{});var H=s(F);or=i(H,`Please note there are two different checkpoints for each size of Splinter. Both are basically the same, except that
one also has the pretrained wights of the QASS layer (`),rn=r(H,"EM",{});var Ja=s(rn);rr=i(Ja,"tau/splinter-base-qass"),Ja.forEach(n),sr=i(H," and "),sn=r(H,"EM",{});var Ka=s(sn);ar=i(Ka,"tau/splinter-large-qass"),Ka.forEach(n),ir=i(H,`) and one
doesn\u2019t (`),an=r(H,"EM",{});var Ra=s(an);lr=i(Ra,"tau/splinter-base"),Ra.forEach(n),dr=i(H," and "),ln=r(H,"EM",{});var Ga=s(ln);cr=i(Ga,"tau/splinter-large"),Ga.forEach(n),pr=i(H,`). This is done to support randomly initializing this layer at
fine-tuning, as it is shown to yield better results for some cases in the paper.`),H.forEach(n),Te.forEach(n),Kn=p(t),D=r(t,"P",{});var $e=s(D);hr=i($e,"This model was contributed by "),Oe=r($e,"A",{href:!0,rel:!0});var Xa=s(Oe);mr=i(Xa,"yuvalkirstain"),Xa.forEach(n),ur=i($e," and "),Ne=r($e,"A",{href:!0,rel:!0});var Ya=s(Ne);fr=i(Ya,"oriram"),Ya.forEach(n),gr=i($e,". The original code can be found "),De=r($e,"A",{href:!0,rel:!0});var Za=s(De);_r=i(Za,"here"),Za.forEach(n),kr=i($e,"."),$e.forEach(n),Rn=p(t),R=r(t,"H2",{class:!0});var ho=s(R);de=r(ho,"A",{id:!0,class:!0,href:!0});var ei=s(de);dn=r(ei,"SPAN",{});var ti=s(dn);b(je.$$.fragment,ti),ti.forEach(n),ei.forEach(n),vr=p(ho),cn=r(ho,"SPAN",{});var ni=s(cn);br=i(ni,"SplinterConfig"),ni.forEach(n),ho.forEach(n),Gn=p(t),M=r(t,"DIV",{class:!0});var qe=s(M);b(Qe.$$.fragment,qe),wr=p(qe),G=r(qe,"P",{});var Ut=s(G);yr=i(Ut,"This is the configuration class to store the configuration of a "),Et=r(Ut,"A",{href:!0});var oi=s(Et);Tr=i(oi,"SplinterModel"),oi.forEach(n),Sr=i(Ut,`. It is used to instantiate an
Splinter model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the Splinter
`),We=r(Ut,"A",{href:!0,rel:!0});var ri=s(We);$r=i(ri,"tau/splinter-base"),ri.forEach(n),qr=i(Ut," architecture."),Ut.forEach(n),zr=p(qe),X=r(qe,"P",{});var Vt=s(X);xr=i(Vt,"Configuration objects inherit from "),Pt=r(Vt,"A",{href:!0});var si=s(Pt);Er=i(si,"PretrainedConfig"),si.forEach(n),Pr=i(Vt,` and can be used to control the model outputs. Read the
documentation from `),At=r(Vt,"A",{href:!0});var ai=s(At);Ar=i(ai,"PretrainedConfig"),ai.forEach(n),Fr=i(Vt," for more information."),Vt.forEach(n),Mr=p(qe),b(ce.$$.fragment,qe),qe.forEach(n),Xn=p(t),Y=r(t,"H2",{class:!0});var mo=s(Y);pe=r(mo,"A",{id:!0,class:!0,href:!0});var ii=s(pe);pn=r(ii,"SPAN",{});var li=s(pn);b(Be.$$.fragment,li),li.forEach(n),ii.forEach(n),Ir=p(mo),hn=r(mo,"SPAN",{});var di=s(hn);Cr=i(di,"SplinterTokenizer"),di.forEach(n),mo.forEach(n),Yn=p(t),q=r(t,"DIV",{class:!0});var P=s(q);b(Ue.$$.fragment,P),Lr=p(P),mn=r(P,"P",{});var ci=s(mn);Or=i(ci,"Construct a Splinter tokenizer. Based on WordPiece."),ci.forEach(n),Nr=p(P),Ve=r(P,"P",{});var uo=s(Ve);Dr=i(uo,"This tokenizer inherits from "),Ft=r(uo,"A",{href:!0});var pi=s(Ft);jr=i(pi,"PreTrainedTokenizer"),pi.forEach(n),Qr=i(uo,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),uo.forEach(n),Wr=p(P),W=r(P,"DIV",{class:!0});var Ht=s(W);b(He.$$.fragment,Ht),Br=p(Ht),un=r(Ht,"P",{});var hi=s(un);Ur=i(hi,`Build model inputs from a pair of sequence for question answering tasks by concatenating and adding special
tokens. A Splinter sequence has the following format:`),hi.forEach(n),Vr=p(Ht),Je=r(Ht,"UL",{});var fo=s(Je);Mt=r(fo,"LI",{});var Aa=s(Mt);Hr=i(Aa,"single sequence: "),fn=r(Aa,"CODE",{});var mi=s(fn);Jr=i(mi,"[CLS] X [SEP]"),mi.forEach(n),Aa.forEach(n),Kr=p(fo),It=r(fo,"LI",{});var Fa=s(It);Rr=i(Fa,"pair of sequences for question answering: "),gn=r(Fa,"CODE",{});var ui=s(gn);Gr=i(ui,"[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),ui.forEach(n),Fa.forEach(n),fo.forEach(n),Ht.forEach(n),Xr=p(P),he=r(P,"DIV",{class:!0});var go=s(he);b(Ke.$$.fragment,go),Yr=p(go),Re=r(go,"P",{});var _o=s(Re);Zr=i(_o,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),_n=r(_o,"CODE",{});var fi=s(_n);es=i(fi,"prepare_for_model"),fi.forEach(n),ts=i(_o," method."),_o.forEach(n),go.forEach(n),ns=p(P),B=r(P,"DIV",{class:!0});var Jt=s(B);b(Ge.$$.fragment,Jt),os=p(Jt),Ct=r(Jt,"P",{});var Ma=s(Ct);rs=i(Ma,"Create the token type IDs corresponding to the sequences passed. "),Lt=r(Ma,"A",{href:!0});var gi=s(Lt);ss=i(gi,`What are token type
IDs?`),gi.forEach(n),Ma.forEach(n),as=p(Jt),kn=r(Jt,"P",{});var _i=s(kn);is=i(_i,"Should be overridden in a subclass if the model has a special way of building those."),_i.forEach(n),Jt.forEach(n),ls=p(P),Ot=r(P,"DIV",{class:!0});var ki=s(Ot);b(Xe.$$.fragment,ki),ki.forEach(n),P.forEach(n),Zn=p(t),Z=r(t,"H2",{class:!0});var ko=s(Z);me=r(ko,"A",{id:!0,class:!0,href:!0});var vi=s(me);vn=r(vi,"SPAN",{});var bi=s(vn);b(Ye.$$.fragment,bi),bi.forEach(n),vi.forEach(n),ds=p(ko),bn=r(ko,"SPAN",{});var wi=s(bn);cs=i(wi,"SplinterTokenizerFast"),wi.forEach(n),ko.forEach(n),eo=p(t),I=r(t,"DIV",{class:!0});var ze=s(I);b(Ze.$$.fragment,ze),ps=p(ze),et=r(ze,"P",{});var vo=s(et);hs=i(vo,"Construct a \u201Cfast\u201D Splinter tokenizer (backed by HuggingFace\u2019s "),wn=r(vo,"EM",{});var yi=s(wn);ms=i(yi,"tokenizers"),yi.forEach(n),us=i(vo," library). Based on WordPiece."),vo.forEach(n),fs=p(ze),tt=r(ze,"P",{});var bo=s(tt);gs=i(bo,"This tokenizer inherits from "),Nt=r(bo,"A",{href:!0});var Ti=s(Nt);_s=i(Ti,"PreTrainedTokenizerFast"),Ti.forEach(n),ks=i(bo,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),bo.forEach(n),vs=p(ze),U=r(ze,"DIV",{class:!0});var Kt=s(U);b(nt.$$.fragment,Kt),bs=p(Kt),yn=r(Kt,"P",{});var Si=s(yn);ws=i(Si,`Build model inputs from a pair of sequence for question answering tasks by concatenating and adding special
tokens. A Splinter sequence has the following format:`),Si.forEach(n),ys=p(Kt),ot=r(Kt,"UL",{});var wo=s(ot);Dt=r(wo,"LI",{});var Ia=s(Dt);Ts=i(Ia,"single sequence: "),Tn=r(Ia,"CODE",{});var $i=s(Tn);Ss=i($i,"[CLS] X [SEP]"),$i.forEach(n),Ia.forEach(n),$s=p(wo),jt=r(wo,"LI",{});var Ca=s(jt);qs=i(Ca,"pair of sequences for question answering: "),Sn=r(Ca,"CODE",{});var qi=s(Sn);zs=i(qi,"[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),qi.forEach(n),Ca.forEach(n),wo.forEach(n),Kt.forEach(n),ze.forEach(n),to=p(t),ee=r(t,"H2",{class:!0});var yo=s(ee);ue=r(yo,"A",{id:!0,class:!0,href:!0});var zi=s(ue);$n=r(zi,"SPAN",{});var xi=s($n);b(rt.$$.fragment,xi),xi.forEach(n),zi.forEach(n),xs=p(yo),qn=r(yo,"SPAN",{});var Ei=s(qn);Es=i(Ei,"SplinterModel"),Ei.forEach(n),yo.forEach(n),no=p(t),C=r(t,"DIV",{class:!0});var xe=s(C);b(st.$$.fragment,xe),Ps=p(xe),at=r(xe,"P",{});var To=s(at);As=i(To,`The bare Splinter Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),it=r(To,"A",{href:!0,rel:!0});var Pi=s(it);Fs=i(Pi,"torch.nn.Module"),Pi.forEach(n),Ms=i(To,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),To.forEach(n),Is=p(xe),lt=r(xe,"P",{});var So=s(lt);Cs=i(So,"The model is an encoder (with only self-attention) following the architecture described in "),dt=r(So,"A",{href:!0,rel:!0});var Ai=s(dt);Ls=i(Ai,`Attention is all you
need`),Ai.forEach(n),Os=i(So,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),So.forEach(n),Ns=p(xe),j=r(xe,"DIV",{class:!0});var Ee=s(j);b(ct.$$.fragment,Ee),Ds=p(Ee),te=r(Ee,"P",{});var Rt=s(te);js=i(Rt,"The "),Qt=r(Rt,"A",{href:!0});var Fi=s(Qt);Qs=i(Fi,"SplinterModel"),Fi.forEach(n),Ws=i(Rt," forward method, overrides the "),zn=r(Rt,"CODE",{});var Mi=s(zn);Bs=i(Mi,"__call__"),Mi.forEach(n),Us=i(Rt," special method."),Rt.forEach(n),Vs=p(Ee),b(fe.$$.fragment,Ee),Hs=p(Ee),b(ge.$$.fragment,Ee),Ee.forEach(n),xe.forEach(n),oo=p(t),ne=r(t,"H2",{class:!0});var $o=s(ne);_e=r($o,"A",{id:!0,class:!0,href:!0});var Ii=s(_e);xn=r(Ii,"SPAN",{});var Ci=s(xn);b(pt.$$.fragment,Ci),Ci.forEach(n),Ii.forEach(n),Js=p($o),En=r($o,"SPAN",{});var Li=s(En);Ks=i(Li,"SplinterForQuestionAnswering"),Li.forEach(n),$o.forEach(n),ro=p(t),L=r(t,"DIV",{class:!0});var Pe=s(L);b(ht.$$.fragment,Pe),Rs=p(Pe),oe=r(Pe,"P",{});var Gt=s(oe);Gs=i(Gt,`Splinter Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),Pn=r(Gt,"CODE",{});var Oi=s(Pn);Xs=i(Oi,"span start logits"),Oi.forEach(n),Ys=i(Gt," and "),An=r(Gt,"CODE",{});var Ni=s(An);Zs=i(Ni,"span end logits"),Ni.forEach(n),ea=i(Gt,")."),Gt.forEach(n),ta=p(Pe),mt=r(Pe,"P",{});var qo=s(mt);na=i(qo,"This model is a PyTorch "),ut=r(qo,"A",{href:!0,rel:!0});var Di=s(ut);oa=i(Di,"torch.nn.Module"),Di.forEach(n),ra=i(qo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),qo.forEach(n),sa=p(Pe),E=r(Pe,"DIV",{class:!0});var J=s(E);b(ft.$$.fragment,J),aa=p(J),re=r(J,"P",{});var Xt=s(re);ia=i(Xt,"The "),Wt=r(Xt,"A",{href:!0});var ji=s(Wt);la=i(ji,"SplinterForQuestionAnswering"),ji.forEach(n),da=i(Xt," forward method, overrides the "),Fn=r(Xt,"CODE",{});var Qi=s(Fn);ca=i(Qi,"__call__"),Qi.forEach(n),pa=i(Xt," special method."),Xt.forEach(n),ha=p(J),b(ke.$$.fragment,J),ma=p(J),b(ve.$$.fragment,J),ua=p(J),b(be.$$.fragment,J),J.forEach(n),Pe.forEach(n),so=p(t),se=r(t,"H2",{class:!0});var zo=s(se);we=r(zo,"A",{id:!0,class:!0,href:!0});var Wi=s(we);Mn=r(Wi,"SPAN",{});var Bi=s(Mn);b(gt.$$.fragment,Bi),Bi.forEach(n),Wi.forEach(n),fa=p(zo),In=r(zo,"SPAN",{});var Ui=s(In);ga=i(Ui,"SplinterForPreTraining"),Ui.forEach(n),zo.forEach(n),ao=p(t),O=r(t,"DIV",{class:!0});var Ae=s(O);b(_t.$$.fragment,Ae),_a=p(Ae),Cn=r(Ae,"P",{});var Vi=s(Cn);ka=i(Vi,`Splinter Model for the recurring span selection task as done during the pretraining. The difference to the QA task
is that we do not have a question, but multiple question tokens that replace the occurrences of recurring spans
instead.`),Vi.forEach(n),va=p(Ae),kt=r(Ae,"P",{});var xo=s(kt);ba=i(xo,"This model is a PyTorch "),vt=r(xo,"A",{href:!0,rel:!0});var Hi=s(vt);wa=i(Hi,"torch.nn.Module"),Hi.forEach(n),ya=i(xo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),xo.forEach(n),Ta=p(Ae),V=r(Ae,"DIV",{class:!0});var Yt=s(V);b(bt.$$.fragment,Yt),Sa=p(Yt),ae=r(Yt,"P",{});var Zt=s(ae);$a=i(Zt,"The "),Bt=r(Zt,"A",{href:!0});var Ji=s(Bt);qa=i(Ji,"SplinterForPreTraining"),Ji.forEach(n),za=i(Zt," forward method, overrides the "),Ln=r(Zt,"CODE",{});var Ki=s(Ln);xa=i(Ki,"__call__"),Ki.forEach(n),Ea=i(Zt," special method."),Zt.forEach(n),Pa=p(Yt),b(ye.$$.fragment,Yt),Yt.forEach(n),Ae.forEach(n),this.h()},h(){l(h,"name","hf:doc:metadata"),l(h,"content",JSON.stringify(ll)),l(g,"id","splinter"),l(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(g,"href","#splinter"),l(u,"class","relative group"),l(ie,"id","overview"),l(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ie,"href","#overview"),l(K,"class","relative group"),l(Ie,"href","https://arxiv.org/abs/2101.00438"),l(Ie,"rel","nofollow"),l(qt,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterForQuestionAnswering"),l(zt,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterTokenizer"),l(xt,"href","/docs/transformers/pr_17548/en/model_doc/bert#transformers.BertTokenizer"),l(Oe,"href","https://huggingface.co/yuvalkirstain"),l(Oe,"rel","nofollow"),l(Ne,"href","https://huggingface.co/oriram"),l(Ne,"rel","nofollow"),l(De,"href","https://github.com/oriram/splinter"),l(De,"rel","nofollow"),l(de,"id","transformers.SplinterConfig"),l(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(de,"href","#transformers.SplinterConfig"),l(R,"class","relative group"),l(Et,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterModel"),l(We,"href","https://huggingface.co/tau/splinter-base"),l(We,"rel","nofollow"),l(Pt,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),l(At,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"id","transformers.SplinterTokenizer"),l(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(pe,"href","#transformers.SplinterTokenizer"),l(Y,"class","relative group"),l(Ft,"href","/docs/transformers/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Lt,"href","../glossary#token-type-ids"),l(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(me,"id","transformers.SplinterTokenizerFast"),l(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(me,"href","#transformers.SplinterTokenizerFast"),l(Z,"class","relative group"),l(Nt,"href","/docs/transformers/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"id","transformers.SplinterModel"),l(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ue,"href","#transformers.SplinterModel"),l(ee,"class","relative group"),l(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(it,"rel","nofollow"),l(dt,"href","https://arxiv.org/abs/1706.03762"),l(dt,"rel","nofollow"),l(Qt,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterModel"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_e,"id","transformers.SplinterForQuestionAnswering"),l(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(_e,"href","#transformers.SplinterForQuestionAnswering"),l(ne,"class","relative group"),l(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ut,"rel","nofollow"),l(Wt,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterForQuestionAnswering"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(we,"id","transformers.SplinterForPreTraining"),l(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(we,"href","#transformers.SplinterForPreTraining"),l(se,"class","relative group"),l(vt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(vt,"rel","nofollow"),l(Bt,"href","/docs/transformers/pr_17548/en/model_doc/splinter#transformers.SplinterForPreTraining"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,m){e(document.head,h),f(t,k,m),f(t,u,m),e(u,g),e(g,$),w(d,$,null),e(u,_),e(u,x),e(x,Fo),f(t,Wn,m),f(t,K,m),e(K,ie),e(ie,en),w(Me,en,null),e(K,Mo),e(K,tn),e(tn,Io),f(t,Bn,m),f(t,le,m),e(le,Co),e(le,Ie),e(Ie,Lo),e(le,Oo),f(t,Un,m),f(t,Tt,m),e(Tt,No),f(t,Vn,m),f(t,St,m),e(St,Do),f(t,Hn,m),f(t,$t,m),e($t,jo),f(t,Jn,m),f(t,N,m),e(N,Ce),e(Ce,Qo),e(Ce,qt),e(qt,Wo),e(Ce,Bo),e(N,Uo),e(N,Q),e(Q,Vo),e(Q,zt),e(zt,Ho),e(Q,Jo),e(Q,xt),e(xt,Ko),e(Q,Ro),e(Q,nn),e(nn,Go),e(Q,Xo),e(N,Yo),e(N,Le),e(Le,Zo),e(Le,on),e(on,er),e(Le,tr),e(N,nr),e(N,F),e(F,or),e(F,rn),e(rn,rr),e(F,sr),e(F,sn),e(sn,ar),e(F,ir),e(F,an),e(an,lr),e(F,dr),e(F,ln),e(ln,cr),e(F,pr),f(t,Kn,m),f(t,D,m),e(D,hr),e(D,Oe),e(Oe,mr),e(D,ur),e(D,Ne),e(Ne,fr),e(D,gr),e(D,De),e(De,_r),e(D,kr),f(t,Rn,m),f(t,R,m),e(R,de),e(de,dn),w(je,dn,null),e(R,vr),e(R,cn),e(cn,br),f(t,Gn,m),f(t,M,m),w(Qe,M,null),e(M,wr),e(M,G),e(G,yr),e(G,Et),e(Et,Tr),e(G,Sr),e(G,We),e(We,$r),e(G,qr),e(M,zr),e(M,X),e(X,xr),e(X,Pt),e(Pt,Er),e(X,Pr),e(X,At),e(At,Ar),e(X,Fr),e(M,Mr),w(ce,M,null),f(t,Xn,m),f(t,Y,m),e(Y,pe),e(pe,pn),w(Be,pn,null),e(Y,Ir),e(Y,hn),e(hn,Cr),f(t,Yn,m),f(t,q,m),w(Ue,q,null),e(q,Lr),e(q,mn),e(mn,Or),e(q,Nr),e(q,Ve),e(Ve,Dr),e(Ve,Ft),e(Ft,jr),e(Ve,Qr),e(q,Wr),e(q,W),w(He,W,null),e(W,Br),e(W,un),e(un,Ur),e(W,Vr),e(W,Je),e(Je,Mt),e(Mt,Hr),e(Mt,fn),e(fn,Jr),e(Je,Kr),e(Je,It),e(It,Rr),e(It,gn),e(gn,Gr),e(q,Xr),e(q,he),w(Ke,he,null),e(he,Yr),e(he,Re),e(Re,Zr),e(Re,_n),e(_n,es),e(Re,ts),e(q,ns),e(q,B),w(Ge,B,null),e(B,os),e(B,Ct),e(Ct,rs),e(Ct,Lt),e(Lt,ss),e(B,as),e(B,kn),e(kn,is),e(q,ls),e(q,Ot),w(Xe,Ot,null),f(t,Zn,m),f(t,Z,m),e(Z,me),e(me,vn),w(Ye,vn,null),e(Z,ds),e(Z,bn),e(bn,cs),f(t,eo,m),f(t,I,m),w(Ze,I,null),e(I,ps),e(I,et),e(et,hs),e(et,wn),e(wn,ms),e(et,us),e(I,fs),e(I,tt),e(tt,gs),e(tt,Nt),e(Nt,_s),e(tt,ks),e(I,vs),e(I,U),w(nt,U,null),e(U,bs),e(U,yn),e(yn,ws),e(U,ys),e(U,ot),e(ot,Dt),e(Dt,Ts),e(Dt,Tn),e(Tn,Ss),e(ot,$s),e(ot,jt),e(jt,qs),e(jt,Sn),e(Sn,zs),f(t,to,m),f(t,ee,m),e(ee,ue),e(ue,$n),w(rt,$n,null),e(ee,xs),e(ee,qn),e(qn,Es),f(t,no,m),f(t,C,m),w(st,C,null),e(C,Ps),e(C,at),e(at,As),e(at,it),e(it,Fs),e(at,Ms),e(C,Is),e(C,lt),e(lt,Cs),e(lt,dt),e(dt,Ls),e(lt,Os),e(C,Ns),e(C,j),w(ct,j,null),e(j,Ds),e(j,te),e(te,js),e(te,Qt),e(Qt,Qs),e(te,Ws),e(te,zn),e(zn,Bs),e(te,Us),e(j,Vs),w(fe,j,null),e(j,Hs),w(ge,j,null),f(t,oo,m),f(t,ne,m),e(ne,_e),e(_e,xn),w(pt,xn,null),e(ne,Js),e(ne,En),e(En,Ks),f(t,ro,m),f(t,L,m),w(ht,L,null),e(L,Rs),e(L,oe),e(oe,Gs),e(oe,Pn),e(Pn,Xs),e(oe,Ys),e(oe,An),e(An,Zs),e(oe,ea),e(L,ta),e(L,mt),e(mt,na),e(mt,ut),e(ut,oa),e(mt,ra),e(L,sa),e(L,E),w(ft,E,null),e(E,aa),e(E,re),e(re,ia),e(re,Wt),e(Wt,la),e(re,da),e(re,Fn),e(Fn,ca),e(re,pa),e(E,ha),w(ke,E,null),e(E,ma),w(ve,E,null),e(E,ua),w(be,E,null),f(t,so,m),f(t,se,m),e(se,we),e(we,Mn),w(gt,Mn,null),e(se,fa),e(se,In),e(In,ga),f(t,ao,m),f(t,O,m),w(_t,O,null),e(O,_a),e(O,Cn),e(Cn,ka),e(O,va),e(O,kt),e(kt,ba),e(kt,vt),e(vt,wa),e(kt,ya),e(O,Ta),e(O,V),w(bt,V,null),e(V,Sa),e(V,ae),e(ae,$a),e(ae,Bt),e(Bt,qa),e(ae,za),e(ae,Ln),e(Ln,xa),e(ae,Ea),e(V,Pa),w(ye,V,null),io=!0},p(t,[m]){const wt={};m&2&&(wt.$$scope={dirty:m,ctx:t}),ce.$set(wt);const On={};m&2&&(On.$$scope={dirty:m,ctx:t}),fe.$set(On);const Nn={};m&2&&(Nn.$$scope={dirty:m,ctx:t}),ge.$set(Nn);const Dn={};m&2&&(Dn.$$scope={dirty:m,ctx:t}),ke.$set(Dn);const yt={};m&2&&(yt.$$scope={dirty:m,ctx:t}),ve.$set(yt);const jn={};m&2&&(jn.$$scope={dirty:m,ctx:t}),be.$set(jn);const Qn={};m&2&&(Qn.$$scope={dirty:m,ctx:t}),ye.$set(Qn)},i(t){io||(y(d.$$.fragment,t),y(Me.$$.fragment,t),y(je.$$.fragment,t),y(Qe.$$.fragment,t),y(ce.$$.fragment,t),y(Be.$$.fragment,t),y(Ue.$$.fragment,t),y(He.$$.fragment,t),y(Ke.$$.fragment,t),y(Ge.$$.fragment,t),y(Xe.$$.fragment,t),y(Ye.$$.fragment,t),y(Ze.$$.fragment,t),y(nt.$$.fragment,t),y(rt.$$.fragment,t),y(st.$$.fragment,t),y(ct.$$.fragment,t),y(fe.$$.fragment,t),y(ge.$$.fragment,t),y(pt.$$.fragment,t),y(ht.$$.fragment,t),y(ft.$$.fragment,t),y(ke.$$.fragment,t),y(ve.$$.fragment,t),y(be.$$.fragment,t),y(gt.$$.fragment,t),y(_t.$$.fragment,t),y(bt.$$.fragment,t),y(ye.$$.fragment,t),io=!0)},o(t){T(d.$$.fragment,t),T(Me.$$.fragment,t),T(je.$$.fragment,t),T(Qe.$$.fragment,t),T(ce.$$.fragment,t),T(Be.$$.fragment,t),T(Ue.$$.fragment,t),T(He.$$.fragment,t),T(Ke.$$.fragment,t),T(Ge.$$.fragment,t),T(Xe.$$.fragment,t),T(Ye.$$.fragment,t),T(Ze.$$.fragment,t),T(nt.$$.fragment,t),T(rt.$$.fragment,t),T(st.$$.fragment,t),T(ct.$$.fragment,t),T(fe.$$.fragment,t),T(ge.$$.fragment,t),T(pt.$$.fragment,t),T(ht.$$.fragment,t),T(ft.$$.fragment,t),T(ke.$$.fragment,t),T(ve.$$.fragment,t),T(be.$$.fragment,t),T(gt.$$.fragment,t),T(_t.$$.fragment,t),T(bt.$$.fragment,t),T(ye.$$.fragment,t),io=!1},d(t){n(h),t&&n(k),t&&n(u),S(d),t&&n(Wn),t&&n(K),S(Me),t&&n(Bn),t&&n(le),t&&n(Un),t&&n(Tt),t&&n(Vn),t&&n(St),t&&n(Hn),t&&n($t),t&&n(Jn),t&&n(N),t&&n(Kn),t&&n(D),t&&n(Rn),t&&n(R),S(je),t&&n(Gn),t&&n(M),S(Qe),S(ce),t&&n(Xn),t&&n(Y),S(Be),t&&n(Yn),t&&n(q),S(Ue),S(He),S(Ke),S(Ge),S(Xe),t&&n(Zn),t&&n(Z),S(Ye),t&&n(eo),t&&n(I),S(Ze),S(nt),t&&n(to),t&&n(ee),S(rt),t&&n(no),t&&n(C),S(st),S(ct),S(fe),S(ge),t&&n(oo),t&&n(ne),S(pt),t&&n(ro),t&&n(L),S(ht),S(ft),S(ke),S(ve),S(be),t&&n(so),t&&n(se),S(gt),t&&n(ao),t&&n(O),S(_t),S(bt),S(ye)}}}const ll={local:"splinter",sections:[{local:"overview",title:"Overview"},{local:"transformers.SplinterConfig",title:"SplinterConfig"},{local:"transformers.SplinterTokenizer",title:"SplinterTokenizer"},{local:"transformers.SplinterTokenizerFast",title:"SplinterTokenizerFast"},{local:"transformers.SplinterModel",title:"SplinterModel"},{local:"transformers.SplinterForQuestionAnswering",title:"SplinterForQuestionAnswering"},{local:"transformers.SplinterForPreTraining",title:"SplinterForPreTraining"}],title:"Splinter"};function dl(z){return Zi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gl extends Ri{constructor(h){super();Gi(this,h,dl,il,Xi,{})}}export{gl as default,ll as metadata};
