import{S as Hm,i as Ym,s as Km,e as s,k as d,w as T,t as n,M as ef,c as a,d as t,m as c,a as i,x as w,h as r,b as p,N as Xm,G as e,g as m,y as R,q as k,o as E,B as $,v as tf,L as So}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 Wo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ze}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Vo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function of(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Example:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function nf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"with the format:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function rf(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 sf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function af(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 lf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function df(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 cf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(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,ke,U,de,H,P,Fe,B,ce,Ge,L,Y,se,S,ie,Ce,W,qe,Ee,N,Ie,le,pe,C,I,he,K,$e,ue,G,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=d(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),ke=d(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=d(),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()"),Ge=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()"),Ee=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=d(),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: "),G=s("code"),Je=n("model(input_ids)"),Pe=d(),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=d(),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=d(),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=c(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),ke=c(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=c(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),Ge=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),Ee=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=c(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),G=a(ne,"CODE",{});var at=i(G);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=c(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=c(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=c(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(){p(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(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,ke),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,Ge),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,Ee),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,G),e(G,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 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 Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function mf(F){let h,y,_,g,b,l,u,z,Me,ke,U,de,H,P,Fe,B,ce,Ge,L,Y,se,S,ie,Ce,W,qe,Ee,N,Ie,le,pe,C,I,he,K,$e,ue,G,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=d(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),ke=d(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=d(),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()"),Ge=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()"),Ee=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=d(),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: "),G=s("code"),Je=n("model(input_ids)"),Pe=d(),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=d(),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=d(),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=c(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),ke=c(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=c(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),Ge=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),Ee=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=c(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),G=a(ne,"CODE",{});var at=i(G);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=c(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=c(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=c(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(){p(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(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,ke),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,Ge),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,Ee),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,G),e(G,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 ff(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 gf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function _f(F){let h,y,_,g,b,l,u,z,Me,ke,U,de,H,P,Fe,B,ce,Ge,L,Y,se,S,ie,Ce,W,qe,Ee,N,Ie,le,pe,C,I,he,K,$e,ue,G,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=d(),u=s("ul"),z=s("li"),Me=n("having all inputs as keyword arguments (like PyTorch models), or"),ke=d(),U=s("li"),de=n("having all inputs as a list, tuple or dict in the first positional argument."),H=d(),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()"),Ge=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()"),Ee=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=d(),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: "),G=s("code"),Je=n("model(input_ids)"),Pe=d(),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=d(),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=d(),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=c(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),ke=c(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=c(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),Ge=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),Ee=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=c(v),C=a(v,"UL",{});var J=i(C);I=a(J,"LI",{});var ne=i(I);he=r(ne,"a single Tensor with "),K=a(ne,"CODE",{});var Oe=i(K);$e=r(Oe,"input_ids"),Oe.forEach(t),ue=r(ne," only and nothing else: "),G=a(ne,"CODE",{});var at=i(G);Je=r(at,"model(input_ids)"),at.forEach(t),ne.forEach(t),Pe=c(J),M=a(J,"LI",{});var O=i(M);Ue=r(O,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),Z=a(O,"CODE",{});var V=i(Z);je=r(V,"model([input_ids, attention_mask])"),V.forEach(t),Ne=r(O," or "),A=a(O,"CODE",{});var xe=i(A);Ze=r(xe,"model([input_ids, attention_mask, token_type_ids])"),xe.forEach(t),O.forEach(t),Ae=c(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=c(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(){p(j,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),p(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,ke),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,Ge),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,Ee),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,G),e(G,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 vf(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 bf(F){let h,y,_,g,b;return g=new Wo({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:"),_=d(),T(g.$$.fragment)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Examples:"),u.forEach(t),_=c(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:So,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){E(g.$$.fragment,l),b=!1},d(l){l&&t(h),l&&t(_),$(g,l)}}}function yf(F){let h,y,_,g,b,l,u,z,Me,ke,U,de,H,P,Fe,B,ce,Ge,L,Y,se,S,ie,Ce,W,qe,Ee,N,Ie,le,pe,C,I,he,K,$e,ue,G,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,Oe,at,O,V,xe,Be,ve,re,it,ji,ss,Ni,Zi,Ai,He,Qi,ur,Bi,Vi,mr,Si,Wi,fr,Gi,Li,Go,Oi,Xi,Hi,Lo,Yi,gr,Ki,el,tl,Yt,ya,Dt,Kt,as,Oo,ol,is,nl,Ta,Ye,Xo,rl,ls,sl,al,eo,_r,il,ll,vr,dl,cl,pl,Ho,hl,br,ul,ml,wa,xt,to,ds,Yo,fl,cs,gl,Ra,Ke,Ko,_l,en,vl,ps,bl,yl,Tl,oo,yr,wl,Rl,Tr,kl,El,$l,tn,Pl,wr,Dl,xl,ka,zt,no,hs,on,zl,us,Ml,Ea,et,nn,Fl,ms,Cl,ql,ro,Rr,Il,Jl,kr,Ul,jl,Nl,rn,Zl,Er,Al,Ql,$a,Mt,so,fs,sn,Bl,gs,Vl,Pa,tt,an,Sl,ln,Wl,_s,Gl,Ll,Ol,ao,$r,Xl,Hl,Pr,Yl,Kl,ed,dn,td,Dr,od,nd,Da,Ft,io,vs,cn,rd,bs,sd,xa,be,pn,ad,ys,id,ld,yt,xr,dd,cd,zr,pd,hd,Mr,ud,md,fd,hn,gd,Fr,_d,vd,bd,Tt,yd,Ts,Td,wd,ws,Rd,kd,Rs,Ed,$d,lo,za,Ct,co,ks,un,Pd,Es,Dd,Ma,ye,mn,xd,fn,zd,$s,Md,Fd,Cd,wt,Cr,qd,Id,qr,Jd,Ud,Ir,jd,Nd,Zd,gn,Ad,Jr,Qd,Bd,Vd,bt,Sd,Ps,Wd,Gd,Ds,Ld,Od,xs,Xd,Hd,Yd,zs,Kd,Fa,qt,po,Ms,_n,ec,Fs,tc,Ca,It,vn,oc,bn,nc,Ur,rc,sc,qa,Jt,yn,ac,Tn,ic,jr,lc,dc,Ia,Ut,wn,cc,Rn,pc,Nr,hc,uc,Ja,jt,ho,Cs,kn,mc,qs,fc,Ua,Ve,En,gc,Is,_c,vc,$n,bc,Zr,yc,Tc,wc,Pn,Rc,Dn,kc,Ec,$c,lt,xn,Pc,Nt,Dc,Ar,xc,zc,Js,Mc,Fc,Cc,uo,qc,mo,ja,Zt,fo,Us,zn,Ic,js,Jc,Na,Se,Mn,Uc,Ns,jc,Nc,Fn,Zc,Qr,Ac,Qc,Bc,Cn,Vc,qn,Sc,Wc,Gc,dt,In,Lc,At,Oc,Br,Xc,Hc,Zs,Yc,Kc,ep,go,tp,_o,Za,Qt,vo,As,Jn,op,Qs,np,Aa,We,Un,rp,Bs,sp,ap,jn,ip,Vr,lp,dp,cp,Nn,pp,Zn,hp,up,mp,ct,An,fp,Bt,gp,Sr,_p,vp,Vs,bp,yp,Tp,bo,wp,yo,Qa,Vt,To,Ss,Qn,Rp,Ws,kp,Ba,Te,Bn,Ep,Gs,$p,Pp,Vn,Dp,Wr,xp,zp,Mp,Sn,Fp,Wn,Cp,qp,Ip,wo,Jp,pt,Gn,Up,St,jp,Gr,Np,Zp,Ls,Ap,Qp,Bp,Ro,Vp,ko,Va,Wt,Eo,Os,Ln,Sp,Xs,Wp,Sa,we,On,Gp,Hs,Lp,Op,Xn,Xp,Lr,Hp,Yp,Kp,Hn,eh,Yn,th,oh,nh,$o,rh,ht,Kn,sh,Gt,ah,Or,ih,lh,Ys,dh,ch,ph,Po,hh,Do,Wa,Lt,xo,Ks,er,uh,ea,mh,Ga,Re,tr,fh,ta,gh,_h,or,vh,Xr,bh,yh,Th,nr,wh,rr,Rh,kh,Eh,zo,$h,ut,sr,Ph,Ot,Dh,Hr,xh,zh,oa,Mh,Fh,Ch,Mo,qh,Fo,La;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 Vo({props:{anchor:"transformers.DPRConfig.example",$$slots:{default:[of]},$$scope:{ctx:F}}}),Oo=new ze({}),Xo=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"}}),Yo=new ze({}),Ko=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"}}),on=new ze({}),nn=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"}}),sn=new ze({}),an=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"}}),cn=new ze({}),pn=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 Vo({props:{anchor:"transformers.DPRReaderTokenizer.example",$$slots:{default:[nf]},$$scope:{ctx:F}}}),un=new ze({}),mn=new X({props:{name:"class transformers.DPRReaderTokenizerFast",anchor:"transformers.DPRReaderTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPRReaderTokenizerFast.questions",description:`<strong>questions</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The questions to be encoded. You can specify one question for many passages. In this case, the question
will be duplicated like <code>[questions] * n_passages</code>. Otherwise you have to specify as many questions as in
<code>titles</code> or <code>texts</code>.`,name:"questions"},{anchor:"transformers.DPRReaderTokenizerFast.titles",description:`<strong>titles</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages titles to be encoded. This can be a string or a list of strings if there are several passages.`,name:"titles"},{anchor:"transformers.DPRReaderTokenizerFast.texts",description:`<strong>texts</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages texts to be encoded. This can be a string or a list of strings if there are several passages.`,name:"texts"},{anchor:"transformers.DPRReaderTokenizerFast.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/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>
`}}),_n=new ze({}),vn=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"}}),yn=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"}}),wn=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"}}),kn=new ze({}),En=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"}}),xn=new X({props:{name:"forward",anchor:"transformers.DPRContextEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRContextEncoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/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>
`}}),uo=new Ht({props:{$$slots:{default:[rf]},$$scope:{ctx:F}}}),mo=new Vo({props:{anchor:"transformers.DPRContextEncoder.forward.example",$$slots:{default:[sf]},$$scope:{ctx:F}}}),zn=new ze({}),Mn=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"}}),In=new X({props:{name:"forward",anchor:"transformers.DPRQuestionEncoder.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRQuestionEncoder.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/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>
`}}),go=new Ht({props:{$$slots:{default:[af]},$$scope:{ctx:F}}}),_o=new Vo({props:{anchor:"transformers.DPRQuestionEncoder.forward.example",$$slots:{default:[lf]},$$scope:{ctx:F}}}),Jn=new ze({}),Un=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"}}),An=new X({props:{name:"forward",anchor:"transformers.DPRReader.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": bool = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.DPRReader.forward.input_ids",description:`<strong>input_ids</strong> (<code>Tuple[torch.LongTensor]</code> of shapes <code>(n_passages, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. It has to be a sequence triplet with 1) the question
and 2) the passages titles and 3) the passages texts To match pretraining, DPR <code>input_ids</code> sequence should
be formatted with [CLS] and [SEP] with the format:</p>
<p><code>[CLS] &lt;question token ids&gt; [SEP] &lt;titles ids&gt; [SEP] &lt;texts ids&gt;</code></p>
<p>DPR is a model with absolute position embeddings so it&#x2019;s usually advised to pad the inputs on the right
rather than the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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>
`}}),bo=new Ht({props:{$$slots:{default:[df]},$$scope:{ctx:F}}}),yo=new Vo({props:{anchor:"transformers.DPRReader.forward.example",$$slots:{default:[cf]},$$scope:{ctx:F}}}),Qn=new ze({}),Bn=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"}}),wo=new Ht({props:{$$slots:{default:[pf]},$$scope:{ctx:F}}}),Gn=new X({props:{name:"call",anchor:"transformers.TFDPRContextEncoder.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRContextEncoder.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/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>
`}}),Ro=new Ht({props:{$$slots:{default:[hf]},$$scope:{ctx:F}}}),ko=new Vo({props:{anchor:"transformers.TFDPRContextEncoder.call.example",$$slots:{default:[uf]},$$scope:{ctx:F}}}),Ln=new ze({}),On=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"}}),$o=new Ht({props:{$$slots:{default:[mf]},$$scope:{ctx:F}}}),Kn=new X({props:{name:"call",anchor:"transformers.TFDPRQuestionEncoder.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"token_type_ids",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRQuestionEncoder.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
formatted with [CLS] and [SEP] tokens as follows:</p>
<p>(a) For sequence pairs (for a pair title+text for example):`,name:"input_ids"}],source:"https://github.com/huggingface/transformers/blob/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>
`}}),Po=new Ht({props:{$$slots:{default:[ff]},$$scope:{ctx:F}}}),Do=new Vo({props:{anchor:"transformers.TFDPRQuestionEncoder.call.example",$$slots:{default:[gf]},$$scope:{ctx:F}}}),er=new ze({}),tr=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"}}),zo=new Ht({props:{$$slots:{default:[_f]},$$scope:{ctx:F}}}),sr=new X({props:{name:"call",anchor:"transformers.TFDPRReader.call",parameters:[{name:"input_ids",val:" = None"},{name:"attention_mask",val:": tf.Tensor | None = None"},{name:"inputs_embeds",val:": tf.Tensor | None = None"},{name:"output_attentions",val:": bool = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:" = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFDPRReader.call.input_ids",description:`<strong>input_ids</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shapes <code>(n_passages, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. It has to be a sequence triplet with 1) the question
and 2) the passages titles and 3) the passages texts To match pretraining, DPR <code>input_ids</code> sequence should
be formatted with [CLS] and [SEP] with the format:</p>
<p><code>[CLS] &lt;question token ids&gt; [SEP] &lt;titles ids&gt; [SEP] &lt;texts ids&gt;</code></p>
<p>DPR is a model with absolute position embeddings so it&#x2019;s usually advised to pad the inputs on the right
rather than the left.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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>
`}}),Mo=new Ht({props:{$$slots:{default:[vf]},$$scope:{ctx:F}}}),Fo=new Vo({props:{anchor:"transformers.TFDPRReader.call.example",$$slots:{default:[bf]},$$scope:{ctx:F}}}),{c(){h=s("meta"),y=d(),_=s("h1"),g=s("a"),b=s("span"),T(l.$$.fragment),u=d(),z=s("span"),Me=n("DPR"),ke=d(),U=s("div"),de=s("a"),H=s("img"),Fe=d(),B=s("a"),ce=s("img"),L=d(),Y=s("h2"),se=s("a"),S=s("span"),T(ie.$$.fragment),Ce=d(),W=s("span"),qe=n("Overview"),Ee=d(),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=d(),he=s("p"),K=n("The abstract from the paper is the following:"),$e=d(),ue=s("p"),G=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=d(),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=d(),me=s("p"),ee=n("Tips:"),De=d(),te=s("ul"),q=s("li"),ge=s("p"),j=n("DPR consists in three models:"),Qe=d(),oe=s("ul"),v=s("li"),D=n("Question encoder: encode questions as vectors"),ot=d(),ae=s("li"),nt=n("Context encoder: encode contexts as vectors"),rt=d(),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=d(),fe=s("h2"),_e=s("a"),Le=s("span"),T(J.$$.fragment),ne=d(),Oe=s("span"),at=n("DPRConfig"),O=d(),V=s("div"),T(xe.$$.fragment),Be=d(),ve=s("p"),re=s("a"),it=n("DPRConfig"),ji=n(" is the configuration class to store the configuration of a "),ss=s("em"),Ni=n("DPRModel"),Zi=n("."),Ai=d(),He=s("p"),Qi=n("This is the configuration class to store the configuration of a "),ur=s("a"),Bi=n("DPRContextEncoder"),Vi=n(", "),mr=s("a"),Si=n("DPRQuestionEncoder"),Wi=n(`, or a
`),fr=s("a"),Gi=n("DPRReader"),Li=n(`. It is used to instantiate the components of the DPR model according to the specified arguments,
defining the model component architectures. Instantiating a configuration with the defaults will yield a similar
configuration to that of the DPRContextEncoder
`),Go=s("a"),Oi=n("facebook/dpr-ctx_encoder-single-nq-base"),Xi=n(`
architecture.`),Hi=d(),Lo=s("p"),Yi=n("This class is a subclass of "),gr=s("a"),Ki=n("BertConfig"),el=n(". Please check the superclass for the documentation of all kwargs."),tl=d(),T(Yt.$$.fragment),ya=d(),Dt=s("h2"),Kt=s("a"),as=s("span"),T(Oo.$$.fragment),ol=d(),is=s("span"),nl=n("DPRContextEncoderTokenizer"),Ta=d(),Ye=s("div"),T(Xo.$$.fragment),rl=d(),ls=s("p"),sl=n("Construct a DPRContextEncoder tokenizer."),al=d(),eo=s("p"),_r=s("a"),il=n("DPRContextEncoderTokenizer"),ll=n(" is identical to "),vr=s("a"),dl=n("BertTokenizer"),cl=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),pl=d(),Ho=s("p"),hl=n("Refer to superclass "),br=s("a"),ul=n("BertTokenizer"),ml=n(" for usage examples and documentation concerning parameters."),wa=d(),xt=s("h2"),to=s("a"),ds=s("span"),T(Yo.$$.fragment),fl=d(),cs=s("span"),gl=n("DPRContextEncoderTokenizerFast"),Ra=d(),Ke=s("div"),T(Ko.$$.fragment),_l=d(),en=s("p"),vl=n("Construct a \u201Cfast\u201D DPRContextEncoder tokenizer (backed by HuggingFace\u2019s "),ps=s("em"),bl=n("tokenizers"),yl=n(" library)."),Tl=d(),oo=s("p"),yr=s("a"),wl=n("DPRContextEncoderTokenizerFast"),Rl=n(" is identical to "),Tr=s("a"),kl=n("BertTokenizerFast"),El=n(` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),$l=d(),tn=s("p"),Pl=n("Refer to superclass "),wr=s("a"),Dl=n("BertTokenizerFast"),xl=n(" for usage examples and documentation concerning parameters."),ka=d(),zt=s("h2"),no=s("a"),hs=s("span"),T(on.$$.fragment),zl=d(),us=s("span"),Ml=n("DPRQuestionEncoderTokenizer"),Ea=d(),et=s("div"),T(nn.$$.fragment),Fl=d(),ms=s("p"),Cl=n("Constructs a DPRQuestionEncoder tokenizer."),ql=d(),ro=s("p"),Rr=s("a"),Il=n("DPRQuestionEncoderTokenizer"),Jl=n(" is identical to "),kr=s("a"),Ul=n("BertTokenizer"),jl=n(` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),Nl=d(),rn=s("p"),Zl=n("Refer to superclass "),Er=s("a"),Al=n("BertTokenizer"),Ql=n(" for usage examples and documentation concerning parameters."),$a=d(),Mt=s("h2"),so=s("a"),fs=s("span"),T(sn.$$.fragment),Bl=d(),gs=s("span"),Vl=n("DPRQuestionEncoderTokenizerFast"),Pa=d(),tt=s("div"),T(an.$$.fragment),Sl=d(),ln=s("p"),Wl=n("Constructs a \u201Cfast\u201D DPRQuestionEncoder tokenizer (backed by HuggingFace\u2019s "),_s=s("em"),Gl=n("tokenizers"),Ll=n(" library)."),Ol=d(),ao=s("p"),$r=s("a"),Xl=n("DPRQuestionEncoderTokenizerFast"),Hl=n(" is identical to "),Pr=s("a"),Yl=n("BertTokenizerFast"),Kl=n(` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),ed=d(),dn=s("p"),td=n("Refer to superclass "),Dr=s("a"),od=n("BertTokenizerFast"),nd=n(" for usage examples and documentation concerning parameters."),Da=d(),Ft=s("h2"),io=s("a"),vs=s("span"),T(cn.$$.fragment),rd=d(),bs=s("span"),sd=n("DPRReaderTokenizer"),xa=d(),be=s("div"),T(pn.$$.fragment),ad=d(),ys=s("p"),id=n("Construct a DPRReader tokenizer."),ld=d(),yt=s("p"),xr=s("a"),dd=n("DPRReaderTokenizer"),cd=n(" is almost identical to "),zr=s("a"),pd=n("BertTokenizer"),hd=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 `),Mr=s("a"),ud=n("DPRReader"),md=n(" model."),fd=d(),hn=s("p"),gd=n("Refer to superclass "),Fr=s("a"),_d=n("BertTokenizer"),vd=n(" for usage examples and documentation concerning parameters."),bd=d(),Tt=s("p"),yd=n("Return a dictionary with the token ids of the input strings and other information to give to "),Ts=s("code"),Td=n(".decode_best_spans"),wd=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 `),ws=s("code"),Rd=n("input_ids"),kd=n(" is a matrix of size "),Rs=s("code"),Ed=n("(n_passages, sequence_length)"),$d=d(),T(lo.$$.fragment),za=d(),Ct=s("h2"),co=s("a"),ks=s("span"),T(un.$$.fragment),Pd=d(),Es=s("span"),Dd=n("DPRReaderTokenizerFast"),Ma=d(),ye=s("div"),T(mn.$$.fragment),xd=d(),fn=s("p"),zd=n("Constructs a \u201Cfast\u201D DPRReader tokenizer (backed by HuggingFace\u2019s "),$s=s("em"),Md=n("tokenizers"),Fd=n(" library)."),Cd=d(),wt=s("p"),Cr=s("a"),qd=n("DPRReaderTokenizerFast"),Id=n(" is almost identical to "),qr=s("a"),Jd=n("BertTokenizerFast"),Ud=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 `),Ir=s("a"),jd=n("DPRReader"),Nd=n(" model."),Zd=d(),gn=s("p"),Ad=n("Refer to superclass "),Jr=s("a"),Qd=n("BertTokenizerFast"),Bd=n(" for usage examples and documentation concerning parameters."),Vd=d(),bt=s("p"),Sd=n("Return a dictionary with the token ids of the input strings and other information to give to "),Ps=s("code"),Wd=n(".decode_best_spans"),Gd=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 `),Ds=s("code"),Ld=n("input_ids"),Od=n(" is a matrix of size "),xs=s("code"),Xd=n("(n_passages, sequence_length)"),Hd=n(`
with the format:`),Yd=d(),zs=s("p"),Kd=n("[CLS] <question token ids> [SEP] <titles ids> [SEP] <texts ids>"),Fa=d(),qt=s("h2"),po=s("a"),Ms=s("span"),T(_n.$$.fragment),ec=d(),Fs=s("span"),tc=n("DPR specific outputs"),Ca=d(),It=s("div"),T(vn.$$.fragment),oc=d(),bn=s("p"),nc=n("Class for outputs of "),Ur=s("a"),rc=n("DPRQuestionEncoder"),sc=n("."),qa=d(),Jt=s("div"),T(yn.$$.fragment),ac=d(),Tn=s("p"),ic=n("Class for outputs of "),jr=s("a"),lc=n("DPRQuestionEncoder"),dc=n("."),Ia=d(),Ut=s("div"),T(wn.$$.fragment),cc=d(),Rn=s("p"),pc=n("Class for outputs of "),Nr=s("a"),hc=n("DPRQuestionEncoder"),uc=n("."),Ja=d(),jt=s("h2"),ho=s("a"),Cs=s("span"),T(kn.$$.fragment),mc=d(),qs=s("span"),fc=n("DPRContextEncoder"),Ua=d(),Ve=s("div"),T(En.$$.fragment),gc=d(),Is=s("p"),_c=n("The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),vc=d(),$n=s("p"),bc=n("This model inherits from "),Zr=s("a"),yc=n("PreTrainedModel"),Tc=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.)`),wc=d(),Pn=s("p"),Rc=n("This model is also a PyTorch "),Dn=s("a"),kc=n("torch.nn.Module"),Ec=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$c=d(),lt=s("div"),T(xn.$$.fragment),Pc=d(),Nt=s("p"),Dc=n("The "),Ar=s("a"),xc=n("DPRContextEncoder"),zc=n(" forward method, overrides the "),Js=s("code"),Mc=n("__call__"),Fc=n(" special method."),Cc=d(),T(uo.$$.fragment),qc=d(),T(mo.$$.fragment),ja=d(),Zt=s("h2"),fo=s("a"),Us=s("span"),T(zn.$$.fragment),Ic=d(),js=s("span"),Jc=n("DPRQuestionEncoder"),Na=d(),Se=s("div"),T(Mn.$$.fragment),Uc=d(),Ns=s("p"),jc=n("The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Nc=d(),Fn=s("p"),Zc=n("This model inherits from "),Qr=s("a"),Ac=n("PreTrainedModel"),Qc=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.)`),Bc=d(),Cn=s("p"),Vc=n("This model is also a PyTorch "),qn=s("a"),Sc=n("torch.nn.Module"),Wc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gc=d(),dt=s("div"),T(In.$$.fragment),Lc=d(),At=s("p"),Oc=n("The "),Br=s("a"),Xc=n("DPRQuestionEncoder"),Hc=n(" forward method, overrides the "),Zs=s("code"),Yc=n("__call__"),Kc=n(" special method."),ep=d(),T(go.$$.fragment),tp=d(),T(_o.$$.fragment),Za=d(),Qt=s("h2"),vo=s("a"),As=s("span"),T(Jn.$$.fragment),op=d(),Qs=s("span"),np=n("DPRReader"),Aa=d(),We=s("div"),T(Un.$$.fragment),rp=d(),Bs=s("p"),sp=n("The bare DPRReader transformer outputting span predictions."),ap=d(),jn=s("p"),ip=n("This model inherits from "),Vr=s("a"),lp=n("PreTrainedModel"),dp=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.)`),cp=d(),Nn=s("p"),pp=n("This model is also a PyTorch "),Zn=s("a"),hp=n("torch.nn.Module"),up=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),mp=d(),ct=s("div"),T(An.$$.fragment),fp=d(),Bt=s("p"),gp=n("The "),Sr=s("a"),_p=n("DPRReader"),vp=n(" forward method, overrides the "),Vs=s("code"),bp=n("__call__"),yp=n(" special method."),Tp=d(),T(bo.$$.fragment),wp=d(),T(yo.$$.fragment),Qa=d(),Vt=s("h2"),To=s("a"),Ss=s("span"),T(Qn.$$.fragment),Rp=d(),Ws=s("span"),kp=n("TFDPRContextEncoder"),Ba=d(),Te=s("div"),T(Bn.$$.fragment),Ep=d(),Gs=s("p"),$p=n("The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),Pp=d(),Vn=s("p"),Dp=n("This model inherits from "),Wr=s("a"),xp=n("TFPreTrainedModel"),zp=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mp=d(),Sn=s("p"),Fp=n("This model is also a Tensorflow "),Wn=s("a"),Cp=n("tf.keras.Model"),qp=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.`),Ip=d(),T(wo.$$.fragment),Jp=d(),pt=s("div"),T(Gn.$$.fragment),Up=d(),St=s("p"),jp=n("The "),Gr=s("a"),Np=n("TFDPRContextEncoder"),Zp=n(" forward method, overrides the "),Ls=s("code"),Ap=n("__call__"),Qp=n(" special method."),Bp=d(),T(Ro.$$.fragment),Vp=d(),T(ko.$$.fragment),Va=d(),Wt=s("h2"),Eo=s("a"),Os=s("span"),T(Ln.$$.fragment),Sp=d(),Xs=s("span"),Wp=n("TFDPRQuestionEncoder"),Sa=d(),we=s("div"),T(On.$$.fragment),Gp=d(),Hs=s("p"),Lp=n("The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Op=d(),Xn=s("p"),Xp=n("This model inherits from "),Lr=s("a"),Hp=n("TFPreTrainedModel"),Yp=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.)`),Kp=d(),Hn=s("p"),eh=n("This model is also a Tensorflow "),Yn=s("a"),th=n("tf.keras.Model"),oh=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.`),nh=d(),T($o.$$.fragment),rh=d(),ht=s("div"),T(Kn.$$.fragment),sh=d(),Gt=s("p"),ah=n("The "),Or=s("a"),ih=n("TFDPRQuestionEncoder"),lh=n(" forward method, overrides the "),Ys=s("code"),dh=n("__call__"),ch=n(" special method."),ph=d(),T(Po.$$.fragment),hh=d(),T(Do.$$.fragment),Wa=d(),Lt=s("h2"),xo=s("a"),Ks=s("span"),T(er.$$.fragment),uh=d(),ea=s("span"),mh=n("TFDPRReader"),Ga=d(),Re=s("div"),T(tr.$$.fragment),fh=d(),ta=s("p"),gh=n("The bare DPRReader transformer outputting span predictions."),_h=d(),or=s("p"),vh=n("This model inherits from "),Xr=s("a"),bh=n("TFPreTrainedModel"),yh=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.)`),Th=d(),nr=s("p"),wh=n("This model is also a Tensorflow "),rr=s("a"),Rh=n("tf.keras.Model"),kh=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.`),Eh=d(),T(zo.$$.fragment),$h=d(),ut=s("div"),T(sr.$$.fragment),Ph=d(),Ot=s("p"),Dh=n("The "),Hr=s("a"),xh=n("TFDPRReader"),zh=n(" forward method, overrides the "),oa=s("code"),Mh=n("__call__"),Fh=n(" special method."),Ch=d(),T(Mo.$$.fragment),qh=d(),T(Fo.$$.fragment),this.h()},l(o){const f=ef('[data-svelte="svelte-1phssyn"]',document.head);h=a(f,"META",{name:!0,content:!0}),f.forEach(t),y=c(o),_=a(o,"H1",{class:!0});var ar=i(_);g=a(ar,"A",{id:!0,class:!0,href:!0});var na=i(g);b=a(na,"SPAN",{});var ra=i(b);w(l.$$.fragment,ra),ra.forEach(t),na.forEach(t),u=c(ar),z=a(ar,"SPAN",{});var sa=i(z);Me=r(sa,"DPR"),sa.forEach(t),ar.forEach(t),ke=c(o),U=a(o,"DIV",{class:!0});var ir=i(U);de=a(ir,"A",{href:!0});var aa=i(de);H=a(aa,"IMG",{alt:!0,src:!0}),aa.forEach(t),Fe=c(ir),B=a(ir,"A",{href:!0});var ia=i(B);ce=a(ia,"IMG",{alt:!0,src:!0}),ia.forEach(t),ir.forEach(t),L=c(o),Y=a(o,"H2",{class:!0});var lr=i(Y);se=a(lr,"A",{id:!0,class:!0,href:!0});var la=i(se);S=a(la,"SPAN",{});var da=i(S);w(ie.$$.fragment,da),da.forEach(t),la.forEach(t),Ce=c(lr),W=a(lr,"SPAN",{});var ca=i(W);qe=r(ca,"Overview"),ca.forEach(t),lr.forEach(t),Ee=c(o),N=a(o,"P",{});var dr=i(N);Ie=r(dr,`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(dr,"A",{href:!0,rel:!0});var pa=i(le);pe=r(pa,"Dense Passage Retrieval for Open-Domain Question Answering"),pa.forEach(t),C=r(dr,` by
Vladimir Karpukhin, Barlas O\u011Fuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, Wen-tau Yih.`),dr.forEach(t),I=c(o),he=a(o,"P",{});var ha=i(he);K=r(ha,"The abstract from the paper is the following:"),ha.forEach(t),$e=c(o),ue=a(o,"P",{});var ua=i(ue);G=a(ua,"EM",{});var ma=i(G);Je=r(ma,`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.`),ma.forEach(t),ua.forEach(t),Pe=c(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 Ih=i(Z);je=r(Ih,"lhoestq"),Ih.forEach(t),Ne=r(Xt,". The original code can be found "),A=a(Xt,"A",{href:!0,rel:!0});var Jh=i(A);Ze=r(Jh,"here"),Jh.forEach(t),Ae=r(Xt,"."),Xt.forEach(t),Q=c(o),me=a(o,"P",{});var Uh=i(me);ee=r(Uh,"Tips:"),Uh.forEach(t),De=c(o),te=a(o,"UL",{});var jh=i(te);q=a(jh,"LI",{});var Oa=i(q);ge=a(Oa,"P",{});var Nh=i(ge);j=r(Nh,"DPR consists in three models:"),Nh.forEach(t),Qe=c(Oa),oe=a(Oa,"UL",{});var Yr=i(oe);v=a(Yr,"LI",{});var Zh=i(v);D=r(Zh,"Question encoder: encode questions as vectors"),Zh.forEach(t),ot=c(Yr),ae=a(Yr,"LI",{});var Ah=i(ae);nt=r(Ah,"Context encoder: encode contexts as vectors"),Ah.forEach(t),rt=c(Yr),x=a(Yr,"LI",{});var Qh=i(x);st=r(Qh,"Reader: extract the answer of the questions inside retrieved contexts, along with a relevance score (high if the inferred span actually answers the question)."),Qh.forEach(t),Yr.forEach(t),Oa.forEach(t),jh.forEach(t),Xe=c(o),fe=a(o,"H2",{class:!0});var Xa=i(fe);_e=a(Xa,"A",{id:!0,class:!0,href:!0});var Bh=i(_e);Le=a(Bh,"SPAN",{});var Vh=i(Le);w(J.$$.fragment,Vh),Vh.forEach(t),Bh.forEach(t),ne=c(Xa),Oe=a(Xa,"SPAN",{});var Sh=i(Oe);at=r(Sh,"DPRConfig"),Sh.forEach(t),Xa.forEach(t),O=c(o),V=a(o,"DIV",{class:!0});var Rt=i(V);w(xe.$$.fragment,Rt),Be=c(Rt),ve=a(Rt,"P",{});var fa=i(ve);re=a(fa,"A",{href:!0});var Wh=i(re);it=r(Wh,"DPRConfig"),Wh.forEach(t),ji=r(fa," is the configuration class to store the configuration of a "),ss=a(fa,"EM",{});var Gh=i(ss);Ni=r(Gh,"DPRModel"),Gh.forEach(t),Zi=r(fa,"."),fa.forEach(t),Ai=c(Rt),He=a(Rt,"P",{});var kt=i(He);Qi=r(kt,"This is the configuration class to store the configuration of a "),ur=a(kt,"A",{href:!0});var Lh=i(ur);Bi=r(Lh,"DPRContextEncoder"),Lh.forEach(t),Vi=r(kt,", "),mr=a(kt,"A",{href:!0});var Oh=i(mr);Si=r(Oh,"DPRQuestionEncoder"),Oh.forEach(t),Wi=r(kt,`, or a
`),fr=a(kt,"A",{href:!0});var Xh=i(fr);Gi=r(Xh,"DPRReader"),Xh.forEach(t),Li=r(kt,`. It is used to instantiate the components of the DPR model according to the specified arguments,
defining the model component architectures. Instantiating a configuration with the defaults will yield a similar
configuration to that of the DPRContextEncoder
`),Go=a(kt,"A",{href:!0,rel:!0});var Hh=i(Go);Oi=r(Hh,"facebook/dpr-ctx_encoder-single-nq-base"),Hh.forEach(t),Xi=r(kt,`
architecture.`),kt.forEach(t),Hi=c(Rt),Lo=a(Rt,"P",{});var Ha=i(Lo);Yi=r(Ha,"This class is a subclass of "),gr=a(Ha,"A",{href:!0});var Yh=i(gr);Ki=r(Yh,"BertConfig"),Yh.forEach(t),el=r(Ha,". Please check the superclass for the documentation of all kwargs."),Ha.forEach(t),tl=c(Rt),w(Yt.$$.fragment,Rt),Rt.forEach(t),ya=c(o),Dt=a(o,"H2",{class:!0});var Ya=i(Dt);Kt=a(Ya,"A",{id:!0,class:!0,href:!0});var Kh=i(Kt);as=a(Kh,"SPAN",{});var eu=i(as);w(Oo.$$.fragment,eu),eu.forEach(t),Kh.forEach(t),ol=c(Ya),is=a(Ya,"SPAN",{});var tu=i(is);nl=r(tu,"DPRContextEncoderTokenizer"),tu.forEach(t),Ya.forEach(t),Ta=c(o),Ye=a(o,"DIV",{class:!0});var Co=i(Ye);w(Xo.$$.fragment,Co),rl=c(Co),ls=a(Co,"P",{});var ou=i(ls);sl=r(ou,"Construct a DPRContextEncoder tokenizer."),ou.forEach(t),al=c(Co),eo=a(Co,"P",{});var ga=i(eo);_r=a(ga,"A",{href:!0});var nu=i(_r);il=r(nu,"DPRContextEncoderTokenizer"),nu.forEach(t),ll=r(ga," is identical to "),vr=a(ga,"A",{href:!0});var ru=i(vr);dl=r(ru,"BertTokenizer"),ru.forEach(t),cl=r(ga,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),ga.forEach(t),pl=c(Co),Ho=a(Co,"P",{});var Ka=i(Ho);hl=r(Ka,"Refer to superclass "),br=a(Ka,"A",{href:!0});var su=i(br);ul=r(su,"BertTokenizer"),su.forEach(t),ml=r(Ka," for usage examples and documentation concerning parameters."),Ka.forEach(t),Co.forEach(t),wa=c(o),xt=a(o,"H2",{class:!0});var ei=i(xt);to=a(ei,"A",{id:!0,class:!0,href:!0});var au=i(to);ds=a(au,"SPAN",{});var iu=i(ds);w(Yo.$$.fragment,iu),iu.forEach(t),au.forEach(t),fl=c(ei),cs=a(ei,"SPAN",{});var lu=i(cs);gl=r(lu,"DPRContextEncoderTokenizerFast"),lu.forEach(t),ei.forEach(t),Ra=c(o),Ke=a(o,"DIV",{class:!0});var qo=i(Ke);w(Ko.$$.fragment,qo),_l=c(qo),en=a(qo,"P",{});var ti=i(en);vl=r(ti,"Construct a \u201Cfast\u201D DPRContextEncoder tokenizer (backed by HuggingFace\u2019s "),ps=a(ti,"EM",{});var du=i(ps);bl=r(du,"tokenizers"),du.forEach(t),yl=r(ti," library)."),ti.forEach(t),Tl=c(qo),oo=a(qo,"P",{});var _a=i(oo);yr=a(_a,"A",{href:!0});var cu=i(yr);wl=r(cu,"DPRContextEncoderTokenizerFast"),cu.forEach(t),Rl=r(_a," is identical to "),Tr=a(_a,"A",{href:!0});var pu=i(Tr);kl=r(pu,"BertTokenizerFast"),pu.forEach(t),El=r(_a,` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),_a.forEach(t),$l=c(qo),tn=a(qo,"P",{});var oi=i(tn);Pl=r(oi,"Refer to superclass "),wr=a(oi,"A",{href:!0});var hu=i(wr);Dl=r(hu,"BertTokenizerFast"),hu.forEach(t),xl=r(oi," for usage examples and documentation concerning parameters."),oi.forEach(t),qo.forEach(t),ka=c(o),zt=a(o,"H2",{class:!0});var ni=i(zt);no=a(ni,"A",{id:!0,class:!0,href:!0});var uu=i(no);hs=a(uu,"SPAN",{});var mu=i(hs);w(on.$$.fragment,mu),mu.forEach(t),uu.forEach(t),zl=c(ni),us=a(ni,"SPAN",{});var fu=i(us);Ml=r(fu,"DPRQuestionEncoderTokenizer"),fu.forEach(t),ni.forEach(t),Ea=c(o),et=a(o,"DIV",{class:!0});var Io=i(et);w(nn.$$.fragment,Io),Fl=c(Io),ms=a(Io,"P",{});var gu=i(ms);Cl=r(gu,"Constructs a DPRQuestionEncoder tokenizer."),gu.forEach(t),ql=c(Io),ro=a(Io,"P",{});var va=i(ro);Rr=a(va,"A",{href:!0});var _u=i(Rr);Il=r(_u,"DPRQuestionEncoderTokenizer"),_u.forEach(t),Jl=r(va," is identical to "),kr=a(va,"A",{href:!0});var vu=i(kr);Ul=r(vu,"BertTokenizer"),vu.forEach(t),jl=r(va,` and runs end-to-end tokenization: punctuation
splitting and wordpiece.`),va.forEach(t),Nl=c(Io),rn=a(Io,"P",{});var ri=i(rn);Zl=r(ri,"Refer to superclass "),Er=a(ri,"A",{href:!0});var bu=i(Er);Al=r(bu,"BertTokenizer"),bu.forEach(t),Ql=r(ri," for usage examples and documentation concerning parameters."),ri.forEach(t),Io.forEach(t),$a=c(o),Mt=a(o,"H2",{class:!0});var si=i(Mt);so=a(si,"A",{id:!0,class:!0,href:!0});var yu=i(so);fs=a(yu,"SPAN",{});var Tu=i(fs);w(sn.$$.fragment,Tu),Tu.forEach(t),yu.forEach(t),Bl=c(si),gs=a(si,"SPAN",{});var wu=i(gs);Vl=r(wu,"DPRQuestionEncoderTokenizerFast"),wu.forEach(t),si.forEach(t),Pa=c(o),tt=a(o,"DIV",{class:!0});var Jo=i(tt);w(an.$$.fragment,Jo),Sl=c(Jo),ln=a(Jo,"P",{});var ai=i(ln);Wl=r(ai,"Constructs a \u201Cfast\u201D DPRQuestionEncoder tokenizer (backed by HuggingFace\u2019s "),_s=a(ai,"EM",{});var Ru=i(_s);Gl=r(Ru,"tokenizers"),Ru.forEach(t),Ll=r(ai," library)."),ai.forEach(t),Ol=c(Jo),ao=a(Jo,"P",{});var ba=i(ao);$r=a(ba,"A",{href:!0});var ku=i($r);Xl=r(ku,"DPRQuestionEncoderTokenizerFast"),ku.forEach(t),Hl=r(ba," is identical to "),Pr=a(ba,"A",{href:!0});var Eu=i(Pr);Yl=r(Eu,"BertTokenizerFast"),Eu.forEach(t),Kl=r(ba,` and runs end-to-end tokenization:
punctuation splitting and wordpiece.`),ba.forEach(t),ed=c(Jo),dn=a(Jo,"P",{});var ii=i(dn);td=r(ii,"Refer to superclass "),Dr=a(ii,"A",{href:!0});var $u=i(Dr);od=r($u,"BertTokenizerFast"),$u.forEach(t),nd=r(ii," for usage examples and documentation concerning parameters."),ii.forEach(t),Jo.forEach(t),Da=c(o),Ft=a(o,"H2",{class:!0});var li=i(Ft);io=a(li,"A",{id:!0,class:!0,href:!0});var Pu=i(io);vs=a(Pu,"SPAN",{});var Du=i(vs);w(cn.$$.fragment,Du),Du.forEach(t),Pu.forEach(t),rd=c(li),bs=a(li,"SPAN",{});var xu=i(bs);sd=r(xu,"DPRReaderTokenizer"),xu.forEach(t),li.forEach(t),xa=c(o),be=a(o,"DIV",{class:!0});var mt=i(be);w(pn.$$.fragment,mt),ad=c(mt),ys=a(mt,"P",{});var zu=i(ys);id=r(zu,"Construct a DPRReader tokenizer."),zu.forEach(t),ld=c(mt),yt=a(mt,"P",{});var cr=i(yt);xr=a(cr,"A",{href:!0});var Mu=i(xr);dd=r(Mu,"DPRReaderTokenizer"),Mu.forEach(t),cd=r(cr," is almost identical to "),zr=a(cr,"A",{href:!0});var Fu=i(zr);pd=r(Fu,"BertTokenizer"),Fu.forEach(t),hd=r(cr,` 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 `),Mr=a(cr,"A",{href:!0});var Cu=i(Mr);ud=r(Cu,"DPRReader"),Cu.forEach(t),md=r(cr," model."),cr.forEach(t),fd=c(mt),hn=a(mt,"P",{});var di=i(hn);gd=r(di,"Refer to superclass "),Fr=a(di,"A",{href:!0});var qu=i(Fr);_d=r(qu,"BertTokenizer"),qu.forEach(t),vd=r(di," for usage examples and documentation concerning parameters."),di.forEach(t),bd=c(mt),Tt=a(mt,"P",{});var pr=i(Tt);yd=r(pr,"Return a dictionary with the token ids of the input strings and other information to give to "),Ts=a(pr,"CODE",{});var Iu=i(Ts);Td=r(Iu,".decode_best_spans"),Iu.forEach(t),wd=r(pr,`.
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 `),ws=a(pr,"CODE",{});var Ju=i(ws);Rd=r(Ju,"input_ids"),Ju.forEach(t),kd=r(pr," is a matrix of size "),Rs=a(pr,"CODE",{});var Uu=i(Rs);Ed=r(Uu,"(n_passages, sequence_length)"),Uu.forEach(t),pr.forEach(t),$d=c(mt),w(lo.$$.fragment,mt),mt.forEach(t),za=c(o),Ct=a(o,"H2",{class:!0});var ci=i(Ct);co=a(ci,"A",{id:!0,class:!0,href:!0});var ju=i(co);ks=a(ju,"SPAN",{});var Nu=i(ks);w(un.$$.fragment,Nu),Nu.forEach(t),ju.forEach(t),Pd=c(ci),Es=a(ci,"SPAN",{});var Zu=i(Es);Dd=r(Zu,"DPRReaderTokenizerFast"),Zu.forEach(t),ci.forEach(t),Ma=c(o),ye=a(o,"DIV",{class:!0});var ft=i(ye);w(mn.$$.fragment,ft),xd=c(ft),fn=a(ft,"P",{});var pi=i(fn);zd=r(pi,"Constructs a \u201Cfast\u201D DPRReader tokenizer (backed by HuggingFace\u2019s "),$s=a(pi,"EM",{});var Au=i($s);Md=r(Au,"tokenizers"),Au.forEach(t),Fd=r(pi," library)."),pi.forEach(t),Cd=c(ft),wt=a(ft,"P",{});var hr=i(wt);Cr=a(hr,"A",{href:!0});var Qu=i(Cr);qd=r(Qu,"DPRReaderTokenizerFast"),Qu.forEach(t),Id=r(hr," is almost identical to "),qr=a(hr,"A",{href:!0});var Bu=i(qr);Jd=r(Bu,"BertTokenizerFast"),Bu.forEach(t),Ud=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 `),Ir=a(hr,"A",{href:!0});var Vu=i(Ir);jd=r(Vu,"DPRReader"),Vu.forEach(t),Nd=r(hr," model."),hr.forEach(t),Zd=c(ft),gn=a(ft,"P",{});var hi=i(gn);Ad=r(hi,"Refer to superclass "),Jr=a(hi,"A",{href:!0});var Su=i(Jr);Qd=r(Su,"BertTokenizerFast"),Su.forEach(t),Bd=r(hi," for usage examples and documentation concerning parameters."),hi.forEach(t),Vd=c(ft),bt=a(ft,"P",{});var Uo=i(bt);Sd=r(Uo,"Return a dictionary with the token ids of the input strings and other information to give to "),Ps=a(Uo,"CODE",{});var Wu=i(Ps);Wd=r(Wu,".decode_best_spans"),Wu.forEach(t),Gd=r(Uo,`.
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 `),Ds=a(Uo,"CODE",{});var Gu=i(Ds);Ld=r(Gu,"input_ids"),Gu.forEach(t),Od=r(Uo," is a matrix of size "),xs=a(Uo,"CODE",{});var Lu=i(xs);Xd=r(Lu,"(n_passages, sequence_length)"),Lu.forEach(t),Hd=r(Uo,`
with the format:`),Uo.forEach(t),Yd=c(ft),zs=a(ft,"P",{});var Ou=i(zs);Kd=r(Ou,"[CLS] <question token ids> [SEP] <titles ids> [SEP] <texts ids>"),Ou.forEach(t),ft.forEach(t),Fa=c(o),qt=a(o,"H2",{class:!0});var ui=i(qt);po=a(ui,"A",{id:!0,class:!0,href:!0});var Xu=i(po);Ms=a(Xu,"SPAN",{});var Hu=i(Ms);w(_n.$$.fragment,Hu),Hu.forEach(t),Xu.forEach(t),ec=c(ui),Fs=a(ui,"SPAN",{});var Yu=i(Fs);tc=r(Yu,"DPR specific outputs"),Yu.forEach(t),ui.forEach(t),Ca=c(o),It=a(o,"DIV",{class:!0});var mi=i(It);w(vn.$$.fragment,mi),oc=c(mi),bn=a(mi,"P",{});var fi=i(bn);nc=r(fi,"Class for outputs of "),Ur=a(fi,"A",{href:!0});var Ku=i(Ur);rc=r(Ku,"DPRQuestionEncoder"),Ku.forEach(t),sc=r(fi,"."),fi.forEach(t),mi.forEach(t),qa=c(o),Jt=a(o,"DIV",{class:!0});var gi=i(Jt);w(yn.$$.fragment,gi),ac=c(gi),Tn=a(gi,"P",{});var _i=i(Tn);ic=r(_i,"Class for outputs of "),jr=a(_i,"A",{href:!0});var em=i(jr);lc=r(em,"DPRQuestionEncoder"),em.forEach(t),dc=r(_i,"."),_i.forEach(t),gi.forEach(t),Ia=c(o),Ut=a(o,"DIV",{class:!0});var vi=i(Ut);w(wn.$$.fragment,vi),cc=c(vi),Rn=a(vi,"P",{});var bi=i(Rn);pc=r(bi,"Class for outputs of "),Nr=a(bi,"A",{href:!0});var tm=i(Nr);hc=r(tm,"DPRQuestionEncoder"),tm.forEach(t),uc=r(bi,"."),bi.forEach(t),vi.forEach(t),Ja=c(o),jt=a(o,"H2",{class:!0});var yi=i(jt);ho=a(yi,"A",{id:!0,class:!0,href:!0});var om=i(ho);Cs=a(om,"SPAN",{});var nm=i(Cs);w(kn.$$.fragment,nm),nm.forEach(t),om.forEach(t),mc=c(yi),qs=a(yi,"SPAN",{});var rm=i(qs);fc=r(rm,"DPRContextEncoder"),rm.forEach(t),yi.forEach(t),Ua=c(o),Ve=a(o,"DIV",{class:!0});var Et=i(Ve);w(En.$$.fragment,Et),gc=c(Et),Is=a(Et,"P",{});var sm=i(Is);_c=r(sm,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),sm.forEach(t),vc=c(Et),$n=a(Et,"P",{});var Ti=i($n);bc=r(Ti,"This model inherits from "),Zr=a(Ti,"A",{href:!0});var am=i(Zr);yc=r(am,"PreTrainedModel"),am.forEach(t),Tc=r(Ti,`. 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.)`),Ti.forEach(t),wc=c(Et),Pn=a(Et,"P",{});var wi=i(Pn);Rc=r(wi,"This model is also a PyTorch "),Dn=a(wi,"A",{href:!0,rel:!0});var im=i(Dn);kc=r(im,"torch.nn.Module"),im.forEach(t),Ec=r(wi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),wi.forEach(t),$c=c(Et),lt=a(Et,"DIV",{class:!0});var jo=i(lt);w(xn.$$.fragment,jo),Pc=c(jo),Nt=a(jo,"P",{});var Kr=i(Nt);Dc=r(Kr,"The "),Ar=a(Kr,"A",{href:!0});var lm=i(Ar);xc=r(lm,"DPRContextEncoder"),lm.forEach(t),zc=r(Kr," forward method, overrides the "),Js=a(Kr,"CODE",{});var dm=i(Js);Mc=r(dm,"__call__"),dm.forEach(t),Fc=r(Kr," special method."),Kr.forEach(t),Cc=c(jo),w(uo.$$.fragment,jo),qc=c(jo),w(mo.$$.fragment,jo),jo.forEach(t),Et.forEach(t),ja=c(o),Zt=a(o,"H2",{class:!0});var Ri=i(Zt);fo=a(Ri,"A",{id:!0,class:!0,href:!0});var cm=i(fo);Us=a(cm,"SPAN",{});var pm=i(Us);w(zn.$$.fragment,pm),pm.forEach(t),cm.forEach(t),Ic=c(Ri),js=a(Ri,"SPAN",{});var hm=i(js);Jc=r(hm,"DPRQuestionEncoder"),hm.forEach(t),Ri.forEach(t),Na=c(o),Se=a(o,"DIV",{class:!0});var $t=i(Se);w(Mn.$$.fragment,$t),Uc=c($t),Ns=a($t,"P",{});var um=i(Ns);jc=r(um,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),um.forEach(t),Nc=c($t),Fn=a($t,"P",{});var ki=i(Fn);Zc=r(ki,"This model inherits from "),Qr=a(ki,"A",{href:!0});var mm=i(Qr);Ac=r(mm,"PreTrainedModel"),mm.forEach(t),Qc=r(ki,`. 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.)`),ki.forEach(t),Bc=c($t),Cn=a($t,"P",{});var Ei=i(Cn);Vc=r(Ei,"This model is also a PyTorch "),qn=a(Ei,"A",{href:!0,rel:!0});var fm=i(qn);Sc=r(fm,"torch.nn.Module"),fm.forEach(t),Wc=r(Ei,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ei.forEach(t),Gc=c($t),dt=a($t,"DIV",{class:!0});var No=i(dt);w(In.$$.fragment,No),Lc=c(No),At=a(No,"P",{});var es=i(At);Oc=r(es,"The "),Br=a(es,"A",{href:!0});var gm=i(Br);Xc=r(gm,"DPRQuestionEncoder"),gm.forEach(t),Hc=r(es," forward method, overrides the "),Zs=a(es,"CODE",{});var _m=i(Zs);Yc=r(_m,"__call__"),_m.forEach(t),Kc=r(es," special method."),es.forEach(t),ep=c(No),w(go.$$.fragment,No),tp=c(No),w(_o.$$.fragment,No),No.forEach(t),$t.forEach(t),Za=c(o),Qt=a(o,"H2",{class:!0});var $i=i(Qt);vo=a($i,"A",{id:!0,class:!0,href:!0});var vm=i(vo);As=a(vm,"SPAN",{});var bm=i(As);w(Jn.$$.fragment,bm),bm.forEach(t),vm.forEach(t),op=c($i),Qs=a($i,"SPAN",{});var ym=i(Qs);np=r(ym,"DPRReader"),ym.forEach(t),$i.forEach(t),Aa=c(o),We=a(o,"DIV",{class:!0});var Pt=i(We);w(Un.$$.fragment,Pt),rp=c(Pt),Bs=a(Pt,"P",{});var Tm=i(Bs);sp=r(Tm,"The bare DPRReader transformer outputting span predictions."),Tm.forEach(t),ap=c(Pt),jn=a(Pt,"P",{});var Pi=i(jn);ip=r(Pi,"This model inherits from "),Vr=a(Pi,"A",{href:!0});var wm=i(Vr);lp=r(wm,"PreTrainedModel"),wm.forEach(t),dp=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),cp=c(Pt),Nn=a(Pt,"P",{});var Di=i(Nn);pp=r(Di,"This model is also a PyTorch "),Zn=a(Di,"A",{href:!0,rel:!0});var Rm=i(Zn);hp=r(Rm,"torch.nn.Module"),Rm.forEach(t),up=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),mp=c(Pt),ct=a(Pt,"DIV",{class:!0});var Zo=i(ct);w(An.$$.fragment,Zo),fp=c(Zo),Bt=a(Zo,"P",{});var ts=i(Bt);gp=r(ts,"The "),Sr=a(ts,"A",{href:!0});var km=i(Sr);_p=r(km,"DPRReader"),km.forEach(t),vp=r(ts," forward method, overrides the "),Vs=a(ts,"CODE",{});var Em=i(Vs);bp=r(Em,"__call__"),Em.forEach(t),yp=r(ts," special method."),ts.forEach(t),Tp=c(Zo),w(bo.$$.fragment,Zo),wp=c(Zo),w(yo.$$.fragment,Zo),Zo.forEach(t),Pt.forEach(t),Qa=c(o),Vt=a(o,"H2",{class:!0});var xi=i(Vt);To=a(xi,"A",{id:!0,class:!0,href:!0});var $m=i(To);Ss=a($m,"SPAN",{});var Pm=i(Ss);w(Qn.$$.fragment,Pm),Pm.forEach(t),$m.forEach(t),Rp=c(xi),Ws=a(xi,"SPAN",{});var Dm=i(Ws);kp=r(Dm,"TFDPRContextEncoder"),Dm.forEach(t),xi.forEach(t),Ba=c(o),Te=a(o,"DIV",{class:!0});var gt=i(Te);w(Bn.$$.fragment,gt),Ep=c(gt),Gs=a(gt,"P",{});var xm=i(Gs);$p=r(xm,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),xm.forEach(t),Pp=c(gt),Vn=a(gt,"P",{});var zi=i(Vn);Dp=r(zi,"This model inherits from "),Wr=a(zi,"A",{href:!0});var zm=i(Wr);xp=r(zm,"TFPreTrainedModel"),zm.forEach(t),zp=r(zi,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zi.forEach(t),Mp=c(gt),Sn=a(gt,"P",{});var Mi=i(Sn);Fp=r(Mi,"This model is also a Tensorflow "),Wn=a(Mi,"A",{href:!0,rel:!0});var Mm=i(Wn);Cp=r(Mm,"tf.keras.Model"),Mm.forEach(t),qp=r(Mi,`
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.`),Mi.forEach(t),Ip=c(gt),w(wo.$$.fragment,gt),Jp=c(gt),pt=a(gt,"DIV",{class:!0});var Ao=i(pt);w(Gn.$$.fragment,Ao),Up=c(Ao),St=a(Ao,"P",{});var os=i(St);jp=r(os,"The "),Gr=a(os,"A",{href:!0});var Fm=i(Gr);Np=r(Fm,"TFDPRContextEncoder"),Fm.forEach(t),Zp=r(os," forward method, overrides the "),Ls=a(os,"CODE",{});var Cm=i(Ls);Ap=r(Cm,"__call__"),Cm.forEach(t),Qp=r(os," special method."),os.forEach(t),Bp=c(Ao),w(Ro.$$.fragment,Ao),Vp=c(Ao),w(ko.$$.fragment,Ao),Ao.forEach(t),gt.forEach(t),Va=c(o),Wt=a(o,"H2",{class:!0});var Fi=i(Wt);Eo=a(Fi,"A",{id:!0,class:!0,href:!0});var qm=i(Eo);Os=a(qm,"SPAN",{});var Im=i(Os);w(Ln.$$.fragment,Im),Im.forEach(t),qm.forEach(t),Sp=c(Fi),Xs=a(Fi,"SPAN",{});var Jm=i(Xs);Wp=r(Jm,"TFDPRQuestionEncoder"),Jm.forEach(t),Fi.forEach(t),Sa=c(o),we=a(o,"DIV",{class:!0});var _t=i(we);w(On.$$.fragment,_t),Gp=c(_t),Hs=a(_t,"P",{});var Um=i(Hs);Lp=r(Um,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),Um.forEach(t),Op=c(_t),Xn=a(_t,"P",{});var Ci=i(Xn);Xp=r(Ci,"This model inherits from "),Lr=a(Ci,"A",{href:!0});var jm=i(Lr);Hp=r(jm,"TFPreTrainedModel"),jm.forEach(t),Yp=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),Kp=c(_t),Hn=a(_t,"P",{});var qi=i(Hn);eh=r(qi,"This model is also a Tensorflow "),Yn=a(qi,"A",{href:!0,rel:!0});var Nm=i(Yn);th=r(Nm,"tf.keras.Model"),Nm.forEach(t),oh=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),nh=c(_t),w($o.$$.fragment,_t),rh=c(_t),ht=a(_t,"DIV",{class:!0});var Qo=i(ht);w(Kn.$$.fragment,Qo),sh=c(Qo),Gt=a(Qo,"P",{});var ns=i(Gt);ah=r(ns,"The "),Or=a(ns,"A",{href:!0});var Zm=i(Or);ih=r(Zm,"TFDPRQuestionEncoder"),Zm.forEach(t),lh=r(ns," forward method, overrides the "),Ys=a(ns,"CODE",{});var Am=i(Ys);dh=r(Am,"__call__"),Am.forEach(t),ch=r(ns," special method."),ns.forEach(t),ph=c(Qo),w(Po.$$.fragment,Qo),hh=c(Qo),w(Do.$$.fragment,Qo),Qo.forEach(t),_t.forEach(t),Wa=c(o),Lt=a(o,"H2",{class:!0});var Ii=i(Lt);xo=a(Ii,"A",{id:!0,class:!0,href:!0});var Qm=i(xo);Ks=a(Qm,"SPAN",{});var Bm=i(Ks);w(er.$$.fragment,Bm),Bm.forEach(t),Qm.forEach(t),uh=c(Ii),ea=a(Ii,"SPAN",{});var Vm=i(ea);mh=r(Vm,"TFDPRReader"),Vm.forEach(t),Ii.forEach(t),Ga=c(o),Re=a(o,"DIV",{class:!0});var vt=i(Re);w(tr.$$.fragment,vt),fh=c(vt),ta=a(vt,"P",{});var Sm=i(ta);gh=r(Sm,"The bare DPRReader transformer outputting span predictions."),Sm.forEach(t),_h=c(vt),or=a(vt,"P",{});var Ji=i(or);vh=r(Ji,"This model inherits from "),Xr=a(Ji,"A",{href:!0});var Wm=i(Xr);bh=r(Wm,"TFPreTrainedModel"),Wm.forEach(t),yh=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),Th=c(vt),nr=a(vt,"P",{});var Ui=i(nr);wh=r(Ui,"This model is also a Tensorflow "),rr=a(Ui,"A",{href:!0,rel:!0});var Gm=i(rr);Rh=r(Gm,"tf.keras.Model"),Gm.forEach(t),kh=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),Eh=c(vt),w(zo.$$.fragment,vt),$h=c(vt),ut=a(vt,"DIV",{class:!0});var Bo=i(ut);w(sr.$$.fragment,Bo),Ph=c(Bo),Ot=a(Bo,"P",{});var rs=i(Ot);Dh=r(rs,"The "),Hr=a(rs,"A",{href:!0});var Lm=i(Hr);xh=r(Lm,"TFDPRReader"),Lm.forEach(t),zh=r(rs," forward method, overrides the "),oa=a(rs,"CODE",{});var Om=i(oa);Mh=r(Om,"__call__"),Om.forEach(t),Fh=r(rs," special method."),rs.forEach(t),Ch=c(Bo),w(Mo.$$.fragment,Bo),qh=c(Bo),w(Fo.$$.fragment,Bo),Bo.forEach(t),vt.forEach(t),this.h()},h(){p(h,"name","hf:doc:metadata"),p(h,"content",JSON.stringify(Tf)),p(g,"id","dpr"),p(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"),p(g,"href","#dpr"),p(_,"class","relative group"),p(H,"alt","Models"),Xm(H.src,P="https://img.shields.io/badge/All_model_pages-dpr-blueviolet")||p(H,"src",P),p(de,"href","https://huggingface.co/models?filter=dpr"),p(ce,"alt","Spaces"),Xm(ce.src,Ge="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue")||p(ce,"src",Ge),p(B,"href","https://huggingface.co/spaces/docs-demos/dpr-question_encoder-bert-base-multilingual"),p(U,"class","flex flex-wrap space-x-1"),p(se,"id","overview"),p(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"),p(se,"href","#overview"),p(Y,"class","relative group"),p(le,"href","https://arxiv.org/abs/2004.04906"),p(le,"rel","nofollow"),p(Z,"href","https://huggingface.co/lhoestq"),p(Z,"rel","nofollow"),p(A,"href","https://github.com/facebookresearch/DPR"),p(A,"rel","nofollow"),p(_e,"id","transformers.DPRConfig"),p(_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"),p(_e,"href","#transformers.DPRConfig"),p(fe,"class","relative group"),p(re,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRConfig"),p(ur,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRContextEncoder"),p(mr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(fr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),p(Go,"href","https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base"),p(Go,"rel","nofollow"),p(gr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertConfig"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Kt,"id","transformers.DPRContextEncoderTokenizer"),p(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"),p(Kt,"href","#transformers.DPRContextEncoderTokenizer"),p(Dt,"class","relative group"),p(_r,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRContextEncoderTokenizer"),p(vr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(br,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(to,"id","transformers.DPRContextEncoderTokenizerFast"),p(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"),p(to,"href","#transformers.DPRContextEncoderTokenizerFast"),p(xt,"class","relative group"),p(yr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRContextEncoderTokenizerFast"),p(Tr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(wr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(no,"id","transformers.DPRQuestionEncoderTokenizer"),p(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"),p(no,"href","#transformers.DPRQuestionEncoderTokenizer"),p(zt,"class","relative group"),p(Rr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizer"),p(kr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(Er,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(so,"id","transformers.DPRQuestionEncoderTokenizerFast"),p(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"),p(so,"href","#transformers.DPRQuestionEncoderTokenizerFast"),p(Mt,"class","relative group"),p($r,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizerFast"),p(Pr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(Dr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(io,"id","transformers.DPRReaderTokenizer"),p(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"),p(io,"href","#transformers.DPRReaderTokenizer"),p(Ft,"class","relative group"),p(xr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReaderTokenizer"),p(zr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(Mr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),p(Fr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizer"),p(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(co,"id","transformers.DPRReaderTokenizerFast"),p(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"),p(co,"href","#transformers.DPRReaderTokenizerFast"),p(Ct,"class","relative group"),p(Cr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReaderTokenizerFast"),p(qr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(Ir,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),p(Jr,"href","/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast"),p(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(po,"id","transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"),p(po,"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"),p(po,"href","#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"),p(qt,"class","relative group"),p(Ur,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(jr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Nr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ho,"id","transformers.DPRContextEncoder"),p(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"),p(ho,"href","#transformers.DPRContextEncoder"),p(jt,"class","relative group"),p(Zr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Dn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Dn,"rel","nofollow"),p(Ar,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRContextEncoder"),p(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(fo,"id","transformers.DPRQuestionEncoder"),p(fo,"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"),p(fo,"href","#transformers.DPRQuestionEncoder"),p(Zt,"class","relative group"),p(Qr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(qn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(qn,"rel","nofollow"),p(Br,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(vo,"id","transformers.DPRReader"),p(vo,"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"),p(vo,"href","#transformers.DPRReader"),p(Qt,"class","relative group"),p(Vr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Zn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Zn,"rel","nofollow"),p(Sr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.DPRReader"),p(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(To,"id","transformers.TFDPRContextEncoder"),p(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"),p(To,"href","#transformers.TFDPRContextEncoder"),p(Vt,"class","relative group"),p(Wr,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(Wn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Wn,"rel","nofollow"),p(Gr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.TFDPRContextEncoder"),p(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Eo,"id","transformers.TFDPRQuestionEncoder"),p(Eo,"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"),p(Eo,"href","#transformers.TFDPRQuestionEncoder"),p(Wt,"class","relative group"),p(Lr,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(Yn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(Yn,"rel","nofollow"),p(Or,"href","/docs/transformers/main/en/model_doc/dpr#transformers.TFDPRQuestionEncoder"),p(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(xo,"id","transformers.TFDPRReader"),p(xo,"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"),p(xo,"href","#transformers.TFDPRReader"),p(Lt,"class","relative group"),p(Xr,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),p(rr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),p(rr,"rel","nofollow"),p(Hr,"href","/docs/transformers/main/en/model_doc/dpr#transformers.TFDPRReader"),p(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(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,ke,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,Ee,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,G),e(G,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,Oe),e(Oe,at),m(o,O,f),m(o,V,f),R(xe,V,null),e(V,Be),e(V,ve),e(ve,re),e(re,it),e(ve,ji),e(ve,ss),e(ss,Ni),e(ve,Zi),e(V,Ai),e(V,He),e(He,Qi),e(He,ur),e(ur,Bi),e(He,Vi),e(He,mr),e(mr,Si),e(He,Wi),e(He,fr),e(fr,Gi),e(He,Li),e(He,Go),e(Go,Oi),e(He,Xi),e(V,Hi),e(V,Lo),e(Lo,Yi),e(Lo,gr),e(gr,Ki),e(Lo,el),e(V,tl),R(Yt,V,null),m(o,ya,f),m(o,Dt,f),e(Dt,Kt),e(Kt,as),R(Oo,as,null),e(Dt,ol),e(Dt,is),e(is,nl),m(o,Ta,f),m(o,Ye,f),R(Xo,Ye,null),e(Ye,rl),e(Ye,ls),e(ls,sl),e(Ye,al),e(Ye,eo),e(eo,_r),e(_r,il),e(eo,ll),e(eo,vr),e(vr,dl),e(eo,cl),e(Ye,pl),e(Ye,Ho),e(Ho,hl),e(Ho,br),e(br,ul),e(Ho,ml),m(o,wa,f),m(o,xt,f),e(xt,to),e(to,ds),R(Yo,ds,null),e(xt,fl),e(xt,cs),e(cs,gl),m(o,Ra,f),m(o,Ke,f),R(Ko,Ke,null),e(Ke,_l),e(Ke,en),e(en,vl),e(en,ps),e(ps,bl),e(en,yl),e(Ke,Tl),e(Ke,oo),e(oo,yr),e(yr,wl),e(oo,Rl),e(oo,Tr),e(Tr,kl),e(oo,El),e(Ke,$l),e(Ke,tn),e(tn,Pl),e(tn,wr),e(wr,Dl),e(tn,xl),m(o,ka,f),m(o,zt,f),e(zt,no),e(no,hs),R(on,hs,null),e(zt,zl),e(zt,us),e(us,Ml),m(o,Ea,f),m(o,et,f),R(nn,et,null),e(et,Fl),e(et,ms),e(ms,Cl),e(et,ql),e(et,ro),e(ro,Rr),e(Rr,Il),e(ro,Jl),e(ro,kr),e(kr,Ul),e(ro,jl),e(et,Nl),e(et,rn),e(rn,Zl),e(rn,Er),e(Er,Al),e(rn,Ql),m(o,$a,f),m(o,Mt,f),e(Mt,so),e(so,fs),R(sn,fs,null),e(Mt,Bl),e(Mt,gs),e(gs,Vl),m(o,Pa,f),m(o,tt,f),R(an,tt,null),e(tt,Sl),e(tt,ln),e(ln,Wl),e(ln,_s),e(_s,Gl),e(ln,Ll),e(tt,Ol),e(tt,ao),e(ao,$r),e($r,Xl),e(ao,Hl),e(ao,Pr),e(Pr,Yl),e(ao,Kl),e(tt,ed),e(tt,dn),e(dn,td),e(dn,Dr),e(Dr,od),e(dn,nd),m(o,Da,f),m(o,Ft,f),e(Ft,io),e(io,vs),R(cn,vs,null),e(Ft,rd),e(Ft,bs),e(bs,sd),m(o,xa,f),m(o,be,f),R(pn,be,null),e(be,ad),e(be,ys),e(ys,id),e(be,ld),e(be,yt),e(yt,xr),e(xr,dd),e(yt,cd),e(yt,zr),e(zr,pd),e(yt,hd),e(yt,Mr),e(Mr,ud),e(yt,md),e(be,fd),e(be,hn),e(hn,gd),e(hn,Fr),e(Fr,_d),e(hn,vd),e(be,bd),e(be,Tt),e(Tt,yd),e(Tt,Ts),e(Ts,Td),e(Tt,wd),e(Tt,ws),e(ws,Rd),e(Tt,kd),e(Tt,Rs),e(Rs,Ed),e(be,$d),R(lo,be,null),m(o,za,f),m(o,Ct,f),e(Ct,co),e(co,ks),R(un,ks,null),e(Ct,Pd),e(Ct,Es),e(Es,Dd),m(o,Ma,f),m(o,ye,f),R(mn,ye,null),e(ye,xd),e(ye,fn),e(fn,zd),e(fn,$s),e($s,Md),e(fn,Fd),e(ye,Cd),e(ye,wt),e(wt,Cr),e(Cr,qd),e(wt,Id),e(wt,qr),e(qr,Jd),e(wt,Ud),e(wt,Ir),e(Ir,jd),e(wt,Nd),e(ye,Zd),e(ye,gn),e(gn,Ad),e(gn,Jr),e(Jr,Qd),e(gn,Bd),e(ye,Vd),e(ye,bt),e(bt,Sd),e(bt,Ps),e(Ps,Wd),e(bt,Gd),e(bt,Ds),e(Ds,Ld),e(bt,Od),e(bt,xs),e(xs,Xd),e(bt,Hd),e(ye,Yd),e(ye,zs),e(zs,Kd),m(o,Fa,f),m(o,qt,f),e(qt,po),e(po,Ms),R(_n,Ms,null),e(qt,ec),e(qt,Fs),e(Fs,tc),m(o,Ca,f),m(o,It,f),R(vn,It,null),e(It,oc),e(It,bn),e(bn,nc),e(bn,Ur),e(Ur,rc),e(bn,sc),m(o,qa,f),m(o,Jt,f),R(yn,Jt,null),e(Jt,ac),e(Jt,Tn),e(Tn,ic),e(Tn,jr),e(jr,lc),e(Tn,dc),m(o,Ia,f),m(o,Ut,f),R(wn,Ut,null),e(Ut,cc),e(Ut,Rn),e(Rn,pc),e(Rn,Nr),e(Nr,hc),e(Rn,uc),m(o,Ja,f),m(o,jt,f),e(jt,ho),e(ho,Cs),R(kn,Cs,null),e(jt,mc),e(jt,qs),e(qs,fc),m(o,Ua,f),m(o,Ve,f),R(En,Ve,null),e(Ve,gc),e(Ve,Is),e(Is,_c),e(Ve,vc),e(Ve,$n),e($n,bc),e($n,Zr),e(Zr,yc),e($n,Tc),e(Ve,wc),e(Ve,Pn),e(Pn,Rc),e(Pn,Dn),e(Dn,kc),e(Pn,Ec),e(Ve,$c),e(Ve,lt),R(xn,lt,null),e(lt,Pc),e(lt,Nt),e(Nt,Dc),e(Nt,Ar),e(Ar,xc),e(Nt,zc),e(Nt,Js),e(Js,Mc),e(Nt,Fc),e(lt,Cc),R(uo,lt,null),e(lt,qc),R(mo,lt,null),m(o,ja,f),m(o,Zt,f),e(Zt,fo),e(fo,Us),R(zn,Us,null),e(Zt,Ic),e(Zt,js),e(js,Jc),m(o,Na,f),m(o,Se,f),R(Mn,Se,null),e(Se,Uc),e(Se,Ns),e(Ns,jc),e(Se,Nc),e(Se,Fn),e(Fn,Zc),e(Fn,Qr),e(Qr,Ac),e(Fn,Qc),e(Se,Bc),e(Se,Cn),e(Cn,Vc),e(Cn,qn),e(qn,Sc),e(Cn,Wc),e(Se,Gc),e(Se,dt),R(In,dt,null),e(dt,Lc),e(dt,At),e(At,Oc),e(At,Br),e(Br,Xc),e(At,Hc),e(At,Zs),e(Zs,Yc),e(At,Kc),e(dt,ep),R(go,dt,null),e(dt,tp),R(_o,dt,null),m(o,Za,f),m(o,Qt,f),e(Qt,vo),e(vo,As),R(Jn,As,null),e(Qt,op),e(Qt,Qs),e(Qs,np),m(o,Aa,f),m(o,We,f),R(Un,We,null),e(We,rp),e(We,Bs),e(Bs,sp),e(We,ap),e(We,jn),e(jn,ip),e(jn,Vr),e(Vr,lp),e(jn,dp),e(We,cp),e(We,Nn),e(Nn,pp),e(Nn,Zn),e(Zn,hp),e(Nn,up),e(We,mp),e(We,ct),R(An,ct,null),e(ct,fp),e(ct,Bt),e(Bt,gp),e(Bt,Sr),e(Sr,_p),e(Bt,vp),e(Bt,Vs),e(Vs,bp),e(Bt,yp),e(ct,Tp),R(bo,ct,null),e(ct,wp),R(yo,ct,null),m(o,Qa,f),m(o,Vt,f),e(Vt,To),e(To,Ss),R(Qn,Ss,null),e(Vt,Rp),e(Vt,Ws),e(Ws,kp),m(o,Ba,f),m(o,Te,f),R(Bn,Te,null),e(Te,Ep),e(Te,Gs),e(Gs,$p),e(Te,Pp),e(Te,Vn),e(Vn,Dp),e(Vn,Wr),e(Wr,xp),e(Vn,zp),e(Te,Mp),e(Te,Sn),e(Sn,Fp),e(Sn,Wn),e(Wn,Cp),e(Sn,qp),e(Te,Ip),R(wo,Te,null),e(Te,Jp),e(Te,pt),R(Gn,pt,null),e(pt,Up),e(pt,St),e(St,jp),e(St,Gr),e(Gr,Np),e(St,Zp),e(St,Ls),e(Ls,Ap),e(St,Qp),e(pt,Bp),R(Ro,pt,null),e(pt,Vp),R(ko,pt,null),m(o,Va,f),m(o,Wt,f),e(Wt,Eo),e(Eo,Os),R(Ln,Os,null),e(Wt,Sp),e(Wt,Xs),e(Xs,Wp),m(o,Sa,f),m(o,we,f),R(On,we,null),e(we,Gp),e(we,Hs),e(Hs,Lp),e(we,Op),e(we,Xn),e(Xn,Xp),e(Xn,Lr),e(Lr,Hp),e(Xn,Yp),e(we,Kp),e(we,Hn),e(Hn,eh),e(Hn,Yn),e(Yn,th),e(Hn,oh),e(we,nh),R($o,we,null),e(we,rh),e(we,ht),R(Kn,ht,null),e(ht,sh),e(ht,Gt),e(Gt,ah),e(Gt,Or),e(Or,ih),e(Gt,lh),e(Gt,Ys),e(Ys,dh),e(Gt,ch),e(ht,ph),R(Po,ht,null),e(ht,hh),R(Do,ht,null),m(o,Wa,f),m(o,Lt,f),e(Lt,xo),e(xo,Ks),R(er,Ks,null),e(Lt,uh),e(Lt,ea),e(ea,mh),m(o,Ga,f),m(o,Re,f),R(tr,Re,null),e(Re,fh),e(Re,ta),e(ta,gh),e(Re,_h),e(Re,or),e(or,vh),e(or,Xr),e(Xr,bh),e(or,yh),e(Re,Th),e(Re,nr),e(nr,wh),e(nr,rr),e(rr,Rh),e(nr,kh),e(Re,Eh),R(zo,Re,null),e(Re,$h),e(Re,ut),R(sr,ut,null),e(ut,Ph),e(ut,Ot),e(Ot,Dh),e(Ot,Hr),e(Hr,xh),e(Ot,zh),e(Ot,oa),e(oa,Mh),e(Ot,Fh),e(ut,Ch),R(Mo,ut,null),e(ut,qh),R(Fo,ut,null),La=!0},p(o,[f]){const ar={};f&2&&(ar.$$scope={dirty:f,ctx:o}),Yt.$set(ar);const na={};f&2&&(na.$$scope={dirty:f,ctx:o}),lo.$set(na);const ra={};f&2&&(ra.$$scope={dirty:f,ctx:o}),uo.$set(ra);const sa={};f&2&&(sa.$$scope={dirty:f,ctx:o}),mo.$set(sa);const ir={};f&2&&(ir.$$scope={dirty:f,ctx:o}),go.$set(ir);const aa={};f&2&&(aa.$$scope={dirty:f,ctx:o}),_o.$set(aa);const ia={};f&2&&(ia.$$scope={dirty:f,ctx:o}),bo.$set(ia);const lr={};f&2&&(lr.$$scope={dirty:f,ctx:o}),yo.$set(lr);const la={};f&2&&(la.$$scope={dirty:f,ctx:o}),wo.$set(la);const da={};f&2&&(da.$$scope={dirty:f,ctx:o}),Ro.$set(da);const ca={};f&2&&(ca.$$scope={dirty:f,ctx:o}),ko.$set(ca);const dr={};f&2&&(dr.$$scope={dirty:f,ctx:o}),$o.$set(dr);const pa={};f&2&&(pa.$$scope={dirty:f,ctx:o}),Po.$set(pa);const ha={};f&2&&(ha.$$scope={dirty:f,ctx:o}),Do.$set(ha);const ua={};f&2&&(ua.$$scope={dirty:f,ctx:o}),zo.$set(ua);const ma={};f&2&&(ma.$$scope={dirty:f,ctx:o}),Mo.$set(ma);const Xt={};f&2&&(Xt.$$scope={dirty:f,ctx:o}),Fo.$set(Xt)},i(o){La||(k(l.$$.fragment,o),k(ie.$$.fragment,o),k(J.$$.fragment,o),k(xe.$$.fragment,o),k(Yt.$$.fragment,o),k(Oo.$$.fragment,o),k(Xo.$$.fragment,o),k(Yo.$$.fragment,o),k(Ko.$$.fragment,o),k(on.$$.fragment,o),k(nn.$$.fragment,o),k(sn.$$.fragment,o),k(an.$$.fragment,o),k(cn.$$.fragment,o),k(pn.$$.fragment,o),k(lo.$$.fragment,o),k(un.$$.fragment,o),k(mn.$$.fragment,o),k(_n.$$.fragment,o),k(vn.$$.fragment,o),k(yn.$$.fragment,o),k(wn.$$.fragment,o),k(kn.$$.fragment,o),k(En.$$.fragment,o),k(xn.$$.fragment,o),k(uo.$$.fragment,o),k(mo.$$.fragment,o),k(zn.$$.fragment,o),k(Mn.$$.fragment,o),k(In.$$.fragment,o),k(go.$$.fragment,o),k(_o.$$.fragment,o),k(Jn.$$.fragment,o),k(Un.$$.fragment,o),k(An.$$.fragment,o),k(bo.$$.fragment,o),k(yo.$$.fragment,o),k(Qn.$$.fragment,o),k(Bn.$$.fragment,o),k(wo.$$.fragment,o),k(Gn.$$.fragment,o),k(Ro.$$.fragment,o),k(ko.$$.fragment,o),k(Ln.$$.fragment,o),k(On.$$.fragment,o),k($o.$$.fragment,o),k(Kn.$$.fragment,o),k(Po.$$.fragment,o),k(Do.$$.fragment,o),k(er.$$.fragment,o),k(tr.$$.fragment,o),k(zo.$$.fragment,o),k(sr.$$.fragment,o),k(Mo.$$.fragment,o),k(Fo.$$.fragment,o),La=!0)},o(o){E(l.$$.fragment,o),E(ie.$$.fragment,o),E(J.$$.fragment,o),E(xe.$$.fragment,o),E(Yt.$$.fragment,o),E(Oo.$$.fragment,o),E(Xo.$$.fragment,o),E(Yo.$$.fragment,o),E(Ko.$$.fragment,o),E(on.$$.fragment,o),E(nn.$$.fragment,o),E(sn.$$.fragment,o),E(an.$$.fragment,o),E(cn.$$.fragment,o),E(pn.$$.fragment,o),E(lo.$$.fragment,o),E(un.$$.fragment,o),E(mn.$$.fragment,o),E(_n.$$.fragment,o),E(vn.$$.fragment,o),E(yn.$$.fragment,o),E(wn.$$.fragment,o),E(kn.$$.fragment,o),E(En.$$.fragment,o),E(xn.$$.fragment,o),E(uo.$$.fragment,o),E(mo.$$.fragment,o),E(zn.$$.fragment,o),E(Mn.$$.fragment,o),E(In.$$.fragment,o),E(go.$$.fragment,o),E(_o.$$.fragment,o),E(Jn.$$.fragment,o),E(Un.$$.fragment,o),E(An.$$.fragment,o),E(bo.$$.fragment,o),E(yo.$$.fragment,o),E(Qn.$$.fragment,o),E(Bn.$$.fragment,o),E(wo.$$.fragment,o),E(Gn.$$.fragment,o),E(Ro.$$.fragment,o),E(ko.$$.fragment,o),E(Ln.$$.fragment,o),E(On.$$.fragment,o),E($o.$$.fragment,o),E(Kn.$$.fragment,o),E(Po.$$.fragment,o),E(Do.$$.fragment,o),E(er.$$.fragment,o),E(tr.$$.fragment,o),E(zo.$$.fragment,o),E(sr.$$.fragment,o),E(Mo.$$.fragment,o),E(Fo.$$.fragment,o),La=!1},d(o){t(h),o&&t(y),o&&t(_),$(l),o&&t(ke),o&&t(U),o&&t(L),o&&t(Y),$(ie),o&&t(Ee),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(O),o&&t(V),$(xe),$(Yt),o&&t(ya),o&&t(Dt),$(Oo),o&&t(Ta),o&&t(Ye),$(Xo),o&&t(wa),o&&t(xt),$(Yo),o&&t(Ra),o&&t(Ke),$(Ko),o&&t(ka),o&&t(zt),$(on),o&&t(Ea),o&&t(et),$(nn),o&&t($a),o&&t(Mt),$(sn),o&&t(Pa),o&&t(tt),$(an),o&&t(Da),o&&t(Ft),$(cn),o&&t(xa),o&&t(be),$(pn),$(lo),o&&t(za),o&&t(Ct),$(un),o&&t(Ma),o&&t(ye),$(mn),o&&t(Fa),o&&t(qt),$(_n),o&&t(Ca),o&&t(It),$(vn),o&&t(qa),o&&t(Jt),$(yn),o&&t(Ia),o&&t(Ut),$(wn),o&&t(Ja),o&&t(jt),$(kn),o&&t(Ua),o&&t(Ve),$(En),$(xn),$(uo),$(mo),o&&t(ja),o&&t(Zt),$(zn),o&&t(Na),o&&t(Se),$(Mn),$(In),$(go),$(_o),o&&t(Za),o&&t(Qt),$(Jn),o&&t(Aa),o&&t(We),$(Un),$(An),$(bo),$(yo),o&&t(Qa),o&&t(Vt),$(Qn),o&&t(Ba),o&&t(Te),$(Bn),$(wo),$(Gn),$(Ro),$(ko),o&&t(Va),o&&t(Wt),$(Ln),o&&t(Sa),o&&t(we),$(On),$($o),$(Kn),$(Po),$(Do),o&&t(Wa),o&&t(Lt),$(er),o&&t(Ga),o&&t(Re),$(tr),$(zo),$(sr),$(Mo),$(Fo)}}}const Tf={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 wf(F){return tf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xf extends Hm{constructor(h){super();Ym(this,h,wf,yf,Km,{})}}export{xf as default,Tf as metadata};
