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

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

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

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

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

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

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