import{S as Yf,i as Kf,s as em,e as s,k as d,w as T,t as n,M as tm,c as a,d as t,m as c,a as i,x as w,h as r,b as p,N as Hf,G as e,g as f,y as R,q as k,o as E,B as $,v as om,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 nm(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){f(l,h,u),e(h,y),f(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 rm(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){f(l,h,u),e(h,y),f(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 sm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function am(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){f(l,h,u),e(h,y),f(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 im(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function lm(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){f(l,h,u),e(h,y),f(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 dm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function cm(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){f(l,h,u),e(h,y),f(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 pm(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,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=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"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=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 me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),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);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=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){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,ke),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,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),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,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,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function hm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function um(F){let h,y,_,g,b;return g=new 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){f(l,h,u),e(h,y),f(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 fm(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,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=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"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=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 me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),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);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=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){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,ke),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,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),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,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,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function mm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function gm(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){f(l,h,u),e(h,y),f(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 _m(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,fe,ee,De,te,q,ge,j,Qe,oe;return{c(){h=s("p"),y=n("TensorFlow models and layers in "),_=s("code"),g=n("transformers"),b=n(" accept two formats as input:"),l=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"),fe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=s("code"),De=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),te=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 me=i(S);ie=r(me,"fit()"),me.forEach(t),Ce=r(x," and "),W=a(x,"CODE",{});var _e=i(W);qe=r(_e,"predict()"),_e.forEach(t),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);fe=r(Be,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ee=a(Be,"CODE",{});var ve=i(ee);De=r(ve,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),ve.forEach(t),Be.forEach(t),J.forEach(t),te=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){f(v,h,D),e(h,y),e(h,_),e(_,g),e(h,b),f(v,l,D),f(v,u,D),e(u,z),e(z,Me),e(u,ke),e(u,U),e(U,de),f(v,H,D),f(v,P,D),e(P,Fe),e(P,B),e(B,ce),e(P,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),f(v,pe,D),f(v,C,D),e(C,I),e(I,he),e(I,K),e(K,$e),e(I,ue),e(I,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,fe),e(Q,ee),e(ee,De),f(v,te,D),f(v,q,D),e(q,ge),e(q,j),e(j,Qe),e(q,oe)},d(v){v&&t(h),v&&t(l),v&&t(u),v&&t(H),v&&t(P),v&&t(pe),v&&t(C),v&&t(te),v&&t(q)}}}function vm(F){let h,y,_,g,b;return{c(){h=s("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),g=n("Module"),b=n(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){h=a(l,"P",{});var u=i(h);y=r(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(u,"CODE",{});var z=i(_);g=r(z,"Module"),z.forEach(t),b=r(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(t)},m(l,u){f(l,h,u),e(h,y),e(h,_),e(_,g),e(h,b)},d(l){l&&t(h)}}}function bm(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){f(l,h,u),e(h,y),f(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 ym(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,fe,ee,De,te,q,ge,j,Qe,oe,v,D,ot,ae,nt,rt,x,st,Xe,me,_e,Le,J,ne,Oe,at,O,V,xe,Be,ve,re,it,ji,ss,Ni,Zi,Ai,He,Qi,ur,Bi,Vi,fr,Si,Wi,mr,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,fl,wa,xt,to,ds,Yo,ml,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,fs,Cl,ql,ro,Rr,Il,Jl,kr,Ul,jl,Nl,rn,Zl,Er,Al,Ql,$a,Mt,so,ms,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,fd,md,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,fn,xd,mn,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,fc,qs,mc,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,fo,ja,Zt,mo,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,fp,ct,An,mp,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,fh,Ga,Re,tr,mh,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/v4.31.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"vocab_size"},{anchor:"transformers.DPRConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.DPRConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.DPRConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.DPRConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.DPRConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.DPRConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.DPRConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.DPRConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.DPRConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <em>token_type_ids</em> passed into <a href="/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertModel">BertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.DPRConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.DPRConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.DPRConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.DPRConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Dimension of the projection for the context and question encoders. If it is set to zero (default), then no
projection is done.`,name:"projection_dim"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/configuration_dpr.py#L45"}}),Yt=new Vo({props:{anchor:"transformers.DPRConfig.example",$$slots:{default:[nm]},$$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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single sequence
if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DPRReaderTokenizer.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to
the maximum acceptable input length for the model if that argument is not provided. This will truncate
token by token, removing a token from the longest sequence in the pair if a pair of sequences (or a batch
of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the first
sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the
second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.DPRReaderTokenizer.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.DPRReaderTokenizer.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DPRReaderTokenizer.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attention mask. If not set, will return the attention mask according to the
specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/tokenization_dpr.py#L395",returnDescription:`
<p>A dictionary with the following keys:</p>
<ul>
<li><code>input_ids</code>: List of token ids to be fed to a model.</li>
<li><code>attention_mask</code>: List of indices specifying which tokens should be attended to by the model.</li>
</ul>
`,returnType:`
<p><code>Dict[str, List[List[int]]]</code></p>
`}}),lo=new Vo({props:{anchor:"transformers.DPRReaderTokenizer.example",$$slots:{default:[rm]},$$scope:{ctx:F}}}),un=new ze({}),fn=new X({props:{name:"class transformers.DPRReaderTokenizerFast",anchor:"transformers.DPRReaderTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = True"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DPRReaderTokenizerFast.questions",description:`<strong>questions</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The questions to be encoded. You can specify one question for many passages. In this case, the question
will be duplicated like <code>[questions] * n_passages</code>. Otherwise you have to specify as many questions as in
<code>titles</code> or <code>texts</code>.`,name:"questions"},{anchor:"transformers.DPRReaderTokenizerFast.titles",description:`<strong>titles</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages titles to be encoded. This can be a string or a list of strings if there are several passages.`,name:"titles"},{anchor:"transformers.DPRReaderTokenizerFast.texts",description:`<strong>texts</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The passages texts to be encoded. This can be a string or a list of strings if there are several passages.`,name:"texts"},{anchor:"transformers.DPRReaderTokenizerFast.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single sequence
if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DPRReaderTokenizerFast.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to
the maximum acceptable input length for the model if that argument is not provided. This will truncate
token by token, removing a token from the longest sequence in the pair if a pair of sequences (or a batch
of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the first
sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided. This will only truncate the
second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.DPRReaderTokenizerFast.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.DPRReaderTokenizerFast.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.DPRReaderTokenizerFast.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attention mask. If not set, will return the attention mask according to the
specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/tokenization_dpr_fast.py#L393",returnDescription:`
<p>A dictionary with the following keys:</p>
<ul>
<li><code>input_ids</code>: List of token ids to be fed to a model.</li>
<li><code>attention_mask</code>: List of indices specifying which tokens should be attended to by the model.</li>
</ul>
`,returnType:`
<p><code>Dict[str, List[List[int]]]</code></p>
`}}),_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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/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/v4.31.0/src/transformers/models/dpr/modeling_dpr.py#L449",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the context representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRContextEncoderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),uo=new Ht({props:{$$slots:{default:[sm]},$$scope:{ctx:F}}}),fo=new Vo({props:{anchor:"transformers.DPRContextEncoder.forward.example",$$slots:{default:[am]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/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/v4.31.0/src/transformers/models/dpr/modeling_dpr.py#L530",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the question representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed questions for nearest neighbors queries with context embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput"
>transformers.models.dpr.modeling_dpr.DPRQuestionEncoderOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),go=new Ht({props:{$$slots:{default:[im]},$$scope:{ctx:F}}}),_o=new Vo({props:{anchor:"transformers.DPRQuestionEncoder.forward.example",$$slots:{default:[lm]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_dpr.py#L603"}}),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/v4.31.0/en/model_doc/dpr#transformers.DPRReaderTokenizer">DPRReaderTokenizer</a>. See this class documentation for more details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.DPRReader.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.DPRReader.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.DPRReader.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.DPRReader.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.DPRReader.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_dpr.py#L611",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRReaderOutput"
>transformers.models.dpr.modeling_dpr.DPRReaderOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the start index of the span for each passage.</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the end index of the span for each passage.</p>
</li>
<li>
<p><strong>relevance_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(n_passages, )</code>) \u2014 Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
question, compared to all the other passages.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/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:[dm]},$$scope:{ctx:F}}}),yo=new Vo({props:{anchor:"transformers.DPRReader.forward.example",$$slots:{default:[cm]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L526"}}),wo=new Ht({props:{$$slots:{default:[pm]},$$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/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L538",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRContextEncoderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the context representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRContextEncoderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ro=new Ht({props:{$$slots:{default:[hm]},$$scope:{ctx:F}}}),ko=new Vo({props:{anchor:"transformers.TFDPRContextEncoder.call.example",$$slots:{default:[um]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L607"}}),$o=new Ht({props:{$$slots:{default:[fm]},$$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/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L619",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRQuestionEncoderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, embeddings_size)</code>) \u2014 The DPR encoder outputs the <em>pooler_output</em> that corresponds to the question representation. Last layer
hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
This output is to be used to embed questions for nearest neighbors queries with context embeddings.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRQuestionEncoderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Po=new Ht({props:{$$slots:{default:[mm]},$$scope:{ctx:F}}}),Do=new Vo({props:{anchor:"transformers.TFDPRQuestionEncoder.call.example",$$slots:{default:[gm]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRConfig">DPRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L687"}}),zo=new Ht({props:{$$slots:{default:[_m]},$$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/v4.31.0/en/model_doc/dpr#transformers.DPRReaderTokenizer">DPRReaderTokenizer</a>. See this class documentation for more details.`,name:"input_ids"},{anchor:"transformers.TFDPRReader.call.attention_mask",description:`<strong>attention_mask</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFDPRReader.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>Numpy array</code> or <code>tf.Tensor</code> of shape <code>(n_passages, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFDPRReader.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFDPRReader.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFDPRReader.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/dpr/modeling_tf_dpr.py#L699",returnDescription:`
<p>A <code>transformers.models.dpr.modeling_tf_dpr.TFDPRReaderOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"
>DPRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the start index of the span for each passage.</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, sequence_length)</code>) \u2014 Logits of the end index of the span for each passage.</p>
</li>
<li>
<p><strong>relevance_logits</strong> (<code>tf.Tensor</code> of shape <code>(n_passages, )</code>) \u2014 Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
question, compared to all the other passages.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape
<code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.dpr.modeling_tf_dpr.TFDPRReaderOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Mo=new Ht({props:{$$slots:{default:[vm]},$$scope:{ctx:F}}}),Fo=new Vo({props:{anchor:"transformers.TFDPRReader.call.example",$$slots:{default:[bm]},$$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(),fe=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(),me=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(", "),fr=s("a"),Si=n("DPRQuestionEncoder"),Wi=n(`, or a
`),mr=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"),fl=n(" for usage examples and documentation concerning parameters."),wa=d(),xt=s("h2"),to=s("a"),ds=s("span"),T(Yo.$$.fragment),ml=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(),fs=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"),ms=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"),fd=n(" model."),md=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(fn.$$.fragment),xd=d(),mn=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),fc=d(),qs=s("span"),mc=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(fo.$$.fragment),ja=d(),Zt=s("h2"),mo=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.`),fp=d(),ct=s("div"),T(An.$$.fragment),mp=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"),fh=n("TFDPRReader"),Ga=d(),Re=s("div"),T(tr.$$.fragment),mh=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 m=tm('[data-svelte="svelte-1phssyn"]',document.head);h=a(m,"META",{name:!0,content:!0}),m.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 fa=i(G);Je=r(fa,`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.`),fa.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),fe=a(o,"P",{});var Uh=i(fe);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),me=a(o,"H2",{class:!0});var Xa=i(me);_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 ma=i(ve);re=a(ma,"A",{href:!0});var Wh=i(re);it=r(Wh,"DPRConfig"),Wh.forEach(t),ji=r(ma," is the configuration class to store the configuration of a "),ss=a(ma,"EM",{});var Gh=i(ss);Ni=r(Gh,"DPRModel"),Gh.forEach(t),Zi=r(ma,"."),ma.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,", "),fr=a(kt,"A",{href:!0});var Oh=i(fr);Si=r(Oh,"DPRQuestionEncoder"),Oh.forEach(t),Wi=r(kt,`, or a
`),mr=a(kt,"A",{href:!0});var Xh=i(mr);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),fl=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),ml=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 fu=i(hs);w(on.$$.fragment,fu),fu.forEach(t),uu.forEach(t),zl=c(ni),us=a(ni,"SPAN",{});var mu=i(us);Ml=r(mu,"DPRQuestionEncoderTokenizer"),mu.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),fs=a(Io,"P",{});var gu=i(fs);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);ms=a(yu,"SPAN",{});var Tu=i(ms);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 ft=i(be);w(pn.$$.fragment,ft),ad=c(ft),ys=a(ft,"P",{});var zu=i(ys);id=r(zu,"Construct a DPRReader tokenizer."),zu.forEach(t),ld=c(ft),yt=a(ft,"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),fd=r(cr," model."),cr.forEach(t),md=c(ft),hn=a(ft,"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(ft),Tt=a(ft,"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(ft),w(lo.$$.fragment,ft),ft.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 mt=i(ye);w(fn.$$.fragment,mt),xd=c(mt),mn=a(mt,"P",{});var pi=i(mn);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(mt),wt=a(mt,"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(mt),gn=a(mt,"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(mt),bt=a(mt,"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(mt),zs=a(mt,"P",{});var Ou=i(zs);Kd=r(Ou,"[CLS] <question token ids> [SEP] <titles ids> [SEP] <texts ids>"),Ou.forEach(t),mt.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 fi=i(It);w(vn.$$.fragment,fi),oc=c(fi),bn=a(fi,"P",{});var mi=i(bn);nc=r(mi,"Class for outputs of "),Ur=a(mi,"A",{href:!0});var Ku=i(Ur);rc=r(Ku,"DPRQuestionEncoder"),Ku.forEach(t),sc=r(mi,"."),mi.forEach(t),fi.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 ef=i(jr);lc=r(ef,"DPRQuestionEncoder"),ef.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 tf=i(Nr);hc=r(tf,"DPRQuestionEncoder"),tf.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 of=i(ho);Cs=a(of,"SPAN",{});var nf=i(Cs);w(kn.$$.fragment,nf),nf.forEach(t),of.forEach(t),fc=c(yi),qs=a(yi,"SPAN",{});var rf=i(qs);mc=r(rf,"DPRContextEncoder"),rf.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 sf=i(Is);_c=r(sf,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),sf.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 af=i(Zr);yc=r(af,"PreTrainedModel"),af.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 lf=i(Dn);kc=r(lf,"torch.nn.Module"),lf.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 df=i(Ar);xc=r(df,"DPRContextEncoder"),df.forEach(t),zc=r(Kr," forward method, overrides the "),Js=a(Kr,"CODE",{});var cf=i(Js);Mc=r(cf,"__call__"),cf.forEach(t),Fc=r(Kr," special method."),Kr.forEach(t),Cc=c(jo),w(uo.$$.fragment,jo),qc=c(jo),w(fo.$$.fragment,jo),jo.forEach(t),Et.forEach(t),ja=c(o),Zt=a(o,"H2",{class:!0});var Ri=i(Zt);mo=a(Ri,"A",{id:!0,class:!0,href:!0});var pf=i(mo);Us=a(pf,"SPAN",{});var hf=i(Us);w(zn.$$.fragment,hf),hf.forEach(t),pf.forEach(t),Ic=c(Ri),js=a(Ri,"SPAN",{});var uf=i(js);Jc=r(uf,"DPRQuestionEncoder"),uf.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 ff=i(Ns);jc=r(ff,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),ff.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 mf=i(Qr);Ac=r(mf,"PreTrainedModel"),mf.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 gf=i(qn);Sc=r(gf,"torch.nn.Module"),gf.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 _f=i(Br);Xc=r(_f,"DPRQuestionEncoder"),_f.forEach(t),Hc=r(es," forward method, overrides the "),Zs=a(es,"CODE",{});var vf=i(Zs);Yc=r(vf,"__call__"),vf.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 bf=i(vo);As=a(bf,"SPAN",{});var yf=i(As);w(Jn.$$.fragment,yf),yf.forEach(t),bf.forEach(t),op=c($i),Qs=a($i,"SPAN",{});var Tf=i(Qs);np=r(Tf,"DPRReader"),Tf.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 wf=i(Bs);sp=r(wf,"The bare DPRReader transformer outputting span predictions."),wf.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 Rf=i(Vr);lp=r(Rf,"PreTrainedModel"),Rf.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 kf=i(Zn);hp=r(kf,"torch.nn.Module"),kf.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),fp=c(Pt),ct=a(Pt,"DIV",{class:!0});var Zo=i(ct);w(An.$$.fragment,Zo),mp=c(Zo),Bt=a(Zo,"P",{});var ts=i(Bt);gp=r(ts,"The "),Sr=a(ts,"A",{href:!0});var Ef=i(Sr);_p=r(Ef,"DPRReader"),Ef.forEach(t),vp=r(ts," forward method, overrides the "),Vs=a(ts,"CODE",{});var $f=i(Vs);bp=r($f,"__call__"),$f.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 Pf=i(To);Ss=a(Pf,"SPAN",{});var Df=i(Ss);w(Qn.$$.fragment,Df),Df.forEach(t),Pf.forEach(t),Rp=c(xi),Ws=a(xi,"SPAN",{});var xf=i(Ws);kp=r(xf,"TFDPRContextEncoder"),xf.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 zf=i(Gs);$p=r(zf,"The bare DPRContextEncoder transformer outputting pooler outputs as context representations."),zf.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 Mf=i(Wr);xp=r(Mf,"TFPreTrainedModel"),Mf.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 Ff=i(Wn);Cp=r(Ff,"tf.keras.Model"),Ff.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 Cf=i(Gr);Np=r(Cf,"TFDPRContextEncoder"),Cf.forEach(t),Zp=r(os," forward method, overrides the "),Ls=a(os,"CODE",{});var qf=i(Ls);Ap=r(qf,"__call__"),qf.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 If=i(Eo);Os=a(If,"SPAN",{});var Jf=i(Os);w(Ln.$$.fragment,Jf),Jf.forEach(t),If.forEach(t),Sp=c(Fi),Xs=a(Fi,"SPAN",{});var Uf=i(Xs);Wp=r(Uf,"TFDPRQuestionEncoder"),Uf.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 jf=i(Hs);Lp=r(jf,"The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations."),jf.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 Nf=i(Lr);Hp=r(Nf,"TFPreTrainedModel"),Nf.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 Zf=i(Yn);th=r(Zf,"tf.keras.Model"),Zf.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 Af=i(Or);ih=r(Af,"TFDPRQuestionEncoder"),Af.forEach(t),lh=r(ns," forward method, overrides the "),Ys=a(ns,"CODE",{});var Qf=i(Ys);dh=r(Qf,"__call__"),Qf.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 Bf=i(xo);Ks=a(Bf,"SPAN",{});var Vf=i(Ks);w(er.$$.fragment,Vf),Vf.forEach(t),Bf.forEach(t),uh=c(Ii),ea=a(Ii,"SPAN",{});var Sf=i(ea);fh=r(Sf,"TFDPRReader"),Sf.forEach(t),Ii.forEach(t),Ga=c(o),Re=a(o,"DIV",{class:!0});var vt=i(Re);w(tr.$$.fragment,vt),mh=c(vt),ta=a(vt,"P",{});var Wf=i(ta);gh=r(Wf,"The bare DPRReader transformer outputting span predictions."),Wf.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 Gf=i(Xr);bh=r(Gf,"TFPreTrainedModel"),Gf.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 Lf=i(rr);Rh=r(Lf,"tf.keras.Model"),Lf.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 Of=i(Hr);xh=r(Of,"TFDPRReader"),Of.forEach(t),zh=r(rs," forward method, overrides the "),oa=a(rs,"CODE",{});var Xf=i(oa);Mh=r(Xf,"__call__"),Xf.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(Tm)),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"),Hf(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"),Hf(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(me,"class","relative group"),p(re,"href","/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRConfig"),p(ur,"href","/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRContextEncoder"),p(fr,"href","/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRQuestionEncoder"),p(mr,"href","/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRContextEncoderTokenizer"),p(vr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizer"),p(br,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRContextEncoderTokenizerFast"),p(Tr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizerFast"),p(wr,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizer"),p(kr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizer"),p(Er,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRQuestionEncoderTokenizerFast"),p(Pr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizerFast"),p(Dr,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRReaderTokenizer"),p(zr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizer"),p(Mr,"href","/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRReader"),p(Fr,"href","/docs/transformers/v4.31.0/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/v4.31.0/en/model_doc/dpr#transformers.DPRReaderTokenizerFast"),p(qr,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertTokenizerFast"),p(Ir,"href","/docs/transformers/v4.31.0/en/model_doc/dpr#transformers.DPRReader"),p(Jr,"href","/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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(mo,"id","transformers.DPRQuestionEncoder"),p(mo,"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(mo,"href","#transformers.DPRQuestionEncoder"),p(Zt,"class","relative group"),p(Qr,"href","/docs/transformers/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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/v4.31.0/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,m){e(document.head,h),f(o,y,m),f(o,_,m),e(_,g),e(g,b),R(l,b,null),e(_,u),e(_,z),e(z,Me),f(o,ke,m),f(o,U,m),e(U,de),e(de,H),e(U,Fe),e(U,B),e(B,ce),f(o,L,m),f(o,Y,m),e(Y,se),e(se,S),R(ie,S,null),e(Y,Ce),e(Y,W),e(W,qe),f(o,Ee,m),f(o,N,m),e(N,Ie),e(N,le),e(le,pe),e(N,C),f(o,I,m),f(o,he,m),e(he,K),f(o,$e,m),f(o,ue,m),e(ue,G),e(G,Je),f(o,Pe,m),f(o,M,m),e(M,Ue),e(M,Z),e(Z,je),e(M,Ne),e(M,A),e(A,Ze),e(M,Ae),f(o,Q,m),f(o,fe,m),e(fe,ee),f(o,De,m),f(o,te,m),e(te,q),e(q,ge),e(ge,j),e(q,Qe),e(q,oe),e(oe,v),e(v,D),e(oe,ot),e(oe,ae),e(ae,nt),e(oe,rt),e(oe,x),e(x,st),f(o,Xe,m),f(o,me,m),e(me,_e),e(_e,Le),R(J,Le,null),e(me,ne),e(me,Oe),e(Oe,at),f(o,O,m),f(o,V,m),R(xe,V,null),e(V,Be),e(V,ve),e(ve,re),e(re,it),e(ve,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,fr),e(fr,Si),e(He,Wi),e(He,mr),e(mr,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),f(o,ya,m),f(o,Dt,m),e(Dt,Kt),e(Kt,as),R(Oo,as,null),e(Dt,ol),e(Dt,is),e(is,nl),f(o,Ta,m),f(o,Ye,m),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,fl),f(o,wa,m),f(o,xt,m),e(xt,to),e(to,ds),R(Yo,ds,null),e(xt,ml),e(xt,cs),e(cs,gl),f(o,Ra,m),f(o,Ke,m),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),f(o,ka,m),f(o,zt,m),e(zt,no),e(no,hs),R(on,hs,null),e(zt,zl),e(zt,us),e(us,Ml),f(o,Ea,m),f(o,et,m),R(nn,et,null),e(et,Fl),e(et,fs),e(fs,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),f(o,$a,m),f(o,Mt,m),e(Mt,so),e(so,ms),R(sn,ms,null),e(Mt,Bl),e(Mt,gs),e(gs,Vl),f(o,Pa,m),f(o,tt,m),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),f(o,Da,m),f(o,Ft,m),e(Ft,io),e(io,vs),R(cn,vs,null),e(Ft,rd),e(Ft,bs),e(bs,sd),f(o,xa,m),f(o,be,m),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,fd),e(be,md),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),f(o,za,m),f(o,Ct,m),e(Ct,co),e(co,ks),R(un,ks,null),e(Ct,Pd),e(Ct,Es),e(Es,Dd),f(o,Ma,m),f(o,ye,m),R(fn,ye,null),e(ye,xd),e(ye,mn),e(mn,zd),e(mn,$s),e($s,Md),e(mn,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),f(o,Fa,m),f(o,qt,m),e(qt,po),e(po,Ms),R(_n,Ms,null),e(qt,ec),e(qt,Fs),e(Fs,tc),f(o,Ca,m),f(o,It,m),R(vn,It,null),e(It,oc),e(It,bn),e(bn,nc),e(bn,Ur),e(Ur,rc),e(bn,sc),f(o,qa,m),f(o,Jt,m),R(yn,Jt,null),e(Jt,ac),e(Jt,Tn),e(Tn,ic),e(Tn,jr),e(jr,lc),e(Tn,dc),f(o,Ia,m),f(o,Ut,m),R(wn,Ut,null),e(Ut,cc),e(Ut,Rn),e(Rn,pc),e(Rn,Nr),e(Nr,hc),e(Rn,uc),f(o,Ja,m),f(o,jt,m),e(jt,ho),e(ho,Cs),R(kn,Cs,null),e(jt,fc),e(jt,qs),e(qs,mc),f(o,Ua,m),f(o,Ve,m),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(fo,lt,null),f(o,ja,m),f(o,Zt,m),e(Zt,mo),e(mo,Us),R(zn,Us,null),e(Zt,Ic),e(Zt,js),e(js,Jc),f(o,Na,m),f(o,Se,m),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),f(o,Za,m),f(o,Qt,m),e(Qt,vo),e(vo,As),R(Jn,As,null),e(Qt,op),e(Qt,Qs),e(Qs,np),f(o,Aa,m),f(o,We,m),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,fp),e(We,ct),R(An,ct,null),e(ct,mp),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),f(o,Qa,m),f(o,Vt,m),e(Vt,To),e(To,Ss),R(Qn,Ss,null),e(Vt,Rp),e(Vt,Ws),e(Ws,kp),f(o,Ba,m),f(o,Te,m),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),f(o,Va,m),f(o,Wt,m),e(Wt,Eo),e(Eo,Os),R(Ln,Os,null),e(Wt,Sp),e(Wt,Xs),e(Xs,Wp),f(o,Sa,m),f(o,we,m),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),f(o,Wa,m),f(o,Lt,m),e(Lt,xo),e(xo,Ks),R(er,Ks,null),e(Lt,uh),e(Lt,ea),e(ea,fh),f(o,Ga,m),f(o,Re,m),R(tr,Re,null),e(Re,mh),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,[m]){const ar={};m&2&&(ar.$$scope={dirty:m,ctx:o}),Yt.$set(ar);const na={};m&2&&(na.$$scope={dirty:m,ctx:o}),lo.$set(na);const ra={};m&2&&(ra.$$scope={dirty:m,ctx:o}),uo.$set(ra);const sa={};m&2&&(sa.$$scope={dirty:m,ctx:o}),fo.$set(sa);const ir={};m&2&&(ir.$$scope={dirty:m,ctx:o}),go.$set(ir);const aa={};m&2&&(aa.$$scope={dirty:m,ctx:o}),_o.$set(aa);const ia={};m&2&&(ia.$$scope={dirty:m,ctx:o}),bo.$set(ia);const lr={};m&2&&(lr.$$scope={dirty:m,ctx:o}),yo.$set(lr);const la={};m&2&&(la.$$scope={dirty:m,ctx:o}),wo.$set(la);const da={};m&2&&(da.$$scope={dirty:m,ctx:o}),Ro.$set(da);const ca={};m&2&&(ca.$$scope={dirty:m,ctx:o}),ko.$set(ca);const dr={};m&2&&(dr.$$scope={dirty:m,ctx:o}),$o.$set(dr);const pa={};m&2&&(pa.$$scope={dirty:m,ctx:o}),Po.$set(pa);const ha={};m&2&&(ha.$$scope={dirty:m,ctx:o}),Do.$set(ha);const ua={};m&2&&(ua.$$scope={dirty:m,ctx:o}),zo.$set(ua);const fa={};m&2&&(fa.$$scope={dirty:m,ctx:o}),Mo.$set(fa);const Xt={};m&2&&(Xt.$$scope={dirty:m,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(fn.$$.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(fo.$$.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(fn.$$.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(fo.$$.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(fe),o&&t(De),o&&t(te),o&&t(Xe),o&&t(me),$(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),$(fn),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),$(fo),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 Tm={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 wm(F){return om(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xm extends Yf{constructor(h){super();Kf(this,h,wm,ym,em,{})}}export{xm as default,Tm as metadata};
