import{S as sm,i as am,s as im,e as s,k as c,w as T,t as n,M as lm,c as a,d as t,m as p,a as i,x as w,h as r,b as d,N as rm,G as e,g as f,y as R,q as E,o as k,B as $,v as dm,L as Wo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ht}from"../../chunks/Tip-hf-doc-builder.js";import{D as X}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Lo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ze}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as So}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function cm(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQUkNvbmZpZyUyQyUyMERQUkNvbnRleHRFbmNvZGVyJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMERQUiUyMGZhY2Vib29rJTJGZHByLWN0eF9lbmNvZGVyLXNpbmdsZS1ucS1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMERQUkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBmYWNlYm9vayUyRmRwci1jdHhfZW5jb2Rlci1zaW5nbGUtbnEtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRFBSQ29udGV4dEVuY29kZXIoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPRConfig, DPRContextEncoder

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DPR facebook/dpr-ctx_encoder-single-nq-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DPRConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the facebook/dpr-ctx_encoder-single-nq-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPRContextEncoder(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){h=s("p"),y=n("Example:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Example:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function pm(F){let h,y,_,g,b;return g=new Lo({props:{code:"JTVCQ0xTJTVEJTIwJTNDcXVlc3Rpb24lMjB0b2tlbiUyMGlkcyUzRSUyMCU1QlNFUCU1RCUyMCUzQ3RpdGxlcyUyMGlkcyUzRSUyMCU1QlNFUCU1RCUyMCUzQ3RleHRzJTIwaWRzJTNF",highlighted:'[CLS] <span class="hljs-tag">&lt;<span class="hljs-name">question</span> <span class="hljs-attr">token</span> <span class="hljs-attr">ids</span>&gt;</span> [SEP] <span class="hljs-tag">&lt;<span class="hljs-name">titles</span> <span class="hljs-attr">ids</span>&gt;</span> [SEP] <span class="hljs-tag">&lt;<span class="hljs-name">texts</span> <span class="hljs-attr">ids</span>&gt;</span>'}}),{c(){h=s("p"),y=n("with the format:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"with the format:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function hm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function um(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQUkNvbnRleHRFbmNvZGVyJTJDJTIwRFBSQ29udGV4dEVuY29kZXJUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBEUFJDb250ZXh0RW5jb2RlclRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItY3R4X2VuY29kZXItc2luZ2xlLW5xLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBEUFJDb250ZXh0RW5jb2Rlci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItY3R4X2VuY29kZXItc2luZ2xlLW5xLWJhc2UlMjIpJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwaXMlMjBteSUyMGRvZyUyMGN1dGUlMjAlM0YlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQWVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpLnBvb2xlcl9vdXRwdXQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPRContextEncoder, DPRContextEncoderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRContextEncoderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-ctx_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPRContextEncoder.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-ctx_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, is my dog cute ?&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = model(input_ids).pooler_output`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function fm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function mm(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQUlF1ZXN0aW9uRW5jb2RlciUyQyUyMERQUlF1ZXN0aW9uRW5jb2RlclRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMERQUlF1ZXN0aW9uRW5jb2RlclRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItcXVlc3Rpb25fZW5jb2Rlci1zaW5nbGUtbnEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMERQUlF1ZXN0aW9uRW5jb2Rlci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItcXVlc3Rpb25fZW5jb2Rlci1zaW5nbGUtbnEtYmFzZSUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBpcyUyMG15JTIwZG9nJTIwY3V0ZSUyMCUzRiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBZW1iZWRkaW5ncyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcykucG9vbGVyX291dHB1dA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPRQuestionEncoder, DPRQuestionEncoderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRQuestionEncoderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-question_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPRQuestionEncoder.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-question_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, is my dog cute ?&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = model(input_ids).pooler_output`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function gm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function _m(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERQUlJlYWRlciUyQyUyMERQUlJlYWRlclRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMERQUlJlYWRlclRva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItcmVhZGVyLXNpbmdsZS1ucS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwRFBSUmVhZGVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRwci1yZWFkZXItc2luZ2xlLW5xLWJhc2UlMjIpJTBBZW5jb2RlZF9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwcXVlc3Rpb25zJTNEJTVCJTIyV2hhdCUyMGlzJTIwbG92ZSUyMCUzRiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRpdGxlcyUzRCU1QiUyMkhhZGRhd2F5JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdGV4dHMlM0QlNUIlMjInV2hhdCUyMElzJTIwTG92ZSclMjBpcyUyMGElMjBzb25nJTIwcmVjb3JkZWQlMjBieSUyMHRoZSUyMGFydGlzdCUyMEhhZGRhd2F5JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUwQSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGVkX2lucHV0cyklMEFzdGFydF9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cyUwQWVuZF9sb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMlMEFyZWxldmFuY2VfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5yZWxldmFuY2VfbG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DPRReader, DPRReaderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRReaderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-reader-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DPRReader.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-reader-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_inputs = tokenizer(
<span class="hljs-meta">... </span>    questions=[<span class="hljs-string">&quot;What is love ?&quot;</span>],
<span class="hljs-meta">... </span>    titles=[<span class="hljs-string">&quot;Haddaway&quot;</span>],
<span class="hljs-meta">... </span>    texts=[<span class="hljs-string">&quot;&#x27;What Is Love&#x27; is a song recorded by the artist Haddaway&quot;</span>],
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoded_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_logits = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_logits = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>relevance_logits = outputs.relevance_logits`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function vm(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Le,G,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,L,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=c(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),Ee=c(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),P=s("p"),Fe=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=s("code"),ce=n("model.fit()"),Le=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=s("code"),Y=n("model.fit()"),se=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),S=s("code"),ie=n("fit()"),Ce=n(" and "),W=s("code"),qe=n("predict()"),ke=n(`, such as when creating your own layers or models with
the Keras `),N=s("code"),Ie=n("Functional"),le=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),pe=c(),C=s("ul"),I=s("li"),he=n("a single Tensor with "),K=s("code"),$e=n("input_ids"),ue=n(" only and nothing else: "),L=s("code"),Je=n("model(input_ids)"),Pe=c(),M=s("li"),Ue=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=s("code"),je=n("model([input_ids, attention_mask])"),Ne=n(" or "),A=s("code"),Ze=n("model([input_ids, attention_mask, token_type_ids])"),Ae=c(),Q=s("li"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=c(),q=s("p"),ge=n(`Note that when creating models and layers with
`),j=s("a"),Qe=n("subclassing"),oe=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){h=a(v,"P",{});var D=i(h);y=r(D,"TensorFlow models and layers in "),_=a(D,"CODE",{});var ot=i(_);g=r(ot,"transformers"),ot.forEach(t),b=r(D," accept two formats as input:"),D.forEach(t),l=p(v),u=a(v,"UL",{});var ae=i(u);z=a(ae,"LI",{});var nt=i(z);Me=r(nt,"having all inputs as keyword arguments (like PyTorch models), or"),nt.forEach(t),Ee=p(ae),U=a(ae,"LI",{});var rt=i(U);de=r(rt,"having all inputs as a list, tuple or dict in the first positional argument."),rt.forEach(t),ae.forEach(t),H=p(v),P=a(v,"P",{});var x=i(P);Fe=r(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=a(x,"CODE",{});var st=i(B);ce=r(st,"model.fit()"),st.forEach(t),Le=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=a(x,"CODE",{});var Xe=i(G);Y=r(Xe,"model.fit()"),Xe.forEach(t),se=r(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),S=a(x,"CODE",{});var me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),ke=r(x,`, such as when creating your own layers or models with
the Keras `),N=a(x,"CODE",{});var Ge=i(N);Ie=r(Ge,"Functional"),Ge.forEach(t),le=r(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),pe=p(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),L=a(ne,"CODE",{});var at=i(L);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=p(v),q=a(v,"P",{});var re=i(q);ge=r(re,`Note that when creating models and layers with
`),j=a(re,"A",{href:!0,rel:!0});var it=i(j);Qe=r(it,"subclassing"),it.forEach(t),oe=r(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){d(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(j,"rel","nofollow")},m(v,D){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Le),e(P,G),e(G,Y),e(P,se),e(P,S),e(S,ie),e(P,Ce),e(P,W),e(W,qe),e(P,ke),e(P,N),e(N,Ie),e(P,le),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,L),e(L,Je),e(C,Pe),e(C,M),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(C,Ae),e(C,Q),e(Q,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function bm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function ym(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRFBSQ29udGV4dEVuY29kZXIlMkMlMjBEUFJDb250ZXh0RW5jb2RlclRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMERQUkNvbnRleHRFbmNvZGVyVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRwci1jdHhfZW5jb2Rlci1zaW5nbGUtbnEtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRFBSQ29udGV4dEVuY29kZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZHByLWN0eF9lbmNvZGVyLXNpbmdsZS1ucS1iYXNlJTIyJTJDJTIwZnJvbV9wdCUzRFRydWUpJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwaXMlMjBteSUyMGRvZyUyMGN1dGUlMjAlM0YlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQWVtYmVkZGluZ3MlMjAlM0QlMjBtb2RlbChpbnB1dF9pZHMpLnBvb2xlcl9vdXRwdXQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDPRContextEncoder, DPRContextEncoderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRContextEncoderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-ctx_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDPRContextEncoder.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-ctx_encoder-single-nq-base&quot;</span>, from_pt=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, is my dog cute ?&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = model(input_ids).pooler_output`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Tm(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Le,G,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,L,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=c(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),Ee=c(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),P=s("p"),Fe=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=s("code"),ce=n("model.fit()"),Le=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=s("code"),Y=n("model.fit()"),se=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),S=s("code"),ie=n("fit()"),Ce=n(" and "),W=s("code"),qe=n("predict()"),ke=n(`, such as when creating your own layers or models with
the Keras `),N=s("code"),Ie=n("Functional"),le=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),pe=c(),C=s("ul"),I=s("li"),he=n("a single Tensor with "),K=s("code"),$e=n("input_ids"),ue=n(" only and nothing else: "),L=s("code"),Je=n("model(input_ids)"),Pe=c(),M=s("li"),Ue=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=s("code"),je=n("model([input_ids, attention_mask])"),Ne=n(" or "),A=s("code"),Ze=n("model([input_ids, attention_mask, token_type_ids])"),Ae=c(),Q=s("li"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=c(),q=s("p"),ge=n(`Note that when creating models and layers with
`),j=s("a"),Qe=n("subclassing"),oe=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){h=a(v,"P",{});var D=i(h);y=r(D,"TensorFlow models and layers in "),_=a(D,"CODE",{});var ot=i(_);g=r(ot,"transformers"),ot.forEach(t),b=r(D," accept two formats as input:"),D.forEach(t),l=p(v),u=a(v,"UL",{});var ae=i(u);z=a(ae,"LI",{});var nt=i(z);Me=r(nt,"having all inputs as keyword arguments (like PyTorch models), or"),nt.forEach(t),Ee=p(ae),U=a(ae,"LI",{});var rt=i(U);de=r(rt,"having all inputs as a list, tuple or dict in the first positional argument."),rt.forEach(t),ae.forEach(t),H=p(v),P=a(v,"P",{});var x=i(P);Fe=r(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=a(x,"CODE",{});var st=i(B);ce=r(st,"model.fit()"),st.forEach(t),Le=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=a(x,"CODE",{});var Xe=i(G);Y=r(Xe,"model.fit()"),Xe.forEach(t),se=r(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),S=a(x,"CODE",{});var me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),ke=r(x,`, such as when creating your own layers or models with
the Keras `),N=a(x,"CODE",{});var Ge=i(N);Ie=r(Ge,"Functional"),Ge.forEach(t),le=r(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),pe=p(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),L=a(ne,"CODE",{});var at=i(L);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=p(v),q=a(v,"P",{});var re=i(q);ge=r(re,`Note that when creating models and layers with
`),j=a(re,"A",{href:!0,rel:!0});var it=i(j);Qe=r(it,"subclassing"),it.forEach(t),oe=r(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){d(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(j,"rel","nofollow")},m(v,D){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Le),e(P,G),e(G,Y),e(P,se),e(P,S),e(S,ie),e(P,Ce),e(P,W),e(W,qe),e(P,ke),e(P,N),e(N,Ie),e(P,le),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,L),e(L,Je),e(C,Pe),e(C,M),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(C,Ae),e(C,Q),e(Q,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function wm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function Rm(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRFBSUXVlc3Rpb25FbmNvZGVyJTJDJTIwRFBSUXVlc3Rpb25FbmNvZGVyVG9rZW5pemVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwRFBSUXVlc3Rpb25FbmNvZGVyVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRwci1xdWVzdGlvbl9lbmNvZGVyLXNpbmdsZS1ucS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVEZEUFJRdWVzdGlvbkVuY29kZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZHByLXF1ZXN0aW9uX2VuY29kZXItc2luZ2xlLW5xLWJhc2UlMjIlMkMlMjBmcm9tX3B0JTNEVHJ1ZSklMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBpcyUyMG15JTIwZG9nJTIwY3V0ZSUyMCUzRiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTBBZW1iZWRkaW5ncyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcykucG9vbGVyX291dHB1dA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDPRQuestionEncoder, DPRQuestionEncoderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRQuestionEncoderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-question_encoder-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDPRQuestionEncoder.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-question_encoder-single-nq-base&quot;</span>, from_pt=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(<span class="hljs-string">&quot;Hello, is my dog cute ?&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>embeddings = model(input_ids).pooler_output`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Em(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Le,G,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,L,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=c(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),Ee=c(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=c(),P=s("p"),Fe=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=s("code"),ce=n("model.fit()"),Le=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=s("code"),Y=n("model.fit()"),se=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),S=s("code"),ie=n("fit()"),Ce=n(" and "),W=s("code"),qe=n("predict()"),ke=n(`, such as when creating your own layers or models with
the Keras `),N=s("code"),Ie=n("Functional"),le=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),pe=c(),C=s("ul"),I=s("li"),he=n("a single Tensor with "),K=s("code"),$e=n("input_ids"),ue=n(" only and nothing else: "),L=s("code"),Je=n("model(input_ids)"),Pe=c(),M=s("li"),Ue=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=s("code"),je=n("model([input_ids, attention_mask])"),Ne=n(" or "),A=s("code"),Ze=n("model([input_ids, attention_mask, token_type_ids])"),Ae=c(),Q=s("li"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=c(),q=s("p"),ge=n(`Note that when creating models and layers with
`),j=s("a"),Qe=n("subclassing"),oe=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(v){h=a(v,"P",{});var D=i(h);y=r(D,"TensorFlow models and layers in "),_=a(D,"CODE",{});var ot=i(_);g=r(ot,"transformers"),ot.forEach(t),b=r(D," accept two formats as input:"),D.forEach(t),l=p(v),u=a(v,"UL",{});var ae=i(u);z=a(ae,"LI",{});var nt=i(z);Me=r(nt,"having all inputs as keyword arguments (like PyTorch models), or"),nt.forEach(t),Ee=p(ae),U=a(ae,"LI",{});var rt=i(U);de=r(rt,"having all inputs as a list, tuple or dict in the first positional argument."),rt.forEach(t),ae.forEach(t),H=p(v),P=a(v,"P",{});var x=i(P);Fe=r(x,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),B=a(x,"CODE",{});var st=i(B);ce=r(st,"model.fit()"),st.forEach(t),Le=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),G=a(x,"CODE",{});var Xe=i(G);Y=r(Xe,"model.fit()"),Xe.forEach(t),se=r(x,` supports! If, however, you want to use the second
format outside of Keras methods like `),S=a(x,"CODE",{});var me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),ke=r(x,`, such as when creating your own layers or models with
the Keras `),N=a(x,"CODE",{});var Ge=i(N);Ie=r(Ge,"Functional"),Ge.forEach(t),le=r(x,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),x.forEach(t),pe=p(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),L=a(ne,"CODE",{});var at=i(L);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=p(v),q=a(v,"P",{});var re=i(q);ge=r(re,`Note that when creating models and layers with
`),j=a(re,"A",{href:!0,rel:!0});var it=i(j);Qe=r(it,"subclassing"),it.forEach(t),oe=r(re,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),re.forEach(t),this.h()},h(){d(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),d(j,"rel","nofollow")},m(v,D){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Le),e(P,G),e(G,Y),e(P,se),e(P,S),e(S,ie),e(P,Ce),e(P,W),e(W,qe),e(P,ke),e(P,N),e(N,Ie),e(P,le),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,L),e(L,Je),e(C,Pe),e(C,M),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(C,Ae),e(C,Q),e(Q,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function km(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function $m(F){let h,y,_,g,b;return g=new Lo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRFBSUmVhZGVyJTJDJTIwRFBSUmVhZGVyVG9rZW5pemVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwRFBSUmVhZGVyVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmRwci1yZWFkZXItc2luZ2xlLW5xLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkRQUlJlYWRlci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZkcHItcmVhZGVyLXNpbmdsZS1ucS1iYXNlJTIyJTJDJTIwZnJvbV9wdCUzRFRydWUpJTBBZW5jb2RlZF9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwcXVlc3Rpb25zJTNEJTVCJTIyV2hhdCUyMGlzJTIwbG92ZSUyMCUzRiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRpdGxlcyUzRCU1QiUyMkhhZGRhd2F5JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdGV4dHMlM0QlNUIlMjInV2hhdCUyMElzJTIwTG92ZSclMjBpcyUyMGElMjBzb25nJTIwcmVjb3JkZWQlMjBieSUyMHRoZSUyMGFydGlzdCUyMEhhZGRhd2F5JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUwQSklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoZW5jb2RlZF9pbnB1dHMpJTBBc3RhcnRfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMlMEFlbmRfbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzJTBBcmVsZXZhbmNlX2xvZ2l0cyUyMCUzRCUyMG91dHB1dHMucmVsZXZhbmNlX2xvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDPRReader, DPRReaderTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = DPRReaderTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-reader-single-nq-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFDPRReader.from_pretrained(<span class="hljs-string">&quot;facebook/dpr-reader-single-nq-base&quot;</span>, from_pt=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_inputs = tokenizer(
<span class="hljs-meta">... </span>    questions=[<span class="hljs-string">&quot;What is love ?&quot;</span>],
<span class="hljs-meta">... </span>    titles=[<span class="hljs-string">&quot;Haddaway&quot;</span>],
<span class="hljs-meta">... </span>    texts=[<span class="hljs-string">&quot;&#x27;What Is Love&#x27; is a song recorded by the artist Haddaway&quot;</span>],
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;tf&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(encoded_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>start_logits = outputs.start_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>end_logits = outputs.end_logits
<span class="hljs-meta">&gt;&gt;&gt; </span>relevance_logits = outputs.relevance_logits`}}),{c(){h=s("p"),y=n("Examples:"),_=c(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=p(l),w(g.$$.fragment,l)},m(l,u){f(l,h,u),e(h,y),f(l,_,u),R(g,l,u),b=!0},p:Wo,i(l){b||(E(g.$$.fragment,l),b=!0)},o(l){k(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function Pm(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Le,G,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,L,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,fe,ee,De,te,q,ge,j,Qe,oe,v,D,ot,ae,nt,rt,x,st,Xe,me,_e,Ge,J,ne,Oe,at,O,V,xe,Be,ve,re,it,Ai,ls,Qi,Bi,Vi,He,Si,mr,Wi,Li,gr,Gi,Oi,_r,Xi,Hi,Go,Yi,Ki,el,Oo,tl,vr,ol,nl,rl,Yt,Ra,Dt,Kt,ds,Xo,sl,cs,al,Ea,Ye,Ho,il,ps,ll,dl,eo,br,cl,pl,yr,hl,ul,fl,Yo,ml,Tr,gl,_l,ka,xt,to,hs,Ko,vl,us,bl,$a,Ke,en,yl,tn,Tl,fs,wl,Rl,El,oo,wr,kl,$l,Rr,Pl,Dl,xl,on,zl,Er,Ml,Fl,Pa,zt,no,ms,nn,Cl,gs,ql,Da,et,rn,Il,_s,Jl,Ul,ro,kr,jl,Nl,$r,Zl,Al,Ql,sn,Bl,Pr,Vl,Sl,xa,Mt,so,vs,an,Wl,bs,Ll,za,tt,ln,Gl,dn,Ol,ys,Xl,Hl,Yl,ao,Dr,Kl,ed,xr,td,od,nd,cn,rd,zr,sd,ad,Ma,Ft,io,Ts,pn,id,ws,ld,Fa,be,hn,dd,Rs,cd,pd,yt,Mr,hd,ud,Fr,fd,md,Cr,gd,_d,vd,un,bd,qr,yd,Td,wd,Tt,Rd,Es,Ed,kd,ks,$d,Pd,$s,Dd,xd,lo,Ca,Ct,co,Ps,fn,zd,Ds,Md,qa,ye,mn,Fd,gn,Cd,xs,qd,Id,Jd,wt,Ir,Ud,jd,Jr,Nd,Zd,Ur,Ad,Qd,Bd,_n,Vd,jr,Sd,Wd,Ld,bt,Gd,zs,Od,Xd,Ms,Hd,Yd,Fs,Kd,ec,tc,Nr,oc,po,nc,vn,rc,Cs,Ia,qt,ho,qs,bn,sc,Is,ac,Ja,It,yn,ic,Tn,lc,Zr,dc,cc,Ua,Jt,wn,pc,Rn,hc,Ar,uc,fc,ja,Ut,En,mc,kn,gc,Qr,_c,vc,Na,jt,uo,Js,$n,bc,Us,yc,Za,Ve,Pn,Tc,js,wc,Rc,Dn,Ec,Br,kc,$c,Pc,xn,Dc,zn,xc,zc,Mc,lt,Mn,Fc,Nt,Cc,Vr,qc,Ic,Ns,Jc,Uc,jc,fo,Nc,mo,Aa,Zt,go,Zs,Fn,Zc,As,Ac,Qa,Se,Cn,Qc,Qs,Bc,Vc,qn,Sc,Sr,Wc,Lc,Gc,In,Oc,Jn,Xc,Hc,Yc,dt,Un,Kc,At,ep,Wr,tp,op,Bs,np,rp,sp,_o,ap,vo,Ba,Qt,bo,Vs,jn,ip,Ss,lp,Va,We,Nn,dp,Ws,cp,pp,Zn,hp,Lr,up,fp,mp,An,gp,Qn,_p,vp,bp,ct,Bn,yp,Bt,Tp,Gr,wp,Rp,Ls,Ep,kp,$p,yo,Pp,To,Sa,Vt,wo,Gs,Vn,Dp,Os,xp,Wa,Te,Sn,zp,Xs,Mp,Fp,Wn,Cp,Or,qp,Ip,Jp,Ln,Up,Gn,jp,Np,Zp,Ro,Ap,pt,On,Qp,St,Bp,Xr,Vp,Sp,Hs,Wp,Lp,Gp,Eo,Op,ko,La,Wt,$o,Ys,Xn,Xp,Ks,Hp,Ga,we,Hn,Yp,ea,Kp,eh,Yn,th,Hr,oh,nh,rh,Kn,sh,er,ah,ih,lh,Po,dh,ht,tr,ch,Lt,ph,Yr,hh,uh,ta,fh,mh,gh,Do,_h,xo,Oa,Gt,zo,oa,or,vh,na,bh,Xa,Re,nr,yh,ra,Th,wh,rr,Rh,Kr,Eh,kh,$h,sr,Ph,ar,Dh,xh,zh,Mo,Mh,ut,ir,Fh,Ot,Ch,es,qh,Ih,sa,Jh,Uh,jh,Fo,Nh,Co,Ha;return l=new ze({}),ie=new ze({}),J=new ze({}),xe=new X({props:{name:"class transformers.DPRConfig",anchor:"transformers.DPRConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"projection_dim",val:": int = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPRConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the DPR model. Defines the different tokens that can be represented by the <em>inputs_ids</em>
passed to the forward method of <a href="/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"vocab_size"},{anchor:"transformers.DPRConfig.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.DPRConfig.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.DPRConfig.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.DPRConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.DPRConfig.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.DPRConfig.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.DPRConfig.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.DPRConfig.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.DPRConfig.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.32.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.DPRConfig.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.DPRConfig.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.DPRConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.DPRConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Dimension of the projection for the context and question encoders. If it is set to zero (default), then no
projection is done.`,name:"projection_dim"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/configuration_dpr.py#L45"}}),Yt=new So({props:{anchor:"transformers.DPRConfig.example",$$slots:{default:[cm]},$$scope:{ctx:F}}}),Xo=new ze({}),Ho=new X({props:{name:"class transformers.DPRContextEncoderTokenizer",anchor:"transformers.DPRContextEncoderTokenizer",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:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr.py#L113"}}),Ko=new ze({}),en=new X({props:{name:"class transformers.DPRContextEncoderTokenizerFast",anchor:"transformers.DPRContextEncoderTokenizerFast",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:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr_fast.py#L114"}}),nn=new ze({}),rn=new X({props:{name:"class transformers.DPRQuestionEncoderTokenizer",anchor:"transformers.DPRQuestionEncoderTokenizer",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:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr.py#L129"}}),an=new ze({}),ln=new X({props:{name:"class transformers.DPRQuestionEncoderTokenizerFast",anchor:"transformers.DPRQuestionEncoderTokenizerFast",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:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr_fast.py#L131"}}),pn=new ze({}),hn=new X({props:{name:"class transformers.DPRReaderTokenizer",anchor:"transformers.DPRReaderTokenizer",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.DPRReaderTokenizer.questions",description:`<strong>questions</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The questions to be encoded. You can specify one question for many passages. In this case, the question
will be duplicated like <code>[questions] * n_passages</code>. Otherwise you have to specify as many questions as in
<code>titles</code> or <code>texts</code>.`,name:"questions"},{anchor:"transformers.DPRReaderTokenizer.titles",description:`<strong>titles</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages titles to be encoded. This can be a string or a list of strings if there are several passages.`,name:"titles"},{anchor:"transformers.DPRReaderTokenizer.texts",description:`<strong>texts</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages texts to be encoded. This can be a string or a list of strings if there are several passages.`,name:"texts"},{anchor:"transformers.DPRReaderTokenizer.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single sequence
if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DPRReaderTokenizer.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to
the maximum acceptable input length for the model if that argument is not provided. This will truncate
token by token, removing a token from the longest sequence in the pair if a pair of sequences (or a batch
of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the first
sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the
second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.DPRReaderTokenizer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.DPRReaderTokenizer.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DPRReaderTokenizer.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attention mask. If not set, will return the attention mask according to the
specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr.py#L395",returnDescription:`
<p>A dictionary with the following keys:</p>
<ul>
<li><code>input_ids</code>: List of token ids to be fed to a model.</li>
<li><code>attention_mask</code>: List of indices specifying which tokens should be attended to by the model.</li>
</ul>
`,returnType:`
<p><code>Dict[str, List[List[int]]]</code></p>
`}}),lo=new So({props:{anchor:"transformers.DPRReaderTokenizer.example",$$slots:{default:[pm]},$$scope:{ctx:F}}}),fn=new ze({}),mn=new X({props:{name:"class transformers.DPRReaderTokenizerFast",anchor:"transformers.DPRReaderTokenizerFast",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.DPRReaderTokenizerFast.questions",description:`<strong>questions</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The questions to be encoded. You can specify one question for many passages. In this case, the question
will be duplicated like <code>[questions] * n_passages</code>. Otherwise you have to specify as many questions as in
<code>titles</code> or <code>texts</code>.`,name:"questions"},{anchor:"transformers.DPRReaderTokenizerFast.titles",description:`<strong>titles</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages titles to be encoded. This can be a string or a list of strings if there are several passages.`,name:"titles"},{anchor:"transformers.DPRReaderTokenizerFast.texts",description:`<strong>texts</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages texts to be encoded. This can be a string or a list of strings if there are several passages.`,name:"texts"},{anchor:"transformers.DPRReaderTokenizerFast.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single sequence
if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DPRReaderTokenizerFast.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to
the maximum acceptable input length for the model if that argument is not provided. This will truncate
token by token, removing a token from the longest sequence in the pair if a pair of sequences (or a batch
of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the first
sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the
second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.DPRReaderTokenizerFast.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.DPRReaderTokenizerFast.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DPRReaderTokenizerFast.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attention mask. If not set, will return the attention mask according to the
specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/tokenization_dpr_fast.py#L393",returnDescription:`
<p>A dictionary with the following keys:</p>
<ul>
<li><code>input_ids</code>: List of token ids to be fed to a model.</li>
<li><code>attention_mask</code>: List of indices specifying which tokens should be attended to by the model.</li>
</ul>
`,returnType:`
<p><code>Dict[str, List[List[int]]]</code></p>
`}}),bn=new ze({}),yn=new X({props:{name:"class transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput",anchor:"transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput",parameters:[{name:"pooler_output",val:": FloatTensor"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput.pooler_output",description:`<strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) &#x2014;
The DPR encoder outputs the <em>pooler_output</em> that corresponds to the context representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.`,name:"pooler_output"},{anchor:"transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L62"}}),wn=new X({props:{name:"class transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput",anchor:"transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput",parameters:[{name:"pooler_output",val:": FloatTensor"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput.pooler_output",description:`<strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) &#x2014;
The DPR encoder outputs the <em>pooler_output</em> that corresponds to the question representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed questions for nearest neighbors queries with context embeddings.`,name:"pooler_output"},{anchor:"transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L90"}}),En=new X({props:{name:"class transformers.DPRReaderOutput",anchor:"transformers.DPRReaderOutput",parameters:[{name:"start_logits",val:": FloatTensor"},{name:"end_logits",val:": FloatTensor = None"},{name:"relevance_logits",val:": FloatTensor = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.DPRReaderOutput.start_logits",description:`<strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) &#x2014;
Logits of the start index of the span for each passage.`,name:"start_logits"},{anchor:"transformers.DPRReaderOutput.end_logits",description:`<strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) &#x2014;
Logits of the end index of the span for each passage.`,name:"end_logits"},{anchor:"transformers.DPRReaderOutput.relevance_logits",description:`<strong>relevance_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, )</code>) &#x2014;
Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
question, compared to all the other passages.`,name:"relevance_logits"},{anchor:"transformers.DPRReaderOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.`,name:"hidden_states"},{anchor:"transformers.DPRReaderOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L118"}}),$n=new ze({}),Pn=new X({props:{name:"class transformers.DPRContextEncoder",anchor:"transformers.DPRContextEncoder",parameters:[{name:"config",val:": DPRConfig"}],parametersDescription:[{anchor:"transformers.DPRContextEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L441"}}),Mn=new X({props:{name:"forward",anchor:"transformers.DPRContextEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRContextEncoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L449",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the context representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fo=new Ht({props:{$$slots:{default:[hm]},$$scope:{ctx:F}}}),mo=new So({props:{anchor:"transformers.DPRContextEncoder.forward.example",$$slots:{default:[um]},$$scope:{ctx:F}}}),Fn=new ze({}),Cn=new X({props:{name:"class transformers.DPRQuestionEncoder",anchor:"transformers.DPRQuestionEncoder",parameters:[{name:"config",val:": DPRConfig"}],parametersDescription:[{anchor:"transformers.DPRQuestionEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L522"}}),Un=new X({props:{name:"forward",anchor:"transformers.DPRQuestionEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRQuestionEncoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L530",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the question representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed questions for nearest neighbors queries with context embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_o=new Ht({props:{$$slots:{default:[fm]},$$scope:{ctx:F}}}),vo=new So({props:{anchor:"transformers.DPRQuestionEncoder.forward.example",$$slots:{default:[mm]},$$scope:{ctx:F}}}),jn=new ze({}),Nn=new X({props:{name:"class transformers.DPRReader",anchor:"transformers.DPRReader",parameters:[{name:"config",val:": DPRConfig"}],parametersDescription:[{anchor:"transformers.DPRReader.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L604"}}),Bn=new X({props:{name:"forward",anchor:"transformers.DPRReader.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": bool = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRReader.forward.input_ids",description:`<strong>input_ids</strong> (<code>Tuple[torch.LongTensor]</code> of shapes <code>(n_passages, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. It has to be a sequence triplet with 1) the question
and 2) the passages titles and 3) the passages texts To match pretraining, DPR <code>input_ids</code> sequence should
be formatted with [CLS] and [SEP] with the format:</p>
<p><code>[CLS] &lt;question token ids&gt; [SEP] &lt;titles ids&gt; [SEP] &lt;texts ids&gt;</code></p>
<p>DPR is a model with absolute position embeddings so it&#x2019;s usually advised to pad the inputs on the right
rather than the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderTokenizer">DPRReaderTokenizer</a>. See this class documentation for more details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.DPRReader.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.DPRReader.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.DPRReader.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DPRReader.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DPRReader.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_dpr.py#L612",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderOutput"
>transformers.models.dpr.modeling_dpr.DPRReaderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the start index of the span for each passage.</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the end index of the span for each passage.</p>
</li>
<li>
<p><strong>relevance_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, )</code>) \u2014 Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
question, compared to all the other passages.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderOutput"
>transformers.models.dpr.modeling_dpr.DPRReaderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yo=new Ht({props:{$$slots:{default:[gm]},$$scope:{ctx:F}}}),To=new So({props:{anchor:"transformers.DPRReader.forward.example",$$slots:{default:[_m]},$$scope:{ctx:F}}}),Vn=new ze({}),Sn=new X({props:{name:"class transformers.TFDPRContextEncoder",anchor:"transformers.TFDPRContextEncoder",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDPRContextEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L526"}}),Ro=new Ht({props:{$$slots:{default:[vm]},$$scope:{ctx:F}}}),On=new X({props:{name:"call",anchor:"transformers.TFDPRContextEncoder.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRContextEncoder.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L538",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRContextEncoderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the context representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRContextEncoderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Eo=new Ht({props:{$$slots:{default:[bm]},$$scope:{ctx:F}}}),ko=new So({props:{anchor:"transformers.TFDPRContextEncoder.call.example",$$slots:{default:[ym]},$$scope:{ctx:F}}}),Xn=new ze({}),Hn=new X({props:{name:"class transformers.TFDPRQuestionEncoder",anchor:"transformers.TFDPRQuestionEncoder",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDPRQuestionEncoder.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L607"}}),Po=new Ht({props:{$$slots:{default:[Tm]},$$scope:{ctx:F}}}),tr=new X({props:{name:"call",anchor:"transformers.TFDPRQuestionEncoder.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRQuestionEncoder.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L619",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRQuestionEncoderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the question representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed questions for nearest neighbors queries with context embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRQuestionEncoderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Do=new Ht({props:{$$slots:{default:[wm]},$$scope:{ctx:F}}}),xo=new So({props:{anchor:"transformers.TFDPRQuestionEncoder.call.example",$$slots:{default:[Rm]},$$scope:{ctx:F}}}),or=new ze({}),nr=new X({props:{name:"class transformers.TFDPRReader",anchor:"transformers.TFDPRReader",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFDPRReader.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L687"}}),Mo=new Ht({props:{$$slots:{default:[Em]},$$scope:{ctx:F}}}),ir=new X({props:{name:"call",anchor:"transformers.TFDPRReader.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRReader.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shapes <code>(n_passages, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. It has to be a sequence triplet with 1) the question
and 2) the passages titles and 3) the passages texts To match pretraining, DPR <code>input_ids</code> sequence should
be formatted with [CLS] and [SEP] with the format:</p>
<p><code>[CLS] &lt;question token ids&gt; [SEP] &lt;titles ids&gt; [SEP] &lt;texts ids&gt;</code></p>
<p>DPR is a model with absolute position embeddings so it&#x2019;s usually advised to pad the inputs on the right
rather than the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderTokenizer">DPRReaderTokenizer</a>. See this class documentation for more details.`,name:"input_ids"},{anchor:"transformers.TFDPRReader.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFDPRReader.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(n_passages, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFDPRReader.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFDPRReader.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFDPRReader.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/dpr/modeling_tf_dpr.py#L699",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRReaderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the start index of the span for each passage.</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the end index of the span for each passage.</p>
</li>
<li>
<p><strong>relevance_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, )</code>) \u2014 Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
question, compared to all the other passages.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRReaderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Fo=new Ht({props:{$$slots:{default:[km]},$$scope:{ctx:F}}}),Co=new So({props:{anchor:"transformers.TFDPRReader.call.example",$$slots:{default:[$m]},$$scope:{ctx:F}}}),{c(){h=s("meta"),y=c(),_=s("h1"),g=s("a"),b=s("span"),T(l.$$.fragment),u=c(),z=s("span"),Me=n("DPR"),Ee=c(),U=s("div"),de=s("a"),H=s("img"),Fe=c(),B=s("a"),ce=s("img"),G=c(),Y=s("h2"),se=s("a"),S=s("span"),T(ie.$$.fragment),Ce=c(),W=s("span"),qe=n("Overview"),ke=c(),N=s("p"),Ie=n(`Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research. It was
introduced in `),le=s("a"),pe=n("Dense Passage Retrieval for Open-Domain Question Answering"),C=n(` by
Vladimir Karpukhin, Barlas O\u011Fuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, Wen-tau Yih.`),I=c(),he=s("p"),K=n("The abstract from the paper is the following:"),$e=c(),ue=s("p"),L=s("em"),Je=n(`Open-domain question answering relies on efficient passage retrieval to select candidate contexts, where traditional
sparse vector space models, such as TF-IDF or BM25, are the de facto method. In this work, we show that retrieval can
be practically implemented using dense representations alone, where embeddings are learned from a small number of
questions and passages by a simple dual-encoder framework. When evaluated on a wide range of open-domain QA datasets,
our dense retriever outperforms a strong Lucene-BM25 system largely by 9%-19% absolute in terms of top-20 passage
retrieval accuracy, and helps our end-to-end QA system establish new state-of-the-art on multiple open-domain QA
benchmarks.`),Pe=c(),M=s("p"),Ue=n("This model was contributed by "),Z=s("a"),je=n("lhoestq"),Ne=n(". The original code can be found "),A=s("a"),Ze=n("here"),Ae=n("."),Q=c(),fe=s("p"),ee=n("Tips:"),De=c(),te=s("ul"),q=s("li"),ge=s("p"),j=n("DPR consists in three models:"),Qe=c(),oe=s("ul"),v=s("li"),D=n("Question encoder: encode questions as vectors"),ot=c(),ae=s("li"),nt=n("Context encoder: encode contexts as vectors"),rt=c(),x=s("li"),st=n("Reader: extract the answer of the questions inside retrieved contexts, along with a relevance score (high if the inferred span actually answers the question)."),Xe=c(),me=s("h2"),_e=s("a"),Ge=s("span"),T(J.$$.fragment),ne=c(),Oe=s("span"),at=n("DPRConfig"),O=c(),V=s("div"),T(xe.$$.fragment),Be=c(),ve=s("p"),re=s("a"),it=n("DPRConfig"),Ai=n(" is the configuration class to store the configuration of a "),ls=s("em"),Qi=n("DPRModel"),Bi=n("."),Vi=c(),He=s("p"),Si=n("This is the configuration class to store the configuration of a "),mr=s("a"),Wi=n("DPRContextEncoder"),Li=n(", "),gr=s("a"),Gi=n("DPRQuestionEncoder"),Oi=n(`, or a
`),_r=s("a"),Xi=n("DPRReader"),Hi=n(`. It is used to instantiate the components of the DPR model according to the specified arguments,
defining the model component architectures. Instantiating a configuration with the defaults will yield a similar
configuration to that of the DPRContextEncoder
`),Go=s("a"),Yi=n("facebook/dpr-ctx_encoder-single-nq-base"),Ki=n(`
architecture.`),el=c(),Oo=s("p"),tl=n("This class is a subclass of "),vr=s("a"),ol=n("BertConfig"),nl=n(". Please check the superclass for the documentation of all kwargs."),rl=c(),T(Yt.$$.fragment),Ra=c(),Dt=s("h2"),Kt=s("a"),ds=s("span"),T(Xo.$$.fragment),sl=c(),cs=s("span"),al=n("DPRContextEncoderTokenizer"),Ea=c(),Ye=s("div"),T(Ho.$$.fragment),il=c(),ps=s("p"),ll=n("Construct a DPRContextEncoder tokenizer."),dl=c(),eo=s("p"),br=s("a"),cl=n("DPRContextEncoderTokenizer"),pl=n(" is identical to "),yr=s("a"),hl=n("BertTokenizer"),ul=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),fl=c(),Yo=s("p"),ml=n("Refer to superclass "),Tr=s("a"),gl=n("BertTokenizer"),_l=n(" for usage examples and documentation concerning parameters."),ka=c(),xt=s("h2"),to=s("a"),hs=s("span"),T(Ko.$$.fragment),vl=c(),us=s("span"),bl=n("DPRContextEncoderTokenizerFast"),$a=c(),Ke=s("div"),T(en.$$.fragment),yl=c(),tn=s("p"),Tl=n("Construct a \u201Cfast\u201D DPRContextEncoder tokenizer (backed by HuggingFace\u2019s "),fs=s("em"),wl=n("tokenizers"),Rl=n(" library)."),El=c(),oo=s("p"),wr=s("a"),kl=n("DPRContextEncoderTokenizerFast"),$l=n(" is identical to "),Rr=s("a"),Pl=n("BertTokenizerFast"),Dl=n(` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),xl=c(),on=s("p"),zl=n("Refer to superclass "),Er=s("a"),Ml=n("BertTokenizerFast"),Fl=n(" for usage examples and documentation concerning parameters."),Pa=c(),zt=s("h2"),no=s("a"),ms=s("span"),T(nn.$$.fragment),Cl=c(),gs=s("span"),ql=n("DPRQuestionEncoderTokenizer"),Da=c(),et=s("div"),T(rn.$$.fragment),Il=c(),_s=s("p"),Jl=n("Constructs a DPRQuestionEncoder tokenizer."),Ul=c(),ro=s("p"),kr=s("a"),jl=n("DPRQuestionEncoderTokenizer"),Nl=n(" is identical to "),$r=s("a"),Zl=n("BertTokenizer"),Al=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Ql=c(),sn=s("p"),Bl=n("Refer to superclass "),Pr=s("a"),Vl=n("BertTokenizer"),Sl=n(" for usage examples and documentation concerning parameters."),xa=c(),Mt=s("h2"),so=s("a"),vs=s("span"),T(an.$$.fragment),Wl=c(),bs=s("span"),Ll=n("DPRQuestionEncoderTokenizerFast"),za=c(),tt=s("div"),T(ln.$$.fragment),Gl=c(),dn=s("p"),Ol=n("Constructs a \u201Cfast\u201D DPRQuestionEncoder tokenizer (backed by HuggingFace\u2019s "),ys=s("em"),Xl=n("tokenizers"),Hl=n(" library)."),Yl=c(),ao=s("p"),Dr=s("a"),Kl=n("DPRQuestionEncoderTokenizerFast"),ed=n(" is identical to "),xr=s("a"),td=n("BertTokenizerFast"),od=n(` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),nd=c(),cn=s("p"),rd=n("Refer to superclass "),zr=s("a"),sd=n("BertTokenizerFast"),ad=n(" for usage examples and documentation concerning parameters."),Ma=c(),Ft=s("h2"),io=s("a"),Ts=s("span"),T(pn.$$.fragment),id=c(),ws=s("span"),ld=n("DPRReaderTokenizer"),Fa=c(),be=s("div"),T(hn.$$.fragment),dd=c(),Rs=s("p"),cd=n("Construct a DPRReader tokenizer."),pd=c(),yt=s("p"),Mr=s("a"),hd=n("DPRReaderTokenizer"),ud=n(" is almost identical to "),Fr=s("a"),fd=n("BertTokenizer"),md=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece. The difference is that is has three inputs strings: question, titles and texts that are
combined to be fed to the `),Cr=s("a"),gd=n("DPRReader"),_d=n(" model."),vd=c(),un=s("p"),bd=n("Refer to superclass "),qr=s("a"),yd=n("BertTokenizer"),Td=n(" for usage examples and documentation concerning parameters."),wd=c(),Tt=s("p"),Rd=n("Return a dictionary with the token ids of the input strings and other information to give to "),Es=s("code"),Ed=n(".decode_best_spans"),kd=n(`.
It converts the strings of a question and different passages (title and text) in a sequence of IDs (integers),
using the tokenizer and vocabulary. The resulting `),ks=s("code"),$d=n("input_ids"),Pd=n(" is a matrix of size "),$s=s("code"),Dd=n("(n_passages, sequence_length)"),xd=c(),T(lo.$$.fragment),Ca=c(),Ct=s("h2"),co=s("a"),Ps=s("span"),T(fn.$$.fragment),zd=c(),Ds=s("span"),Md=n("DPRReaderTokenizerFast"),qa=c(),ye=s("div"),T(mn.$$.fragment),Fd=c(),gn=s("p"),Cd=n("Constructs a \u201Cfast\u201D DPRReader tokenizer (backed by HuggingFace\u2019s "),xs=s("em"),qd=n("tokenizers"),Id=n(" library)."),Jd=c(),wt=s("p"),Ir=s("a"),Ud=n("DPRReaderTokenizerFast"),jd=n(" is almost identical to "),Jr=s("a"),Nd=n("BertTokenizerFast"),Zd=n(` and runs end-to-end tokenization:
punctuation splitting and wordpiece. The difference is that is has three inputs strings: question, titles and texts
that are combined to be fed to the `),Ur=s("a"),Ad=n("DPRReader"),Qd=n(" model."),Bd=c(),_n=s("p"),Vd=n("Refer to superclass "),jr=s("a"),Sd=n("BertTokenizerFast"),Wd=n(" for usage examples and documentation concerning parameters."),Ld=c(),bt=s("p"),Gd=n("Return a dictionary with the token ids of the input strings and other information to give to "),zs=s("code"),Od=n(".decode_best_spans"),Xd=n(`.
It converts the strings of a question and different passages (title and text) in a sequence of IDs (integers),
using the tokenizer and vocabulary. The resulting `),Ms=s("code"),Hd=n("input_ids"),Yd=n(" is a matrix of size "),Fs=s("code"),Kd=n("(n_passages, sequence_length)"),ec=n(`
with the format:`),tc=c(),Nr=s("p"),oc=n("[CLS] "),po=s("question"),nc=n("[SEP] "),vn=s("titles"),rc=n("[SEP] "),Cs=s("texts"),Ia=c(),qt=s("h2"),ho=s("a"),qs=s("span"),T(bn.$$.fragment),sc=c(),Is=s("span"),ac=n("DPR specific outputs"),Ja=c(),It=s("div"),T(yn.$$.fragment),ic=c(),Tn=s("p"),lc=n("Class for outputs of "),Zr=s("a"),dc=n("DPRQuestionEncoder"),cc=n("."),Ua=c(),Jt=s("div"),T(wn.$$.fragment),pc=c(),Rn=s("p"),hc=n("Class for outputs of "),Ar=s("a"),uc=n("DPRQuestionEncoder"),fc=n("."),ja=c(),Ut=s("div"),T(En.$$.fragment),mc=c(),kn=s("p"),gc=n("Class for outputs of "),Qr=s("a"),_c=n("DPRQuestionEncoder"),vc=n("."),Na=c(),jt=s("h2"),uo=s("a"),Js=s("span"),T($n.$$.fragment),bc=c(),Us=s("span"),yc=n("DPRContextEncoder"),Za=c(),Ve=s("div"),T(Pn.$$.fragment),Tc=c(),js=s("p"),wc=n("The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),Rc=c(),Dn=s("p"),Ec=n("This model inherits from "),Br=s("a"),kc=n("PreTrainedModel"),$c=n(`. 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.)`),Pc=c(),xn=s("p"),Dc=n("This model is also a PyTorch "),zn=s("a"),xc=n("torch.nn.Module"),zc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mc=c(),lt=s("div"),T(Mn.$$.fragment),Fc=c(),Nt=s("p"),Cc=n("The "),Vr=s("a"),qc=n("DPRContextEncoder"),Ic=n(" forward method, overrides the "),Ns=s("code"),Jc=n("__call__"),Uc=n(" special method."),jc=c(),T(fo.$$.fragment),Nc=c(),T(mo.$$.fragment),Aa=c(),Zt=s("h2"),go=s("a"),Zs=s("span"),T(Fn.$$.fragment),Zc=c(),As=s("span"),Ac=n("DPRQuestionEncoder"),Qa=c(),Se=s("div"),T(Cn.$$.fragment),Qc=c(),Qs=s("p"),Bc=n("The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Vc=c(),qn=s("p"),Sc=n("This model inherits from "),Sr=s("a"),Wc=n("PreTrainedModel"),Lc=n(`. 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.)`),Gc=c(),In=s("p"),Oc=n("This model is also a PyTorch "),Jn=s("a"),Xc=n("torch.nn.Module"),Hc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yc=c(),dt=s("div"),T(Un.$$.fragment),Kc=c(),At=s("p"),ep=n("The "),Wr=s("a"),tp=n("DPRQuestionEncoder"),op=n(" forward method, overrides the "),Bs=s("code"),np=n("__call__"),rp=n(" special method."),sp=c(),T(_o.$$.fragment),ap=c(),T(vo.$$.fragment),Ba=c(),Qt=s("h2"),bo=s("a"),Vs=s("span"),T(jn.$$.fragment),ip=c(),Ss=s("span"),lp=n("DPRReader"),Va=c(),We=s("div"),T(Nn.$$.fragment),dp=c(),Ws=s("p"),cp=n("The bare DPRReader transformer outputting span predictions."),pp=c(),Zn=s("p"),hp=n("This model inherits from "),Lr=s("a"),up=n("PreTrainedModel"),fp=n(`. 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.)`),mp=c(),An=s("p"),gp=n("This model is also a PyTorch "),Qn=s("a"),_p=n("torch.nn.Module"),vp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),bp=c(),ct=s("div"),T(Bn.$$.fragment),yp=c(),Bt=s("p"),Tp=n("The "),Gr=s("a"),wp=n("DPRReader"),Rp=n(" forward method, overrides the "),Ls=s("code"),Ep=n("__call__"),kp=n(" special method."),$p=c(),T(yo.$$.fragment),Pp=c(),T(To.$$.fragment),Sa=c(),Vt=s("h2"),wo=s("a"),Gs=s("span"),T(Vn.$$.fragment),Dp=c(),Os=s("span"),xp=n("TFDPRContextEncoder"),Wa=c(),Te=s("div"),T(Sn.$$.fragment),zp=c(),Xs=s("p"),Mp=n("The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),Fp=c(),Wn=s("p"),Cp=n("This model inherits from "),Or=s("a"),qp=n("TFPreTrainedModel"),Ip=n(`. 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.)`),Jp=c(),Ln=s("p"),Up=n("This model is also a Tensorflow "),Gn=s("a"),jp=n("tf.keras.Model"),Np=n(`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),Zp=c(),T(Ro.$$.fragment),Ap=c(),pt=s("div"),T(On.$$.fragment),Qp=c(),St=s("p"),Bp=n("The "),Xr=s("a"),Vp=n("TFDPRContextEncoder"),Sp=n(" forward method, overrides the "),Hs=s("code"),Wp=n("__call__"),Lp=n(" special method."),Gp=c(),T(Eo.$$.fragment),Op=c(),T(ko.$$.fragment),La=c(),Wt=s("h2"),$o=s("a"),Ys=s("span"),T(Xn.$$.fragment),Xp=c(),Ks=s("span"),Hp=n("TFDPRQuestionEncoder"),Ga=c(),we=s("div"),T(Hn.$$.fragment),Yp=c(),ea=s("p"),Kp=n("The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),eh=c(),Yn=s("p"),th=n("This model inherits from "),Hr=s("a"),oh=n("TFPreTrainedModel"),nh=n(`. 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.)`),rh=c(),Kn=s("p"),sh=n("This model is also a Tensorflow "),er=s("a"),ah=n("tf.keras.Model"),ih=n(`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),lh=c(),T(Po.$$.fragment),dh=c(),ht=s("div"),T(tr.$$.fragment),ch=c(),Lt=s("p"),ph=n("The "),Yr=s("a"),hh=n("TFDPRQuestionEncoder"),uh=n(" forward method, overrides the "),ta=s("code"),fh=n("__call__"),mh=n(" special method."),gh=c(),T(Do.$$.fragment),_h=c(),T(xo.$$.fragment),Oa=c(),Gt=s("h2"),zo=s("a"),oa=s("span"),T(or.$$.fragment),vh=c(),na=s("span"),bh=n("TFDPRReader"),Xa=c(),Re=s("div"),T(nr.$$.fragment),yh=c(),ra=s("p"),Th=n("The bare DPRReader transformer outputting span predictions."),wh=c(),rr=s("p"),Rh=n("This model inherits from "),Kr=s("a"),Eh=n("TFPreTrainedModel"),kh=n(`. 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.)`),$h=c(),sr=s("p"),Ph=n("This model is also a Tensorflow "),ar=s("a"),Dh=n("tf.keras.Model"),xh=n(`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),zh=c(),T(Mo.$$.fragment),Mh=c(),ut=s("div"),T(ir.$$.fragment),Fh=c(),Ot=s("p"),Ch=n("The "),es=s("a"),qh=n("TFDPRReader"),Ih=n(" forward method, overrides the "),sa=s("code"),Jh=n("__call__"),Uh=n(" special method."),jh=c(),T(Fo.$$.fragment),Nh=c(),T(Co.$$.fragment),this.h()},l(o){const m=lm('[data-svelte="svelte-1phssyn"]',document.head);h=a(m,"META",{name:!0,content:!0}),m.forEach(t),y=p(o),_=a(o,"H1",{class:!0});var lr=i(_);g=a(lr,"A",{id:!0,class:!0,href:!0});var aa=i(g);b=a(aa,"SPAN",{});var ia=i(b);w(l.$$.fragment,ia),ia.forEach(t),aa.forEach(t),u=p(lr),z=a(lr,"SPAN",{});var la=i(z);Me=r(la,"DPR"),la.forEach(t),lr.forEach(t),Ee=p(o),U=a(o,"DIV",{class:!0});var dr=i(U);de=a(dr,"A",{href:!0});var da=i(de);H=a(da,"IMG",{alt:!0,src:!0}),da.forEach(t),Fe=p(dr),B=a(dr,"A",{href:!0});var ca=i(B);ce=a(ca,"IMG",{alt:!0,src:!0}),ca.forEach(t),dr.forEach(t),G=p(o),Y=a(o,"H2",{class:!0});var cr=i(Y);se=a(cr,"A",{id:!0,class:!0,href:!0});var pa=i(se);S=a(pa,"SPAN",{});var ha=i(S);w(ie.$$.fragment,ha),ha.forEach(t),pa.forEach(t),Ce=p(cr),W=a(cr,"SPAN",{});var ua=i(W);qe=r(ua,"Overview"),ua.forEach(t),cr.forEach(t),ke=p(o),N=a(o,"P",{});var pr=i(N);Ie=r(pr,`Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research. It was
introduced in `),le=a(pr,"A",{href:!0,rel:!0});var fa=i(le);pe=r(fa,"Dense Passage Retrieval for Open-Domain Question Answering"),fa.forEach(t),C=r(pr,` by
Vladimir Karpukhin, Barlas O\u011Fuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, Wen-tau Yih.`),pr.forEach(t),I=p(o),he=a(o,"P",{});var ma=i(he);K=r(ma,"The abstract from the paper is the following:"),ma.forEach(t),$e=p(o),ue=a(o,"P",{});var ga=i(ue);L=a(ga,"EM",{});var _a=i(L);Je=r(_a,`Open-domain question answering relies on efficient passage retrieval to select candidate contexts, where traditional
sparse vector space models, such as TF-IDF or BM25, are the de facto method. In this work, we show that retrieval can
be practically implemented using dense representations alone, where embeddings are learned from a small number of
questions and passages by a simple dual-encoder framework. When evaluated on a wide range of open-domain QA datasets,
our dense retriever outperforms a strong Lucene-BM25 system largely by 9%-19% absolute in terms of top-20 passage
retrieval accuracy, and helps our end-to-end QA system establish new state-of-the-art on multiple open-domain QA
benchmarks.`),_a.forEach(t),ga.forEach(t),Pe=p(o),M=a(o,"P",{});var Xt=i(M);Ue=r(Xt,"This model was contributed by "),Z=a(Xt,"A",{href:!0,rel:!0});var Bh=i(Z);je=r(Bh,"lhoestq"),Bh.forEach(t),Ne=r(Xt,". The original code can be found "),A=a(Xt,"A",{href:!0,rel:!0});var Vh=i(A);Ze=r(Vh,"here"),Vh.forEach(t),Ae=r(Xt,"."),Xt.forEach(t),Q=p(o),fe=a(o,"P",{});var Sh=i(fe);ee=r(Sh,"Tips:"),Sh.forEach(t),De=p(o),te=a(o,"UL",{});var Wh=i(te);q=a(Wh,"LI",{});var Ya=i(q);ge=a(Ya,"P",{});var Lh=i(ge);j=r(Lh,"DPR consists in three models:"),Lh.forEach(t),Qe=p(Ya),oe=a(Ya,"UL",{});var ts=i(oe);v=a(ts,"LI",{});var Gh=i(v);D=r(Gh,"Question encoder: encode questions as vectors"),Gh.forEach(t),ot=p(ts),ae=a(ts,"LI",{});var Oh=i(ae);nt=r(Oh,"Context encoder: encode contexts as vectors"),Oh.forEach(t),rt=p(ts),x=a(ts,"LI",{});var Xh=i(x);st=r(Xh,"Reader: extract the answer of the questions inside retrieved contexts, along with a relevance score (high if the inferred span actually answers the question)."),Xh.forEach(t),ts.forEach(t),Ya.forEach(t),Wh.forEach(t),Xe=p(o),me=a(o,"H2",{class:!0});var Ka=i(me);_e=a(Ka,"A",{id:!0,class:!0,href:!0});var Hh=i(_e);Ge=a(Hh,"SPAN",{});var Yh=i(Ge);w(J.$$.fragment,Yh),Yh.forEach(t),Hh.forEach(t),ne=p(Ka),Oe=a(Ka,"SPAN",{});var Kh=i(Oe);at=r(Kh,"DPRConfig"),Kh.forEach(t),Ka.forEach(t),O=p(o),V=a(o,"DIV",{class:!0});var Rt=i(V);w(xe.$$.fragment,Rt),Be=p(Rt),ve=a(Rt,"P",{});var va=i(ve);re=a(va,"A",{href:!0});var eu=i(re);it=r(eu,"DPRConfig"),eu.forEach(t),Ai=r(va," is the configuration class to store the configuration of a "),ls=a(va,"EM",{});var tu=i(ls);Qi=r(tu,"DPRModel"),tu.forEach(t),Bi=r(va,"."),va.forEach(t),Vi=p(Rt),He=a(Rt,"P",{});var Et=i(He);Si=r(Et,"This is the configuration class to store the configuration of a "),mr=a(Et,"A",{href:!0});var ou=i(mr);Wi=r(ou,"DPRContextEncoder"),ou.forEach(t),Li=r(Et,", "),gr=a(Et,"A",{href:!0});var nu=i(gr);Gi=r(nu,"DPRQuestionEncoder"),nu.forEach(t),Oi=r(Et,`, or a
`),_r=a(Et,"A",{href:!0});var ru=i(_r);Xi=r(ru,"DPRReader"),ru.forEach(t),Hi=r(Et,`. It is used to instantiate the components of the DPR model according to the specified arguments,
defining the model component architectures. Instantiating a configuration with the defaults will yield a similar
configuration to that of the DPRContextEncoder
`),Go=a(Et,"A",{href:!0,rel:!0});var su=i(Go);Yi=r(su,"facebook/dpr-ctx_encoder-single-nq-base"),su.forEach(t),Ki=r(Et,`
architecture.`),Et.forEach(t),el=p(Rt),Oo=a(Rt,"P",{});var ei=i(Oo);tl=r(ei,"This class is a subclass of "),vr=a(ei,"A",{href:!0});var au=i(vr);ol=r(au,"BertConfig"),au.forEach(t),nl=r(ei,". Please check the superclass for the documentation of all kwargs."),ei.forEach(t),rl=p(Rt),w(Yt.$$.fragment,Rt),Rt.forEach(t),Ra=p(o),Dt=a(o,"H2",{class:!0});var ti=i(Dt);Kt=a(ti,"A",{id:!0,class:!0,href:!0});var iu=i(Kt);ds=a(iu,"SPAN",{});var lu=i(ds);w(Xo.$$.fragment,lu),lu.forEach(t),iu.forEach(t),sl=p(ti),cs=a(ti,"SPAN",{});var du=i(cs);al=r(du,"DPRContextEncoderTokenizer"),du.forEach(t),ti.forEach(t),Ea=p(o),Ye=a(o,"DIV",{class:!0});var qo=i(Ye);w(Ho.$$.fragment,qo),il=p(qo),ps=a(qo,"P",{});var cu=i(ps);ll=r(cu,"Construct a DPRContextEncoder tokenizer."),cu.forEach(t),dl=p(qo),eo=a(qo,"P",{});var ba=i(eo);br=a(ba,"A",{href:!0});var pu=i(br);cl=r(pu,"DPRContextEncoderTokenizer"),pu.forEach(t),pl=r(ba," is identical to "),yr=a(ba,"A",{href:!0});var hu=i(yr);hl=r(hu,"BertTokenizer"),hu.forEach(t),ul=r(ba,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),ba.forEach(t),fl=p(qo),Yo=a(qo,"P",{});var oi=i(Yo);ml=r(oi,"Refer to superclass "),Tr=a(oi,"A",{href:!0});var uu=i(Tr);gl=r(uu,"BertTokenizer"),uu.forEach(t),_l=r(oi," for usage examples and documentation concerning parameters."),oi.forEach(t),qo.forEach(t),ka=p(o),xt=a(o,"H2",{class:!0});var ni=i(xt);to=a(ni,"A",{id:!0,class:!0,href:!0});var fu=i(to);hs=a(fu,"SPAN",{});var mu=i(hs);w(Ko.$$.fragment,mu),mu.forEach(t),fu.forEach(t),vl=p(ni),us=a(ni,"SPAN",{});var gu=i(us);bl=r(gu,"DPRContextEncoderTokenizerFast"),gu.forEach(t),ni.forEach(t),$a=p(o),Ke=a(o,"DIV",{class:!0});var Io=i(Ke);w(en.$$.fragment,Io),yl=p(Io),tn=a(Io,"P",{});var ri=i(tn);Tl=r(ri,"Construct a \u201Cfast\u201D DPRContextEncoder tokenizer (backed by HuggingFace\u2019s "),fs=a(ri,"EM",{});var _u=i(fs);wl=r(_u,"tokenizers"),_u.forEach(t),Rl=r(ri," library)."),ri.forEach(t),El=p(Io),oo=a(Io,"P",{});var ya=i(oo);wr=a(ya,"A",{href:!0});var vu=i(wr);kl=r(vu,"DPRContextEncoderTokenizerFast"),vu.forEach(t),$l=r(ya," is identical to "),Rr=a(ya,"A",{href:!0});var bu=i(Rr);Pl=r(bu,"BertTokenizerFast"),bu.forEach(t),Dl=r(ya,` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),ya.forEach(t),xl=p(Io),on=a(Io,"P",{});var si=i(on);zl=r(si,"Refer to superclass "),Er=a(si,"A",{href:!0});var yu=i(Er);Ml=r(yu,"BertTokenizerFast"),yu.forEach(t),Fl=r(si," for usage examples and documentation concerning parameters."),si.forEach(t),Io.forEach(t),Pa=p(o),zt=a(o,"H2",{class:!0});var ai=i(zt);no=a(ai,"A",{id:!0,class:!0,href:!0});var Tu=i(no);ms=a(Tu,"SPAN",{});var wu=i(ms);w(nn.$$.fragment,wu),wu.forEach(t),Tu.forEach(t),Cl=p(ai),gs=a(ai,"SPAN",{});var Ru=i(gs);ql=r(Ru,"DPRQuestionEncoderTokenizer"),Ru.forEach(t),ai.forEach(t),Da=p(o),et=a(o,"DIV",{class:!0});var Jo=i(et);w(rn.$$.fragment,Jo),Il=p(Jo),_s=a(Jo,"P",{});var Eu=i(_s);Jl=r(Eu,"Constructs a DPRQuestionEncoder tokenizer."),Eu.forEach(t),Ul=p(Jo),ro=a(Jo,"P",{});var Ta=i(ro);kr=a(Ta,"A",{href:!0});var ku=i(kr);jl=r(ku,"DPRQuestionEncoderTokenizer"),ku.forEach(t),Nl=r(Ta," is identical to "),$r=a(Ta,"A",{href:!0});var $u=i($r);Zl=r($u,"BertTokenizer"),$u.forEach(t),Al=r(Ta,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Ta.forEach(t),Ql=p(Jo),sn=a(Jo,"P",{});var ii=i(sn);Bl=r(ii,"Refer to superclass "),Pr=a(ii,"A",{href:!0});var Pu=i(Pr);Vl=r(Pu,"BertTokenizer"),Pu.forEach(t),Sl=r(ii," for usage examples and documentation concerning parameters."),ii.forEach(t),Jo.forEach(t),xa=p(o),Mt=a(o,"H2",{class:!0});var li=i(Mt);so=a(li,"A",{id:!0,class:!0,href:!0});var Du=i(so);vs=a(Du,"SPAN",{});var xu=i(vs);w(an.$$.fragment,xu),xu.forEach(t),Du.forEach(t),Wl=p(li),bs=a(li,"SPAN",{});var zu=i(bs);Ll=r(zu,"DPRQuestionEncoderTokenizerFast"),zu.forEach(t),li.forEach(t),za=p(o),tt=a(o,"DIV",{class:!0});var Uo=i(tt);w(ln.$$.fragment,Uo),Gl=p(Uo),dn=a(Uo,"P",{});var di=i(dn);Ol=r(di,"Constructs a \u201Cfast\u201D DPRQuestionEncoder tokenizer (backed by HuggingFace\u2019s "),ys=a(di,"EM",{});var Mu=i(ys);Xl=r(Mu,"tokenizers"),Mu.forEach(t),Hl=r(di," library)."),di.forEach(t),Yl=p(Uo),ao=a(Uo,"P",{});var wa=i(ao);Dr=a(wa,"A",{href:!0});var Fu=i(Dr);Kl=r(Fu,"DPRQuestionEncoderTokenizerFast"),Fu.forEach(t),ed=r(wa," is identical to "),xr=a(wa,"A",{href:!0});var Cu=i(xr);td=r(Cu,"BertTokenizerFast"),Cu.forEach(t),od=r(wa,` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),wa.forEach(t),nd=p(Uo),cn=a(Uo,"P",{});var ci=i(cn);rd=r(ci,"Refer to superclass "),zr=a(ci,"A",{href:!0});var qu=i(zr);sd=r(qu,"BertTokenizerFast"),qu.forEach(t),ad=r(ci," for usage examples and documentation concerning parameters."),ci.forEach(t),Uo.forEach(t),Ma=p(o),Ft=a(o,"H2",{class:!0});var pi=i(Ft);io=a(pi,"A",{id:!0,class:!0,href:!0});var Iu=i(io);Ts=a(Iu,"SPAN",{});var Ju=i(Ts);w(pn.$$.fragment,Ju),Ju.forEach(t),Iu.forEach(t),id=p(pi),ws=a(pi,"SPAN",{});var Uu=i(ws);ld=r(Uu,"DPRReaderTokenizer"),Uu.forEach(t),pi.forEach(t),Fa=p(o),be=a(o,"DIV",{class:!0});var ft=i(be);w(hn.$$.fragment,ft),dd=p(ft),Rs=a(ft,"P",{});var ju=i(Rs);cd=r(ju,"Construct a DPRReader tokenizer."),ju.forEach(t),pd=p(ft),yt=a(ft,"P",{});var hr=i(yt);Mr=a(hr,"A",{href:!0});var Nu=i(Mr);hd=r(Nu,"DPRReaderTokenizer"),Nu.forEach(t),ud=r(hr," is almost identical to "),Fr=a(hr,"A",{href:!0});var Zu=i(Fr);fd=r(Zu,"BertTokenizer"),Zu.forEach(t),md=r(hr,` and runs end-to-end tokenization: punctuation
splitting and wordpiece. The difference is that is has three inputs strings: question, titles and texts that are
combined to be fed to the `),Cr=a(hr,"A",{href:!0});var Au=i(Cr);gd=r(Au,"DPRReader"),Au.forEach(t),_d=r(hr," model."),hr.forEach(t),vd=p(ft),un=a(ft,"P",{});var hi=i(un);bd=r(hi,"Refer to superclass "),qr=a(hi,"A",{href:!0});var Qu=i(qr);yd=r(Qu,"BertTokenizer"),Qu.forEach(t),Td=r(hi," for usage examples and documentation concerning parameters."),hi.forEach(t),wd=p(ft),Tt=a(ft,"P",{});var ur=i(Tt);Rd=r(ur,"Return a dictionary with the token ids of the input strings and other information to give to "),Es=a(ur,"CODE",{});var Bu=i(Es);Ed=r(Bu,".decode_best_spans"),Bu.forEach(t),kd=r(ur,`.
It converts the strings of a question and different passages (title and text) in a sequence of IDs (integers),
using the tokenizer and vocabulary. The resulting `),ks=a(ur,"CODE",{});var Vu=i(ks);$d=r(Vu,"input_ids"),Vu.forEach(t),Pd=r(ur," is a matrix of size "),$s=a(ur,"CODE",{});var Su=i($s);Dd=r(Su,"(n_passages, sequence_length)"),Su.forEach(t),ur.forEach(t),xd=p(ft),w(lo.$$.fragment,ft),ft.forEach(t),Ca=p(o),Ct=a(o,"H2",{class:!0});var ui=i(Ct);co=a(ui,"A",{id:!0,class:!0,href:!0});var Wu=i(co);Ps=a(Wu,"SPAN",{});var Lu=i(Ps);w(fn.$$.fragment,Lu),Lu.forEach(t),Wu.forEach(t),zd=p(ui),Ds=a(ui,"SPAN",{});var Gu=i(Ds);Md=r(Gu,"DPRReaderTokenizerFast"),Gu.forEach(t),ui.forEach(t),qa=p(o),ye=a(o,"DIV",{class:!0});var mt=i(ye);w(mn.$$.fragment,mt),Fd=p(mt),gn=a(mt,"P",{});var fi=i(gn);Cd=r(fi,"Constructs a \u201Cfast\u201D DPRReader tokenizer (backed by HuggingFace\u2019s "),xs=a(fi,"EM",{});var Ou=i(xs);qd=r(Ou,"tokenizers"),Ou.forEach(t),Id=r(fi," library)."),fi.forEach(t),Jd=p(mt),wt=a(mt,"P",{});var fr=i(wt);Ir=a(fr,"A",{href:!0});var Xu=i(Ir);Ud=r(Xu,"DPRReaderTokenizerFast"),Xu.forEach(t),jd=r(fr," is almost identical to "),Jr=a(fr,"A",{href:!0});var Hu=i(Jr);Nd=r(Hu,"BertTokenizerFast"),Hu.forEach(t),Zd=r(fr,` and runs end-to-end tokenization:
punctuation splitting and wordpiece. The difference is that is has three inputs strings: question, titles and texts
that are combined to be fed to the `),Ur=a(fr,"A",{href:!0});var Yu=i(Ur);Ad=r(Yu,"DPRReader"),Yu.forEach(t),Qd=r(fr," model."),fr.forEach(t),Bd=p(mt),_n=a(mt,"P",{});var mi=i(_n);Vd=r(mi,"Refer to superclass "),jr=a(mi,"A",{href:!0});var Ku=i(jr);Sd=r(Ku,"BertTokenizerFast"),Ku.forEach(t),Wd=r(mi," for usage examples and documentation concerning parameters."),mi.forEach(t),Ld=p(mt),bt=a(mt,"P",{});var jo=i(bt);Gd=r(jo,"Return a dictionary with the token ids of the input strings and other information to give to "),zs=a(jo,"CODE",{});var ef=i(zs);Od=r(ef,".decode_best_spans"),ef.forEach(t),Xd=r(jo,`.
It converts the strings of a question and different passages (title and text) in a sequence of IDs (integers),
using the tokenizer and vocabulary. The resulting `),Ms=a(jo,"CODE",{});var tf=i(Ms);Hd=r(tf,"input_ids"),tf.forEach(t),Yd=r(jo," is a matrix of size "),Fs=a(jo,"CODE",{});var of=i(Fs);Kd=r(of,"(n_passages, sequence_length)"),of.forEach(t),ec=r(jo,`
with the format:`),jo.forEach(t),tc=p(mt),Nr=a(mt,"P",{});var Zh=i(Nr);oc=r(Zh,"[CLS] "),po=a(Zh,"QUESTION",{token:!0,ids:!0});var Ah=i(po);nc=r(Ah,"[SEP] "),vn=a(Ah,"TITLES",{ids:!0});var Qh=i(vn);rc=r(Qh,"[SEP] "),Cs=a(Qh,"TEXTS",{ids:!0}),i(Cs).forEach(t),Qh.forEach(t),Ah.forEach(t),Zh.forEach(t),mt.forEach(t),Ia=p(o),qt=a(o,"H2",{class:!0});var gi=i(qt);ho=a(gi,"A",{id:!0,class:!0,href:!0});var nf=i(ho);qs=a(nf,"SPAN",{});var rf=i(qs);w(bn.$$.fragment,rf),rf.forEach(t),nf.forEach(t),sc=p(gi),Is=a(gi,"SPAN",{});var sf=i(Is);ac=r(sf,"DPR specific outputs"),sf.forEach(t),gi.forEach(t),Ja=p(o),It=a(o,"DIV",{class:!0});var _i=i(It);w(yn.$$.fragment,_i),ic=p(_i),Tn=a(_i,"P",{});var vi=i(Tn);lc=r(vi,"Class for outputs of "),Zr=a(vi,"A",{href:!0});var af=i(Zr);dc=r(af,"DPRQuestionEncoder"),af.forEach(t),cc=r(vi,"."),vi.forEach(t),_i.forEach(t),Ua=p(o),Jt=a(o,"DIV",{class:!0});var bi=i(Jt);w(wn.$$.fragment,bi),pc=p(bi),Rn=a(bi,"P",{});var yi=i(Rn);hc=r(yi,"Class for outputs of "),Ar=a(yi,"A",{href:!0});var lf=i(Ar);uc=r(lf,"DPRQuestionEncoder"),lf.forEach(t),fc=r(yi,"."),yi.forEach(t),bi.forEach(t),ja=p(o),Ut=a(o,"DIV",{class:!0});var Ti=i(Ut);w(En.$$.fragment,Ti),mc=p(Ti),kn=a(Ti,"P",{});var wi=i(kn);gc=r(wi,"Class for outputs of "),Qr=a(wi,"A",{href:!0});var df=i(Qr);_c=r(df,"DPRQuestionEncoder"),df.forEach(t),vc=r(wi,"."),wi.forEach(t),Ti.forEach(t),Na=p(o),jt=a(o,"H2",{class:!0});var Ri=i(jt);uo=a(Ri,"A",{id:!0,class:!0,href:!0});var cf=i(uo);Js=a(cf,"SPAN",{});var pf=i(Js);w($n.$$.fragment,pf),pf.forEach(t),cf.forEach(t),bc=p(Ri),Us=a(Ri,"SPAN",{});var hf=i(Us);yc=r(hf,"DPRContextEncoder"),hf.forEach(t),Ri.forEach(t),Za=p(o),Ve=a(o,"DIV",{class:!0});var kt=i(Ve);w(Pn.$$.fragment,kt),Tc=p(kt),js=a(kt,"P",{});var uf=i(js);wc=r(uf,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),uf.forEach(t),Rc=p(kt),Dn=a(kt,"P",{});var Ei=i(Dn);Ec=r(Ei,"This model inherits from "),Br=a(Ei,"A",{href:!0});var ff=i(Br);kc=r(ff,"PreTrainedModel"),ff.forEach(t),$c=r(Ei,`. 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.)`),Ei.forEach(t),Pc=p(kt),xn=a(kt,"P",{});var ki=i(xn);Dc=r(ki,"This model is also a PyTorch "),zn=a(ki,"A",{href:!0,rel:!0});var mf=i(zn);xc=r(mf,"torch.nn.Module"),mf.forEach(t),zc=r(ki,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ki.forEach(t),Mc=p(kt),lt=a(kt,"DIV",{class:!0});var No=i(lt);w(Mn.$$.fragment,No),Fc=p(No),Nt=a(No,"P",{});var os=i(Nt);Cc=r(os,"The "),Vr=a(os,"A",{href:!0});var gf=i(Vr);qc=r(gf,"DPRContextEncoder"),gf.forEach(t),Ic=r(os," forward method, overrides the "),Ns=a(os,"CODE",{});var _f=i(Ns);Jc=r(_f,"__call__"),_f.forEach(t),Uc=r(os," special method."),os.forEach(t),jc=p(No),w(fo.$$.fragment,No),Nc=p(No),w(mo.$$.fragment,No),No.forEach(t),kt.forEach(t),Aa=p(o),Zt=a(o,"H2",{class:!0});var $i=i(Zt);go=a($i,"A",{id:!0,class:!0,href:!0});var vf=i(go);Zs=a(vf,"SPAN",{});var bf=i(Zs);w(Fn.$$.fragment,bf),bf.forEach(t),vf.forEach(t),Zc=p($i),As=a($i,"SPAN",{});var yf=i(As);Ac=r(yf,"DPRQuestionEncoder"),yf.forEach(t),$i.forEach(t),Qa=p(o),Se=a(o,"DIV",{class:!0});var $t=i(Se);w(Cn.$$.fragment,$t),Qc=p($t),Qs=a($t,"P",{});var Tf=i(Qs);Bc=r(Tf,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Tf.forEach(t),Vc=p($t),qn=a($t,"P",{});var Pi=i(qn);Sc=r(Pi,"This model inherits from "),Sr=a(Pi,"A",{href:!0});var wf=i(Sr);Wc=r(wf,"PreTrainedModel"),wf.forEach(t),Lc=r(Pi,`. 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.)`),Pi.forEach(t),Gc=p($t),In=a($t,"P",{});var Di=i(In);Oc=r(Di,"This model is also a PyTorch "),Jn=a(Di,"A",{href:!0,rel:!0});var Rf=i(Jn);Xc=r(Rf,"torch.nn.Module"),Rf.forEach(t),Hc=r(Di,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Di.forEach(t),Yc=p($t),dt=a($t,"DIV",{class:!0});var Zo=i(dt);w(Un.$$.fragment,Zo),Kc=p(Zo),At=a(Zo,"P",{});var ns=i(At);ep=r(ns,"The "),Wr=a(ns,"A",{href:!0});var Ef=i(Wr);tp=r(Ef,"DPRQuestionEncoder"),Ef.forEach(t),op=r(ns," forward method, overrides the "),Bs=a(ns,"CODE",{});var kf=i(Bs);np=r(kf,"__call__"),kf.forEach(t),rp=r(ns," special method."),ns.forEach(t),sp=p(Zo),w(_o.$$.fragment,Zo),ap=p(Zo),w(vo.$$.fragment,Zo),Zo.forEach(t),$t.forEach(t),Ba=p(o),Qt=a(o,"H2",{class:!0});var xi=i(Qt);bo=a(xi,"A",{id:!0,class:!0,href:!0});var $f=i(bo);Vs=a($f,"SPAN",{});var Pf=i(Vs);w(jn.$$.fragment,Pf),Pf.forEach(t),$f.forEach(t),ip=p(xi),Ss=a(xi,"SPAN",{});var Df=i(Ss);lp=r(Df,"DPRReader"),Df.forEach(t),xi.forEach(t),Va=p(o),We=a(o,"DIV",{class:!0});var Pt=i(We);w(Nn.$$.fragment,Pt),dp=p(Pt),Ws=a(Pt,"P",{});var xf=i(Ws);cp=r(xf,"The bare DPRReader transformer outputting span predictions."),xf.forEach(t),pp=p(Pt),Zn=a(Pt,"P",{});var zi=i(Zn);hp=r(zi,"This model inherits from "),Lr=a(zi,"A",{href:!0});var zf=i(Lr);up=r(zf,"PreTrainedModel"),zf.forEach(t),fp=r(zi,`. 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.)`),zi.forEach(t),mp=p(Pt),An=a(Pt,"P",{});var Mi=i(An);gp=r(Mi,"This model is also a PyTorch "),Qn=a(Mi,"A",{href:!0,rel:!0});var Mf=i(Qn);_p=r(Mf,"torch.nn.Module"),Mf.forEach(t),vp=r(Mi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mi.forEach(t),bp=p(Pt),ct=a(Pt,"DIV",{class:!0});var Ao=i(ct);w(Bn.$$.fragment,Ao),yp=p(Ao),Bt=a(Ao,"P",{});var rs=i(Bt);Tp=r(rs,"The "),Gr=a(rs,"A",{href:!0});var Ff=i(Gr);wp=r(Ff,"DPRReader"),Ff.forEach(t),Rp=r(rs," forward method, overrides the "),Ls=a(rs,"CODE",{});var Cf=i(Ls);Ep=r(Cf,"__call__"),Cf.forEach(t),kp=r(rs," special method."),rs.forEach(t),$p=p(Ao),w(yo.$$.fragment,Ao),Pp=p(Ao),w(To.$$.fragment,Ao),Ao.forEach(t),Pt.forEach(t),Sa=p(o),Vt=a(o,"H2",{class:!0});var Fi=i(Vt);wo=a(Fi,"A",{id:!0,class:!0,href:!0});var qf=i(wo);Gs=a(qf,"SPAN",{});var If=i(Gs);w(Vn.$$.fragment,If),If.forEach(t),qf.forEach(t),Dp=p(Fi),Os=a(Fi,"SPAN",{});var Jf=i(Os);xp=r(Jf,"TFDPRContextEncoder"),Jf.forEach(t),Fi.forEach(t),Wa=p(o),Te=a(o,"DIV",{class:!0});var gt=i(Te);w(Sn.$$.fragment,gt),zp=p(gt),Xs=a(gt,"P",{});var Uf=i(Xs);Mp=r(Uf,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),Uf.forEach(t),Fp=p(gt),Wn=a(gt,"P",{});var Ci=i(Wn);Cp=r(Ci,"This model inherits from "),Or=a(Ci,"A",{href:!0});var jf=i(Or);qp=r(jf,"TFPreTrainedModel"),jf.forEach(t),Ip=r(Ci,`. 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.)`),Ci.forEach(t),Jp=p(gt),Ln=a(gt,"P",{});var qi=i(Ln);Up=r(qi,"This model is also a Tensorflow "),Gn=a(qi,"A",{href:!0,rel:!0});var Nf=i(Gn);jp=r(Nf,"tf.keras.Model"),Nf.forEach(t),Np=r(qi,`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),qi.forEach(t),Zp=p(gt),w(Ro.$$.fragment,gt),Ap=p(gt),pt=a(gt,"DIV",{class:!0});var Qo=i(pt);w(On.$$.fragment,Qo),Qp=p(Qo),St=a(Qo,"P",{});var ss=i(St);Bp=r(ss,"The "),Xr=a(ss,"A",{href:!0});var Zf=i(Xr);Vp=r(Zf,"TFDPRContextEncoder"),Zf.forEach(t),Sp=r(ss," forward method, overrides the "),Hs=a(ss,"CODE",{});var Af=i(Hs);Wp=r(Af,"__call__"),Af.forEach(t),Lp=r(ss," special method."),ss.forEach(t),Gp=p(Qo),w(Eo.$$.fragment,Qo),Op=p(Qo),w(ko.$$.fragment,Qo),Qo.forEach(t),gt.forEach(t),La=p(o),Wt=a(o,"H2",{class:!0});var Ii=i(Wt);$o=a(Ii,"A",{id:!0,class:!0,href:!0});var Qf=i($o);Ys=a(Qf,"SPAN",{});var Bf=i(Ys);w(Xn.$$.fragment,Bf),Bf.forEach(t),Qf.forEach(t),Xp=p(Ii),Ks=a(Ii,"SPAN",{});var Vf=i(Ks);Hp=r(Vf,"TFDPRQuestionEncoder"),Vf.forEach(t),Ii.forEach(t),Ga=p(o),we=a(o,"DIV",{class:!0});var _t=i(we);w(Hn.$$.fragment,_t),Yp=p(_t),ea=a(_t,"P",{});var Sf=i(ea);Kp=r(Sf,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Sf.forEach(t),eh=p(_t),Yn=a(_t,"P",{});var Ji=i(Yn);th=r(Ji,"This model inherits from "),Hr=a(Ji,"A",{href:!0});var Wf=i(Hr);oh=r(Wf,"TFPreTrainedModel"),Wf.forEach(t),nh=r(Ji,`. 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.)`),Ji.forEach(t),rh=p(_t),Kn=a(_t,"P",{});var Ui=i(Kn);sh=r(Ui,"This model is also a Tensorflow "),er=a(Ui,"A",{href:!0,rel:!0});var Lf=i(er);ah=r(Lf,"tf.keras.Model"),Lf.forEach(t),ih=r(Ui,`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),Ui.forEach(t),lh=p(_t),w(Po.$$.fragment,_t),dh=p(_t),ht=a(_t,"DIV",{class:!0});var Bo=i(ht);w(tr.$$.fragment,Bo),ch=p(Bo),Lt=a(Bo,"P",{});var as=i(Lt);ph=r(as,"The "),Yr=a(as,"A",{href:!0});var Gf=i(Yr);hh=r(Gf,"TFDPRQuestionEncoder"),Gf.forEach(t),uh=r(as," forward method, overrides the "),ta=a(as,"CODE",{});var Of=i(ta);fh=r(Of,"__call__"),Of.forEach(t),mh=r(as," special method."),as.forEach(t),gh=p(Bo),w(Do.$$.fragment,Bo),_h=p(Bo),w(xo.$$.fragment,Bo),Bo.forEach(t),_t.forEach(t),Oa=p(o),Gt=a(o,"H2",{class:!0});var ji=i(Gt);zo=a(ji,"A",{id:!0,class:!0,href:!0});var Xf=i(zo);oa=a(Xf,"SPAN",{});var Hf=i(oa);w(or.$$.fragment,Hf),Hf.forEach(t),Xf.forEach(t),vh=p(ji),na=a(ji,"SPAN",{});var Yf=i(na);bh=r(Yf,"TFDPRReader"),Yf.forEach(t),ji.forEach(t),Xa=p(o),Re=a(o,"DIV",{class:!0});var vt=i(Re);w(nr.$$.fragment,vt),yh=p(vt),ra=a(vt,"P",{});var Kf=i(ra);Th=r(Kf,"The bare DPRReader transformer outputting span predictions."),Kf.forEach(t),wh=p(vt),rr=a(vt,"P",{});var Ni=i(rr);Rh=r(Ni,"This model inherits from "),Kr=a(Ni,"A",{href:!0});var em=i(Kr);Eh=r(em,"TFPreTrainedModel"),em.forEach(t),kh=r(Ni,`. 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.)`),Ni.forEach(t),$h=p(vt),sr=a(vt,"P",{});var Zi=i(sr);Ph=r(Zi,"This model is also a Tensorflow "),ar=a(Zi,"A",{href:!0,rel:!0});var tm=i(ar);Dh=r(tm,"tf.keras.Model"),tm.forEach(t),xh=r(Zi,`
subclass. Use it as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to
general usage and behavior.`),Zi.forEach(t),zh=p(vt),w(Mo.$$.fragment,vt),Mh=p(vt),ut=a(vt,"DIV",{class:!0});var Vo=i(ut);w(ir.$$.fragment,Vo),Fh=p(Vo),Ot=a(Vo,"P",{});var is=i(Ot);Ch=r(is,"The "),es=a(is,"A",{href:!0});var om=i(es);qh=r(om,"TFDPRReader"),om.forEach(t),Ih=r(is," forward method, overrides the "),sa=a(is,"CODE",{});var nm=i(sa);Jh=r(nm,"__call__"),nm.forEach(t),Uh=r(is," special method."),is.forEach(t),jh=p(Vo),w(Fo.$$.fragment,Vo),Nh=p(Vo),w(Co.$$.fragment,Vo),Vo.forEach(t),vt.forEach(t),this.h()},h(){d(h,"name","hf:doc:metadata"),d(h,"content",JSON.stringify(Dm)),d(g,"id","dpr"),d(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"),d(g,"href","#dpr"),d(_,"class","relative group"),d(H,"alt","Models"),rm(H.src,P="https://img.shields.io/badge/All_model_pages-dpr-blueviolet")||d(H,"src",P),d(de,"href","https://huggingface.co/models?filter=dpr"),d(ce,"alt","Spaces"),rm(ce.src,Le="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d(ce,"src",Le),d(B,"href","https://huggingface.co/spaces/docs-demos/dpr-question_encoder-bert-base-multilingual"),d(U,"class","flex flex-wrap space-x-1"),d(se,"id","overview"),d(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"),d(se,"href","#overview"),d(Y,"class","relative group"),d(le,"href","https://arxiv.org/abs/2004.04906"),d(le,"rel","nofollow"),d(Z,"href","https://huggingface.co/lhoestq"),d(Z,"rel","nofollow"),d(A,"href","https://github.com/facebookresearch/DPR"),d(A,"rel","nofollow"),d(_e,"id","transformers.DPRConfig"),d(_e,"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"),d(_e,"href","#transformers.DPRConfig"),d(me,"class","relative group"),d(re,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRConfig"),d(mr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRContextEncoder"),d(gr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(_r,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReader"),d(Go,"href","https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base"),d(Go,"rel","nofollow"),d(vr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertConfig"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Kt,"id","transformers.DPRContextEncoderTokenizer"),d(Kt,"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"),d(Kt,"href","#transformers.DPRContextEncoderTokenizer"),d(Dt,"class","relative group"),d(br,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRContextEncoderTokenizer"),d(yr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(Tr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(to,"id","transformers.DPRContextEncoderTokenizerFast"),d(to,"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"),d(to,"href","#transformers.DPRContextEncoderTokenizerFast"),d(xt,"class","relative group"),d(wr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRContextEncoderTokenizerFast"),d(Rr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(Er,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(no,"id","transformers.DPRQuestionEncoderTokenizer"),d(no,"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"),d(no,"href","#transformers.DPRQuestionEncoderTokenizer"),d(zt,"class","relative group"),d(kr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizer"),d($r,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(Pr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(so,"id","transformers.DPRQuestionEncoderTokenizerFast"),d(so,"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"),d(so,"href","#transformers.DPRQuestionEncoderTokenizerFast"),d(Mt,"class","relative group"),d(Dr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizerFast"),d(xr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(zr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(io,"id","transformers.DPRReaderTokenizer"),d(io,"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"),d(io,"href","#transformers.DPRReaderTokenizer"),d(Ft,"class","relative group"),d(Mr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderTokenizer"),d(Fr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(Cr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReader"),d(qr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizer"),d(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(co,"id","transformers.DPRReaderTokenizerFast"),d(co,"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"),d(co,"href","#transformers.DPRReaderTokenizerFast"),d(Ct,"class","relative group"),d(Ir,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReaderTokenizerFast"),d(Jr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(Ur,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReader"),d(jr,"href","/docs/transformers/v4.32.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(Cs,"ids",""),d(vn,"ids",""),d(po,"token",""),d(po,"ids",""),d(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ho,"id","transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"),d(ho,"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"),d(ho,"href","#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"),d(qt,"class","relative group"),d(Zr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ar,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Qr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(uo,"id","transformers.DPRContextEncoder"),d(uo,"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"),d(uo,"href","#transformers.DPRContextEncoder"),d(jt,"class","relative group"),d(Br,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),d(zn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(zn,"rel","nofollow"),d(Vr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRContextEncoder"),d(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(go,"id","transformers.DPRQuestionEncoder"),d(go,"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"),d(go,"href","#transformers.DPRQuestionEncoder"),d(Zt,"class","relative group"),d(Sr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),d(Jn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Jn,"rel","nofollow"),d(Wr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bo,"id","transformers.DPRReader"),d(bo,"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"),d(bo,"href","#transformers.DPRReader"),d(Qt,"class","relative group"),d(Lr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),d(Qn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Qn,"rel","nofollow"),d(Gr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.DPRReader"),d(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(wo,"id","transformers.TFDPRContextEncoder"),d(wo,"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"),d(wo,"href","#transformers.TFDPRContextEncoder"),d(Vt,"class","relative group"),d(Or,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(Gn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Gn,"rel","nofollow"),d(Xr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.TFDPRContextEncoder"),d(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($o,"id","transformers.TFDPRQuestionEncoder"),d($o,"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"),d($o,"href","#transformers.TFDPRQuestionEncoder"),d(Wt,"class","relative group"),d(Hr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(er,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(er,"rel","nofollow"),d(Yr,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.TFDPRQuestionEncoder"),d(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(zo,"id","transformers.TFDPRReader"),d(zo,"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"),d(zo,"href","#transformers.TFDPRReader"),d(Gt,"class","relative group"),d(Kr,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),d(ar,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(ar,"rel","nofollow"),d(es,"href","/docs/transformers/v4.32.0/en/model_doc/dpr#transformers.TFDPRReader"),d(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,m){e(document.head,h),f(o,y,m),f(o,_,m),e(_,g),e(g,b),R(l,b,null),e(_,u),e(_,z),e(z,Me),f(o,Ee,m),f(o,U,m),e(U,de),e(de,H),e(U,Fe),e(U,B),e(B,ce),f(o,G,m),f(o,Y,m),e(Y,se),e(se,S),R(ie,S,null),e(Y,Ce),e(Y,W),e(W,qe),f(o,ke,m),f(o,N,m),e(N,Ie),e(N,le),e(le,pe),e(N,C),f(o,I,m),f(o,he,m),e(he,K),f(o,$e,m),f(o,ue,m),e(ue,L),e(L,Je),f(o,Pe,m),f(o,M,m),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(M,Ae),f(o,Q,m),f(o,fe,m),e(fe,ee),f(o,De,m),f(o,te,m),e(te,q),e(q,ge),e(ge,j),e(q,Qe),e(q,oe),e(oe,v),e(v,D),e(oe,ot),e(oe,ae),e(ae,nt),e(oe,rt),e(oe,x),e(x,st),f(o,Xe,m),f(o,me,m),e(me,_e),e(_e,Ge),R(J,Ge,null),e(me,ne),e(me,Oe),e(Oe,at),f(o,O,m),f(o,V,m),R(xe,V,null),e(V,Be),e(V,ve),e(ve,re),e(re,it),e(ve,Ai),e(ve,ls),e(ls,Qi),e(ve,Bi),e(V,Vi),e(V,He),e(He,Si),e(He,mr),e(mr,Wi),e(He,Li),e(He,gr),e(gr,Gi),e(He,Oi),e(He,_r),e(_r,Xi),e(He,Hi),e(He,Go),e(Go,Yi),e(He,Ki),e(V,el),e(V,Oo),e(Oo,tl),e(Oo,vr),e(vr,ol),e(Oo,nl),e(V,rl),R(Yt,V,null),f(o,Ra,m),f(o,Dt,m),e(Dt,Kt),e(Kt,ds),R(Xo,ds,null),e(Dt,sl),e(Dt,cs),e(cs,al),f(o,Ea,m),f(o,Ye,m),R(Ho,Ye,null),e(Ye,il),e(Ye,ps),e(ps,ll),e(Ye,dl),e(Ye,eo),e(eo,br),e(br,cl),e(eo,pl),e(eo,yr),e(yr,hl),e(eo,ul),e(Ye,fl),e(Ye,Yo),e(Yo,ml),e(Yo,Tr),e(Tr,gl),e(Yo,_l),f(o,ka,m),f(o,xt,m),e(xt,to),e(to,hs),R(Ko,hs,null),e(xt,vl),e(xt,us),e(us,bl),f(o,$a,m),f(o,Ke,m),R(en,Ke,null),e(Ke,yl),e(Ke,tn),e(tn,Tl),e(tn,fs),e(fs,wl),e(tn,Rl),e(Ke,El),e(Ke,oo),e(oo,wr),e(wr,kl),e(oo,$l),e(oo,Rr),e(Rr,Pl),e(oo,Dl),e(Ke,xl),e(Ke,on),e(on,zl),e(on,Er),e(Er,Ml),e(on,Fl),f(o,Pa,m),f(o,zt,m),e(zt,no),e(no,ms),R(nn,ms,null),e(zt,Cl),e(zt,gs),e(gs,ql),f(o,Da,m),f(o,et,m),R(rn,et,null),e(et,Il),e(et,_s),e(_s,Jl),e(et,Ul),e(et,ro),e(ro,kr),e(kr,jl),e(ro,Nl),e(ro,$r),e($r,Zl),e(ro,Al),e(et,Ql),e(et,sn),e(sn,Bl),e(sn,Pr),e(Pr,Vl),e(sn,Sl),f(o,xa,m),f(o,Mt,m),e(Mt,so),e(so,vs),R(an,vs,null),e(Mt,Wl),e(Mt,bs),e(bs,Ll),f(o,za,m),f(o,tt,m),R(ln,tt,null),e(tt,Gl),e(tt,dn),e(dn,Ol),e(dn,ys),e(ys,Xl),e(dn,Hl),e(tt,Yl),e(tt,ao),e(ao,Dr),e(Dr,Kl),e(ao,ed),e(ao,xr),e(xr,td),e(ao,od),e(tt,nd),e(tt,cn),e(cn,rd),e(cn,zr),e(zr,sd),e(cn,ad),f(o,Ma,m),f(o,Ft,m),e(Ft,io),e(io,Ts),R(pn,Ts,null),e(Ft,id),e(Ft,ws),e(ws,ld),f(o,Fa,m),f(o,be,m),R(hn,be,null),e(be,dd),e(be,Rs),e(Rs,cd),e(be,pd),e(be,yt),e(yt,Mr),e(Mr,hd),e(yt,ud),e(yt,Fr),e(Fr,fd),e(yt,md),e(yt,Cr),e(Cr,gd),e(yt,_d),e(be,vd),e(be,un),e(un,bd),e(un,qr),e(qr,yd),e(un,Td),e(be,wd),e(be,Tt),e(Tt,Rd),e(Tt,Es),e(Es,Ed),e(Tt,kd),e(Tt,ks),e(ks,$d),e(Tt,Pd),e(Tt,$s),e($s,Dd),e(be,xd),R(lo,be,null),f(o,Ca,m),f(o,Ct,m),e(Ct,co),e(co,Ps),R(fn,Ps,null),e(Ct,zd),e(Ct,Ds),e(Ds,Md),f(o,qa,m),f(o,ye,m),R(mn,ye,null),e(ye,Fd),e(ye,gn),e(gn,Cd),e(gn,xs),e(xs,qd),e(gn,Id),e(ye,Jd),e(ye,wt),e(wt,Ir),e(Ir,Ud),e(wt,jd),e(wt,Jr),e(Jr,Nd),e(wt,Zd),e(wt,Ur),e(Ur,Ad),e(wt,Qd),e(ye,Bd),e(ye,_n),e(_n,Vd),e(_n,jr),e(jr,Sd),e(_n,Wd),e(ye,Ld),e(ye,bt),e(bt,Gd),e(bt,zs),e(zs,Od),e(bt,Xd),e(bt,Ms),e(Ms,Hd),e(bt,Yd),e(bt,Fs),e(Fs,Kd),e(bt,ec),e(ye,tc),e(ye,Nr),e(Nr,oc),e(Nr,po),e(po,nc),e(po,vn),e(vn,rc),e(vn,Cs),f(o,Ia,m),f(o,qt,m),e(qt,ho),e(ho,qs),R(bn,qs,null),e(qt,sc),e(qt,Is),e(Is,ac),f(o,Ja,m),f(o,It,m),R(yn,It,null),e(It,ic),e(It,Tn),e(Tn,lc),e(Tn,Zr),e(Zr,dc),e(Tn,cc),f(o,Ua,m),f(o,Jt,m),R(wn,Jt,null),e(Jt,pc),e(Jt,Rn),e(Rn,hc),e(Rn,Ar),e(Ar,uc),e(Rn,fc),f(o,ja,m),f(o,Ut,m),R(En,Ut,null),e(Ut,mc),e(Ut,kn),e(kn,gc),e(kn,Qr),e(Qr,_c),e(kn,vc),f(o,Na,m),f(o,jt,m),e(jt,uo),e(uo,Js),R($n,Js,null),e(jt,bc),e(jt,Us),e(Us,yc),f(o,Za,m),f(o,Ve,m),R(Pn,Ve,null),e(Ve,Tc),e(Ve,js),e(js,wc),e(Ve,Rc),e(Ve,Dn),e(Dn,Ec),e(Dn,Br),e(Br,kc),e(Dn,$c),e(Ve,Pc),e(Ve,xn),e(xn,Dc),e(xn,zn),e(zn,xc),e(xn,zc),e(Ve,Mc),e(Ve,lt),R(Mn,lt,null),e(lt,Fc),e(lt,Nt),e(Nt,Cc),e(Nt,Vr),e(Vr,qc),e(Nt,Ic),e(Nt,Ns),e(Ns,Jc),e(Nt,Uc),e(lt,jc),R(fo,lt,null),e(lt,Nc),R(mo,lt,null),f(o,Aa,m),f(o,Zt,m),e(Zt,go),e(go,Zs),R(Fn,Zs,null),e(Zt,Zc),e(Zt,As),e(As,Ac),f(o,Qa,m),f(o,Se,m),R(Cn,Se,null),e(Se,Qc),e(Se,Qs),e(Qs,Bc),e(Se,Vc),e(Se,qn),e(qn,Sc),e(qn,Sr),e(Sr,Wc),e(qn,Lc),e(Se,Gc),e(Se,In),e(In,Oc),e(In,Jn),e(Jn,Xc),e(In,Hc),e(Se,Yc),e(Se,dt),R(Un,dt,null),e(dt,Kc),e(dt,At),e(At,ep),e(At,Wr),e(Wr,tp),e(At,op),e(At,Bs),e(Bs,np),e(At,rp),e(dt,sp),R(_o,dt,null),e(dt,ap),R(vo,dt,null),f(o,Ba,m),f(o,Qt,m),e(Qt,bo),e(bo,Vs),R(jn,Vs,null),e(Qt,ip),e(Qt,Ss),e(Ss,lp),f(o,Va,m),f(o,We,m),R(Nn,We,null),e(We,dp),e(We,Ws),e(Ws,cp),e(We,pp),e(We,Zn),e(Zn,hp),e(Zn,Lr),e(Lr,up),e(Zn,fp),e(We,mp),e(We,An),e(An,gp),e(An,Qn),e(Qn,_p),e(An,vp),e(We,bp),e(We,ct),R(Bn,ct,null),e(ct,yp),e(ct,Bt),e(Bt,Tp),e(Bt,Gr),e(Gr,wp),e(Bt,Rp),e(Bt,Ls),e(Ls,Ep),e(Bt,kp),e(ct,$p),R(yo,ct,null),e(ct,Pp),R(To,ct,null),f(o,Sa,m),f(o,Vt,m),e(Vt,wo),e(wo,Gs),R(Vn,Gs,null),e(Vt,Dp),e(Vt,Os),e(Os,xp),f(o,Wa,m),f(o,Te,m),R(Sn,Te,null),e(Te,zp),e(Te,Xs),e(Xs,Mp),e(Te,Fp),e(Te,Wn),e(Wn,Cp),e(Wn,Or),e(Or,qp),e(Wn,Ip),e(Te,Jp),e(Te,Ln),e(Ln,Up),e(Ln,Gn),e(Gn,jp),e(Ln,Np),e(Te,Zp),R(Ro,Te,null),e(Te,Ap),e(Te,pt),R(On,pt,null),e(pt,Qp),e(pt,St),e(St,Bp),e(St,Xr),e(Xr,Vp),e(St,Sp),e(St,Hs),e(Hs,Wp),e(St,Lp),e(pt,Gp),R(Eo,pt,null),e(pt,Op),R(ko,pt,null),f(o,La,m),f(o,Wt,m),e(Wt,$o),e($o,Ys),R(Xn,Ys,null),e(Wt,Xp),e(Wt,Ks),e(Ks,Hp),f(o,Ga,m),f(o,we,m),R(Hn,we,null),e(we,Yp),e(we,ea),e(ea,Kp),e(we,eh),e(we,Yn),e(Yn,th),e(Yn,Hr),e(Hr,oh),e(Yn,nh),e(we,rh),e(we,Kn),e(Kn,sh),e(Kn,er),e(er,ah),e(Kn,ih),e(we,lh),R(Po,we,null),e(we,dh),e(we,ht),R(tr,ht,null),e(ht,ch),e(ht,Lt),e(Lt,ph),e(Lt,Yr),e(Yr,hh),e(Lt,uh),e(Lt,ta),e(ta,fh),e(Lt,mh),e(ht,gh),R(Do,ht,null),e(ht,_h),R(xo,ht,null),f(o,Oa,m),f(o,Gt,m),e(Gt,zo),e(zo,oa),R(or,oa,null),e(Gt,vh),e(Gt,na),e(na,bh),f(o,Xa,m),f(o,Re,m),R(nr,Re,null),e(Re,yh),e(Re,ra),e(ra,Th),e(Re,wh),e(Re,rr),e(rr,Rh),e(rr,Kr),e(Kr,Eh),e(rr,kh),e(Re,$h),e(Re,sr),e(sr,Ph),e(sr,ar),e(ar,Dh),e(sr,xh),e(Re,zh),R(Mo,Re,null),e(Re,Mh),e(Re,ut),R(ir,ut,null),e(ut,Fh),e(ut,Ot),e(Ot,Ch),e(Ot,es),e(es,qh),e(Ot,Ih),e(Ot,sa),e(sa,Jh),e(Ot,Uh),e(ut,jh),R(Fo,ut,null),e(ut,Nh),R(Co,ut,null),Ha=!0},p(o,[m]){const lr={};m&2&&(lr.$$scope={dirty:m,ctx:o}),Yt.$set(lr);const aa={};m&2&&(aa.$$scope={dirty:m,ctx:o}),lo.$set(aa);const ia={};m&2&&(ia.$$scope={dirty:m,ctx:o}),fo.$set(ia);const la={};m&2&&(la.$$scope={dirty:m,ctx:o}),mo.$set(la);const dr={};m&2&&(dr.$$scope={dirty:m,ctx:o}),_o.$set(dr);const da={};m&2&&(da.$$scope={dirty:m,ctx:o}),vo.$set(da);const ca={};m&2&&(ca.$$scope={dirty:m,ctx:o}),yo.$set(ca);const cr={};m&2&&(cr.$$scope={dirty:m,ctx:o}),To.$set(cr);const pa={};m&2&&(pa.$$scope={dirty:m,ctx:o}),Ro.$set(pa);const ha={};m&2&&(ha.$$scope={dirty:m,ctx:o}),Eo.$set(ha);const ua={};m&2&&(ua.$$scope={dirty:m,ctx:o}),ko.$set(ua);const pr={};m&2&&(pr.$$scope={dirty:m,ctx:o}),Po.$set(pr);const fa={};m&2&&(fa.$$scope={dirty:m,ctx:o}),Do.$set(fa);const ma={};m&2&&(ma.$$scope={dirty:m,ctx:o}),xo.$set(ma);const ga={};m&2&&(ga.$$scope={dirty:m,ctx:o}),Mo.$set(ga);const _a={};m&2&&(_a.$$scope={dirty:m,ctx:o}),Fo.$set(_a);const Xt={};m&2&&(Xt.$$scope={dirty:m,ctx:o}),Co.$set(Xt)},i(o){Ha||(E(l.$$.fragment,o),E(ie.$$.fragment,o),E(J.$$.fragment,o),E(xe.$$.fragment,o),E(Yt.$$.fragment,o),E(Xo.$$.fragment,o),E(Ho.$$.fragment,o),E(Ko.$$.fragment,o),E(en.$$.fragment,o),E(nn.$$.fragment,o),E(rn.$$.fragment,o),E(an.$$.fragment,o),E(ln.$$.fragment,o),E(pn.$$.fragment,o),E(hn.$$.fragment,o),E(lo.$$.fragment,o),E(fn.$$.fragment,o),E(mn.$$.fragment,o),E(bn.$$.fragment,o),E(yn.$$.fragment,o),E(wn.$$.fragment,o),E(En.$$.fragment,o),E($n.$$.fragment,o),E(Pn.$$.fragment,o),E(Mn.$$.fragment,o),E(fo.$$.fragment,o),E(mo.$$.fragment,o),E(Fn.$$.fragment,o),E(Cn.$$.fragment,o),E(Un.$$.fragment,o),E(_o.$$.fragment,o),E(vo.$$.fragment,o),E(jn.$$.fragment,o),E(Nn.$$.fragment,o),E(Bn.$$.fragment,o),E(yo.$$.fragment,o),E(To.$$.fragment,o),E(Vn.$$.fragment,o),E(Sn.$$.fragment,o),E(Ro.$$.fragment,o),E(On.$$.fragment,o),E(Eo.$$.fragment,o),E(ko.$$.fragment,o),E(Xn.$$.fragment,o),E(Hn.$$.fragment,o),E(Po.$$.fragment,o),E(tr.$$.fragment,o),E(Do.$$.fragment,o),E(xo.$$.fragment,o),E(or.$$.fragment,o),E(nr.$$.fragment,o),E(Mo.$$.fragment,o),E(ir.$$.fragment,o),E(Fo.$$.fragment,o),E(Co.$$.fragment,o),Ha=!0)},o(o){k(l.$$.fragment,o),k(ie.$$.fragment,o),k(J.$$.fragment,o),k(xe.$$.fragment,o),k(Yt.$$.fragment,o),k(Xo.$$.fragment,o),k(Ho.$$.fragment,o),k(Ko.$$.fragment,o),k(en.$$.fragment,o),k(nn.$$.fragment,o),k(rn.$$.fragment,o),k(an.$$.fragment,o),k(ln.$$.fragment,o),k(pn.$$.fragment,o),k(hn.$$.fragment,o),k(lo.$$.fragment,o),k(fn.$$.fragment,o),k(mn.$$.fragment,o),k(bn.$$.fragment,o),k(yn.$$.fragment,o),k(wn.$$.fragment,o),k(En.$$.fragment,o),k($n.$$.fragment,o),k(Pn.$$.fragment,o),k(Mn.$$.fragment,o),k(fo.$$.fragment,o),k(mo.$$.fragment,o),k(Fn.$$.fragment,o),k(Cn.$$.fragment,o),k(Un.$$.fragment,o),k(_o.$$.fragment,o),k(vo.$$.fragment,o),k(jn.$$.fragment,o),k(Nn.$$.fragment,o),k(Bn.$$.fragment,o),k(yo.$$.fragment,o),k(To.$$.fragment,o),k(Vn.$$.fragment,o),k(Sn.$$.fragment,o),k(Ro.$$.fragment,o),k(On.$$.fragment,o),k(Eo.$$.fragment,o),k(ko.$$.fragment,o),k(Xn.$$.fragment,o),k(Hn.$$.fragment,o),k(Po.$$.fragment,o),k(tr.$$.fragment,o),k(Do.$$.fragment,o),k(xo.$$.fragment,o),k(or.$$.fragment,o),k(nr.$$.fragment,o),k(Mo.$$.fragment,o),k(ir.$$.fragment,o),k(Fo.$$.fragment,o),k(Co.$$.fragment,o),Ha=!1},d(o){t(h),o&&t(y),o&&t(_),$(l),o&&t(Ee),o&&t(U),o&&t(G),o&&t(Y),$(ie),o&&t(ke),o&&t(N),o&&t(I),o&&t(he),o&&t($e),o&&t(ue),o&&t(Pe),o&&t(M),o&&t(Q),o&&t(fe),o&&t(De),o&&t(te),o&&t(Xe),o&&t(me),$(J),o&&t(O),o&&t(V),$(xe),$(Yt),o&&t(Ra),o&&t(Dt),$(Xo),o&&t(Ea),o&&t(Ye),$(Ho),o&&t(ka),o&&t(xt),$(Ko),o&&t($a),o&&t(Ke),$(en),o&&t(Pa),o&&t(zt),$(nn),o&&t(Da),o&&t(et),$(rn),o&&t(xa),o&&t(Mt),$(an),o&&t(za),o&&t(tt),$(ln),o&&t(Ma),o&&t(Ft),$(pn),o&&t(Fa),o&&t(be),$(hn),$(lo),o&&t(Ca),o&&t(Ct),$(fn),o&&t(qa),o&&t(ye),$(mn),o&&t(Ia),o&&t(qt),$(bn),o&&t(Ja),o&&t(It),$(yn),o&&t(Ua),o&&t(Jt),$(wn),o&&t(ja),o&&t(Ut),$(En),o&&t(Na),o&&t(jt),$($n),o&&t(Za),o&&t(Ve),$(Pn),$(Mn),$(fo),$(mo),o&&t(Aa),o&&t(Zt),$(Fn),o&&t(Qa),o&&t(Se),$(Cn),$(Un),$(_o),$(vo),o&&t(Ba),o&&t(Qt),$(jn),o&&t(Va),o&&t(We),$(Nn),$(Bn),$(yo),$(To),o&&t(Sa),o&&t(Vt),$(Vn),o&&t(Wa),o&&t(Te),$(Sn),$(Ro),$(On),$(Eo),$(ko),o&&t(La),o&&t(Wt),$(Xn),o&&t(Ga),o&&t(we),$(Hn),$(Po),$(tr),$(Do),$(xo),o&&t(Oa),o&&t(Gt),$(or),o&&t(Xa),o&&t(Re),$(nr),$(Mo),$(ir),$(Fo),$(Co)}}}const Dm={local:"dpr",sections:[{local:"overview",title:"Overview"},{local:"transformers.DPRConfig",title:"DPRConfig"},{local:"transformers.DPRContextEncoderTokenizer",title:"DPRContextEncoderTokenizer"},{local:"transformers.DPRContextEncoderTokenizerFast",title:"DPRContextEncoderTokenizerFast"},{local:"transformers.DPRQuestionEncoderTokenizer",title:"DPRQuestionEncoderTokenizer"},{local:"transformers.DPRQuestionEncoderTokenizerFast",title:"DPRQuestionEncoderTokenizerFast"},{local:"transformers.DPRReaderTokenizer",title:"DPRReaderTokenizer"},{local:"transformers.DPRReaderTokenizerFast",title:"DPRReaderTokenizerFast"},{local:"transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput",title:"DPR specific outputs"},{local:"transformers.DPRContextEncoder",title:"DPRContextEncoder"},{local:"transformers.DPRQuestionEncoder",title:"DPRQuestionEncoder"},{local:"transformers.DPRReader",title:"DPRReader"},{local:"transformers.TFDPRContextEncoder",title:"TFDPRContextEncoder"},{local:"transformers.TFDPRQuestionEncoder",title:"TFDPRQuestionEncoder"},{local:"transformers.TFDPRReader",title:"TFDPRReader"}],title:"DPR"};function xm(F){return dm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jm extends sm{constructor(h){super();am(this,h,xm,Pm,im,{})}}export{Jm as default,Dm as metadata};
