import{S as rf,i as sf,s as af,e as s,k as c,w as T,t as n,M as lf,c as a,d as t,m as p,a as i,x as w,h as r,b as d,N as nf,G as e,g as m,y as R,q as E,o as k,B as $,v as df,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 Oo}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 cf(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 pf(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 hf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function uf(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 mf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function ff(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 gf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function _f(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 vf(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Oe,L,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,O,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,me,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()"),Oe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=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: "),O=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"),me=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),Oe=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a(x,"CODE",{});var Xe=i(L);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 fe=i(S);ie=r(fe,"fit()"),fe.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 Le=i(N);Ie=r(Le,"Functional"),Le.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 Ge=i(K);$e=r(Ge,"input_ids"),Ge.forEach(t),ue=r(ne," only and nothing else: "),O=a(ne,"CODE",{});var at=i(O);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var G=i(M);Ue=r(G,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(G,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(G," or "),A=a(G,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),G.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);me=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){m(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),m(v,l,D),m(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),m(v,H,D),m(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Oe),e(P,L),e(L,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),m(v,pe,D),m(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,O),e(O,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,me),e(Q,ee),e(ee,De),m(v,te,D),m(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 bf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function yf(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 Tf(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Oe,L,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,O,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,me,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()"),Oe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=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: "),O=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"),me=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),Oe=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a(x,"CODE",{});var Xe=i(L);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 fe=i(S);ie=r(fe,"fit()"),fe.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 Le=i(N);Ie=r(Le,"Functional"),Le.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 Ge=i(K);$e=r(Ge,"input_ids"),Ge.forEach(t),ue=r(ne," only and nothing else: "),O=a(ne,"CODE",{});var at=i(O);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var G=i(M);Ue=r(G,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(G,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(G," or "),A=a(G,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),G.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);me=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){m(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),m(v,l,D),m(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),m(v,H,D),m(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Oe),e(P,L),e(L,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),m(v,pe,D),m(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,O),e(O,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,me),e(Q,ee),e(ee,De),m(v,te,D),m(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 wf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function Rf(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 Ef(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Oe,L,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,O,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,me,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()"),Oe=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=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: "),O=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"),me=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),Oe=r(x,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),L=a(x,"CODE",{});var Xe=i(L);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 fe=i(S);ie=r(fe,"fit()"),fe.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 Le=i(N);Ie=r(Le,"Functional"),Le.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 Ge=i(K);$e=r(Ge,"input_ids"),Ge.forEach(t),ue=r(ne," only and nothing else: "),O=a(ne,"CODE",{});var at=i(O);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=p(J),M=a(J,"LI",{});var G=i(M);Ue=r(G,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(G,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(G," or "),A=a(G,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),G.forEach(t),Ae=p(J),Q=a(J,"LI",{});var Be=i(Q);me=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){m(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),m(v,l,D),m(v,u,D),e(u,z),e(z,Me),e(u,Ee),e(u,U),e(U,de),m(v,H,D),m(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,Oe),e(P,L),e(L,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),m(v,pe,D),m(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,O),e(O,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,me),e(Q,ee),e(ee,De),m(v,te,D),m(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 kf(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){m(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function $f(F){let h,y,_,g,b;return g=new Oo({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){m(l,h,u),e(h,y),m(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 Pf(F){let h,y,_,g,b,l,u,z,Me,Ee,U,de,H,P,Fe,B,ce,Oe,L,Y,se,S,ie,Ce,W,qe,ke,N,Ie,le,pe,C,I,he,K,$e,ue,O,Je,Pe,M,Ue,Z,je,Ne,A,Ze,Ae,Q,me,ee,De,te,q,ge,j,Qe,oe,v,D,ot,ae,nt,rt,x,st,Xe,fe,_e,Le,J,ne,Ge,at,G,V,xe,Be,ve,re,it,Ai,ls,Qi,Bi,Vi,He,Si,fr,Wi,Oi,gr,Li,Gi,_r,Xi,Hi,Lo,Yi,Ki,el,Go,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,ml,Yo,fl,Tr,gl,_l,ka,xt,to,hs,Ko,vl,us,bl,$a,Ke,en,yl,tn,Tl,ms,wl,Rl,El,oo,wr,kl,$l,Rr,Pl,Dl,xl,on,zl,Er,Ml,Fl,Pa,zt,no,fs,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,Ol,za,tt,ln,Ll,dn,Gl,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,md,fd,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,mn,zd,Ds,Md,qa,ye,fn,Fd,gn,Cd,xs,qd,Id,Jd,wt,Ir,Ud,jd,Jr,Nd,Zd,Ur,Ad,Qd,Bd,_n,Vd,jr,Sd,Wd,Od,bt,Ld,zs,Gd,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,mc,ja,Ut,En,fc,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,mo,Nc,fo,Aa,Zt,go,Zs,Fn,Zc,As,Ac,Qa,Se,Cn,Qc,Qs,Bc,Vc,qn,Sc,Sr,Wc,Oc,Lc,In,Gc,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,Or,up,mp,fp,An,gp,Qn,_p,vp,bp,ct,Bn,yp,Bt,Tp,Lr,wp,Rp,Os,Ep,kp,$p,yo,Pp,To,Sa,Vt,wo,Ls,Vn,Dp,Gs,xp,Wa,Te,Sn,zp,Xs,Mp,Fp,Wn,Cp,Gr,qp,Ip,Jp,On,Up,Ln,jp,Np,Zp,Ro,Ap,pt,Gn,Qp,St,Bp,Xr,Vp,Sp,Hs,Wp,Op,Lp,Eo,Gp,ko,Oa,Wt,$o,Ys,Xn,Xp,Ks,Hp,La,we,Hn,Yp,ea,Kp,eh,Yn,th,Hr,oh,nh,rh,Kn,sh,er,ah,ih,lh,Po,dh,ht,tr,ch,Ot,ph,Yr,hh,uh,ta,mh,fh,gh,Do,_h,xo,Ga,Lt,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,Gt,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/main/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/main/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/main/src/transformers/models/dpr/configuration_dpr.py#L45"}}),Yt=new So({props:{anchor:"transformers.DPRConfig.example",$$slots:{default:[cf]},$$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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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:[pf]},$$scope:{ctx:F}}}),mn=new ze({}),fn=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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/src/transformers/models/dpr/modeling_dpr.py#L449",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mo=new Ht({props:{$$slots:{default:[hf]},$$scope:{ctx:F}}}),fo=new So({props:{anchor:"transformers.DPRContextEncoder.forward.example",$$slots:{default:[uf]},$$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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/src/transformers/models/dpr/modeling_dpr.py#L530",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[mf]},$$scope:{ctx:F}}}),vo=new So({props:{anchor:"transformers.DPRQuestionEncoder.forward.example",$$slots:{default:[ff]},$$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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/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:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = 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/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/dpr/modeling_dpr.py#L612",returnDescription:`
<p>A <a
  href="/docs/transformers/main/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/main/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/main/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:[gf]},$$scope:{ctx:F}}}),To=new So({props:{anchor:"transformers.DPRReader.forward.example",$$slots:{default:[_f]},$$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/main/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/main/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/main/src/transformers/models/dpr/modeling_tf_dpr.py#L526"}}),Ro=new Ht({props:{$$slots:{default:[vf]},$$scope:{ctx:F}}}),Gn=new X({props:{name:"call",anchor:"transformers.TFDPRContextEncoder.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = 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:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = 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/main/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/main/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:[bf]},$$scope:{ctx:F}}}),ko=new So({props:{anchor:"transformers.TFDPRContextEncoder.call.example",$$slots:{default:[yf]},$$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/main/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/main/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/main/src/transformers/models/dpr/modeling_tf_dpr.py#L607"}}),Po=new Ht({props:{$$slots:{default:[Tf]},$$scope:{ctx:F}}}),tr=new X({props:{name:"call",anchor:"transformers.TFDPRQuestionEncoder.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = 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:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = 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/main/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/main/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:[wf]},$$scope:{ctx:F}}}),xo=new So({props:{anchor:"transformers.TFDPRQuestionEncoder.call.example",$$slots:{default:[Rf]},$$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/main/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/main/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/main/src/transformers/models/dpr/modeling_tf_dpr.py#L687"}}),Mo=new Ht({props:{$$slots:{default:[Ef]},$$scope:{ctx:F}}}),ir=new X({props:{name:"call",anchor:"transformers.TFDPRReader.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool | None = None"},{name:"output_hidden_states",val:": bool | None = None"},{name:"return_dict",val:": bool | None = 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/main/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/main/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/main/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/main/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:[kf]},$$scope:{ctx:F}}}),Co=new So({props:{anchor:"transformers.TFDPRReader.call.example",$$slots:{default:[$f]},$$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"),L=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"),O=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(),me=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(),fe=s("h2"),_e=s("a"),Le=s("span"),T(J.$$.fragment),ne=c(),Ge=s("span"),at=n("DPRConfig"),G=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 "),fr=s("a"),Wi=n("DPRContextEncoder"),Oi=n(", "),gr=s("a"),Li=n("DPRQuestionEncoder"),Gi=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
`),Lo=s("a"),Yi=n("facebook/dpr-ctx_encoder-single-nq-base"),Ki=n(`
architecture.`),el=c(),Go=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.`),ml=c(),Yo=s("p"),fl=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 "),ms=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"),fs=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"),Ol=n("DPRQuestionEncoderTokenizerFast"),za=c(),tt=s("div"),T(ln.$$.fragment),Ll=c(),dn=s("p"),Gl=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"),md=n("BertTokenizer"),fd=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(mn.$$.fragment),zd=c(),Ds=s("span"),Md=n("DPRReaderTokenizerFast"),qa=c(),ye=s("div"),T(fn.$$.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."),Od=c(),bt=s("p"),Ld=n("Return a dictionary with the token ids of the input strings and other information to give to "),zs=s("code"),Gd=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"),mc=n("."),ja=c(),Ut=s("div"),T(En.$$.fragment),fc=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(mo.$$.fragment),Nc=c(),T(fo.$$.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"),Oc=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.)`),Lc=c(),In=s("p"),Gc=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 "),Or=s("a"),up=n("PreTrainedModel"),mp=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.)`),fp=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 "),Lr=s("a"),wp=n("DPRReader"),Rp=n(" forward method, overrides the "),Os=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"),Ls=s("span"),T(Vn.$$.fragment),Dp=c(),Gs=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 "),Gr=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(),On=s("p"),Up=n("This model is also a Tensorflow "),Ln=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(Gn.$$.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__"),Op=n(" special method."),Lp=c(),T(Eo.$$.fragment),Gp=c(),T(ko.$$.fragment),Oa=c(),Wt=s("h2"),$o=s("a"),Ys=s("span"),T(Xn.$$.fragment),Xp=c(),Ks=s("span"),Hp=n("TFDPRQuestionEncoder"),La=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(),Ot=s("p"),ph=n("The "),Yr=s("a"),hh=n("TFDPRQuestionEncoder"),uh=n(" forward method, overrides the "),ta=s("code"),mh=n("__call__"),fh=n(" special method."),gh=c(),T(Do.$$.fragment),_h=c(),T(xo.$$.fragment),Ga=c(),Lt=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(),Gt=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 f=lf('[data-svelte="svelte-1phssyn"]',document.head);h=a(f,"META",{name:!0,content:!0}),f.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),L=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 ma=i(le);pe=r(ma,"Dense Passage Retrieval for Open-Domain Question Answering"),ma.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 fa=i(he);K=r(fa,"The abstract from the paper is the following:"),fa.forEach(t),$e=p(o),ue=a(o,"P",{});var ga=i(ue);O=a(ga,"EM",{});var _a=i(O);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),me=a(o,"P",{});var Sh=i(me);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 Oh=i(ge);j=r(Oh,"DPR consists in three models:"),Oh.forEach(t),Qe=p(Ya),oe=a(Ya,"UL",{});var ts=i(oe);v=a(ts,"LI",{});var Lh=i(v);D=r(Lh,"Question encoder: encode questions as vectors"),Lh.forEach(t),ot=p(ts),ae=a(ts,"LI",{});var Gh=i(ae);nt=r(Gh,"Context encoder: encode contexts as vectors"),Gh.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),fe=a(o,"H2",{class:!0});var Ka=i(fe);_e=a(Ka,"A",{id:!0,class:!0,href:!0});var Hh=i(_e);Le=a(Hh,"SPAN",{});var Yh=i(Le);w(J.$$.fragment,Yh),Yh.forEach(t),Hh.forEach(t),ne=p(Ka),Ge=a(Ka,"SPAN",{});var Kh=i(Ge);at=r(Kh,"DPRConfig"),Kh.forEach(t),Ka.forEach(t),G=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 "),fr=a(Et,"A",{href:!0});var ou=i(fr);Wi=r(ou,"DPRContextEncoder"),ou.forEach(t),Oi=r(Et,", "),gr=a(Et,"A",{href:!0});var nu=i(gr);Li=r(nu,"DPRQuestionEncoder"),nu.forEach(t),Gi=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
`),Lo=a(Et,"A",{href:!0,rel:!0});var su=i(Lo);Yi=r(su,"facebook/dpr-ctx_encoder-single-nq-base"),su.forEach(t),Ki=r(Et,`
architecture.`),Et.forEach(t),el=p(Rt),Go=a(Rt,"P",{});var ei=i(Go);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),ml=p(qo),Yo=a(qo,"P",{});var oi=i(Yo);fl=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 mu=i(to);hs=a(mu,"SPAN",{});var fu=i(hs);w(Ko.$$.fragment,fu),fu.forEach(t),mu.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 "),ms=a(ri,"EM",{});var _u=i(ms);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);fs=a(Tu,"SPAN",{});var wu=i(fs);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);Ol=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),Ll=p(Uo),dn=a(Uo,"P",{});var di=i(dn);Gl=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 mt=i(be);w(hn.$$.fragment,mt),dd=p(mt),Rs=a(mt,"P",{});var ju=i(Rs);cd=r(ju,"Construct a DPRReader tokenizer."),ju.forEach(t),pd=p(mt),yt=a(mt,"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);md=r(Zu,"BertTokenizer"),Zu.forEach(t),fd=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(mt),un=a(mt,"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(mt),Tt=a(mt,"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(mt),w(lo.$$.fragment,mt),mt.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 Ou=i(Ps);w(mn.$$.fragment,Ou),Ou.forEach(t),Wu.forEach(t),zd=p(ui),Ds=a(ui,"SPAN",{});var Lu=i(Ds);Md=r(Lu,"DPRReaderTokenizerFast"),Lu.forEach(t),ui.forEach(t),qa=p(o),ye=a(o,"DIV",{class:!0});var ft=i(ye);w(fn.$$.fragment,ft),Fd=p(ft),gn=a(ft,"P",{});var mi=i(gn);Cd=r(mi,"Constructs a \u201Cfast\u201D DPRReader tokenizer (backed by HuggingFace\u2019s "),xs=a(mi,"EM",{});var Gu=i(xs);qd=r(Gu,"tokenizers"),Gu.forEach(t),Id=r(mi," library)."),mi.forEach(t),Jd=p(ft),wt=a(ft,"P",{});var mr=i(wt);Ir=a(mr,"A",{href:!0});var Xu=i(Ir);Ud=r(Xu,"DPRReaderTokenizerFast"),Xu.forEach(t),jd=r(mr," is almost identical to "),Jr=a(mr,"A",{href:!0});var Hu=i(Jr);Nd=r(Hu,"BertTokenizerFast"),Hu.forEach(t),Zd=r(mr,` 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(mr,"A",{href:!0});var Yu=i(Ur);Ad=r(Yu,"DPRReader"),Yu.forEach(t),Qd=r(mr," model."),mr.forEach(t),Bd=p(ft),_n=a(ft,"P",{});var fi=i(_n);Vd=r(fi,"Refer to superclass "),jr=a(fi,"A",{href:!0});var Ku=i(jr);Sd=r(Ku,"BertTokenizerFast"),Ku.forEach(t),Wd=r(fi," for usage examples and documentation concerning parameters."),fi.forEach(t),Od=p(ft),bt=a(ft,"P",{});var jo=i(bt);Ld=r(jo,"Return a dictionary with the token ids of the input strings and other information to give to "),zs=a(jo,"CODE",{});var em=i(zs);Gd=r(em,".decode_best_spans"),em.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 tm=i(Ms);Hd=r(tm,"input_ids"),tm.forEach(t),Yd=r(jo," is a matrix of size "),Fs=a(jo,"CODE",{});var om=i(Fs);Kd=r(om,"(n_passages, sequence_length)"),om.forEach(t),ec=r(jo,`
with the format:`),jo.forEach(t),tc=p(ft),Nr=a(ft,"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),ft.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 nm=i(ho);qs=a(nm,"SPAN",{});var rm=i(qs);w(bn.$$.fragment,rm),rm.forEach(t),nm.forEach(t),sc=p(gi),Is=a(gi,"SPAN",{});var sm=i(Is);ac=r(sm,"DPR specific outputs"),sm.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 am=i(Zr);dc=r(am,"DPRQuestionEncoder"),am.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 im=i(Ar);uc=r(im,"DPRQuestionEncoder"),im.forEach(t),mc=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),fc=p(Ti),kn=a(Ti,"P",{});var wi=i(kn);gc=r(wi,"Class for outputs of "),Qr=a(wi,"A",{href:!0});var lm=i(Qr);_c=r(lm,"DPRQuestionEncoder"),lm.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 dm=i(uo);Js=a(dm,"SPAN",{});var cm=i(Js);w($n.$$.fragment,cm),cm.forEach(t),dm.forEach(t),bc=p(Ri),Us=a(Ri,"SPAN",{});var pm=i(Us);yc=r(pm,"DPRContextEncoder"),pm.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 hm=i(js);wc=r(hm,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),hm.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 um=i(Br);kc=r(um,"PreTrainedModel"),um.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 mm=i(zn);xc=r(mm,"torch.nn.Module"),mm.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 fm=i(Vr);qc=r(fm,"DPRContextEncoder"),fm.forEach(t),Ic=r(os," forward method, overrides the "),Ns=a(os,"CODE",{});var gm=i(Ns);Jc=r(gm,"__call__"),gm.forEach(t),Uc=r(os," special method."),os.forEach(t),jc=p(No),w(mo.$$.fragment,No),Nc=p(No),w(fo.$$.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 _m=i(go);Zs=a(_m,"SPAN",{});var vm=i(Zs);w(Fn.$$.fragment,vm),vm.forEach(t),_m.forEach(t),Zc=p($i),As=a($i,"SPAN",{});var bm=i(As);Ac=r(bm,"DPRQuestionEncoder"),bm.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 ym=i(Qs);Bc=r(ym,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),ym.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 Tm=i(Sr);Wc=r(Tm,"PreTrainedModel"),Tm.forEach(t),Oc=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),Lc=p($t),In=a($t,"P",{});var Di=i(In);Gc=r(Di,"This model is also a PyTorch "),Jn=a(Di,"A",{href:!0,rel:!0});var wm=i(Jn);Xc=r(wm,"torch.nn.Module"),wm.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 Rm=i(Wr);tp=r(Rm,"DPRQuestionEncoder"),Rm.forEach(t),op=r(ns," forward method, overrides the "),Bs=a(ns,"CODE",{});var Em=i(Bs);np=r(Em,"__call__"),Em.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 km=i(bo);Vs=a(km,"SPAN",{});var $m=i(Vs);w(jn.$$.fragment,$m),$m.forEach(t),km.forEach(t),ip=p(xi),Ss=a(xi,"SPAN",{});var Pm=i(Ss);lp=r(Pm,"DPRReader"),Pm.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 Dm=i(Ws);cp=r(Dm,"The bare DPRReader transformer outputting span predictions."),Dm.forEach(t),pp=p(Pt),Zn=a(Pt,"P",{});var zi=i(Zn);hp=r(zi,"This model inherits from "),Or=a(zi,"A",{href:!0});var xm=i(Or);up=r(xm,"PreTrainedModel"),xm.forEach(t),mp=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),fp=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 zm=i(Qn);_p=r(zm,"torch.nn.Module"),zm.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 "),Lr=a(rs,"A",{href:!0});var Mm=i(Lr);wp=r(Mm,"DPRReader"),Mm.forEach(t),Rp=r(rs," forward method, overrides the "),Os=a(rs,"CODE",{});var Fm=i(Os);Ep=r(Fm,"__call__"),Fm.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 Cm=i(wo);Ls=a(Cm,"SPAN",{});var qm=i(Ls);w(Vn.$$.fragment,qm),qm.forEach(t),Cm.forEach(t),Dp=p(Fi),Gs=a(Fi,"SPAN",{});var Im=i(Gs);xp=r(Im,"TFDPRContextEncoder"),Im.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 Jm=i(Xs);Mp=r(Jm,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),Jm.forEach(t),Fp=p(gt),Wn=a(gt,"P",{});var Ci=i(Wn);Cp=r(Ci,"This model inherits from "),Gr=a(Ci,"A",{href:!0});var Um=i(Gr);qp=r(Um,"TFPreTrainedModel"),Um.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),On=a(gt,"P",{});var qi=i(On);Up=r(qi,"This model is also a Tensorflow "),Ln=a(qi,"A",{href:!0,rel:!0});var jm=i(Ln);jp=r(jm,"tf.keras.Model"),jm.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(Gn.$$.fragment,Qo),Qp=p(Qo),St=a(Qo,"P",{});var ss=i(St);Bp=r(ss,"The "),Xr=a(ss,"A",{href:!0});var Nm=i(Xr);Vp=r(Nm,"TFDPRContextEncoder"),Nm.forEach(t),Sp=r(ss," forward method, overrides the "),Hs=a(ss,"CODE",{});var Zm=i(Hs);Wp=r(Zm,"__call__"),Zm.forEach(t),Op=r(ss," special method."),ss.forEach(t),Lp=p(Qo),w(Eo.$$.fragment,Qo),Gp=p(Qo),w(ko.$$.fragment,Qo),Qo.forEach(t),gt.forEach(t),Oa=p(o),Wt=a(o,"H2",{class:!0});var Ii=i(Wt);$o=a(Ii,"A",{id:!0,class:!0,href:!0});var Am=i($o);Ys=a(Am,"SPAN",{});var Qm=i(Ys);w(Xn.$$.fragment,Qm),Qm.forEach(t),Am.forEach(t),Xp=p(Ii),Ks=a(Ii,"SPAN",{});var Bm=i(Ks);Hp=r(Bm,"TFDPRQuestionEncoder"),Bm.forEach(t),Ii.forEach(t),La=p(o),we=a(o,"DIV",{class:!0});var _t=i(we);w(Hn.$$.fragment,_t),Yp=p(_t),ea=a(_t,"P",{});var Vm=i(ea);Kp=r(Vm,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Vm.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 Sm=i(Hr);oh=r(Sm,"TFPreTrainedModel"),Sm.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 Wm=i(er);ah=r(Wm,"tf.keras.Model"),Wm.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),Ot=a(Bo,"P",{});var as=i(Ot);ph=r(as,"The "),Yr=a(as,"A",{href:!0});var Om=i(Yr);hh=r(Om,"TFDPRQuestionEncoder"),Om.forEach(t),uh=r(as," forward method, overrides the "),ta=a(as,"CODE",{});var Lm=i(ta);mh=r(Lm,"__call__"),Lm.forEach(t),fh=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),Ga=p(o),Lt=a(o,"H2",{class:!0});var ji=i(Lt);zo=a(ji,"A",{id:!0,class:!0,href:!0});var Gm=i(zo);oa=a(Gm,"SPAN",{});var Xm=i(oa);w(or.$$.fragment,Xm),Xm.forEach(t),Gm.forEach(t),vh=p(ji),na=a(ji,"SPAN",{});var Hm=i(na);bh=r(Hm,"TFDPRReader"),Hm.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 Ym=i(ra);Th=r(Ym,"The bare DPRReader transformer outputting span predictions."),Ym.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 Km=i(Kr);Eh=r(Km,"TFPreTrainedModel"),Km.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 ef=i(ar);Dh=r(ef,"tf.keras.Model"),ef.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),Gt=a(Vo,"P",{});var is=i(Gt);Ch=r(is,"The "),es=a(is,"A",{href:!0});var tf=i(es);qh=r(tf,"TFDPRReader"),tf.forEach(t),Ih=r(is," forward method, overrides the "),sa=a(is,"CODE",{});var of=i(sa);Jh=r(of,"__call__"),of.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(Df)),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"),nf(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"),nf(ce.src,Oe="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||d(ce,"src",Oe),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(fe,"class","relative group"),d(re,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRConfig"),d(fr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRContextEncoder"),d(gr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),d(_r,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),d(Lo,"href","https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base"),d(Lo,"rel","nofollow"),d(vr,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRContextEncoderTokenizer"),d(yr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),d(Tr,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRContextEncoderTokenizerFast"),d(Rr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),d(Er,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizer"),d($r,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),d(Pr,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizerFast"),d(xr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),d(zr,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRReaderTokenizer"),d(Fr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),d(Cr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),d(qr,"href","/docs/transformers/main/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/main/en/model_doc/dpr#transformers.DPRReaderTokenizerFast"),d(Jr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),d(Ur,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),d(jr,"href","/docs/transformers/main/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/main/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/main/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/main/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/main/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/main/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/main/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/main/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(Or,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Qn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Qn,"rel","nofollow"),d(Lr,"href","/docs/transformers/main/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(Gr,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),d(Ln,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),d(Ln,"rel","nofollow"),d(Xr,"href","/docs/transformers/main/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/main/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/main/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(Lt,"class","relative group"),d(Kr,"href","/docs/transformers/main/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/main/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,f){e(document.head,h),m(o,y,f),m(o,_,f),e(_,g),e(g,b),R(l,b,null),e(_,u),e(_,z),e(z,Me),m(o,Ee,f),m(o,U,f),e(U,de),e(de,H),e(U,Fe),e(U,B),e(B,ce),m(o,L,f),m(o,Y,f),e(Y,se),e(se,S),R(ie,S,null),e(Y,Ce),e(Y,W),e(W,qe),m(o,ke,f),m(o,N,f),e(N,Ie),e(N,le),e(le,pe),e(N,C),m(o,I,f),m(o,he,f),e(he,K),m(o,$e,f),m(o,ue,f),e(ue,O),e(O,Je),m(o,Pe,f),m(o,M,f),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(M,Ae),m(o,Q,f),m(o,me,f),e(me,ee),m(o,De,f),m(o,te,f),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),m(o,Xe,f),m(o,fe,f),e(fe,_e),e(_e,Le),R(J,Le,null),e(fe,ne),e(fe,Ge),e(Ge,at),m(o,G,f),m(o,V,f),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,fr),e(fr,Wi),e(He,Oi),e(He,gr),e(gr,Li),e(He,Gi),e(He,_r),e(_r,Xi),e(He,Hi),e(He,Lo),e(Lo,Yi),e(He,Ki),e(V,el),e(V,Go),e(Go,tl),e(Go,vr),e(vr,ol),e(Go,nl),e(V,rl),R(Yt,V,null),m(o,Ra,f),m(o,Dt,f),e(Dt,Kt),e(Kt,ds),R(Xo,ds,null),e(Dt,sl),e(Dt,cs),e(cs,al),m(o,Ea,f),m(o,Ye,f),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,ml),e(Ye,Yo),e(Yo,fl),e(Yo,Tr),e(Tr,gl),e(Yo,_l),m(o,ka,f),m(o,xt,f),e(xt,to),e(to,hs),R(Ko,hs,null),e(xt,vl),e(xt,us),e(us,bl),m(o,$a,f),m(o,Ke,f),R(en,Ke,null),e(Ke,yl),e(Ke,tn),e(tn,Tl),e(tn,ms),e(ms,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),m(o,Pa,f),m(o,zt,f),e(zt,no),e(no,fs),R(nn,fs,null),e(zt,Cl),e(zt,gs),e(gs,ql),m(o,Da,f),m(o,et,f),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),m(o,xa,f),m(o,Mt,f),e(Mt,so),e(so,vs),R(an,vs,null),e(Mt,Wl),e(Mt,bs),e(bs,Ol),m(o,za,f),m(o,tt,f),R(ln,tt,null),e(tt,Ll),e(tt,dn),e(dn,Gl),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),m(o,Ma,f),m(o,Ft,f),e(Ft,io),e(io,Ts),R(pn,Ts,null),e(Ft,id),e(Ft,ws),e(ws,ld),m(o,Fa,f),m(o,be,f),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,md),e(yt,fd),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),m(o,Ca,f),m(o,Ct,f),e(Ct,co),e(co,Ps),R(mn,Ps,null),e(Ct,zd),e(Ct,Ds),e(Ds,Md),m(o,qa,f),m(o,ye,f),R(fn,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,Od),e(ye,bt),e(bt,Ld),e(bt,zs),e(zs,Gd),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),m(o,Ia,f),m(o,qt,f),e(qt,ho),e(ho,qs),R(bn,qs,null),e(qt,sc),e(qt,Is),e(Is,ac),m(o,Ja,f),m(o,It,f),R(yn,It,null),e(It,ic),e(It,Tn),e(Tn,lc),e(Tn,Zr),e(Zr,dc),e(Tn,cc),m(o,Ua,f),m(o,Jt,f),R(wn,Jt,null),e(Jt,pc),e(Jt,Rn),e(Rn,hc),e(Rn,Ar),e(Ar,uc),e(Rn,mc),m(o,ja,f),m(o,Ut,f),R(En,Ut,null),e(Ut,fc),e(Ut,kn),e(kn,gc),e(kn,Qr),e(Qr,_c),e(kn,vc),m(o,Na,f),m(o,jt,f),e(jt,uo),e(uo,Js),R($n,Js,null),e(jt,bc),e(jt,Us),e(Us,yc),m(o,Za,f),m(o,Ve,f),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(mo,lt,null),e(lt,Nc),R(fo,lt,null),m(o,Aa,f),m(o,Zt,f),e(Zt,go),e(go,Zs),R(Fn,Zs,null),e(Zt,Zc),e(Zt,As),e(As,Ac),m(o,Qa,f),m(o,Se,f),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,Oc),e(Se,Lc),e(Se,In),e(In,Gc),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),m(o,Ba,f),m(o,Qt,f),e(Qt,bo),e(bo,Vs),R(jn,Vs,null),e(Qt,ip),e(Qt,Ss),e(Ss,lp),m(o,Va,f),m(o,We,f),R(Nn,We,null),e(We,dp),e(We,Ws),e(Ws,cp),e(We,pp),e(We,Zn),e(Zn,hp),e(Zn,Or),e(Or,up),e(Zn,mp),e(We,fp),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,Lr),e(Lr,wp),e(Bt,Rp),e(Bt,Os),e(Os,Ep),e(Bt,kp),e(ct,$p),R(yo,ct,null),e(ct,Pp),R(To,ct,null),m(o,Sa,f),m(o,Vt,f),e(Vt,wo),e(wo,Ls),R(Vn,Ls,null),e(Vt,Dp),e(Vt,Gs),e(Gs,xp),m(o,Wa,f),m(o,Te,f),R(Sn,Te,null),e(Te,zp),e(Te,Xs),e(Xs,Mp),e(Te,Fp),e(Te,Wn),e(Wn,Cp),e(Wn,Gr),e(Gr,qp),e(Wn,Ip),e(Te,Jp),e(Te,On),e(On,Up),e(On,Ln),e(Ln,jp),e(On,Np),e(Te,Zp),R(Ro,Te,null),e(Te,Ap),e(Te,pt),R(Gn,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,Op),e(pt,Lp),R(Eo,pt,null),e(pt,Gp),R(ko,pt,null),m(o,Oa,f),m(o,Wt,f),e(Wt,$o),e($o,Ys),R(Xn,Ys,null),e(Wt,Xp),e(Wt,Ks),e(Ks,Hp),m(o,La,f),m(o,we,f),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,Ot),e(Ot,ph),e(Ot,Yr),e(Yr,hh),e(Ot,uh),e(Ot,ta),e(ta,mh),e(Ot,fh),e(ht,gh),R(Do,ht,null),e(ht,_h),R(xo,ht,null),m(o,Ga,f),m(o,Lt,f),e(Lt,zo),e(zo,oa),R(or,oa,null),e(Lt,vh),e(Lt,na),e(na,bh),m(o,Xa,f),m(o,Re,f),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,Gt),e(Gt,Ch),e(Gt,es),e(es,qh),e(Gt,Ih),e(Gt,sa),e(sa,Jh),e(Gt,Uh),e(ut,jh),R(Fo,ut,null),e(ut,Nh),R(Co,ut,null),Ha=!0},p(o,[f]){const lr={};f&2&&(lr.$$scope={dirty:f,ctx:o}),Yt.$set(lr);const aa={};f&2&&(aa.$$scope={dirty:f,ctx:o}),lo.$set(aa);const ia={};f&2&&(ia.$$scope={dirty:f,ctx:o}),mo.$set(ia);const la={};f&2&&(la.$$scope={dirty:f,ctx:o}),fo.$set(la);const dr={};f&2&&(dr.$$scope={dirty:f,ctx:o}),_o.$set(dr);const da={};f&2&&(da.$$scope={dirty:f,ctx:o}),vo.$set(da);const ca={};f&2&&(ca.$$scope={dirty:f,ctx:o}),yo.$set(ca);const cr={};f&2&&(cr.$$scope={dirty:f,ctx:o}),To.$set(cr);const pa={};f&2&&(pa.$$scope={dirty:f,ctx:o}),Ro.$set(pa);const ha={};f&2&&(ha.$$scope={dirty:f,ctx:o}),Eo.$set(ha);const ua={};f&2&&(ua.$$scope={dirty:f,ctx:o}),ko.$set(ua);const pr={};f&2&&(pr.$$scope={dirty:f,ctx:o}),Po.$set(pr);const ma={};f&2&&(ma.$$scope={dirty:f,ctx:o}),Do.$set(ma);const fa={};f&2&&(fa.$$scope={dirty:f,ctx:o}),xo.$set(fa);const ga={};f&2&&(ga.$$scope={dirty:f,ctx:o}),Mo.$set(ga);const _a={};f&2&&(_a.$$scope={dirty:f,ctx:o}),Fo.$set(_a);const Xt={};f&2&&(Xt.$$scope={dirty:f,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(mn.$$.fragment,o),E(fn.$$.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(mo.$$.fragment,o),E(fo.$$.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(Gn.$$.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(mn.$$.fragment,o),k(fn.$$.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(mo.$$.fragment,o),k(fo.$$.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(Gn.$$.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(L),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(me),o&&t(De),o&&t(te),o&&t(Xe),o&&t(fe),$(J),o&&t(G),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),$(mn),o&&t(qa),o&&t(ye),$(fn),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),$(mo),$(fo),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),$(Gn),$(Eo),$(ko),o&&t(Oa),o&&t(Wt),$(Xn),o&&t(La),o&&t(we),$(Hn),$(Po),$(tr),$(Do),$(xo),o&&t(Ga),o&&t(Lt),$(or),o&&t(Xa),o&&t(Re),$(nr),$(Mo),$(ir),$(Fo),$(Co)}}}const Df={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 xf(F){return df(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jf extends rf{constructor(h){super();sf(this,h,xf,Pf,af,{})}}export{Jf as default,Df as metadata};
