import{S as zs,i as Bs,s as Es,e as o,k as c,w as g,t as a,M as Rs,c as n,d as r,m as d,a as s,x as k,h as i,b as l,G as e,g as p,y as v,q as b,o as w,B as T,v as qs,L as ys}from"../../chunks/vendor-hf-doc-builder.js";import{T as xs}from"../../chunks/Tip-hf-doc-builder.js";import{D as L}from"../../chunks/Docstring-hf-doc-builder.js";import{C as $s}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ht}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ts}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ms(Q){let u,E,_,h,z,m,y,U;return{c(){u=o("p"),E=a("This model is in maintenance mode only, so we won\u2019t accept any new PRs changing its code."),_=c(),h=o("p"),z=a(`If you run into any issues running this model, please reinstall the last version that supported this model: v4.30.0.
You can do so by running the following command: `),m=o("code"),y=a("pip install -U transformers==4.30.0"),U=a(".")},l(q){u=n(q,"P",{});var I=s(u);E=i(I,"This model is in maintenance mode only, so we won\u2019t accept any new PRs changing its code."),I.forEach(r),_=d(q),h=n(q,"P",{});var M=s(h);z=i(M,`If you run into any issues running this model, please reinstall the last version that supported this model: v4.30.0.
You can do so by running the following command: `),m=n(M,"CODE",{});var he=s(m);y=i(he,"pip install -U transformers==4.30.0"),he.forEach(r),U=i(M,"."),M.forEach(r)},m(q,I){p(q,u,I),e(u,E),p(q,_,I),p(q,h,I),e(h,z),e(h,m),e(m,y),e(h,U)},d(q){q&&r(u),q&&r(_),q&&r(h)}}}function Ps(Q){let u,E,_,h,z;return h=new $s({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){u=o("p"),E=a("pair mask has the following format:"),_=c(),g(h.$$.fragment)},l(m){u=n(m,"P",{});var y=s(u);E=i(y,"pair mask has the following format:"),y.forEach(r),_=d(m),k(h.$$.fragment,m)},m(m,y){p(m,u,y),e(u,E),p(m,_,y),v(h,m,y),z=!0},p:ys,i(m){z||(b(h.$$.fragment,m),z=!0)},o(m){w(h.$$.fragment,m),z=!1},d(m){m&&r(u),m&&r(_),T(h,m)}}}function Cs(Q){let u,E,_,h,z;return h=new $s({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){u=o("p"),E=a("pair mask has the following format:"),_=c(),g(h.$$.fragment)},l(m){u=n(m,"P",{});var y=s(u);E=i(y,"pair mask has the following format:"),y.forEach(r),_=d(m),k(h.$$.fragment,m)},m(m,y){p(m,u,y),e(u,E),p(m,_,y),v(h,m,y),z=!0},p:ys,i(m){z||(b(h.$$.fragment,m),z=!0)},o(m){w(h.$$.fragment,m),z=!1},d(m){m&&r(u),m&&r(_),T(h,m)}}}function As(Q){let u,E,_,h,z,m,y,U,q,I,M,he,J,Z,pt,pe,kr,ut,vr,Vt,ee,br,ue,wr,Tr,Wt,S,yr,_e,$r,zr,ge,Br,Er,Ht,O,te,_t,ke,Rr,gt,qr,Kt,D,ve,xr,V,Mr,Oe,Pr,Cr,be,Ar,Ir,Dr,W,Lr,Ve,Sr,jr,We,Fr,Nr,Xt,H,re,kt,we,Ur,vt,Jr,Yt,$,Te,Or,bt,Vr,Wr,oe,He,Hr,Kr,Ke,Xr,Yr,Gr,ye,Qr,Xe,Zr,eo,to,j,$e,ro,wt,oo,no,ze,Ye,so,Tt,ao,io,Ge,lo,yt,co,mo,ne,Be,fo,$t,ho,po,P,Ee,uo,zt,_o,go,se,ko,K,vo,Bt,bo,wo,Et,To,yo,$o,ae,Re,zo,qe,Bo,Rt,Eo,Ro,Gt,X,ie,qt,xe,qo,xt,xo,Qt,B,Me,Mo,Pe,Po,Mt,Co,Ao,Io,le,Qe,Do,Lo,Ze,So,jo,Fo,Ce,No,et,Uo,Jo,Oo,F,Ae,Vo,Pt,Wo,Ho,Ie,tt,Ko,Ct,Xo,Yo,rt,Go,At,Qo,Zo,C,De,en,It,tn,rn,ce,on,Y,nn,Dt,sn,an,Lt,ln,cn,Zt,G,de,St,Le,dn,jt,mn,er,x,Se,fn,Ft,hn,pn,je,un,ot,_n,gn,kn,Fe,vn,Ne,bn,wn,Tn,nt,Ue,tr;return m=new ht({}),M=new xs({props:{warning:!0,$$slots:{default:[Ms]},$$scope:{ctx:Q}}}),pe=new ht({}),ke=new ht({}),ve=new L({props:{name:"class transformers.RetriBertConfig",anchor:"transformers.RetriBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 8"},{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:"share_encoders",val:" = True"},{name:"projection_dim",val:" = 128"},{name:"pad_token_id",val:" = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RetriBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the RetriBERT model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/retribert#transformers.RetriBertModel">RetriBertModel</a>`,name:"vocab_size"},{anchor:"transformers.RetriBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.RetriBertConfig.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.RetriBertConfig.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.RetriBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.RetriBertConfig.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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.RetriBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.RetriBertConfig.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.RetriBertConfig.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.RetriBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/v4.33.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.RetriBertConfig.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.RetriBertConfig.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.RetriBertConfig.share_encoders",description:`<strong>share_encoders</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the same Bert-type encoder for the queries and document`,name:"share_encoders"},{anchor:"transformers.RetriBertConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Final dimension of the query and document representation after projection`,name:"projection_dim"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/configuration_retribert.py#L31"}}),we=new ht({}),Te=new L({props:{name:"class transformers.RetriBertTokenizer",anchor:"transformers.RetriBertTokenizer",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:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RetriBertTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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 this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).`,name:"tokenize_chinese_chars"},{anchor:"transformers.RetriBertTokenizer.strip_accents",description:`<strong>strip_accents</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"strip_accents"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert.py#L70"}}),$e=new L({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.RetriBertTokenizer.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.RetriBertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.RetriBertTokenizer.build_inputs_with_special_tokens.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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert.py#L213",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>
`}}),Be=new L({props:{name:"convert_tokens_to_string",anchor:"transformers.RetriBertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert.py#L207"}}),Ee=new L({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.RetriBertTokenizer.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.RetriBertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RetriBertTokenizer.create_token_type_ids_from_sequences.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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert.py#L268",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),se=new Ts({props:{anchor:"transformers.RetriBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Ps]},$$scope:{ctx:Q}}}),Re=new L({props:{name:"get_special_tokens_mask",anchor:"transformers.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.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.RetriBertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert.py#L239",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>
`}}),xe=new ht({}),Me=new L({props:{name:"class transformers.RetriBertTokenizerFast",anchor:"transformers.RetriBertTokenizerFast",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:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RetriBertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.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.RetriBertTokenizerFast.wordpieces_prefix",description:`<strong>wordpieces_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;##&quot;</code>) &#x2014;
The prefix for subwords.`,name:"wordpieces_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py#L54"}}),Ae=new L({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.RetriBertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],parametersDescription:[{anchor:"transformers.RetriBertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.RetriBertTokenizerFast.build_inputs_with_special_tokens.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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py#L148",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>
`}}),De=new L({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.RetriBertTokenizerFast.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.RetriBertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RetriBertTokenizerFast.create_token_type_ids_from_sequences.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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/tokenization_retribert_fast.py#L173",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ce=new Ts({props:{anchor:"transformers.RetriBertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[Cs]},$$scope:{ctx:Q}}}),Le=new ht({}),Se=new L({props:{name:"class transformers.RetriBertModel",anchor:"transformers.RetriBertModel",parameters:[{name:"config",val:": RetriBertConfig"}],parametersDescription:[{anchor:"transformers.RetriBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/retribert#transformers.RetriBertConfig">RetriBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/modeling_retribert.py#L88"}}),Ue=new L({props:{name:"forward",anchor:"transformers.RetriBertModel.forward",parameters:[{name:"input_ids_query",val:": LongTensor"},{name:"attention_mask_query",val:": typing.Optional[torch.FloatTensor]"},{name:"input_ids_doc",val:": LongTensor"},{name:"attention_mask_doc",val:": typing.Optional[torch.FloatTensor]"},{name:"checkpoint_batch_size",val:": int = -1"}],parametersDescription:[{anchor:"transformers.RetriBertModel.forward.input_ids_query",description:`<strong>input_ids_query</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary for the queries in a batch.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids_query"},{anchor:"transformers.RetriBertModel.forward.attention_mask_query",description:`<strong>attention_mask_query</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_query"},{anchor:"transformers.RetriBertModel.forward.input_ids_doc",description:`<strong>input_ids_doc</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary for the documents in a batch.`,name:"input_ids_doc"},{anchor:"transformers.RetriBertModel.forward.attention_mask_doc",description:`<strong>attention_mask_doc</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on documents padding token indices.`,name:"attention_mask_doc"},{anchor:"transformers.RetriBertModel.forward.checkpoint_batch_size",description:`<strong>checkpoint_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>-1</code>) &#x2014;
If greater than 0, uses gradient checkpointing to only compute sequence representation on
<code>checkpoint_batch_size</code> examples at a time on the GPU. All query representations are still compared to
all document representations in the batch.`,name:"checkpoint_batch_size"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/deprecated/retribert/modeling_retribert.py#L176",returnDescription:`
<p>The bidirectional cross-entropy loss obtained while trying to match each query to its
corresponding document and each document to its corresponding query in the batch</p>
`,returnType:`
<p>\`torch.FloatTensor\u201C</p>
`}}),{c(){u=o("meta"),E=c(),_=o("h1"),h=o("a"),z=o("span"),g(m.$$.fragment),y=c(),U=o("span"),q=a("RetriBERT"),I=c(),g(M.$$.fragment),he=c(),J=o("h2"),Z=o("a"),pt=o("span"),g(pe.$$.fragment),kr=c(),ut=o("span"),vr=a("Overview"),Vt=c(),ee=o("p"),br=a("The RetriBERT model was proposed in the blog post "),ue=o("a"),wr=a(`Explain Anything Like I\u2019m Five: A Model for Open Domain Long Form
Question Answering`),Tr=a(`. RetriBERT is a small model that uses either a single or
pair of BERT encoders with lower-dimension projection for dense semantic indexing of text.`),Wt=c(),S=o("p"),yr=a("This model was contributed by "),_e=o("a"),$r=a("yjernite"),zr=a(`. Code to train and use the model can be
found `),ge=o("a"),Br=a("here"),Er=a("."),Ht=c(),O=o("h2"),te=o("a"),_t=o("span"),g(ke.$$.fragment),Rr=c(),gt=o("span"),qr=a("RetriBertConfig"),Kt=c(),D=o("div"),g(ve.$$.fragment),xr=c(),V=o("p"),Mr=a("This is the configuration class to store the configuration of a "),Oe=o("a"),Pr=a("RetriBertModel"),Cr=a(`. It is used to instantiate a
RetriBertModel 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 RetriBERT
`),be=o("a"),Ar=a("yjernite/retribert-base-uncased"),Ir=a(" architecture."),Dr=c(),W=o("p"),Lr=a("Configuration objects inherit from "),Ve=o("a"),Sr=a("PretrainedConfig"),jr=a(` and can be used to control the model outputs. Read the
documentation from `),We=o("a"),Fr=a("PretrainedConfig"),Nr=a(" for more information."),Xt=c(),H=o("h2"),re=o("a"),kt=o("span"),g(we.$$.fragment),Ur=c(),vt=o("span"),Jr=a("RetriBertTokenizer"),Yt=c(),$=o("div"),g(Te.$$.fragment),Or=c(),bt=o("p"),Vr=a("Constructs a RetriBERT tokenizer."),Wr=c(),oe=o("p"),He=o("a"),Hr=a("RetriBertTokenizer"),Kr=a(" is identical to "),Ke=o("a"),Xr=a("BertTokenizer"),Yr=a(` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),Gr=c(),ye=o("p"),Qr=a("This tokenizer inherits from "),Xe=o("a"),Zr=a("PreTrainedTokenizer"),eo=a(` which contains most of the main methods. Users should refer
to: this superclass for more information regarding those methods.`),to=c(),j=o("div"),g($e.$$.fragment),ro=c(),wt=o("p"),oo=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),no=c(),ze=o("ul"),Ye=o("li"),so=a("single sequence: "),Tt=o("code"),ao=a("[CLS] X [SEP]"),io=c(),Ge=o("li"),lo=a("pair of sequences: "),yt=o("code"),co=a("[CLS] A [SEP] B [SEP]"),mo=c(),ne=o("div"),g(Be.$$.fragment),fo=c(),$t=o("p"),ho=a("Converts a sequence of tokens (string) in a single string."),po=c(),P=o("div"),g(Ee.$$.fragment),uo=c(),zt=o("p"),_o=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),go=c(),g(se.$$.fragment),ko=c(),K=o("p"),vo=a("If "),Bt=o("code"),bo=a("token_ids_1"),wo=a(" is "),Et=o("code"),To=a("None"),yo=a(", this method only returns the first portion of the mask (0s)."),$o=c(),ae=o("div"),g(Re.$$.fragment),zo=c(),qe=o("p"),Bo=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 `),Rt=o("code"),Eo=a("prepare_for_model"),Ro=a(" method."),Gt=c(),X=o("h2"),ie=o("a"),qt=o("span"),g(xe.$$.fragment),qo=c(),xt=o("span"),xo=a("RetriBertTokenizerFast"),Qt=c(),B=o("div"),g(Me.$$.fragment),Mo=c(),Pe=o("p"),Po=a("Construct a \u201Cfast\u201D RetriBERT tokenizer (backed by HuggingFace\u2019s "),Mt=o("em"),Co=a("tokenizers"),Ao=a(" library)."),Io=c(),le=o("p"),Qe=o("a"),Do=a("RetriBertTokenizerFast"),Lo=a(" is identical to "),Ze=o("a"),So=a("BertTokenizerFast"),jo=a(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Fo=c(),Ce=o("p"),No=a("This tokenizer inherits from "),et=o("a"),Uo=a("PreTrainedTokenizerFast"),Jo=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Oo=c(),F=o("div"),g(Ae.$$.fragment),Vo=c(),Pt=o("p"),Wo=a(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Ho=c(),Ie=o("ul"),tt=o("li"),Ko=a("single sequence: "),Ct=o("code"),Xo=a("[CLS] X [SEP]"),Yo=c(),rt=o("li"),Go=a("pair of sequences: "),At=o("code"),Qo=a("[CLS] A [SEP] B [SEP]"),Zo=c(),C=o("div"),g(De.$$.fragment),en=c(),It=o("p"),tn=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),rn=c(),g(ce.$$.fragment),on=c(),Y=o("p"),nn=a("If "),Dt=o("code"),sn=a("token_ids_1"),an=a(" is "),Lt=o("code"),ln=a("None"),cn=a(", this method only returns the first portion of the mask (0s)."),Zt=c(),G=o("h2"),de=o("a"),St=o("span"),g(Le.$$.fragment),dn=c(),jt=o("span"),mn=a("RetriBertModel"),er=c(),x=o("div"),g(Se.$$.fragment),fn=c(),Ft=o("p"),hn=a("Bert Based model to embed queries or document for document retrieval."),pn=c(),je=o("p"),un=a("This model inherits from "),ot=o("a"),_n=a("PreTrainedModel"),gn=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),kn=c(),Fe=o("p"),vn=a("This model is also a PyTorch "),Ne=o("a"),bn=a("torch.nn.Module"),wn=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tn=c(),nt=o("div"),g(Ue.$$.fragment),this.h()},l(t){const f=Rs('[data-svelte="svelte-1phssyn"]',document.head);u=n(f,"META",{name:!0,content:!0}),f.forEach(r),E=d(t),_=n(t,"H1",{class:!0});var Je=s(_);h=n(Je,"A",{id:!0,class:!0,href:!0});var Nt=s(h);z=n(Nt,"SPAN",{});var Ut=s(z);k(m.$$.fragment,Ut),Ut.forEach(r),Nt.forEach(r),y=d(Je),U=n(Je,"SPAN",{});var En=s(U);q=i(En,"RetriBERT"),En.forEach(r),Je.forEach(r),I=d(t),k(M.$$.fragment,t),he=d(t),J=n(t,"H2",{class:!0});var rr=s(J);Z=n(rr,"A",{id:!0,class:!0,href:!0});var Rn=s(Z);pt=n(Rn,"SPAN",{});var qn=s(pt);k(pe.$$.fragment,qn),qn.forEach(r),Rn.forEach(r),kr=d(rr),ut=n(rr,"SPAN",{});var xn=s(ut);vr=i(xn,"Overview"),xn.forEach(r),rr.forEach(r),Vt=d(t),ee=n(t,"P",{});var or=s(ee);br=i(or,"The RetriBERT model was proposed in the blog post "),ue=n(or,"A",{href:!0,rel:!0});var Mn=s(ue);wr=i(Mn,`Explain Anything Like I\u2019m Five: A Model for Open Domain Long Form
Question Answering`),Mn.forEach(r),Tr=i(or,`. RetriBERT is a small model that uses either a single or
pair of BERT encoders with lower-dimension projection for dense semantic indexing of text.`),or.forEach(r),Wt=d(t),S=n(t,"P",{});var st=s(S);yr=i(st,"This model was contributed by "),_e=n(st,"A",{href:!0,rel:!0});var Pn=s(_e);$r=i(Pn,"yjernite"),Pn.forEach(r),zr=i(st,`. Code to train and use the model can be
found `),ge=n(st,"A",{href:!0,rel:!0});var Cn=s(ge);Br=i(Cn,"here"),Cn.forEach(r),Er=i(st,"."),st.forEach(r),Ht=d(t),O=n(t,"H2",{class:!0});var nr=s(O);te=n(nr,"A",{id:!0,class:!0,href:!0});var An=s(te);_t=n(An,"SPAN",{});var In=s(_t);k(ke.$$.fragment,In),In.forEach(r),An.forEach(r),Rr=d(nr),gt=n(nr,"SPAN",{});var Dn=s(gt);qr=i(Dn,"RetriBertConfig"),Dn.forEach(r),nr.forEach(r),Kt=d(t),D=n(t,"DIV",{class:!0});var at=s(D);k(ve.$$.fragment,at),xr=d(at),V=n(at,"P",{});var it=s(V);Mr=i(it,"This is the configuration class to store the configuration of a "),Oe=n(it,"A",{href:!0});var Ln=s(Oe);Pr=i(Ln,"RetriBertModel"),Ln.forEach(r),Cr=i(it,`. It is used to instantiate a
RetriBertModel 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 RetriBERT
`),be=n(it,"A",{href:!0,rel:!0});var Sn=s(be);Ar=i(Sn,"yjernite/retribert-base-uncased"),Sn.forEach(r),Ir=i(it," architecture."),it.forEach(r),Dr=d(at),W=n(at,"P",{});var lt=s(W);Lr=i(lt,"Configuration objects inherit from "),Ve=n(lt,"A",{href:!0});var jn=s(Ve);Sr=i(jn,"PretrainedConfig"),jn.forEach(r),jr=i(lt,` and can be used to control the model outputs. Read the
documentation from `),We=n(lt,"A",{href:!0});var Fn=s(We);Fr=i(Fn,"PretrainedConfig"),Fn.forEach(r),Nr=i(lt," for more information."),lt.forEach(r),at.forEach(r),Xt=d(t),H=n(t,"H2",{class:!0});var sr=s(H);re=n(sr,"A",{id:!0,class:!0,href:!0});var Nn=s(re);kt=n(Nn,"SPAN",{});var Un=s(kt);k(we.$$.fragment,Un),Un.forEach(r),Nn.forEach(r),Ur=d(sr),vt=n(sr,"SPAN",{});var Jn=s(vt);Jr=i(Jn,"RetriBertTokenizer"),Jn.forEach(r),sr.forEach(r),Yt=d(t),$=n(t,"DIV",{class:!0});var R=s($);k(Te.$$.fragment,R),Or=d(R),bt=n(R,"P",{});var On=s(bt);Vr=i(On,"Constructs a RetriBERT tokenizer."),On.forEach(r),Wr=d(R),oe=n(R,"P",{});var Jt=s(oe);He=n(Jt,"A",{href:!0});var Vn=s(He);Hr=i(Vn,"RetriBertTokenizer"),Vn.forEach(r),Kr=i(Jt," is identical to "),Ke=n(Jt,"A",{href:!0});var Wn=s(Ke);Xr=i(Wn,"BertTokenizer"),Wn.forEach(r),Yr=i(Jt,` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),Jt.forEach(r),Gr=d(R),ye=n(R,"P",{});var ar=s(ye);Qr=i(ar,"This tokenizer inherits from "),Xe=n(ar,"A",{href:!0});var Hn=s(Xe);Zr=i(Hn,"PreTrainedTokenizer"),Hn.forEach(r),eo=i(ar,` which contains most of the main methods. Users should refer
to: this superclass for more information regarding those methods.`),ar.forEach(r),to=d(R),j=n(R,"DIV",{class:!0});var ct=s(j);k($e.$$.fragment,ct),ro=d(ct),wt=n(ct,"P",{});var Kn=s(wt);oo=i(Kn,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Kn.forEach(r),no=d(ct),ze=n(ct,"UL",{});var ir=s(ze);Ye=n(ir,"LI",{});var yn=s(Ye);so=i(yn,"single sequence: "),Tt=n(yn,"CODE",{});var Xn=s(Tt);ao=i(Xn,"[CLS] X [SEP]"),Xn.forEach(r),yn.forEach(r),io=d(ir),Ge=n(ir,"LI",{});var $n=s(Ge);lo=i($n,"pair of sequences: "),yt=n($n,"CODE",{});var Yn=s(yt);co=i(Yn,"[CLS] A [SEP] B [SEP]"),Yn.forEach(r),$n.forEach(r),ir.forEach(r),ct.forEach(r),mo=d(R),ne=n(R,"DIV",{class:!0});var lr=s(ne);k(Be.$$.fragment,lr),fo=d(lr),$t=n(lr,"P",{});var Gn=s($t);ho=i(Gn,"Converts a sequence of tokens (string) in a single string."),Gn.forEach(r),lr.forEach(r),po=d(R),P=n(R,"DIV",{class:!0});var me=s(P);k(Ee.$$.fragment,me),uo=d(me),zt=n(me,"P",{});var Qn=s(zt);_o=i(Qn,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Qn.forEach(r),go=d(me),k(se.$$.fragment,me),ko=d(me),K=n(me,"P",{});var dt=s(K);vo=i(dt,"If "),Bt=n(dt,"CODE",{});var Zn=s(Bt);bo=i(Zn,"token_ids_1"),Zn.forEach(r),wo=i(dt," is "),Et=n(dt,"CODE",{});var es=s(Et);To=i(es,"None"),es.forEach(r),yo=i(dt,", this method only returns the first portion of the mask (0s)."),dt.forEach(r),me.forEach(r),$o=d(R),ae=n(R,"DIV",{class:!0});var cr=s(ae);k(Re.$$.fragment,cr),zo=d(cr),qe=n(cr,"P",{});var dr=s(qe);Bo=i(dr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Rt=n(dr,"CODE",{});var ts=s(Rt);Eo=i(ts,"prepare_for_model"),ts.forEach(r),Ro=i(dr," method."),dr.forEach(r),cr.forEach(r),R.forEach(r),Gt=d(t),X=n(t,"H2",{class:!0});var mr=s(X);ie=n(mr,"A",{id:!0,class:!0,href:!0});var rs=s(ie);qt=n(rs,"SPAN",{});var os=s(qt);k(xe.$$.fragment,os),os.forEach(r),rs.forEach(r),qo=d(mr),xt=n(mr,"SPAN",{});var ns=s(xt);xo=i(ns,"RetriBertTokenizerFast"),ns.forEach(r),mr.forEach(r),Qt=d(t),B=n(t,"DIV",{class:!0});var A=s(B);k(Me.$$.fragment,A),Mo=d(A),Pe=n(A,"P",{});var fr=s(Pe);Po=i(fr,"Construct a \u201Cfast\u201D RetriBERT tokenizer (backed by HuggingFace\u2019s "),Mt=n(fr,"EM",{});var ss=s(Mt);Co=i(ss,"tokenizers"),ss.forEach(r),Ao=i(fr," library)."),fr.forEach(r),Io=d(A),le=n(A,"P",{});var Ot=s(le);Qe=n(Ot,"A",{href:!0});var as=s(Qe);Do=i(as,"RetriBertTokenizerFast"),as.forEach(r),Lo=i(Ot," is identical to "),Ze=n(Ot,"A",{href:!0});var is=s(Ze);So=i(is,"BertTokenizerFast"),is.forEach(r),jo=i(Ot,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Ot.forEach(r),Fo=d(A),Ce=n(A,"P",{});var hr=s(Ce);No=i(hr,"This tokenizer inherits from "),et=n(hr,"A",{href:!0});var ls=s(et);Uo=i(ls,"PreTrainedTokenizerFast"),ls.forEach(r),Jo=i(hr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),hr.forEach(r),Oo=d(A),F=n(A,"DIV",{class:!0});var mt=s(F);k(Ae.$$.fragment,mt),Vo=d(mt),Pt=n(mt,"P",{});var cs=s(Pt);Wo=i(cs,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),cs.forEach(r),Ho=d(mt),Ie=n(mt,"UL",{});var pr=s(Ie);tt=n(pr,"LI",{});var zn=s(tt);Ko=i(zn,"single sequence: "),Ct=n(zn,"CODE",{});var ds=s(Ct);Xo=i(ds,"[CLS] X [SEP]"),ds.forEach(r),zn.forEach(r),Yo=d(pr),rt=n(pr,"LI",{});var Bn=s(rt);Go=i(Bn,"pair of sequences: "),At=n(Bn,"CODE",{});var ms=s(At);Qo=i(ms,"[CLS] A [SEP] B [SEP]"),ms.forEach(r),Bn.forEach(r),pr.forEach(r),mt.forEach(r),Zo=d(A),C=n(A,"DIV",{class:!0});var fe=s(C);k(De.$$.fragment,fe),en=d(fe),It=n(fe,"P",{});var fs=s(It);tn=i(fs,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),fs.forEach(r),rn=d(fe),k(ce.$$.fragment,fe),on=d(fe),Y=n(fe,"P",{});var ft=s(Y);nn=i(ft,"If "),Dt=n(ft,"CODE",{});var hs=s(Dt);sn=i(hs,"token_ids_1"),hs.forEach(r),an=i(ft," is "),Lt=n(ft,"CODE",{});var ps=s(Lt);ln=i(ps,"None"),ps.forEach(r),cn=i(ft,", this method only returns the first portion of the mask (0s)."),ft.forEach(r),fe.forEach(r),A.forEach(r),Zt=d(t),G=n(t,"H2",{class:!0});var ur=s(G);de=n(ur,"A",{id:!0,class:!0,href:!0});var us=s(de);St=n(us,"SPAN",{});var _s=s(St);k(Le.$$.fragment,_s),_s.forEach(r),us.forEach(r),dn=d(ur),jt=n(ur,"SPAN",{});var gs=s(jt);mn=i(gs,"RetriBertModel"),gs.forEach(r),ur.forEach(r),er=d(t),x=n(t,"DIV",{class:!0});var N=s(x);k(Se.$$.fragment,N),fn=d(N),Ft=n(N,"P",{});var ks=s(Ft);hn=i(ks,"Bert Based model to embed queries or document for document retrieval."),ks.forEach(r),pn=d(N),je=n(N,"P",{});var _r=s(je);un=i(_r,"This model inherits from "),ot=n(_r,"A",{href:!0});var vs=s(ot);_n=i(vs,"PreTrainedModel"),vs.forEach(r),gn=i(_r,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_r.forEach(r),kn=d(N),Fe=n(N,"P",{});var gr=s(Fe);vn=i(gr,"This model is also a PyTorch "),Ne=n(gr,"A",{href:!0,rel:!0});var bs=s(Ne);bn=i(bs,"torch.nn.Module"),bs.forEach(r),wn=i(gr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gr.forEach(r),Tn=d(N),nt=n(N,"DIV",{class:!0});var ws=s(nt);k(Ue.$$.fragment,ws),ws.forEach(r),N.forEach(r),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify(Is)),l(h,"id","retribert"),l(h,"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(h,"href","#retribert"),l(_,"class","relative group"),l(Z,"id","overview"),l(Z,"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(Z,"href","#overview"),l(J,"class","relative group"),l(ue,"href","https://yjernite.github.io/lfqa.html"),l(ue,"rel","nofollow"),l(_e,"href","https://huggingface.co/yjernite"),l(_e,"rel","nofollow"),l(ge,"href","https://github.com/huggingface/transformers/tree/main/examples/research-projects/distillation"),l(ge,"rel","nofollow"),l(te,"id","transformers.RetriBertConfig"),l(te,"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(te,"href","#transformers.RetriBertConfig"),l(O,"class","relative group"),l(Oe,"href","/docs/transformers/v4.33.0/en/model_doc/retribert#transformers.RetriBertModel"),l(be,"href","https://huggingface.co/yjernite/retribert-base-uncased"),l(be,"rel","nofollow"),l(Ve,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(We,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(re,"id","transformers.RetriBertTokenizer"),l(re,"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(re,"href","#transformers.RetriBertTokenizer"),l(H,"class","relative group"),l(He,"href","/docs/transformers/v4.33.0/en/model_doc/retribert#transformers.RetriBertTokenizer"),l(Ke,"href","/docs/transformers/v4.33.0/en/model_doc/bert#transformers.BertTokenizer"),l(Xe,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),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(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ie,"id","transformers.RetriBertTokenizerFast"),l(ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ie,"href","#transformers.RetriBertTokenizerFast"),l(X,"class","relative group"),l(Qe,"href","/docs/transformers/v4.33.0/en/model_doc/retribert#transformers.RetriBertTokenizerFast"),l(Ze,"href","/docs/transformers/v4.33.0/en/model_doc/bert#transformers.BertTokenizerFast"),l(et,"href","/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),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(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(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(de,"id","transformers.RetriBertModel"),l(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(de,"href","#transformers.RetriBertModel"),l(G,"class","relative group"),l(ot,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),l(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ne,"rel","nofollow"),l(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"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,f){e(document.head,u),p(t,E,f),p(t,_,f),e(_,h),e(h,z),v(m,z,null),e(_,y),e(_,U),e(U,q),p(t,I,f),v(M,t,f),p(t,he,f),p(t,J,f),e(J,Z),e(Z,pt),v(pe,pt,null),e(J,kr),e(J,ut),e(ut,vr),p(t,Vt,f),p(t,ee,f),e(ee,br),e(ee,ue),e(ue,wr),e(ee,Tr),p(t,Wt,f),p(t,S,f),e(S,yr),e(S,_e),e(_e,$r),e(S,zr),e(S,ge),e(ge,Br),e(S,Er),p(t,Ht,f),p(t,O,f),e(O,te),e(te,_t),v(ke,_t,null),e(O,Rr),e(O,gt),e(gt,qr),p(t,Kt,f),p(t,D,f),v(ve,D,null),e(D,xr),e(D,V),e(V,Mr),e(V,Oe),e(Oe,Pr),e(V,Cr),e(V,be),e(be,Ar),e(V,Ir),e(D,Dr),e(D,W),e(W,Lr),e(W,Ve),e(Ve,Sr),e(W,jr),e(W,We),e(We,Fr),e(W,Nr),p(t,Xt,f),p(t,H,f),e(H,re),e(re,kt),v(we,kt,null),e(H,Ur),e(H,vt),e(vt,Jr),p(t,Yt,f),p(t,$,f),v(Te,$,null),e($,Or),e($,bt),e(bt,Vr),e($,Wr),e($,oe),e(oe,He),e(He,Hr),e(oe,Kr),e(oe,Ke),e(Ke,Xr),e(oe,Yr),e($,Gr),e($,ye),e(ye,Qr),e(ye,Xe),e(Xe,Zr),e(ye,eo),e($,to),e($,j),v($e,j,null),e(j,ro),e(j,wt),e(wt,oo),e(j,no),e(j,ze),e(ze,Ye),e(Ye,so),e(Ye,Tt),e(Tt,ao),e(ze,io),e(ze,Ge),e(Ge,lo),e(Ge,yt),e(yt,co),e($,mo),e($,ne),v(Be,ne,null),e(ne,fo),e(ne,$t),e($t,ho),e($,po),e($,P),v(Ee,P,null),e(P,uo),e(P,zt),e(zt,_o),e(P,go),v(se,P,null),e(P,ko),e(P,K),e(K,vo),e(K,Bt),e(Bt,bo),e(K,wo),e(K,Et),e(Et,To),e(K,yo),e($,$o),e($,ae),v(Re,ae,null),e(ae,zo),e(ae,qe),e(qe,Bo),e(qe,Rt),e(Rt,Eo),e(qe,Ro),p(t,Gt,f),p(t,X,f),e(X,ie),e(ie,qt),v(xe,qt,null),e(X,qo),e(X,xt),e(xt,xo),p(t,Qt,f),p(t,B,f),v(Me,B,null),e(B,Mo),e(B,Pe),e(Pe,Po),e(Pe,Mt),e(Mt,Co),e(Pe,Ao),e(B,Io),e(B,le),e(le,Qe),e(Qe,Do),e(le,Lo),e(le,Ze),e(Ze,So),e(le,jo),e(B,Fo),e(B,Ce),e(Ce,No),e(Ce,et),e(et,Uo),e(Ce,Jo),e(B,Oo),e(B,F),v(Ae,F,null),e(F,Vo),e(F,Pt),e(Pt,Wo),e(F,Ho),e(F,Ie),e(Ie,tt),e(tt,Ko),e(tt,Ct),e(Ct,Xo),e(Ie,Yo),e(Ie,rt),e(rt,Go),e(rt,At),e(At,Qo),e(B,Zo),e(B,C),v(De,C,null),e(C,en),e(C,It),e(It,tn),e(C,rn),v(ce,C,null),e(C,on),e(C,Y),e(Y,nn),e(Y,Dt),e(Dt,sn),e(Y,an),e(Y,Lt),e(Lt,ln),e(Y,cn),p(t,Zt,f),p(t,G,f),e(G,de),e(de,St),v(Le,St,null),e(G,dn),e(G,jt),e(jt,mn),p(t,er,f),p(t,x,f),v(Se,x,null),e(x,fn),e(x,Ft),e(Ft,hn),e(x,pn),e(x,je),e(je,un),e(je,ot),e(ot,_n),e(je,gn),e(x,kn),e(x,Fe),e(Fe,vn),e(Fe,Ne),e(Ne,bn),e(Fe,wn),e(x,Tn),e(x,nt),v(Ue,nt,null),tr=!0},p(t,[f]){const Je={};f&2&&(Je.$$scope={dirty:f,ctx:t}),M.$set(Je);const Nt={};f&2&&(Nt.$$scope={dirty:f,ctx:t}),se.$set(Nt);const Ut={};f&2&&(Ut.$$scope={dirty:f,ctx:t}),ce.$set(Ut)},i(t){tr||(b(m.$$.fragment,t),b(M.$$.fragment,t),b(pe.$$.fragment,t),b(ke.$$.fragment,t),b(ve.$$.fragment,t),b(we.$$.fragment,t),b(Te.$$.fragment,t),b($e.$$.fragment,t),b(Be.$$.fragment,t),b(Ee.$$.fragment,t),b(se.$$.fragment,t),b(Re.$$.fragment,t),b(xe.$$.fragment,t),b(Me.$$.fragment,t),b(Ae.$$.fragment,t),b(De.$$.fragment,t),b(ce.$$.fragment,t),b(Le.$$.fragment,t),b(Se.$$.fragment,t),b(Ue.$$.fragment,t),tr=!0)},o(t){w(m.$$.fragment,t),w(M.$$.fragment,t),w(pe.$$.fragment,t),w(ke.$$.fragment,t),w(ve.$$.fragment,t),w(we.$$.fragment,t),w(Te.$$.fragment,t),w($e.$$.fragment,t),w(Be.$$.fragment,t),w(Ee.$$.fragment,t),w(se.$$.fragment,t),w(Re.$$.fragment,t),w(xe.$$.fragment,t),w(Me.$$.fragment,t),w(Ae.$$.fragment,t),w(De.$$.fragment,t),w(ce.$$.fragment,t),w(Le.$$.fragment,t),w(Se.$$.fragment,t),w(Ue.$$.fragment,t),tr=!1},d(t){r(u),t&&r(E),t&&r(_),T(m),t&&r(I),T(M,t),t&&r(he),t&&r(J),T(pe),t&&r(Vt),t&&r(ee),t&&r(Wt),t&&r(S),t&&r(Ht),t&&r(O),T(ke),t&&r(Kt),t&&r(D),T(ve),t&&r(Xt),t&&r(H),T(we),t&&r(Yt),t&&r($),T(Te),T($e),T(Be),T(Ee),T(se),T(Re),t&&r(Gt),t&&r(X),T(xe),t&&r(Qt),t&&r(B),T(Me),T(Ae),T(De),T(ce),t&&r(Zt),t&&r(G),T(Le),t&&r(er),t&&r(x),T(Se),T(Ue)}}}const Is={local:"retribert",sections:[{local:"overview",title:"Overview"},{local:"transformers.RetriBertConfig",title:"RetriBertConfig"},{local:"transformers.RetriBertTokenizer",title:"RetriBertTokenizer"},{local:"transformers.RetriBertTokenizerFast",title:"RetriBertTokenizerFast"},{local:"transformers.RetriBertModel",title:"RetriBertModel"}],title:"RetriBERT"};function Ds(Q){return qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Js extends zs{constructor(u){super();Bs(this,u,Ds,As,Es,{})}}export{Js as default,Is as metadata};
