import{S as ys,i as $s,s as zs,e as o,k as c,w as g,t as a,M as Bs,c as n,d as t,m as d,a as s,x as k,h as i,b as l,G as e,g as f,y as v,q as b,o as w,B as T,v as Es,L as ws}from"../../chunks/vendor-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ts}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as lt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as bs}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Rs(Se){let u,q,y,p,E;return p=new Ts({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"),q=a("pair mask has the following format:"),y=c(),g(p.$$.fragment)},l(m){u=n(m,"P",{});var $=s(u);q=i($,"pair mask has the following format:"),$.forEach(t),y=d(m),k(p.$$.fragment,m)},m(m,$){f(m,u,$),e(u,q),f(m,y,$),v(p,m,$),E=!0},p:ws,i(m){E||(b(p.$$.fragment,m),E=!0)},o(m){w(p.$$.fragment,m),E=!1},d(m){m&&t(u),m&&t(y),T(p,m)}}}function qs(Se){let u,q,y,p,E;return p=new Ts({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"),q=a("pair mask has the following format:"),y=c(),g(p.$$.fragment)},l(m){u=n(m,"P",{});var $=s(u);q=i($,"pair mask has the following format:"),$.forEach(t),y=d(m),k(p.$$.fragment,m)},m(m,$){f(m,u,$),e(u,q),f(m,y,$),v(p,m,$),E=!0},p:ws,i(m){E||(b(p.$$.fragment,m),E=!0)},o(m){w(p.$$.fragment,m),E=!1},d(m){m&&t(u),m&&t(y),T(p,m)}}}function xs(Se){let u,q,y,p,E,m,$,ct,pr,Ft,j,K,dt,le,ur,mt,_r,Nt,X,gr,ce,kr,vr,Ut,D,br,de,wr,Tr,me,yr,$r,Jt,F,G,ht,he,zr,ft,Br,Ot,C,fe,Er,N,Rr,je,qr,xr,pe,Mr,Ar,Cr,U,Pr,Fe,Dr,Ir,Ne,Lr,Sr,Vt,J,Q,pt,ue,jr,ut,Fr,Wt,_,_e,Nr,_t,Ur,Jr,Y,Ue,Or,Vr,Je,Wr,Hr,Kr,ge,Xr,Oe,Gr,Qr,Yr,I,ke,Zr,gt,eo,to,ve,Ve,ro,kt,oo,no,We,so,vt,ao,io,Z,be,lo,bt,co,mo,x,we,ho,wt,fo,po,ee,uo,O,_o,Tt,go,ko,yt,vo,bo,wo,te,Te,To,ye,yo,$t,$o,zo,Ht,V,re,zt,$e,Bo,Bt,Eo,Kt,z,ze,Ro,Be,qo,Et,xo,Mo,Ao,oe,He,Co,Po,Ke,Do,Io,Lo,Ee,So,Xe,jo,Fo,No,L,Re,Uo,Rt,Jo,Oo,qe,Ge,Vo,qt,Wo,Ho,Qe,Ko,xt,Xo,Go,M,xe,Qo,Mt,Yo,Zo,ne,en,W,tn,At,rn,on,Ct,nn,sn,Xt,H,se,Pt,Me,an,Dt,ln,Gt,R,Ae,cn,It,dn,mn,Ce,hn,Ye,fn,pn,un,Pe,_n,De,gn,kn,vn,Ze,Ie,Qt;return m=new lt({}),le=new lt({}),he=new lt({}),fe=new P({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.30.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.30.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.30.0/src/transformers/models/retribert/configuration_retribert.py#L31"}}),ue=new lt({}),_e=new P({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.30.0/src/transformers/models/retribert/tokenization_retribert.py#L70"}}),ke=new P({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.30.0/src/transformers/models/retribert/tokenization_retribert.py#L211",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 P({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.30.0/src/transformers/models/retribert/tokenization_retribert.py#L205"}}),we=new P({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.30.0/src/transformers/models/retribert/tokenization_retribert.py#L266",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>
`}}),ee=new bs({props:{anchor:"transformers.RetriBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Rs]},$$scope:{ctx:Se}}}),Te=new P({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.30.0/src/transformers/models/retribert/tokenization_retribert.py#L237",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>
`}}),$e=new lt({}),ze=new P({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.30.0/src/transformers/models/retribert/tokenization_retribert_fast.py#L54"}}),Re=new P({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.30.0/src/transformers/models/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>
`}}),xe=new P({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.30.0/src/transformers/models/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>
`}}),ne=new bs({props:{anchor:"transformers.RetriBertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[qs]},$$scope:{ctx:Se}}}),Me=new lt({}),Ae=new P({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.30.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.30.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.30.0/src/transformers/models/retribert/modeling_retribert.py#L88"}}),Ie=new P({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/src/transformers/models/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"),q=c(),y=o("h1"),p=o("a"),E=o("span"),g(m.$$.fragment),$=c(),ct=o("span"),pr=a("RetriBERT"),Ft=c(),j=o("h2"),K=o("a"),dt=o("span"),g(le.$$.fragment),ur=c(),mt=o("span"),_r=a("Overview"),Nt=c(),X=o("p"),gr=a("The RetriBERT model was proposed in the blog post "),ce=o("a"),kr=a(`Explain Anything Like I\u2019m Five: A Model for Open Domain Long Form
Question Answering`),vr=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.`),Ut=c(),D=o("p"),br=a("This model was contributed by "),de=o("a"),wr=a("yjernite"),Tr=a(`. Code to train and use the model can be
found `),me=o("a"),yr=a("here"),$r=a("."),Jt=c(),F=o("h2"),G=o("a"),ht=o("span"),g(he.$$.fragment),zr=c(),ft=o("span"),Br=a("RetriBertConfig"),Ot=c(),C=o("div"),g(fe.$$.fragment),Er=c(),N=o("p"),Rr=a("This is the configuration class to store the configuration of a "),je=o("a"),qr=a("RetriBertModel"),xr=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
`),pe=o("a"),Mr=a("yjernite/retribert-base-uncased"),Ar=a(" architecture."),Cr=c(),U=o("p"),Pr=a("Configuration objects inherit from "),Fe=o("a"),Dr=a("PretrainedConfig"),Ir=a(` and can be used to control the model outputs. Read the
documentation from `),Ne=o("a"),Lr=a("PretrainedConfig"),Sr=a(" for more information."),Vt=c(),J=o("h2"),Q=o("a"),pt=o("span"),g(ue.$$.fragment),jr=c(),ut=o("span"),Fr=a("RetriBertTokenizer"),Wt=c(),_=o("div"),g(_e.$$.fragment),Nr=c(),_t=o("p"),Ur=a("Constructs a RetriBERT tokenizer."),Jr=c(),Y=o("p"),Ue=o("a"),Or=a("RetriBertTokenizer"),Vr=a(" is identical to "),Je=o("a"),Wr=a("BertTokenizer"),Hr=a(` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),Kr=c(),ge=o("p"),Xr=a("This tokenizer inherits from "),Oe=o("a"),Gr=a("PreTrainedTokenizer"),Qr=a(` which contains most of the main methods. Users should refer
to: this superclass for more information regarding those methods.`),Yr=c(),I=o("div"),g(ke.$$.fragment),Zr=c(),gt=o("p"),eo=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:`),to=c(),ve=o("ul"),Ve=o("li"),ro=a("single sequence: "),kt=o("code"),oo=a("[CLS] X [SEP]"),no=c(),We=o("li"),so=a("pair of sequences: "),vt=o("code"),ao=a("[CLS] A [SEP] B [SEP]"),io=c(),Z=o("div"),g(be.$$.fragment),lo=c(),bt=o("p"),co=a("Converts a sequence of tokens (string) in a single string."),mo=c(),x=o("div"),g(we.$$.fragment),ho=c(),wt=o("p"),fo=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),po=c(),g(ee.$$.fragment),uo=c(),O=o("p"),_o=a("If "),Tt=o("code"),go=a("token_ids_1"),ko=a(" is "),yt=o("code"),vo=a("None"),bo=a(", this method only returns the first portion of the mask (0s)."),wo=c(),te=o("div"),g(Te.$$.fragment),To=c(),ye=o("p"),yo=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 `),$t=o("code"),$o=a("prepare_for_model"),zo=a(" method."),Ht=c(),V=o("h2"),re=o("a"),zt=o("span"),g($e.$$.fragment),Bo=c(),Bt=o("span"),Eo=a("RetriBertTokenizerFast"),Kt=c(),z=o("div"),g(ze.$$.fragment),Ro=c(),Be=o("p"),qo=a("Construct a \u201Cfast\u201D RetriBERT tokenizer (backed by HuggingFace\u2019s "),Et=o("em"),xo=a("tokenizers"),Mo=a(" library)."),Ao=c(),oe=o("p"),He=o("a"),Co=a("RetriBertTokenizerFast"),Po=a(" is identical to "),Ke=o("a"),Do=a("BertTokenizerFast"),Io=a(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Lo=c(),Ee=o("p"),So=a("This tokenizer inherits from "),Xe=o("a"),jo=a("PreTrainedTokenizerFast"),Fo=a(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),No=c(),L=o("div"),g(Re.$$.fragment),Uo=c(),Rt=o("p"),Jo=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:`),Oo=c(),qe=o("ul"),Ge=o("li"),Vo=a("single sequence: "),qt=o("code"),Wo=a("[CLS] X [SEP]"),Ho=c(),Qe=o("li"),Ko=a("pair of sequences: "),xt=o("code"),Xo=a("[CLS] A [SEP] B [SEP]"),Go=c(),M=o("div"),g(xe.$$.fragment),Qo=c(),Mt=o("p"),Yo=a("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Zo=c(),g(ne.$$.fragment),en=c(),W=o("p"),tn=a("If "),At=o("code"),rn=a("token_ids_1"),on=a(" is "),Ct=o("code"),nn=a("None"),sn=a(", this method only returns the first portion of the mask (0s)."),Xt=c(),H=o("h2"),se=o("a"),Pt=o("span"),g(Me.$$.fragment),an=c(),Dt=o("span"),ln=a("RetriBertModel"),Gt=c(),R=o("div"),g(Ae.$$.fragment),cn=c(),It=o("p"),dn=a("Bert Based model to embed queries or document for document retrieval."),mn=c(),Ce=o("p"),hn=a("This model inherits from "),Ye=o("a"),fn=a("PreTrainedModel"),pn=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.)`),un=c(),Pe=o("p"),_n=a("This model is also a PyTorch "),De=o("a"),gn=a("torch.nn.Module"),kn=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vn=c(),Ze=o("div"),g(Ie.$$.fragment),this.h()},l(r){const h=Bs('[data-svelte="svelte-1phssyn"]',document.head);u=n(h,"META",{name:!0,content:!0}),h.forEach(t),q=d(r),y=n(r,"H1",{class:!0});var Le=s(y);p=n(Le,"A",{id:!0,class:!0,href:!0});var Lt=s(p);E=n(Lt,"SPAN",{});var $n=s(E);k(m.$$.fragment,$n),$n.forEach(t),Lt.forEach(t),$=d(Le),ct=n(Le,"SPAN",{});var zn=s(ct);pr=i(zn,"RetriBERT"),zn.forEach(t),Le.forEach(t),Ft=d(r),j=n(r,"H2",{class:!0});var Yt=s(j);K=n(Yt,"A",{id:!0,class:!0,href:!0});var Bn=s(K);dt=n(Bn,"SPAN",{});var En=s(dt);k(le.$$.fragment,En),En.forEach(t),Bn.forEach(t),ur=d(Yt),mt=n(Yt,"SPAN",{});var Rn=s(mt);_r=i(Rn,"Overview"),Rn.forEach(t),Yt.forEach(t),Nt=d(r),X=n(r,"P",{});var Zt=s(X);gr=i(Zt,"The RetriBERT model was proposed in the blog post "),ce=n(Zt,"A",{href:!0,rel:!0});var qn=s(ce);kr=i(qn,`Explain Anything Like I\u2019m Five: A Model for Open Domain Long Form
Question Answering`),qn.forEach(t),vr=i(Zt,`. 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.`),Zt.forEach(t),Ut=d(r),D=n(r,"P",{});var et=s(D);br=i(et,"This model was contributed by "),de=n(et,"A",{href:!0,rel:!0});var xn=s(de);wr=i(xn,"yjernite"),xn.forEach(t),Tr=i(et,`. Code to train and use the model can be
found `),me=n(et,"A",{href:!0,rel:!0});var Mn=s(me);yr=i(Mn,"here"),Mn.forEach(t),$r=i(et,"."),et.forEach(t),Jt=d(r),F=n(r,"H2",{class:!0});var er=s(F);G=n(er,"A",{id:!0,class:!0,href:!0});var An=s(G);ht=n(An,"SPAN",{});var Cn=s(ht);k(he.$$.fragment,Cn),Cn.forEach(t),An.forEach(t),zr=d(er),ft=n(er,"SPAN",{});var Pn=s(ft);Br=i(Pn,"RetriBertConfig"),Pn.forEach(t),er.forEach(t),Ot=d(r),C=n(r,"DIV",{class:!0});var tt=s(C);k(fe.$$.fragment,tt),Er=d(tt),N=n(tt,"P",{});var rt=s(N);Rr=i(rt,"This is the configuration class to store the configuration of a "),je=n(rt,"A",{href:!0});var Dn=s(je);qr=i(Dn,"RetriBertModel"),Dn.forEach(t),xr=i(rt,`. 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
`),pe=n(rt,"A",{href:!0,rel:!0});var In=s(pe);Mr=i(In,"yjernite/retribert-base-uncased"),In.forEach(t),Ar=i(rt," architecture."),rt.forEach(t),Cr=d(tt),U=n(tt,"P",{});var ot=s(U);Pr=i(ot,"Configuration objects inherit from "),Fe=n(ot,"A",{href:!0});var Ln=s(Fe);Dr=i(Ln,"PretrainedConfig"),Ln.forEach(t),Ir=i(ot,` and can be used to control the model outputs. Read the
documentation from `),Ne=n(ot,"A",{href:!0});var Sn=s(Ne);Lr=i(Sn,"PretrainedConfig"),Sn.forEach(t),Sr=i(ot," for more information."),ot.forEach(t),tt.forEach(t),Vt=d(r),J=n(r,"H2",{class:!0});var tr=s(J);Q=n(tr,"A",{id:!0,class:!0,href:!0});var jn=s(Q);pt=n(jn,"SPAN",{});var Fn=s(pt);k(ue.$$.fragment,Fn),Fn.forEach(t),jn.forEach(t),jr=d(tr),ut=n(tr,"SPAN",{});var Nn=s(ut);Fr=i(Nn,"RetriBertTokenizer"),Nn.forEach(t),tr.forEach(t),Wt=d(r),_=n(r,"DIV",{class:!0});var B=s(_);k(_e.$$.fragment,B),Nr=d(B),_t=n(B,"P",{});var Un=s(_t);Ur=i(Un,"Constructs a RetriBERT tokenizer."),Un.forEach(t),Jr=d(B),Y=n(B,"P",{});var St=s(Y);Ue=n(St,"A",{href:!0});var Jn=s(Ue);Or=i(Jn,"RetriBertTokenizer"),Jn.forEach(t),Vr=i(St," is identical to "),Je=n(St,"A",{href:!0});var On=s(Je);Wr=i(On,"BertTokenizer"),On.forEach(t),Hr=i(St,` and runs end-to-end tokenization: punctuation splitting
and wordpiece.`),St.forEach(t),Kr=d(B),ge=n(B,"P",{});var rr=s(ge);Xr=i(rr,"This tokenizer inherits from "),Oe=n(rr,"A",{href:!0});var Vn=s(Oe);Gr=i(Vn,"PreTrainedTokenizer"),Vn.forEach(t),Qr=i(rr,` which contains most of the main methods. Users should refer
to: this superclass for more information regarding those methods.`),rr.forEach(t),Yr=d(B),I=n(B,"DIV",{class:!0});var nt=s(I);k(ke.$$.fragment,nt),Zr=d(nt),gt=n(nt,"P",{});var Wn=s(gt);eo=i(Wn,`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:`),Wn.forEach(t),to=d(nt),ve=n(nt,"UL",{});var or=s(ve);Ve=n(or,"LI",{});var bn=s(Ve);ro=i(bn,"single sequence: "),kt=n(bn,"CODE",{});var Hn=s(kt);oo=i(Hn,"[CLS] X [SEP]"),Hn.forEach(t),bn.forEach(t),no=d(or),We=n(or,"LI",{});var wn=s(We);so=i(wn,"pair of sequences: "),vt=n(wn,"CODE",{});var Kn=s(vt);ao=i(Kn,"[CLS] A [SEP] B [SEP]"),Kn.forEach(t),wn.forEach(t),or.forEach(t),nt.forEach(t),io=d(B),Z=n(B,"DIV",{class:!0});var nr=s(Z);k(be.$$.fragment,nr),lo=d(nr),bt=n(nr,"P",{});var Xn=s(bt);co=i(Xn,"Converts a sequence of tokens (string) in a single string."),Xn.forEach(t),nr.forEach(t),mo=d(B),x=n(B,"DIV",{class:!0});var ae=s(x);k(we.$$.fragment,ae),ho=d(ae),wt=n(ae,"P",{});var Gn=s(wt);fo=i(Gn,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Gn.forEach(t),po=d(ae),k(ee.$$.fragment,ae),uo=d(ae),O=n(ae,"P",{});var st=s(O);_o=i(st,"If "),Tt=n(st,"CODE",{});var Qn=s(Tt);go=i(Qn,"token_ids_1"),Qn.forEach(t),ko=i(st," is "),yt=n(st,"CODE",{});var Yn=s(yt);vo=i(Yn,"None"),Yn.forEach(t),bo=i(st,", this method only returns the first portion of the mask (0s)."),st.forEach(t),ae.forEach(t),wo=d(B),te=n(B,"DIV",{class:!0});var sr=s(te);k(Te.$$.fragment,sr),To=d(sr),ye=n(sr,"P",{});var ar=s(ye);yo=i(ar,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),$t=n(ar,"CODE",{});var Zn=s($t);$o=i(Zn,"prepare_for_model"),Zn.forEach(t),zo=i(ar," method."),ar.forEach(t),sr.forEach(t),B.forEach(t),Ht=d(r),V=n(r,"H2",{class:!0});var ir=s(V);re=n(ir,"A",{id:!0,class:!0,href:!0});var es=s(re);zt=n(es,"SPAN",{});var ts=s(zt);k($e.$$.fragment,ts),ts.forEach(t),es.forEach(t),Bo=d(ir),Bt=n(ir,"SPAN",{});var rs=s(Bt);Eo=i(rs,"RetriBertTokenizerFast"),rs.forEach(t),ir.forEach(t),Kt=d(r),z=n(r,"DIV",{class:!0});var A=s(z);k(ze.$$.fragment,A),Ro=d(A),Be=n(A,"P",{});var lr=s(Be);qo=i(lr,"Construct a \u201Cfast\u201D RetriBERT tokenizer (backed by HuggingFace\u2019s "),Et=n(lr,"EM",{});var os=s(Et);xo=i(os,"tokenizers"),os.forEach(t),Mo=i(lr," library)."),lr.forEach(t),Ao=d(A),oe=n(A,"P",{});var jt=s(oe);He=n(jt,"A",{href:!0});var ns=s(He);Co=i(ns,"RetriBertTokenizerFast"),ns.forEach(t),Po=i(jt," is identical to "),Ke=n(jt,"A",{href:!0});var ss=s(Ke);Do=i(ss,"BertTokenizerFast"),ss.forEach(t),Io=i(jt,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),jt.forEach(t),Lo=d(A),Ee=n(A,"P",{});var cr=s(Ee);So=i(cr,"This tokenizer inherits from "),Xe=n(cr,"A",{href:!0});var as=s(Xe);jo=i(as,"PreTrainedTokenizerFast"),as.forEach(t),Fo=i(cr,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),cr.forEach(t),No=d(A),L=n(A,"DIV",{class:!0});var at=s(L);k(Re.$$.fragment,at),Uo=d(at),Rt=n(at,"P",{});var is=s(Rt);Jo=i(is,`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:`),is.forEach(t),Oo=d(at),qe=n(at,"UL",{});var dr=s(qe);Ge=n(dr,"LI",{});var Tn=s(Ge);Vo=i(Tn,"single sequence: "),qt=n(Tn,"CODE",{});var ls=s(qt);Wo=i(ls,"[CLS] X [SEP]"),ls.forEach(t),Tn.forEach(t),Ho=d(dr),Qe=n(dr,"LI",{});var yn=s(Qe);Ko=i(yn,"pair of sequences: "),xt=n(yn,"CODE",{});var cs=s(xt);Xo=i(cs,"[CLS] A [SEP] B [SEP]"),cs.forEach(t),yn.forEach(t),dr.forEach(t),at.forEach(t),Go=d(A),M=n(A,"DIV",{class:!0});var ie=s(M);k(xe.$$.fragment,ie),Qo=d(ie),Mt=n(ie,"P",{});var ds=s(Mt);Yo=i(ds,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ds.forEach(t),Zo=d(ie),k(ne.$$.fragment,ie),en=d(ie),W=n(ie,"P",{});var it=s(W);tn=i(it,"If "),At=n(it,"CODE",{});var ms=s(At);rn=i(ms,"token_ids_1"),ms.forEach(t),on=i(it," is "),Ct=n(it,"CODE",{});var hs=s(Ct);nn=i(hs,"None"),hs.forEach(t),sn=i(it,", this method only returns the first portion of the mask (0s)."),it.forEach(t),ie.forEach(t),A.forEach(t),Xt=d(r),H=n(r,"H2",{class:!0});var mr=s(H);se=n(mr,"A",{id:!0,class:!0,href:!0});var fs=s(se);Pt=n(fs,"SPAN",{});var ps=s(Pt);k(Me.$$.fragment,ps),ps.forEach(t),fs.forEach(t),an=d(mr),Dt=n(mr,"SPAN",{});var us=s(Dt);ln=i(us,"RetriBertModel"),us.forEach(t),mr.forEach(t),Gt=d(r),R=n(r,"DIV",{class:!0});var S=s(R);k(Ae.$$.fragment,S),cn=d(S),It=n(S,"P",{});var _s=s(It);dn=i(_s,"Bert Based model to embed queries or document for document retrieval."),_s.forEach(t),mn=d(S),Ce=n(S,"P",{});var hr=s(Ce);hn=i(hr,"This model inherits from "),Ye=n(hr,"A",{href:!0});var gs=s(Ye);fn=i(gs,"PreTrainedModel"),gs.forEach(t),pn=i(hr,`. 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.)`),hr.forEach(t),un=d(S),Pe=n(S,"P",{});var fr=s(Pe);_n=i(fr,"This model is also a PyTorch "),De=n(fr,"A",{href:!0,rel:!0});var ks=s(De);gn=i(ks,"torch.nn.Module"),ks.forEach(t),kn=i(fr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fr.forEach(t),vn=d(S),Ze=n(S,"DIV",{class:!0});var vs=s(Ze);k(Ie.$$.fragment,vs),vs.forEach(t),S.forEach(t),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify(Ms)),l(p,"id","retribert"),l(p,"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(p,"href","#retribert"),l(y,"class","relative group"),l(K,"id","overview"),l(K,"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(K,"href","#overview"),l(j,"class","relative group"),l(ce,"href","https://yjernite.github.io/lfqa.html"),l(ce,"rel","nofollow"),l(de,"href","https://huggingface.co/yjernite"),l(de,"rel","nofollow"),l(me,"href","https://github.com/huggingface/transformers/tree/main/examples/research-projects/distillation"),l(me,"rel","nofollow"),l(G,"id","transformers.RetriBertConfig"),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","#transformers.RetriBertConfig"),l(F,"class","relative group"),l(je,"href","/docs/transformers/v4.30.0/en/model_doc/retribert#transformers.RetriBertModel"),l(pe,"href","https://huggingface.co/yjernite/retribert-base-uncased"),l(pe,"rel","nofollow"),l(Fe,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ne,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),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(Q,"id","transformers.RetriBertTokenizer"),l(Q,"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(Q,"href","#transformers.RetriBertTokenizer"),l(J,"class","relative group"),l(Ue,"href","/docs/transformers/v4.30.0/en/model_doc/retribert#transformers.RetriBertTokenizer"),l(Je,"href","/docs/transformers/v4.30.0/en/model_doc/bert#transformers.BertTokenizer"),l(Oe,"href","/docs/transformers/v4.30.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),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(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(te,"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(re,"id","transformers.RetriBertTokenizerFast"),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.RetriBertTokenizerFast"),l(V,"class","relative group"),l(He,"href","/docs/transformers/v4.30.0/en/model_doc/retribert#transformers.RetriBertTokenizerFast"),l(Ke,"href","/docs/transformers/v4.30.0/en/model_doc/bert#transformers.BertTokenizerFast"),l(Xe,"href","/docs/transformers/v4.30.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(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(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(se,"id","transformers.RetriBertModel"),l(se,"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(se,"href","#transformers.RetriBertModel"),l(H,"class","relative group"),l(Ye,"href","/docs/transformers/v4.30.0/en/main_classes/model#transformers.PreTrainedModel"),l(De,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(De,"rel","nofollow"),l(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(r,h){e(document.head,u),f(r,q,h),f(r,y,h),e(y,p),e(p,E),v(m,E,null),e(y,$),e(y,ct),e(ct,pr),f(r,Ft,h),f(r,j,h),e(j,K),e(K,dt),v(le,dt,null),e(j,ur),e(j,mt),e(mt,_r),f(r,Nt,h),f(r,X,h),e(X,gr),e(X,ce),e(ce,kr),e(X,vr),f(r,Ut,h),f(r,D,h),e(D,br),e(D,de),e(de,wr),e(D,Tr),e(D,me),e(me,yr),e(D,$r),f(r,Jt,h),f(r,F,h),e(F,G),e(G,ht),v(he,ht,null),e(F,zr),e(F,ft),e(ft,Br),f(r,Ot,h),f(r,C,h),v(fe,C,null),e(C,Er),e(C,N),e(N,Rr),e(N,je),e(je,qr),e(N,xr),e(N,pe),e(pe,Mr),e(N,Ar),e(C,Cr),e(C,U),e(U,Pr),e(U,Fe),e(Fe,Dr),e(U,Ir),e(U,Ne),e(Ne,Lr),e(U,Sr),f(r,Vt,h),f(r,J,h),e(J,Q),e(Q,pt),v(ue,pt,null),e(J,jr),e(J,ut),e(ut,Fr),f(r,Wt,h),f(r,_,h),v(_e,_,null),e(_,Nr),e(_,_t),e(_t,Ur),e(_,Jr),e(_,Y),e(Y,Ue),e(Ue,Or),e(Y,Vr),e(Y,Je),e(Je,Wr),e(Y,Hr),e(_,Kr),e(_,ge),e(ge,Xr),e(ge,Oe),e(Oe,Gr),e(ge,Qr),e(_,Yr),e(_,I),v(ke,I,null),e(I,Zr),e(I,gt),e(gt,eo),e(I,to),e(I,ve),e(ve,Ve),e(Ve,ro),e(Ve,kt),e(kt,oo),e(ve,no),e(ve,We),e(We,so),e(We,vt),e(vt,ao),e(_,io),e(_,Z),v(be,Z,null),e(Z,lo),e(Z,bt),e(bt,co),e(_,mo),e(_,x),v(we,x,null),e(x,ho),e(x,wt),e(wt,fo),e(x,po),v(ee,x,null),e(x,uo),e(x,O),e(O,_o),e(O,Tt),e(Tt,go),e(O,ko),e(O,yt),e(yt,vo),e(O,bo),e(_,wo),e(_,te),v(Te,te,null),e(te,To),e(te,ye),e(ye,yo),e(ye,$t),e($t,$o),e(ye,zo),f(r,Ht,h),f(r,V,h),e(V,re),e(re,zt),v($e,zt,null),e(V,Bo),e(V,Bt),e(Bt,Eo),f(r,Kt,h),f(r,z,h),v(ze,z,null),e(z,Ro),e(z,Be),e(Be,qo),e(Be,Et),e(Et,xo),e(Be,Mo),e(z,Ao),e(z,oe),e(oe,He),e(He,Co),e(oe,Po),e(oe,Ke),e(Ke,Do),e(oe,Io),e(z,Lo),e(z,Ee),e(Ee,So),e(Ee,Xe),e(Xe,jo),e(Ee,Fo),e(z,No),e(z,L),v(Re,L,null),e(L,Uo),e(L,Rt),e(Rt,Jo),e(L,Oo),e(L,qe),e(qe,Ge),e(Ge,Vo),e(Ge,qt),e(qt,Wo),e(qe,Ho),e(qe,Qe),e(Qe,Ko),e(Qe,xt),e(xt,Xo),e(z,Go),e(z,M),v(xe,M,null),e(M,Qo),e(M,Mt),e(Mt,Yo),e(M,Zo),v(ne,M,null),e(M,en),e(M,W),e(W,tn),e(W,At),e(At,rn),e(W,on),e(W,Ct),e(Ct,nn),e(W,sn),f(r,Xt,h),f(r,H,h),e(H,se),e(se,Pt),v(Me,Pt,null),e(H,an),e(H,Dt),e(Dt,ln),f(r,Gt,h),f(r,R,h),v(Ae,R,null),e(R,cn),e(R,It),e(It,dn),e(R,mn),e(R,Ce),e(Ce,hn),e(Ce,Ye),e(Ye,fn),e(Ce,pn),e(R,un),e(R,Pe),e(Pe,_n),e(Pe,De),e(De,gn),e(Pe,kn),e(R,vn),e(R,Ze),v(Ie,Ze,null),Qt=!0},p(r,[h]){const Le={};h&2&&(Le.$$scope={dirty:h,ctx:r}),ee.$set(Le);const Lt={};h&2&&(Lt.$$scope={dirty:h,ctx:r}),ne.$set(Lt)},i(r){Qt||(b(m.$$.fragment,r),b(le.$$.fragment,r),b(he.$$.fragment,r),b(fe.$$.fragment,r),b(ue.$$.fragment,r),b(_e.$$.fragment,r),b(ke.$$.fragment,r),b(be.$$.fragment,r),b(we.$$.fragment,r),b(ee.$$.fragment,r),b(Te.$$.fragment,r),b($e.$$.fragment,r),b(ze.$$.fragment,r),b(Re.$$.fragment,r),b(xe.$$.fragment,r),b(ne.$$.fragment,r),b(Me.$$.fragment,r),b(Ae.$$.fragment,r),b(Ie.$$.fragment,r),Qt=!0)},o(r){w(m.$$.fragment,r),w(le.$$.fragment,r),w(he.$$.fragment,r),w(fe.$$.fragment,r),w(ue.$$.fragment,r),w(_e.$$.fragment,r),w(ke.$$.fragment,r),w(be.$$.fragment,r),w(we.$$.fragment,r),w(ee.$$.fragment,r),w(Te.$$.fragment,r),w($e.$$.fragment,r),w(ze.$$.fragment,r),w(Re.$$.fragment,r),w(xe.$$.fragment,r),w(ne.$$.fragment,r),w(Me.$$.fragment,r),w(Ae.$$.fragment,r),w(Ie.$$.fragment,r),Qt=!1},d(r){t(u),r&&t(q),r&&t(y),T(m),r&&t(Ft),r&&t(j),T(le),r&&t(Nt),r&&t(X),r&&t(Ut),r&&t(D),r&&t(Jt),r&&t(F),T(he),r&&t(Ot),r&&t(C),T(fe),r&&t(Vt),r&&t(J),T(ue),r&&t(Wt),r&&t(_),T(_e),T(ke),T(be),T(we),T(ee),T(Te),r&&t(Ht),r&&t(V),T($e),r&&t(Kt),r&&t(z),T(ze),T(Re),T(xe),T(ne),r&&t(Xt),r&&t(H),T(Me),r&&t(Gt),r&&t(R),T(Ae),T(Ie)}}}const Ms={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 As(Se){return Es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ss extends ys{constructor(u){super();$s(this,u,As,xs,zs,{})}}export{Ss as default,Ms as metadata};
