import{S as ul,i as ml,s as fl,e as o,k as d,w as v,t as a,M as gl,c as s,d as n,m as c,a as r,x as b,h as i,b as l,G as e,g as m,y as w,q as y,o as T,B as S,v as _l,L as Za}from"../../chunks/vendor-hf-doc-builder.js";import{T as Oa}from"../../chunks/Tip-hf-doc-builder.js";import{D as x}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ga}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Da}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function kl(M){let u,$,_,g,k;return g=new Ga({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwbGludGVyTW9kZWwlMkMlMjBTcGxpbnRlckNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTcGxpbnRlciUyMHRhdSUyRnNwbGludGVyLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU3BsaW50ZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjB0YXUlMkZzcGxpbnRlci1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTcGxpbnRlck1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",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(){u=o("p"),$=a("Example:"),_=d(),v(g.$$.fragment)},l(p){u=s(p,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(n),_=c(p),b(g.$$.fragment,p)},m(p,f){m(p,u,f),e(u,$),m(p,_,f),w(g,p,f),k=!0},p:Za,i(p){k||(y(g.$$.fragment,p),k=!0)},o(p){T(g.$$.fragment,p),k=!1},d(p){p&&n(u),p&&n(_),S(g,p)}}}function vl(M){let u,$,_,g,k;return{c(){u=o("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=a("Module"),k=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(p){u=s(p,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var q=r(_);g=i(q,"Module"),q.forEach(n),k=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(n)},m(p,f){m(p,u,f),e(u,$),e(u,_),e(_,g),e(u,k)},d(p){p&&n(u)}}}function bl(M){let u,$,_,g,k;return g=new Ga({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcGxpbnRlck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0YXUlMkZzcGxpbnRlci1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwU3BsaW50ZXJNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIydGF1JTJGc3BsaW50ZXItYmFzZSUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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 = AutoTokenizer.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(){u=o("p"),$=a("Example:"),_=d(),v(g.$$.fragment)},l(p){u=s(p,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(n),_=c(p),b(g.$$.fragment,p)},m(p,f){m(p,u,f),e(u,$),m(p,_,f),w(g,p,f),k=!0},p:Za,i(p){k||(y(g.$$.fragment,p),k=!0)},o(p){T(g.$$.fragment,p),k=!1},d(p){p&&n(u),p&&n(_),S(g,p)}}}function wl(M){let u,$,_,g,k;return{c(){u=o("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=a("Module"),k=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(p){u=s(p,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var q=r(_);g=i(q,"Module"),q.forEach(n),k=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(n)},m(p,f){m(p,u,f),e(u,$),e(u,_),e(_,g),e(u,k)},d(p){p&&n(u)}}}function yl(M){let u,$,_,g,k;return g=new Ga({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTcGxpbnRlckZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0YXUlMkZzcGxpbnRlci1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwU3BsaW50ZXJGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIydGF1JTJGc3BsaW50ZXItYmFzZSUyMiklMEElMEFxdWVzdGlvbiUyQyUyMHRleHQlMjAlM0QlMjAlMjJXaG8lMjB3YXMlMjBKaW0lMjBIZW5zb24lM0YlMjIlMkMlMjAlMjJKaW0lMjBIZW5zb24lMjB3YXMlMjBhJTIwbmljZSUyMHB1cHBldCUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihxdWVzdGlvbiUyQyUyMHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwaW5wdXRzLmlucHV0X2lkcyU1QjAlMkMlMjBhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0ElMjBhbnN3ZXJfZW5kX2luZGV4JTIwJTJCJTIwMSU1RCUwQSUwQSUyMyUyMHRhcmdldCUyMGlzJTIwJTIybmljZSUyMHB1cHBldCUyMiUwQXRhcmdldF9zdGFydF9pbmRleCUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxNCU1RCklMEF0YXJnZXRfZW5kX2luZGV4JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QjE1JTVEKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMHN0YXJ0X3Bvc2l0aW9ucyUzRHRhcmdldF9zdGFydF9pbmRleCUyQyUyMGVuZF9wb3NpdGlvbnMlM0R0YXJnZXRfZW5kX2luZGV4KSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, 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 = AutoTokenizer.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><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`}}),{c(){u=o("p"),$=a("Example:"),_=d(),v(g.$$.fragment)},l(p){u=s(p,"P",{});var f=r(u);$=i(f,"Example:"),f.forEach(n),_=c(p),b(g.$$.fragment,p)},m(p,f){m(p,u,f),e(u,$),m(p,_,f),w(g,p,f),k=!0},p:Za,i(p){k||(y(g.$$.fragment,p),k=!0)},o(p){T(g.$$.fragment,p),k=!1},d(p){p&&n(u),p&&n(_),S(g,p)}}}function Tl(M){let u,$,_,g,k;return{c(){u=o("p"),$=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=o("code"),g=a("Module"),k=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(p){u=s(p,"P",{});var f=r(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var q=r(_);g=i(q,"Module"),q.forEach(n),k=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(n)},m(p,f){m(p,u,f),e(u,$),e(u,_),e(_,g),e(u,k)},d(p){p&&n(u)}}}function Sl(M){let u,$,_,g,k,p,f,q,Wo,Rn,G,le,sn,Ie,jo,rn,Bo,Xn,de,Jo,Ce,Lo,Qo,Vn,$t,Oo,Hn,zt,Do,Yn,Mt,Zo,Kn,N,Ue,Go,qt,Ro,Xo,Vo,J,Ho,Et,Yo,Ko,xt,es,ts,an,ns,os,ss,Ne,rs,ln,as,is,ls,A,ds,dn,cs,ps,cn,hs,us,pn,ms,fs,hn,gs,_s,eo,W,ks,We,vs,bs,je,ws,ys,Be,Ts,Ss,to,R,ce,un,Je,$s,mn,zs,no,At,fn,Pt,Ms,oo,X,pe,gn,Le,qs,_n,Es,so,P,Qe,xs,V,As,Ft,Ps,Fs,Oe,Is,Cs,Us,H,Ns,It,Ws,js,Ct,Bs,Js,Ls,he,ro,Y,ue,kn,De,Qs,vn,Os,ao,z,Ze,Ds,bn,Zs,Gs,Ge,Rs,Ut,Xs,Vs,Hs,L,Re,Ys,wn,Ks,er,Xe,Nt,tr,yn,nr,or,Wt,sr,Tn,rr,ar,me,Ve,ir,He,lr,Sn,dr,cr,pr,Q,Ye,hr,jt,ur,Bt,mr,fr,$n,gr,_r,Jt,Ke,io,K,fe,zn,et,kr,Mn,vr,lo,F,tt,br,nt,wr,qn,yr,Tr,Sr,ot,$r,Lt,zr,Mr,qr,O,st,Er,En,xr,Ar,rt,Qt,Pr,xn,Fr,Ir,Ot,Cr,An,Ur,co,ee,ge,Pn,at,Nr,Fn,Wr,po,I,it,jr,lt,Br,dt,Jr,Lr,Qr,ct,Or,pt,Dr,Zr,Gr,j,ht,Rr,te,Xr,Dt,Vr,Hr,In,Yr,Kr,ea,_e,ta,ke,ho,ne,ve,Cn,ut,na,Un,oa,uo,C,mt,sa,oe,ra,Nn,aa,ia,Wn,la,da,ca,ft,pa,gt,ha,ua,ma,B,_t,fa,se,ga,Zt,_a,ka,jn,va,ba,wa,be,ya,we,mo,re,ye,Bn,kt,Ta,Jn,Sa,fo,U,vt,$a,Ln,za,Ma,bt,qa,wt,Ea,xa,Aa,D,yt,Pa,ae,Fa,Gt,Ia,Ca,Qn,Ua,Na,Wa,Te,go;return p=new ie({}),Ie=new ie({}),Je=new ie({}),Le=new ie({}),Qe=new x({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/configuration_splinter.py#L32"}}),he=new Da({props:{anchor:"transformers.SplinterConfig.example",$$slots:{default:[kl]},$$scope:{ctx:M}}}),De=new ie({}),Ze=new x({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>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.SplinterTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
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:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/splinter/tokenization_splinter.py#L75"}}),Re=new x({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/v4.32.0/src/transformers/models/splinter/tokenization_splinter.py#L217",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>
`}}),Ve=new x({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/v4.32.0/src/transformers/models/splinter/tokenization_splinter.py#L249",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>
`}}),Ye=new x({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/v4.32.0/src/transformers/models/splinter/tokenization_splinter.py#L277",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ke=new x({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/v4.32.0/src/transformers/models/splinter/tokenization_splinter.py#L306"}}),et=new ie({}),tt=new x({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>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.SplinterTokenizerFast.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
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:"strip_accents"},{anchor:"transformers.SplinterTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/splinter/tokenization_splinter_fast.py#L55"}}),st=new x({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/v4.32.0/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>
`}}),at=new ie({}),it=new x({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L617"}}),ht=new x({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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L648",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPastAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new Oa({props:{$$slots:{default:[vl]},$$scope:{ctx:M}}}),ke=new Da({props:{anchor:"transformers.SplinterModel.forward.example",$$slots:{default:[bl]},$$scope:{ctx:M}}}),ut=new ie({}),mt=new x({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L839"}}),_t=new x({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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L850",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new Oa({props:{$$slots:{default:[wl]},$$scope:{ctx:M}}}),we=new Da({props:{anchor:"transformers.SplinterForQuestionAnswering.forward.example",$$slots:{default:[yl]},$$scope:{ctx:M}}}),kt=new ie({}),vt=new x({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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L993"}}),yt=new x({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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/v4.32.0/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/v4.32.0/src/transformers/models/splinter/modeling_splinter.py#L1004"}}),Te=new Oa({props:{$$slots:{default:[Tl]},$$scope:{ctx:M}}}),{c(){u=o("meta"),$=d(),_=o("h1"),g=o("a"),k=o("span"),v(p.$$.fragment),f=d(),q=o("span"),Wo=a("Splinter"),Rn=d(),G=o("h2"),le=o("a"),sn=o("span"),v(Ie.$$.fragment),jo=d(),rn=o("span"),Bo=a("Overview"),Xn=d(),de=o("p"),Jo=a("The Splinter model was proposed in "),Ce=o("a"),Lo=a("Few-Shot Question Answering by Pretraining Span Selection"),Qo=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.`),Vn=d(),$t=o("p"),Oo=a("The abstract from the paper is the following:"),Hn=d(),zt=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.`),Yn=d(),Mt=o("p"),Zo=a("Tips:"),Kn=d(),N=o("ul"),Ue=o("li"),Go=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"),Ro=a("SplinterForQuestionAnswering"),Xo=a(" class. Therefore:"),Vo=d(),J=o("li"),Ho=a("Use "),Et=o("a"),Yo=a("SplinterTokenizer"),Ko=a(" (rather than "),xt=o("a"),es=a("BertTokenizer"),ts=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 `),an=o("em"),ns=a("run_qa.py"),os=a(" script)."),ss=d(),Ne=o("li"),rs=a("If you plan on using Splinter outside "),ln=o("em"),as=a("run_qa.py"),is=a(`, please keep in mind the question token - it might be important for
the success of your model, especially in a few-shot setting.`),ls=d(),A=o("li"),ds=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 weights of the QASS layer (`),dn=o("em"),cs=a("tau/splinter-base-qass"),ps=a(" and "),cn=o("em"),hs=a("tau/splinter-large-qass"),us=a(`) and one
doesn\u2019t (`),pn=o("em"),ms=a("tau/splinter-base"),fs=a(" and "),hn=o("em"),gs=a("tau/splinter-large"),_s=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.`),eo=d(),W=o("p"),ks=a("This model was contributed by "),We=o("a"),vs=a("yuvalkirstain"),bs=a(" and "),je=o("a"),ws=a("oriram"),ys=a(". The original code can be found "),Be=o("a"),Ts=a("here"),Ss=a("."),to=d(),R=o("h2"),ce=o("a"),un=o("span"),v(Je.$$.fragment),$s=d(),mn=o("span"),zs=a("Documentation resources"),no=d(),At=o("ul"),fn=o("li"),Pt=o("a"),Ms=a("Question answering task guide"),oo=d(),X=o("h2"),pe=o("a"),gn=o("span"),v(Le.$$.fragment),qs=d(),_n=o("span"),Es=a("SplinterConfig"),so=d(),P=o("div"),v(Qe.$$.fragment),xs=d(),V=o("p"),As=a("This is the configuration class to store the configuration of a "),Ft=o("a"),Ps=a("SplinterModel"),Fs=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
`),Oe=o("a"),Is=a("tau/splinter-base"),Cs=a(" architecture."),Us=d(),H=o("p"),Ns=a("Configuration objects inherit from "),It=o("a"),Ws=a("PretrainedConfig"),js=a(` and can be used to control the model outputs. Read the
documentation from `),Ct=o("a"),Bs=a("PretrainedConfig"),Js=a(" for more information."),Ls=d(),v(he.$$.fragment),ro=d(),Y=o("h2"),ue=o("a"),kn=o("span"),v(De.$$.fragment),Qs=d(),vn=o("span"),Os=a("SplinterTokenizer"),ao=d(),z=o("div"),v(Ze.$$.fragment),Ds=d(),bn=o("p"),Zs=a("Construct a Splinter tokenizer. Based on WordPiece."),Gs=d(),Ge=o("p"),Rs=a("This tokenizer inherits from "),Ut=o("a"),Xs=a("PreTrainedTokenizer"),Vs=a(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Hs=d(),L=o("div"),v(Re.$$.fragment),Ys=d(),wn=o("p"),Ks=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:`),er=d(),Xe=o("ul"),Nt=o("li"),tr=a("single sequence: "),yn=o("code"),nr=a("[CLS] X [SEP]"),or=d(),Wt=o("li"),sr=a("pair of sequences for question answering: "),Tn=o("code"),rr=a("[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),ar=d(),me=o("div"),v(Ve.$$.fragment),ir=d(),He=o("p"),lr=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 `),Sn=o("code"),dr=a("prepare_for_model"),cr=a(" method."),pr=d(),Q=o("div"),v(Ye.$$.fragment),hr=d(),jt=o("p"),ur=a("Create the token type IDs corresponding to the sequences passed. "),Bt=o("a"),mr=a(`What are token type
IDs?`),fr=d(),$n=o("p"),gr=a("Should be overridden in a subclass if the model has a special way of building those."),_r=d(),Jt=o("div"),v(Ke.$$.fragment),io=d(),K=o("h2"),fe=o("a"),zn=o("span"),v(et.$$.fragment),kr=d(),Mn=o("span"),vr=a("SplinterTokenizerFast"),lo=d(),F=o("div"),v(tt.$$.fragment),br=d(),nt=o("p"),wr=a("Construct a \u201Cfast\u201D Splinter tokenizer (backed by HuggingFace\u2019s "),qn=o("em"),yr=a("tokenizers"),Tr=a(" library). Based on WordPiece."),Sr=d(),ot=o("p"),$r=a("This tokenizer inherits from "),Lt=o("a"),zr=a("PreTrainedTokenizerFast"),Mr=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),qr=d(),O=o("div"),v(st.$$.fragment),Er=d(),En=o("p"),xr=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:`),Ar=d(),rt=o("ul"),Qt=o("li"),Pr=a("single sequence: "),xn=o("code"),Fr=a("[CLS] X [SEP]"),Ir=d(),Ot=o("li"),Cr=a("pair of sequences for question answering: "),An=o("code"),Ur=a("[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),co=d(),ee=o("h2"),ge=o("a"),Pn=o("span"),v(at.$$.fragment),Nr=d(),Fn=o("span"),Wr=a("SplinterModel"),po=d(),I=o("div"),v(it.$$.fragment),jr=d(),lt=o("p"),Br=a(`The bare Splinter Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),dt=o("a"),Jr=a("torch.nn.Module"),Lr=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.`),Qr=d(),ct=o("p"),Or=a("The model is an encoder (with only self-attention) following the architecture described in "),pt=o("a"),Dr=a(`Attention is all you
need`),Zr=a(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Gr=d(),j=o("div"),v(ht.$$.fragment),Rr=d(),te=o("p"),Xr=a("The "),Dt=o("a"),Vr=a("SplinterModel"),Hr=a(" forward method, overrides the "),In=o("code"),Yr=a("__call__"),Kr=a(" special method."),ea=d(),v(_e.$$.fragment),ta=d(),v(ke.$$.fragment),ho=d(),ne=o("h2"),ve=o("a"),Cn=o("span"),v(ut.$$.fragment),na=d(),Un=o("span"),oa=a("SplinterForQuestionAnswering"),uo=d(),C=o("div"),v(mt.$$.fragment),sa=d(),oe=o("p"),ra=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 `),Nn=o("code"),aa=a("span start logits"),ia=a(" and "),Wn=o("code"),la=a("span end logits"),da=a(")."),ca=d(),ft=o("p"),pa=a("This model is a PyTorch "),gt=o("a"),ha=a("torch.nn.Module"),ua=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.`),ma=d(),B=o("div"),v(_t.$$.fragment),fa=d(),se=o("p"),ga=a("The "),Zt=o("a"),_a=a("SplinterForQuestionAnswering"),ka=a(" forward method, overrides the "),jn=o("code"),va=a("__call__"),ba=a(" special method."),wa=d(),v(be.$$.fragment),ya=d(),v(we.$$.fragment),mo=d(),re=o("h2"),ye=o("a"),Bn=o("span"),v(kt.$$.fragment),Ta=d(),Jn=o("span"),Sa=a("SplinterForPreTraining"),fo=d(),U=o("div"),v(vt.$$.fragment),$a=d(),Ln=o("p"),za=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.`),Ma=d(),bt=o("p"),qa=a("This model is a PyTorch "),wt=o("a"),Ea=a("torch.nn.Module"),xa=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.`),Aa=d(),D=o("div"),v(yt.$$.fragment),Pa=d(),ae=o("p"),Fa=a("The "),Gt=o("a"),Ia=a("SplinterForPreTraining"),Ca=a(" forward method, overrides the "),Qn=o("code"),Ua=a("__call__"),Na=a(" special method."),Wa=d(),v(Te.$$.fragment),this.h()},l(t){const h=gl('[data-svelte="svelte-1phssyn"]',document.head);u=s(h,"META",{name:!0,content:!0}),h.forEach(n),$=c(t),_=s(t,"H1",{class:!0});var Tt=r(_);g=s(Tt,"A",{id:!0,class:!0,href:!0});var On=r(g);k=s(On,"SPAN",{});var Dn=r(k);b(p.$$.fragment,Dn),Dn.forEach(n),On.forEach(n),f=c(Tt),q=s(Tt,"SPAN",{});var Zn=r(q);Wo=i(Zn,"Splinter"),Zn.forEach(n),Tt.forEach(n),Rn=c(t),G=s(t,"H2",{class:!0});var St=r(G);le=s(St,"A",{id:!0,class:!0,href:!0});var Gn=r(le);sn=s(Gn,"SPAN",{});var Ra=r(sn);b(Ie.$$.fragment,Ra),Ra.forEach(n),Gn.forEach(n),jo=c(St),rn=s(St,"SPAN",{});var Xa=r(rn);Bo=i(Xa,"Overview"),Xa.forEach(n),St.forEach(n),Xn=c(t),de=s(t,"P",{});var _o=r(de);Jo=i(_o,"The Splinter model was proposed in "),Ce=s(_o,"A",{href:!0,rel:!0});var Va=r(Ce);Lo=i(Va,"Few-Shot Question Answering by Pretraining Span Selection"),Va.forEach(n),Qo=i(_o,` 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.`),_o.forEach(n),Vn=c(t),$t=s(t,"P",{});var Ha=r($t);Oo=i(Ha,"The abstract from the paper is the following:"),Ha.forEach(n),Hn=c(t),zt=s(t,"P",{});var Ya=r(zt);Do=i(Ya,`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.`),Ya.forEach(n),Yn=c(t),Mt=s(t,"P",{});var Ka=r(Mt);Zo=i(Ka,"Tips:"),Ka.forEach(n),Kn=c(t),N=s(t,"UL",{});var Se=r(N);Ue=s(Se,"LI",{});var ko=r(Ue);Go=i(ko,`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=s(ko,"A",{href:!0});var ei=r(qt);Ro=i(ei,"SplinterForQuestionAnswering"),ei.forEach(n),Xo=i(ko," class. Therefore:"),ko.forEach(n),Vo=c(Se),J=s(Se,"LI",{});var $e=r(J);Ho=i($e,"Use "),Et=s($e,"A",{href:!0});var ti=r(Et);Yo=i(ti,"SplinterTokenizer"),ti.forEach(n),Ko=i($e," (rather than "),xt=s($e,"A",{href:!0});var ni=r(xt);es=i(ni,"BertTokenizer"),ni.forEach(n),ts=i($e,`), 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 `),an=s($e,"EM",{});var oi=r(an);ns=i(oi,"run_qa.py"),oi.forEach(n),os=i($e," script)."),$e.forEach(n),ss=c(Se),Ne=s(Se,"LI",{});var vo=r(Ne);rs=i(vo,"If you plan on using Splinter outside "),ln=s(vo,"EM",{});var si=r(ln);as=i(si,"run_qa.py"),si.forEach(n),is=i(vo,`, please keep in mind the question token - it might be important for
the success of your model, especially in a few-shot setting.`),vo.forEach(n),ls=c(Se),A=s(Se,"LI",{});var Z=r(A);ds=i(Z,`Please note there are two different checkpoints for each size of Splinter. Both are basically the same, except that
one also has the pretrained weights of the QASS layer (`),dn=s(Z,"EM",{});var ri=r(dn);cs=i(ri,"tau/splinter-base-qass"),ri.forEach(n),ps=i(Z," and "),cn=s(Z,"EM",{});var ai=r(cn);hs=i(ai,"tau/splinter-large-qass"),ai.forEach(n),us=i(Z,`) and one
doesn\u2019t (`),pn=s(Z,"EM",{});var ii=r(pn);ms=i(ii,"tau/splinter-base"),ii.forEach(n),fs=i(Z," and "),hn=s(Z,"EM",{});var li=r(hn);gs=i(li,"tau/splinter-large"),li.forEach(n),_s=i(Z,`). 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.`),Z.forEach(n),Se.forEach(n),eo=c(t),W=s(t,"P",{});var ze=r(W);ks=i(ze,"This model was contributed by "),We=s(ze,"A",{href:!0,rel:!0});var di=r(We);vs=i(di,"yuvalkirstain"),di.forEach(n),bs=i(ze," and "),je=s(ze,"A",{href:!0,rel:!0});var ci=r(je);ws=i(ci,"oriram"),ci.forEach(n),ys=i(ze,". The original code can be found "),Be=s(ze,"A",{href:!0,rel:!0});var pi=r(Be);Ts=i(pi,"here"),pi.forEach(n),Ss=i(ze,"."),ze.forEach(n),to=c(t),R=s(t,"H2",{class:!0});var bo=r(R);ce=s(bo,"A",{id:!0,class:!0,href:!0});var hi=r(ce);un=s(hi,"SPAN",{});var ui=r(un);b(Je.$$.fragment,ui),ui.forEach(n),hi.forEach(n),$s=c(bo),mn=s(bo,"SPAN",{});var mi=r(mn);zs=i(mi,"Documentation resources"),mi.forEach(n),bo.forEach(n),no=c(t),At=s(t,"UL",{});var fi=r(At);fn=s(fi,"LI",{});var gi=r(fn);Pt=s(gi,"A",{href:!0});var _i=r(Pt);Ms=i(_i,"Question answering task guide"),_i.forEach(n),gi.forEach(n),fi.forEach(n),oo=c(t),X=s(t,"H2",{class:!0});var wo=r(X);pe=s(wo,"A",{id:!0,class:!0,href:!0});var ki=r(pe);gn=s(ki,"SPAN",{});var vi=r(gn);b(Le.$$.fragment,vi),vi.forEach(n),ki.forEach(n),qs=c(wo),_n=s(wo,"SPAN",{});var bi=r(_n);Es=i(bi,"SplinterConfig"),bi.forEach(n),wo.forEach(n),so=c(t),P=s(t,"DIV",{class:!0});var Me=r(P);b(Qe.$$.fragment,Me),xs=c(Me),V=s(Me,"P",{});var Rt=r(V);As=i(Rt,"This is the configuration class to store the configuration of a "),Ft=s(Rt,"A",{href:!0});var wi=r(Ft);Ps=i(wi,"SplinterModel"),wi.forEach(n),Fs=i(Rt,`. 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
`),Oe=s(Rt,"A",{href:!0,rel:!0});var yi=r(Oe);Is=i(yi,"tau/splinter-base"),yi.forEach(n),Cs=i(Rt," architecture."),Rt.forEach(n),Us=c(Me),H=s(Me,"P",{});var Xt=r(H);Ns=i(Xt,"Configuration objects inherit from "),It=s(Xt,"A",{href:!0});var Ti=r(It);Ws=i(Ti,"PretrainedConfig"),Ti.forEach(n),js=i(Xt,` and can be used to control the model outputs. Read the
documentation from `),Ct=s(Xt,"A",{href:!0});var Si=r(Ct);Bs=i(Si,"PretrainedConfig"),Si.forEach(n),Js=i(Xt," for more information."),Xt.forEach(n),Ls=c(Me),b(he.$$.fragment,Me),Me.forEach(n),ro=c(t),Y=s(t,"H2",{class:!0});var yo=r(Y);ue=s(yo,"A",{id:!0,class:!0,href:!0});var $i=r(ue);kn=s($i,"SPAN",{});var zi=r(kn);b(De.$$.fragment,zi),zi.forEach(n),$i.forEach(n),Qs=c(yo),vn=s(yo,"SPAN",{});var Mi=r(vn);Os=i(Mi,"SplinterTokenizer"),Mi.forEach(n),yo.forEach(n),ao=c(t),z=s(t,"DIV",{class:!0});var E=r(z);b(Ze.$$.fragment,E),Ds=c(E),bn=s(E,"P",{});var qi=r(bn);Zs=i(qi,"Construct a Splinter tokenizer. Based on WordPiece."),qi.forEach(n),Gs=c(E),Ge=s(E,"P",{});var To=r(Ge);Rs=i(To,"This tokenizer inherits from "),Ut=s(To,"A",{href:!0});var Ei=r(Ut);Xs=i(Ei,"PreTrainedTokenizer"),Ei.forEach(n),Vs=i(To,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),To.forEach(n),Hs=c(E),L=s(E,"DIV",{class:!0});var Vt=r(L);b(Re.$$.fragment,Vt),Ys=c(Vt),wn=s(Vt,"P",{});var xi=r(wn);Ks=i(xi,`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:`),xi.forEach(n),er=c(Vt),Xe=s(Vt,"UL",{});var So=r(Xe);Nt=s(So,"LI",{});var ja=r(Nt);tr=i(ja,"single sequence: "),yn=s(ja,"CODE",{});var Ai=r(yn);nr=i(Ai,"[CLS] X [SEP]"),Ai.forEach(n),ja.forEach(n),or=c(So),Wt=s(So,"LI",{});var Ba=r(Wt);sr=i(Ba,"pair of sequences for question answering: "),Tn=s(Ba,"CODE",{});var Pi=r(Tn);rr=i(Pi,"[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),Pi.forEach(n),Ba.forEach(n),So.forEach(n),Vt.forEach(n),ar=c(E),me=s(E,"DIV",{class:!0});var $o=r(me);b(Ve.$$.fragment,$o),ir=c($o),He=s($o,"P",{});var zo=r(He);lr=i(zo,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Sn=s(zo,"CODE",{});var Fi=r(Sn);dr=i(Fi,"prepare_for_model"),Fi.forEach(n),cr=i(zo," method."),zo.forEach(n),$o.forEach(n),pr=c(E),Q=s(E,"DIV",{class:!0});var Ht=r(Q);b(Ye.$$.fragment,Ht),hr=c(Ht),jt=s(Ht,"P",{});var Ja=r(jt);ur=i(Ja,"Create the token type IDs corresponding to the sequences passed. "),Bt=s(Ja,"A",{href:!0});var Ii=r(Bt);mr=i(Ii,`What are token type
IDs?`),Ii.forEach(n),Ja.forEach(n),fr=c(Ht),$n=s(Ht,"P",{});var Ci=r($n);gr=i(Ci,"Should be overridden in a subclass if the model has a special way of building those."),Ci.forEach(n),Ht.forEach(n),_r=c(E),Jt=s(E,"DIV",{class:!0});var Ui=r(Jt);b(Ke.$$.fragment,Ui),Ui.forEach(n),E.forEach(n),io=c(t),K=s(t,"H2",{class:!0});var Mo=r(K);fe=s(Mo,"A",{id:!0,class:!0,href:!0});var Ni=r(fe);zn=s(Ni,"SPAN",{});var Wi=r(zn);b(et.$$.fragment,Wi),Wi.forEach(n),Ni.forEach(n),kr=c(Mo),Mn=s(Mo,"SPAN",{});var ji=r(Mn);vr=i(ji,"SplinterTokenizerFast"),ji.forEach(n),Mo.forEach(n),lo=c(t),F=s(t,"DIV",{class:!0});var qe=r(F);b(tt.$$.fragment,qe),br=c(qe),nt=s(qe,"P",{});var qo=r(nt);wr=i(qo,"Construct a \u201Cfast\u201D Splinter tokenizer (backed by HuggingFace\u2019s "),qn=s(qo,"EM",{});var Bi=r(qn);yr=i(Bi,"tokenizers"),Bi.forEach(n),Tr=i(qo," library). Based on WordPiece."),qo.forEach(n),Sr=c(qe),ot=s(qe,"P",{});var Eo=r(ot);$r=i(Eo,"This tokenizer inherits from "),Lt=s(Eo,"A",{href:!0});var Ji=r(Lt);zr=i(Ji,"PreTrainedTokenizerFast"),Ji.forEach(n),Mr=i(Eo,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Eo.forEach(n),qr=c(qe),O=s(qe,"DIV",{class:!0});var Yt=r(O);b(st.$$.fragment,Yt),Er=c(Yt),En=s(Yt,"P",{});var Li=r(En);xr=i(Li,`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:`),Li.forEach(n),Ar=c(Yt),rt=s(Yt,"UL",{});var xo=r(rt);Qt=s(xo,"LI",{});var La=r(Qt);Pr=i(La,"single sequence: "),xn=s(La,"CODE",{});var Qi=r(xn);Fr=i(Qi,"[CLS] X [SEP]"),Qi.forEach(n),La.forEach(n),Ir=c(xo),Ot=s(xo,"LI",{});var Qa=r(Ot);Cr=i(Qa,"pair of sequences for question answering: "),An=s(Qa,"CODE",{});var Oi=r(An);Ur=i(Oi,"[CLS] question_tokens [QUESTION] . [SEP] context_tokens [SEP]"),Oi.forEach(n),Qa.forEach(n),xo.forEach(n),Yt.forEach(n),qe.forEach(n),co=c(t),ee=s(t,"H2",{class:!0});var Ao=r(ee);ge=s(Ao,"A",{id:!0,class:!0,href:!0});var Di=r(ge);Pn=s(Di,"SPAN",{});var Zi=r(Pn);b(at.$$.fragment,Zi),Zi.forEach(n),Di.forEach(n),Nr=c(Ao),Fn=s(Ao,"SPAN",{});var Gi=r(Fn);Wr=i(Gi,"SplinterModel"),Gi.forEach(n),Ao.forEach(n),po=c(t),I=s(t,"DIV",{class:!0});var Ee=r(I);b(it.$$.fragment,Ee),jr=c(Ee),lt=s(Ee,"P",{});var Po=r(lt);Br=i(Po,`The bare Splinter Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),dt=s(Po,"A",{href:!0,rel:!0});var Ri=r(dt);Jr=i(Ri,"torch.nn.Module"),Ri.forEach(n),Lr=i(Po,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Po.forEach(n),Qr=c(Ee),ct=s(Ee,"P",{});var Fo=r(ct);Or=i(Fo,"The model is an encoder (with only self-attention) following the architecture described in "),pt=s(Fo,"A",{href:!0,rel:!0});var Xi=r(pt);Dr=i(Xi,`Attention is all you
need`),Xi.forEach(n),Zr=i(Fo,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Fo.forEach(n),Gr=c(Ee),j=s(Ee,"DIV",{class:!0});var xe=r(j);b(ht.$$.fragment,xe),Rr=c(xe),te=s(xe,"P",{});var Kt=r(te);Xr=i(Kt,"The "),Dt=s(Kt,"A",{href:!0});var Vi=r(Dt);Vr=i(Vi,"SplinterModel"),Vi.forEach(n),Hr=i(Kt," forward method, overrides the "),In=s(Kt,"CODE",{});var Hi=r(In);Yr=i(Hi,"__call__"),Hi.forEach(n),Kr=i(Kt," special method."),Kt.forEach(n),ea=c(xe),b(_e.$$.fragment,xe),ta=c(xe),b(ke.$$.fragment,xe),xe.forEach(n),Ee.forEach(n),ho=c(t),ne=s(t,"H2",{class:!0});var Io=r(ne);ve=s(Io,"A",{id:!0,class:!0,href:!0});var Yi=r(ve);Cn=s(Yi,"SPAN",{});var Ki=r(Cn);b(ut.$$.fragment,Ki),Ki.forEach(n),Yi.forEach(n),na=c(Io),Un=s(Io,"SPAN",{});var el=r(Un);oa=i(el,"SplinterForQuestionAnswering"),el.forEach(n),Io.forEach(n),uo=c(t),C=s(t,"DIV",{class:!0});var Ae=r(C);b(mt.$$.fragment,Ae),sa=c(Ae),oe=s(Ae,"P",{});var en=r(oe);ra=i(en,`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 `),Nn=s(en,"CODE",{});var tl=r(Nn);aa=i(tl,"span start logits"),tl.forEach(n),ia=i(en," and "),Wn=s(en,"CODE",{});var nl=r(Wn);la=i(nl,"span end logits"),nl.forEach(n),da=i(en,")."),en.forEach(n),ca=c(Ae),ft=s(Ae,"P",{});var Co=r(ft);pa=i(Co,"This model is a PyTorch "),gt=s(Co,"A",{href:!0,rel:!0});var ol=r(gt);ha=i(ol,"torch.nn.Module"),ol.forEach(n),ua=i(Co,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Co.forEach(n),ma=c(Ae),B=s(Ae,"DIV",{class:!0});var Pe=r(B);b(_t.$$.fragment,Pe),fa=c(Pe),se=s(Pe,"P",{});var tn=r(se);ga=i(tn,"The "),Zt=s(tn,"A",{href:!0});var sl=r(Zt);_a=i(sl,"SplinterForQuestionAnswering"),sl.forEach(n),ka=i(tn," forward method, overrides the "),jn=s(tn,"CODE",{});var rl=r(jn);va=i(rl,"__call__"),rl.forEach(n),ba=i(tn," special method."),tn.forEach(n),wa=c(Pe),b(be.$$.fragment,Pe),ya=c(Pe),b(we.$$.fragment,Pe),Pe.forEach(n),Ae.forEach(n),mo=c(t),re=s(t,"H2",{class:!0});var Uo=r(re);ye=s(Uo,"A",{id:!0,class:!0,href:!0});var al=r(ye);Bn=s(al,"SPAN",{});var il=r(Bn);b(kt.$$.fragment,il),il.forEach(n),al.forEach(n),Ta=c(Uo),Jn=s(Uo,"SPAN",{});var ll=r(Jn);Sa=i(ll,"SplinterForPreTraining"),ll.forEach(n),Uo.forEach(n),fo=c(t),U=s(t,"DIV",{class:!0});var Fe=r(U);b(vt.$$.fragment,Fe),$a=c(Fe),Ln=s(Fe,"P",{});var dl=r(Ln);za=i(dl,`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.`),dl.forEach(n),Ma=c(Fe),bt=s(Fe,"P",{});var No=r(bt);qa=i(No,"This model is a PyTorch "),wt=s(No,"A",{href:!0,rel:!0});var cl=r(wt);Ea=i(cl,"torch.nn.Module"),cl.forEach(n),xa=i(No,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),No.forEach(n),Aa=c(Fe),D=s(Fe,"DIV",{class:!0});var nn=r(D);b(yt.$$.fragment,nn),Pa=c(nn),ae=s(nn,"P",{});var on=r(ae);Fa=i(on,"The "),Gt=s(on,"A",{href:!0});var pl=r(Gt);Ia=i(pl,"SplinterForPreTraining"),pl.forEach(n),Ca=i(on," forward method, overrides the "),Qn=s(on,"CODE",{});var hl=r(Qn);Ua=i(hl,"__call__"),hl.forEach(n),Na=i(on," special method."),on.forEach(n),Wa=c(nn),b(Te.$$.fragment,nn),nn.forEach(n),Fe.forEach(n),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify($l)),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(_,"class","relative group"),l(le,"id","overview"),l(le,"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(le,"href","#overview"),l(G,"class","relative group"),l(Ce,"href","https://arxiv.org/abs/2101.00438"),l(Ce,"rel","nofollow"),l(qt,"href","/docs/transformers/v4.32.0/en/model_doc/splinter#transformers.SplinterForQuestionAnswering"),l(Et,"href","/docs/transformers/v4.32.0/en/model_doc/splinter#transformers.SplinterTokenizer"),l(xt,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),l(We,"href","https://huggingface.co/yuvalkirstain"),l(We,"rel","nofollow"),l(je,"href","https://huggingface.co/oriram"),l(je,"rel","nofollow"),l(Be,"href","https://github.com/oriram/splinter"),l(Be,"rel","nofollow"),l(ce,"id","documentation-resources"),l(ce,"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(ce,"href","#documentation-resources"),l(R,"class","relative group"),l(Pt,"href","../tasks/question-answering"),l(pe,"id","transformers.SplinterConfig"),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.SplinterConfig"),l(X,"class","relative group"),l(Ft,"href","/docs/transformers/v4.32.0/en/model_doc/splinter#transformers.SplinterModel"),l(Oe,"href","https://huggingface.co/tau/splinter-base"),l(Oe,"rel","nofollow"),l(It,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ct,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(P,"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.SplinterTokenizer"),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.SplinterTokenizer"),l(Y,"class","relative group"),l(Ut,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),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(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Bt,"href","../glossary#token-type-ids"),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(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(fe,"id","transformers.SplinterTokenizerFast"),l(fe,"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(fe,"href","#transformers.SplinterTokenizerFast"),l(K,"class","relative group"),l(Lt,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),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"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"id","transformers.SplinterModel"),l(ge,"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(ge,"href","#transformers.SplinterModel"),l(ee,"class","relative group"),l(dt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(dt,"rel","nofollow"),l(pt,"href","https://arxiv.org/abs/1706.03762"),l(pt,"rel","nofollow"),l(Dt,"href","/docs/transformers/v4.32.0/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(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(ve,"id","transformers.SplinterForQuestionAnswering"),l(ve,"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(ve,"href","#transformers.SplinterForQuestionAnswering"),l(ne,"class","relative group"),l(gt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(gt,"rel","nofollow"),l(Zt,"href","/docs/transformers/v4.32.0/en/model_doc/splinter#transformers.SplinterForQuestionAnswering"),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(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(ye,"id","transformers.SplinterForPreTraining"),l(ye,"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(ye,"href","#transformers.SplinterForPreTraining"),l(re,"class","relative group"),l(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(wt,"rel","nofollow"),l(Gt,"href","/docs/transformers/v4.32.0/en/model_doc/splinter#transformers.SplinterForPreTraining"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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")},m(t,h){e(document.head,u),m(t,$,h),m(t,_,h),e(_,g),e(g,k),w(p,k,null),e(_,f),e(_,q),e(q,Wo),m(t,Rn,h),m(t,G,h),e(G,le),e(le,sn),w(Ie,sn,null),e(G,jo),e(G,rn),e(rn,Bo),m(t,Xn,h),m(t,de,h),e(de,Jo),e(de,Ce),e(Ce,Lo),e(de,Qo),m(t,Vn,h),m(t,$t,h),e($t,Oo),m(t,Hn,h),m(t,zt,h),e(zt,Do),m(t,Yn,h),m(t,Mt,h),e(Mt,Zo),m(t,Kn,h),m(t,N,h),e(N,Ue),e(Ue,Go),e(Ue,qt),e(qt,Ro),e(Ue,Xo),e(N,Vo),e(N,J),e(J,Ho),e(J,Et),e(Et,Yo),e(J,Ko),e(J,xt),e(xt,es),e(J,ts),e(J,an),e(an,ns),e(J,os),e(N,ss),e(N,Ne),e(Ne,rs),e(Ne,ln),e(ln,as),e(Ne,is),e(N,ls),e(N,A),e(A,ds),e(A,dn),e(dn,cs),e(A,ps),e(A,cn),e(cn,hs),e(A,us),e(A,pn),e(pn,ms),e(A,fs),e(A,hn),e(hn,gs),e(A,_s),m(t,eo,h),m(t,W,h),e(W,ks),e(W,We),e(We,vs),e(W,bs),e(W,je),e(je,ws),e(W,ys),e(W,Be),e(Be,Ts),e(W,Ss),m(t,to,h),m(t,R,h),e(R,ce),e(ce,un),w(Je,un,null),e(R,$s),e(R,mn),e(mn,zs),m(t,no,h),m(t,At,h),e(At,fn),e(fn,Pt),e(Pt,Ms),m(t,oo,h),m(t,X,h),e(X,pe),e(pe,gn),w(Le,gn,null),e(X,qs),e(X,_n),e(_n,Es),m(t,so,h),m(t,P,h),w(Qe,P,null),e(P,xs),e(P,V),e(V,As),e(V,Ft),e(Ft,Ps),e(V,Fs),e(V,Oe),e(Oe,Is),e(V,Cs),e(P,Us),e(P,H),e(H,Ns),e(H,It),e(It,Ws),e(H,js),e(H,Ct),e(Ct,Bs),e(H,Js),e(P,Ls),w(he,P,null),m(t,ro,h),m(t,Y,h),e(Y,ue),e(ue,kn),w(De,kn,null),e(Y,Qs),e(Y,vn),e(vn,Os),m(t,ao,h),m(t,z,h),w(Ze,z,null),e(z,Ds),e(z,bn),e(bn,Zs),e(z,Gs),e(z,Ge),e(Ge,Rs),e(Ge,Ut),e(Ut,Xs),e(Ge,Vs),e(z,Hs),e(z,L),w(Re,L,null),e(L,Ys),e(L,wn),e(wn,Ks),e(L,er),e(L,Xe),e(Xe,Nt),e(Nt,tr),e(Nt,yn),e(yn,nr),e(Xe,or),e(Xe,Wt),e(Wt,sr),e(Wt,Tn),e(Tn,rr),e(z,ar),e(z,me),w(Ve,me,null),e(me,ir),e(me,He),e(He,lr),e(He,Sn),e(Sn,dr),e(He,cr),e(z,pr),e(z,Q),w(Ye,Q,null),e(Q,hr),e(Q,jt),e(jt,ur),e(jt,Bt),e(Bt,mr),e(Q,fr),e(Q,$n),e($n,gr),e(z,_r),e(z,Jt),w(Ke,Jt,null),m(t,io,h),m(t,K,h),e(K,fe),e(fe,zn),w(et,zn,null),e(K,kr),e(K,Mn),e(Mn,vr),m(t,lo,h),m(t,F,h),w(tt,F,null),e(F,br),e(F,nt),e(nt,wr),e(nt,qn),e(qn,yr),e(nt,Tr),e(F,Sr),e(F,ot),e(ot,$r),e(ot,Lt),e(Lt,zr),e(ot,Mr),e(F,qr),e(F,O),w(st,O,null),e(O,Er),e(O,En),e(En,xr),e(O,Ar),e(O,rt),e(rt,Qt),e(Qt,Pr),e(Qt,xn),e(xn,Fr),e(rt,Ir),e(rt,Ot),e(Ot,Cr),e(Ot,An),e(An,Ur),m(t,co,h),m(t,ee,h),e(ee,ge),e(ge,Pn),w(at,Pn,null),e(ee,Nr),e(ee,Fn),e(Fn,Wr),m(t,po,h),m(t,I,h),w(it,I,null),e(I,jr),e(I,lt),e(lt,Br),e(lt,dt),e(dt,Jr),e(lt,Lr),e(I,Qr),e(I,ct),e(ct,Or),e(ct,pt),e(pt,Dr),e(ct,Zr),e(I,Gr),e(I,j),w(ht,j,null),e(j,Rr),e(j,te),e(te,Xr),e(te,Dt),e(Dt,Vr),e(te,Hr),e(te,In),e(In,Yr),e(te,Kr),e(j,ea),w(_e,j,null),e(j,ta),w(ke,j,null),m(t,ho,h),m(t,ne,h),e(ne,ve),e(ve,Cn),w(ut,Cn,null),e(ne,na),e(ne,Un),e(Un,oa),m(t,uo,h),m(t,C,h),w(mt,C,null),e(C,sa),e(C,oe),e(oe,ra),e(oe,Nn),e(Nn,aa),e(oe,ia),e(oe,Wn),e(Wn,la),e(oe,da),e(C,ca),e(C,ft),e(ft,pa),e(ft,gt),e(gt,ha),e(ft,ua),e(C,ma),e(C,B),w(_t,B,null),e(B,fa),e(B,se),e(se,ga),e(se,Zt),e(Zt,_a),e(se,ka),e(se,jn),e(jn,va),e(se,ba),e(B,wa),w(be,B,null),e(B,ya),w(we,B,null),m(t,mo,h),m(t,re,h),e(re,ye),e(ye,Bn),w(kt,Bn,null),e(re,Ta),e(re,Jn),e(Jn,Sa),m(t,fo,h),m(t,U,h),w(vt,U,null),e(U,$a),e(U,Ln),e(Ln,za),e(U,Ma),e(U,bt),e(bt,qa),e(bt,wt),e(wt,Ea),e(bt,xa),e(U,Aa),e(U,D),w(yt,D,null),e(D,Pa),e(D,ae),e(ae,Fa),e(ae,Gt),e(Gt,Ia),e(ae,Ca),e(ae,Qn),e(Qn,Ua),e(ae,Na),e(D,Wa),w(Te,D,null),go=!0},p(t,[h]){const Tt={};h&2&&(Tt.$$scope={dirty:h,ctx:t}),he.$set(Tt);const On={};h&2&&(On.$$scope={dirty:h,ctx:t}),_e.$set(On);const Dn={};h&2&&(Dn.$$scope={dirty:h,ctx:t}),ke.$set(Dn);const Zn={};h&2&&(Zn.$$scope={dirty:h,ctx:t}),be.$set(Zn);const St={};h&2&&(St.$$scope={dirty:h,ctx:t}),we.$set(St);const Gn={};h&2&&(Gn.$$scope={dirty:h,ctx:t}),Te.$set(Gn)},i(t){go||(y(p.$$.fragment,t),y(Ie.$$.fragment,t),y(Je.$$.fragment,t),y(Le.$$.fragment,t),y(Qe.$$.fragment,t),y(he.$$.fragment,t),y(De.$$.fragment,t),y(Ze.$$.fragment,t),y(Re.$$.fragment,t),y(Ve.$$.fragment,t),y(Ye.$$.fragment,t),y(Ke.$$.fragment,t),y(et.$$.fragment,t),y(tt.$$.fragment,t),y(st.$$.fragment,t),y(at.$$.fragment,t),y(it.$$.fragment,t),y(ht.$$.fragment,t),y(_e.$$.fragment,t),y(ke.$$.fragment,t),y(ut.$$.fragment,t),y(mt.$$.fragment,t),y(_t.$$.fragment,t),y(be.$$.fragment,t),y(we.$$.fragment,t),y(kt.$$.fragment,t),y(vt.$$.fragment,t),y(yt.$$.fragment,t),y(Te.$$.fragment,t),go=!0)},o(t){T(p.$$.fragment,t),T(Ie.$$.fragment,t),T(Je.$$.fragment,t),T(Le.$$.fragment,t),T(Qe.$$.fragment,t),T(he.$$.fragment,t),T(De.$$.fragment,t),T(Ze.$$.fragment,t),T(Re.$$.fragment,t),T(Ve.$$.fragment,t),T(Ye.$$.fragment,t),T(Ke.$$.fragment,t),T(et.$$.fragment,t),T(tt.$$.fragment,t),T(st.$$.fragment,t),T(at.$$.fragment,t),T(it.$$.fragment,t),T(ht.$$.fragment,t),T(_e.$$.fragment,t),T(ke.$$.fragment,t),T(ut.$$.fragment,t),T(mt.$$.fragment,t),T(_t.$$.fragment,t),T(be.$$.fragment,t),T(we.$$.fragment,t),T(kt.$$.fragment,t),T(vt.$$.fragment,t),T(yt.$$.fragment,t),T(Te.$$.fragment,t),go=!1},d(t){n(u),t&&n($),t&&n(_),S(p),t&&n(Rn),t&&n(G),S(Ie),t&&n(Xn),t&&n(de),t&&n(Vn),t&&n($t),t&&n(Hn),t&&n(zt),t&&n(Yn),t&&n(Mt),t&&n(Kn),t&&n(N),t&&n(eo),t&&n(W),t&&n(to),t&&n(R),S(Je),t&&n(no),t&&n(At),t&&n(oo),t&&n(X),S(Le),t&&n(so),t&&n(P),S(Qe),S(he),t&&n(ro),t&&n(Y),S(De),t&&n(ao),t&&n(z),S(Ze),S(Re),S(Ve),S(Ye),S(Ke),t&&n(io),t&&n(K),S(et),t&&n(lo),t&&n(F),S(tt),S(st),t&&n(co),t&&n(ee),S(at),t&&n(po),t&&n(I),S(it),S(ht),S(_e),S(ke),t&&n(ho),t&&n(ne),S(ut),t&&n(uo),t&&n(C),S(mt),S(_t),S(be),S(we),t&&n(mo),t&&n(re),S(kt),t&&n(fo),t&&n(U),S(vt),S(yt),S(Te)}}}const $l={local:"splinter",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{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 zl(M){return _l(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fl extends ul{constructor(u){super();ml(this,u,zl,Sl,fl,{})}}export{Fl as default,$l as metadata};
