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 r,d as n,m as c,a as s,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 Va}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ua}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ja}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ha}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function kl(z){let u,$,_,g,k;return g=new Ja({props:{code:`from transformers import SplinterModel, SplinterConfig

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){u=o("p"),$=a("Example:"),_=d(),v(g.$$.fragment)},l(p){u=r(p,"P",{});var f=s(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:Va,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(z){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=r(p,"P",{});var f=s(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var x=s(_);g=i(x,"Module"),x.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(z){let u,$,_,g,k;return g=new Ja({props:{code:`from transformers import AutoTokenizer, SplinterModel
import torch

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

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

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> 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=r(p,"P",{});var f=s(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:Va,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(z){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=r(p,"P",{});var f=s(u);$=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var x=s(_);g=i(x,"Module"),x.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(z){let u,$,_,g,k;return g=new Ja({props:{code:`from transformers import AutoTokenizer, SplinterForQuestionAnswering
import torch

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

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

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

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

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

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