import{S as ld,i as id,s as cd,e as s,k as i,w as _,t as n,M as dd,c as a,d as r,m as c,a as o,x as g,h as l,b as f,G as t,g as p,y as b,q as $,o as y,B as w,v as pd,L as hi}from"../../chunks/vendor-hf-doc-builder.js";import{T as fi}from"../../chunks/Tip-hf-doc-builder.js";import{D as I}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Xs}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as ze}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as mi}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fd(N){let h,E,v,u,M,m,x,q,J,U,j;return{c(){h=s("p"),E=n(`This class method is simply calling the feature extractor
`),v=s("a"),u=n("from_pretrained()"),M=n(`, image processor
`),m=s("a"),x=n("ImageProcessingMixin"),q=n(` and the tokenizer
`),J=s("code"),U=n("~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),j=n(` methods. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(L){h=a(L,"P",{});var Z=o(h);E=l(Z,`This class method is simply calling the feature extractor
`),v=a(Z,"A",{href:!0});var B=o(v);u=l(B,"from_pretrained()"),B.forEach(r),M=l(Z,`, image processor
`),m=a(Z,"A",{href:!0});var z=o(m);x=l(z,"ImageProcessingMixin"),z.forEach(r),q=l(Z,` and the tokenizer
`),J=a(Z,"CODE",{});var Lt=o(J);U=l(Lt,"~tokenization_utils_base.PreTrainedTokenizer.from_pretrained"),Lt.forEach(r),j=l(Z,` methods. Please refer to the docstrings of the
methods above for more information.`),Z.forEach(r),this.h()},h(){f(v,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained"),f(m,"href","/docs/transformers/v4.33.0/en/internal/image_processing_utils#transformers.ImageProcessingMixin")},m(L,Z){p(L,h,Z),t(h,E),t(h,v),t(v,u),t(h,M),t(h,m),t(m,x),t(h,q),t(h,J),t(J,U),t(h,j)},d(L){L&&r(h)}}}function md(N){let h,E,v,u,M;return u=new Xs({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTIzJTIwUHVzaCUyMHRoZSUyMHByb2Nlc3NvciUyMHRvJTIweW91ciUyMG5hbWVzcGFjZSUyMHdpdGglMjB0aGUlMjBuYW1lJTIwJTIybXktZmluZXR1bmVkLWJlcnQlMjIuJTBBcHJvY2Vzc29yLnB1c2hfdG9faHViKCUyMm15LWZpbmV0dW5lZC1iZXJ0JTIyKSUwQSUwQSUyMyUyMFB1c2glMjB0aGUlMjBwcm9jZXNzb3IlMjB0byUyMGFuJTIwb3JnYW5pemF0aW9uJTIwd2l0aCUyMHRoZSUyMG5hbWUlMjAlMjJteS1maW5ldHVuZWQtYmVydCUyMi4lMEFwcm9jZXNzb3IucHVzaF90b19odWIoJTIyaHVnZ2luZ2ZhY2UlMkZteS1maW5ldHVuZWQtYmVydCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the processor to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
processor.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the processor to an organization with the name &quot;my-finetuned-bert&quot;.</span>
processor.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`}}),{c(){h=s("p"),E=n("Examples:"),v=i(),_(u.$$.fragment)},l(m){h=a(m,"P",{});var x=o(h);E=l(x,"Examples:"),x.forEach(r),v=c(m),g(u.$$.fragment,m)},m(m,x){p(m,h,x),t(h,E),p(m,v,x),b(u,m,x),M=!0},p:hi,i(m){M||($(u.$$.fragment,m),M=!0)},o(m){y(u.$$.fragment,m),M=!1},d(m){m&&r(h),m&&r(v),w(u,m)}}}function hd(N){let h,E;return{c(){h=s("p"),E=n("This API is experimental and may have some slight breaking changes in the next releases.")},l(v){h=a(v,"P",{});var u=o(h);E=l(u,"This API is experimental and may have some slight breaking changes in the next releases."),u.forEach(r)},m(v,u){p(v,h,u),t(h,E)},d(v){v&&r(h)}}}function ud(N){let h,E,v,u,M,m,x,q;return{c(){h=s("p"),E=n("This class method is simply calling "),v=s("a"),u=n("save_pretrained()"),M=n(` and
`),m=s("a"),x=n("save_pretrained()"),q=n(`. Please refer to the docstrings of the
methods above for more information.`),this.h()},l(J){h=a(J,"P",{});var U=o(h);E=l(U,"This class method is simply calling "),v=a(U,"A",{href:!0});var j=o(v);u=l(j,"save_pretrained()"),j.forEach(r),M=l(U,` and
`),m=a(U,"A",{href:!0});var L=o(m);x=l(L,"save_pretrained()"),L.forEach(r),q=l(U,`. Please refer to the docstrings of the
methods above for more information.`),U.forEach(r),this.h()},h(){f(v,"href","/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained"),f(m,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained")},m(J,U){p(J,h,U),t(h,E),t(h,v),t(v,u),t(h,M),t(h,m),t(m,x),t(h,q)},d(J){J&&r(h)}}}function vd(N){let h,E,v,u,M;return u=new Xs({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvd19kYXRhc2V0cyUyMGFzJTIwdGZkcyUwQSUwQWRhdGFzZXQlMjAlM0QlMjB0ZmRzLmxvYWQoJTIyc3F1YWQlMjIpJTBBJTBBdHJhaW5pbmdfZXhhbXBsZXMlMjAlM0QlMjBnZXRfZXhhbXBsZXNfZnJvbV9kYXRhc2V0KGRhdGFzZXQlMkMlMjBldmFsdWF0ZSUzREZhbHNlKSUwQWV2YWx1YXRpb25fZXhhbXBsZXMlMjAlM0QlMjBnZXRfZXhhbXBsZXNfZnJvbV9kYXRhc2V0KGRhdGFzZXQlMkMlMjBldmFsdWF0ZSUzRFRydWUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow_datasets <span class="hljs-keyword">as</span> tfds

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = tfds.load(<span class="hljs-string">&quot;squad&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>training_examples = get_examples_from_dataset(dataset, evaluate=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>evaluation_examples = get_examples_from_dataset(dataset, evaluate=<span class="hljs-literal">True</span>)`}}),{c(){h=s("p"),E=n("Examples:"),v=i(),_(u.$$.fragment)},l(m){h=a(m,"P",{});var x=o(h);E=l(x,"Examples:"),x.forEach(r),v=c(m),g(u.$$.fragment,m)},m(m,x){p(m,h,x),t(h,E),p(m,v,x),b(u,m,x),M=!0},p:hi,i(m){M||($(u.$$.fragment,m),M=!0)},o(m){y(u.$$.fragment,m),M=!1},d(m){m&&r(h),m&&r(v),w(u,m)}}}function _d(N){let h,E,v,u,M;return u=new Xs({props:{code:"cHJvY2Vzc29yJTIwJTNEJTIwU3F1YWRWMlByb2Nlc3NvcigpJTBBZXhhbXBsZXMlMjAlM0QlMjBwcm9jZXNzb3IuZ2V0X2Rldl9leGFtcGxlcyhkYXRhX2RpciklMEElMEFmZWF0dXJlcyUyMCUzRCUyMHNxdWFkX2NvbnZlcnRfZXhhbXBsZXNfdG9fZmVhdHVyZXMoJTBBJTIwJTIwJTIwJTIwZXhhbXBsZXMlM0RleGFtcGxlcyUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMG1heF9zZXFfbGVuZ3RoJTNEYXJncy5tYXhfc2VxX2xlbmd0aCUyQyUwQSUyMCUyMCUyMCUyMGRvY19zdHJpZGUlM0RhcmdzLmRvY19zdHJpZGUlMkMlMEElMjAlMjAlMjAlMjBtYXhfcXVlcnlfbGVuZ3RoJTNEYXJncy5tYXhfcXVlcnlfbGVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwaXNfdHJhaW5pbmclM0Rub3QlMjBldmFsdWF0ZSUyQyUwQSk=",highlighted:`processor = SquadV2Processor()
examples = processor.get_dev_examples(data_dir)

features = squad_convert_examples_to_features(
    examples=examples,
    tokenizer=tokenizer,
    max_seq_length=args.max_seq_length,
    doc_stride=args.doc_stride,
    max_query_length=args.max_query_length,
    is_training=<span class="hljs-keyword">not</span> evaluate,
)`}}),{c(){h=s("p"),E=n("Example:"),v=i(),_(u.$$.fragment)},l(m){h=a(m,"P",{});var x=o(h);E=l(x,"Example:"),x.forEach(r),v=c(m),g(u.$$.fragment,m)},m(m,x){p(m,h,x),t(h,E),p(m,v,x),b(u,m,x),M=!0},p:hi,i(m){M||($(u.$$.fragment,m),M=!0)},o(m){y(u.$$.fragment,m),M=!1},d(m){m&&r(h),m&&r(v),w(u,m)}}}function gd(N){let h,E,v,u,M,m,x,q,J,U,j,L,Z,B,z,Lt,zt,Ya,Oa,Dt,Ka,eo,to,gr,ro,Ss,te,de,br,De,so,$r,ao,Js,Bt,oo,Zs,Ft,no,As,X,Be,lo,yr,io,co,R,Fe,po,wr,fo,mo,pe,ho,W,Ge,uo,xr,vo,_o,fe,go,H,Ce,bo,Qe,$o,Er,yo,wo,xo,me,Eo,Y,Re,Mo,We,Po,Gt,Io,To,ko,he,Ns,re,ue,Mr,He,Uo,Pr,Xo,Vs,V,So,Ct,Jo,Zo,Qt,Ao,No,Rt,Vo,qo,Wt,jo,Lo,qs,T,Ye,zo,Ir,Do,Bo,ve,Oe,Fo,Ke,Go,Ht,Co,Qo,Ro,_e,et,Wo,Tr,Ho,Yo,ge,tt,Oo,kr,Ko,en,be,rt,tn,st,rn,Yt,sn,an,on,$e,at,nn,ot,ln,Ot,cn,dn,pn,ye,nt,fn,Ur,mn,js,F,lt,hn,Xr,un,vn,we,it,_n,Sr,gn,Ls,G,ct,bn,Jr,$n,yn,xe,dt,wn,Zr,xn,zs,se,Ee,Ar,pt,En,Nr,Mn,Ds,Me,ft,Pn,In,mt,Tn,Bs,Kt,kn,Fs,er,Un,Gs,P,Vr,qr,Xn,Sn,jr,Lr,Jn,Zn,zr,Dr,An,Nn,Br,Fr,Vn,qn,Gr,Cr,jn,Ln,Qr,Rr,zn,Dn,Wr,Hr,Bn,Fn,Yr,Or,Gn,Cn,Kr,es,Qn,Cs,Pe,Rn,tr,Wn,Hn,Qs,ae,ht,Yn,rr,On,ts,Kn,Rs,oe,Ie,rs,ut,el,ss,tl,Ws,ne,vt,rl,sl,_t,as,al,ol,Hs,gt,nl,bt,ll,Ys,sr,il,Os,ar,os,ns,cl,Ks,or,dl,ea,Te,pl,$t,fl,ml,ta,le,ke,ls,yt,hl,is,ul,ra,C,wt,vl,_l,xt,gl,bl,Et,$l,yl,sa,nr,wl,aa,ie,Ue,cs,Mt,xl,ds,El,oa,lr,Ml,na,Xe,ps,fs,Pl,Il,ms,hs,Tl,la,Pt,kl,us,Ul,ia,A,It,Xl,vs,Sl,Jl,Se,Tt,Zl,_s,Al,Nl,O,kt,Vl,Ut,ql,gs,jl,Ll,zl,Je,Dl,Ze,Xt,Bl,bs,Fl,ca,Ae,Gl,$s,Cl,Ql,da,Q,St,Rl,ys,Wl,Hl,Ne,pa,Ve,Yl,ws,Ol,Kl,fa,ce,qe,xs,Jt,ei,Es,ti,ma,ir,ri,ha,Zt,ua,je,si,Ms,ai,oi,va,At,_a,Le,ni,Nt,li,ii,ga;return m=new ze({}),De=new ze({}),Be=new I({props:{name:"class transformers.ProcessorMixin",anchor:"transformers.ProcessorMixin",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/processing_utils.py#L42"}}),Fe=new I({props:{name:"from_pretrained",anchor:"transformers.ProcessorMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ProcessorMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained feature_extractor hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a feature extractor file saved using the
<a href="/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a path or url to a saved feature extractor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.
**kwargs &#x2014;
Additional keyword arguments passed along to both
<a href="/docs/transformers/v4.33.0/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained">from_pretrained()</a> and
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/processing_utils.py#L167"}}),pe=new fi({props:{$$slots:{default:[fd]},$$scope:{ctx:N}}}),Ge=new I({props:{name:"push_to_hub",anchor:"transformers.ProcessorMixin.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"safe_serialization",val:": bool = False"},{name:"revision",val:": str = None"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.ProcessorMixin.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your processor to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.ProcessorMixin.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.ProcessorMixin.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload processor&quot;</code>.`,name:"commit_message"},{anchor:"transformers.ProcessorMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.ProcessorMixin.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"token"},{anchor:"transformers.ProcessorMixin.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.ProcessorMixin.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"},{anchor:"transformers.ProcessorMixin.push_to_hub.safe_serialization",description:`<strong>safe_serialization</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to convert the model weights in safetensors format for safer serialization.`,name:"safe_serialization"},{anchor:"transformers.ProcessorMixin.push_to_hub.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Branch to push the uploaded files to.`,name:"revision"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/utils/hub.py#L786"}}),fe=new mi({props:{anchor:"transformers.ProcessorMixin.push_to_hub.example",$$slots:{default:[md]},$$scope:{ctx:N}}}),Ce=new I({props:{name:"register_for_auto_class",anchor:"transformers.ProcessorMixin.register_for_auto_class",parameters:[{name:"auto_class",val:" = 'AutoProcessor'"}],parametersDescription:[{anchor:"transformers.ProcessorMixin.register_for_auto_class.auto_class",description:`<strong>auto_class</strong> (<code>str</code> or <code>type</code>, <em>optional</em>, defaults to <code>&quot;AutoProcessor&quot;</code>) &#x2014;
The auto class to register this new feature extractor with.`,name:"auto_class"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/processing_utils.py#L229"}}),me=new fi({props:{warning:!0,$$slots:{default:[hd]},$$scope:{ctx:N}}}),Re=new I({props:{name:"save_pretrained",anchor:"transformers.ProcessorMixin.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ProcessorMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the feature extractor JSON file and the tokenizer files will be saved (directory will
be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.ProcessorMixin.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.ProcessorMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/processing_utils.py#L93"}}),he=new fi({props:{$$slots:{default:[ud]},$$scope:{ctx:N}}}),He=new ze({}),Ye=new I({props:{name:"class transformers.DataProcessor",anchor:"transformers.DataProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L80"}}),Oe=new I({props:{name:"get_dev_examples",anchor:"transformers.DataProcessor.get_dev_examples",parameters:[{name:"data_dir",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L97"}}),et=new I({props:{name:"get_example_from_tensor_dict",anchor:"transformers.DataProcessor.get_example_from_tensor_dict",parameters:[{name:"tensor_dict",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L83"}}),tt=new I({props:{name:"get_labels",anchor:"transformers.DataProcessor.get_labels",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L105"}}),rt=new I({props:{name:"get_test_examples",anchor:"transformers.DataProcessor.get_test_examples",parameters:[{name:"data_dir",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L101"}}),at=new I({props:{name:"get_train_examples",anchor:"transformers.DataProcessor.get_train_examples",parameters:[{name:"data_dir",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L93"}}),nt=new I({props:{name:"tfds_map",anchor:"transformers.DataProcessor.tfds_map",parameters:[{name:"example",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L109"}}),lt=new I({props:{name:"class transformers.InputExample",anchor:"transformers.InputExample",parameters:[{name:"guid",val:": str"},{name:"text_a",val:": str"},{name:"text_b",val:": typing.Optional[str] = None"},{name:"label",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L30"}}),it=new I({props:{name:"to_json_string",anchor:"transformers.InputExample.to_json_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L49"}}),ct=new I({props:{name:"class transformers.InputFeatures",anchor:"transformers.InputFeatures",parameters:[{name:"input_ids",val:": typing.List[int]"},{name:"attention_mask",val:": typing.Optional[typing.List[int]] = None"},{name:"token_type_ids",val:": typing.Optional[typing.List[int]] = None"},{name:"label",val:": typing.Union[int, float, NoneType] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L55"}}),dt=new I({props:{name:"to_json_string",anchor:"transformers.InputFeatures.to_json_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/utils.py#L75"}}),pt=new ze({}),ht=new I({props:{name:"transformers.glue_convert_examples_to_features",anchor:"transformers.glue_convert_examples_to_features",parameters:[{name:"examples",val:": typing.Union[typing.List[transformers.data.processors.utils.InputExample], ForwardRef('tf.data.Dataset')]"},{name:"tokenizer",val:": PreTrainedTokenizer"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"task",val:" = None"},{name:"label_list",val:" = None"},{name:"output_mode",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/glue.py#L41",returnDescription:`
<p>If the <code>examples</code> input is a <code>tf.data.Dataset</code>, will return a <code>tf.data.Dataset</code> containing the task-specific
features. If the input is a list of <code>InputExamples</code>, will return a list of task-specific <code>InputFeatures</code> which
can be fed to the model.</p>
`}}),ut=new ze({}),yt=new ze({}),Mt=new ze({}),It=new I({props:{name:"class transformers.data.processors.squad.SquadProcessor",anchor:"transformers.data.processors.squad.SquadProcessor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/squad.py#L541"}}),Tt=new I({props:{name:"get_dev_examples",anchor:"transformers.data.processors.squad.SquadProcessor.get_dev_examples",parameters:[{name:"data_dir",val:""},{name:"filename",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/squad.py#L629"}}),kt=new I({props:{name:"get_examples_from_dataset",anchor:"transformers.data.processors.squad.SquadProcessor.get_examples_from_dataset",parameters:[{name:"dataset",val:""},{name:"evaluate",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/squad.py#L574",returnDescription:`
<p>List of SquadExample</p>
`}}),Je=new mi({props:{anchor:"transformers.data.processors.squad.SquadProcessor.get_examples_from_dataset.example",$$slots:{default:[vd]},$$scope:{ctx:N}}}),Xt=new I({props:{name:"get_train_examples",anchor:"transformers.data.processors.squad.SquadProcessor.get_train_examples",parameters:[{name:"data_dir",val:""},{name:"filename",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/squad.py#L607"}}),St=new I({props:{name:"transformers.squad_convert_examples_to_features",anchor:"transformers.squad_convert_examples_to_features",parameters:[{name:"examples",val:""},{name:"tokenizer",val:""},{name:"max_seq_length",val:""},{name:"doc_stride",val:""},{name:"max_query_length",val:""},{name:"is_training",val:""},{name:"padding_strategy",val:" = 'max_length'"},{name:"return_dataset",val:" = False"},{name:"threads",val:" = 1"},{name:"tqdm_enabled",val:" = True"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/data/processors/squad.py#L316",returnDescription:`
<p>list of <code>SquadFeatures</code></p>
`}}),Ne=new mi({props:{anchor:"transformers.squad_convert_examples_to_features.example",$$slots:{default:[_d]},$$scope:{ctx:N}}}),Jt=new ze({}),Zt=new Xs({props:{code:"JTIzJTIwTG9hZGluZyUyMGElMjBWMiUyMHByb2Nlc3NvciUwQXByb2Nlc3NvciUyMCUzRCUyMFNxdWFkVjJQcm9jZXNzb3IoKSUwQWV4YW1wbGVzJTIwJTNEJTIwcHJvY2Vzc29yLmdldF9kZXZfZXhhbXBsZXMoc3F1YWRfdjJfZGF0YV9kaXIpJTBBJTBBJTIzJTIwTG9hZGluZyUyMGElMjBWMSUyMHByb2Nlc3NvciUwQXByb2Nlc3NvciUyMCUzRCUyMFNxdWFkVjFQcm9jZXNzb3IoKSUwQWV4YW1wbGVzJTIwJTNEJTIwcHJvY2Vzc29yLmdldF9kZXZfZXhhbXBsZXMoc3F1YWRfdjFfZGF0YV9kaXIpJTBBJTBBZmVhdHVyZXMlMjAlM0QlMjBzcXVhZF9jb252ZXJ0X2V4YW1wbGVzX3RvX2ZlYXR1cmVzKCUwQSUyMCUyMCUyMCUyMGV4YW1wbGVzJTNEZXhhbXBsZXMlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBtYXhfc2VxX2xlbmd0aCUzRG1heF9zZXFfbGVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwZG9jX3N0cmlkZSUzRGFyZ3MuZG9jX3N0cmlkZSUyQyUwQSUyMCUyMCUyMCUyMG1heF9xdWVyeV9sZW5ndGglM0RtYXhfcXVlcnlfbGVuZ3RoJTJDJTBBJTIwJTIwJTIwJTIwaXNfdHJhaW5pbmclM0Rub3QlMjBldmFsdWF0ZSUyQyUwQSk=",highlighted:`<span class="hljs-comment"># Loading a V2 processor</span>
processor = SquadV2Processor()
examples = processor.get_dev_examples(squad_v2_data_dir)

<span class="hljs-comment"># Loading a V1 processor</span>
processor = SquadV1Processor()
examples = processor.get_dev_examples(squad_v1_data_dir)

features = squad_convert_examples_to_features(
    examples=examples,
    tokenizer=tokenizer,
    max_seq_length=max_seq_length,
    doc_stride=args.doc_stride,
    max_query_length=max_query_length,
    is_training=<span class="hljs-keyword">not</span> evaluate,
)`}}),At=new Xs({props:{code:"JTIzJTIwdGVuc29yZmxvd19kYXRhc2V0cyUyMG9ubHklMjBoYW5kbGUlMjBTcXVhZCUyMFYxLiUwQXRmZHNfZXhhbXBsZXMlMjAlM0QlMjB0ZmRzLmxvYWQoJTIyc3F1YWQlMjIpJTBBZXhhbXBsZXMlMjAlM0QlMjBTcXVhZFYxUHJvY2Vzc29yKCkuZ2V0X2V4YW1wbGVzX2Zyb21fZGF0YXNldCh0ZmRzX2V4YW1wbGVzJTJDJTIwZXZhbHVhdGUlM0RldmFsdWF0ZSklMEElMEFmZWF0dXJlcyUyMCUzRCUyMHNxdWFkX2NvbnZlcnRfZXhhbXBsZXNfdG9fZmVhdHVyZXMoJTBBJTIwJTIwJTIwJTIwZXhhbXBsZXMlM0RleGFtcGxlcyUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMG1heF9zZXFfbGVuZ3RoJTNEbWF4X3NlcV9sZW5ndGglMkMlMEElMjAlMjAlMjAlMjBkb2Nfc3RyaWRlJTNEYXJncy5kb2Nfc3RyaWRlJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3F1ZXJ5X2xlbmd0aCUzRG1heF9xdWVyeV9sZW5ndGglMkMlMEElMjAlMjAlMjAlMjBpc190cmFpbmluZyUzRG5vdCUyMGV2YWx1YXRlJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># tensorflow_datasets only handle Squad V1.</span>
tfds_examples = tfds.load(<span class="hljs-string">&quot;squad&quot;</span>)
examples = SquadV1Processor().get_examples_from_dataset(tfds_examples, evaluate=evaluate)

features = squad_convert_examples_to_features(
    examples=examples,
    tokenizer=tokenizer,
    max_seq_length=max_seq_length,
    doc_stride=args.doc_stride,
    max_query_length=max_query_length,
    is_training=<span class="hljs-keyword">not</span> evaluate,
)`}}),{c(){h=s("meta"),E=i(),v=s("h1"),u=s("a"),M=s("span"),_(m.$$.fragment),x=i(),q=s("span"),J=n("Processors"),U=i(),j=s("p"),L=n("Processors can mean two different things in the Transformers library:"),Z=i(),B=s("ul"),z=s("li"),Lt=n("the objects that pre-process inputs for multi-modal models such as "),zt=s("a"),Ya=n("Wav2Vec2"),Oa=n(` (speech and text)
or `),Dt=s("a"),Ka=n("CLIP"),eo=n(" (text and vision)"),to=i(),gr=s("li"),ro=n("deprecated objects that were used in older versions of the library to preprocess data for GLUE or SQUAD."),Ss=i(),te=s("h2"),de=s("a"),br=s("span"),_(De.$$.fragment),so=i(),$r=s("span"),ao=n("Multi-modal processors"),Js=i(),Bt=s("p"),oo=n(`Any multi-modal model will require an object to encode or decode the data that groups several modalities (among text,
vision and audio). This is handled by objects called processors, which group together two or more processing objects
such as tokenizers (for the text modality), image processors (for vision) and feature extractors (for audio).`),Zs=i(),Ft=s("p"),no=n("Those processors inherit from the following base class that implements the saving and loading functionality:"),As=i(),X=s("div"),_(Be.$$.fragment),lo=i(),yr=s("p"),io=n("This is a mixin used to provide saving/loading functionality for all processor classes."),co=i(),R=s("div"),_(Fe.$$.fragment),po=i(),wr=s("p"),fo=n("Instantiate a processor associated with a pretrained model."),mo=i(),_(pe.$$.fragment),ho=i(),W=s("div"),_(Ge.$$.fragment),uo=i(),xr=s("p"),vo=n("Upload the processor files to the \u{1F917} Model Hub."),_o=i(),_(fe.$$.fragment),go=i(),H=s("div"),_(Ce.$$.fragment),bo=i(),Qe=s("p"),$o=n(`Register this class with a given auto class. This should only be used for custom feature extractors as the ones
in the library are already mapped with `),Er=s("code"),yo=n("AutoProcessor"),wo=n("."),xo=i(),_(me.$$.fragment),Eo=i(),Y=s("div"),_(Re.$$.fragment),Mo=i(),We=s("p"),Po=n(`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Gt=s("a"),Io=n("from_pretrained()"),To=n(" method."),ko=i(),_(he.$$.fragment),Ns=i(),re=s("h2"),ue=s("a"),Mr=s("span"),_(He.$$.fragment),Uo=i(),Pr=s("span"),Xo=n("Deprecated processors"),Vs=i(),V=s("p"),So=n(`All processors follow the same architecture which is that of the
`),Ct=s("a"),Jo=n("DataProcessor"),Zo=n(`. The processor returns a list of
`),Qt=s("a"),Ao=n("InputExample"),No=n(`. These
`),Rt=s("a"),Vo=n("InputExample"),qo=n(` can be converted to
`),Wt=s("a"),jo=n("InputFeatures"),Lo=n(" in order to be fed to the model."),qs=i(),T=s("div"),_(Ye.$$.fragment),zo=i(),Ir=s("p"),Do=n("Base class for data converters for sequence classification data sets."),Bo=i(),ve=s("div"),_(Oe.$$.fragment),Fo=i(),Ke=s("p"),Go=n("Gets a collection of "),Ht=s("a"),Co=n("InputExample"),Qo=n(" for the dev set."),Ro=i(),_e=s("div"),_(et.$$.fragment),Wo=i(),Tr=s("p"),Ho=n("Gets an example from a dict with tensorflow tensors."),Yo=i(),ge=s("div"),_(tt.$$.fragment),Oo=i(),kr=s("p"),Ko=n("Gets the list of labels for this data set."),en=i(),be=s("div"),_(rt.$$.fragment),tn=i(),st=s("p"),rn=n("Gets a collection of "),Yt=s("a"),sn=n("InputExample"),an=n(" for the test set."),on=i(),$e=s("div"),_(at.$$.fragment),nn=i(),ot=s("p"),ln=n("Gets a collection of "),Ot=s("a"),cn=n("InputExample"),dn=n(" for the train set."),pn=i(),ye=s("div"),_(nt.$$.fragment),fn=i(),Ur=s("p"),mn=n(`Some tensorflow_datasets datasets are not formatted the same way the GLUE datasets are. This method converts
examples to the correct format.`),js=i(),F=s("div"),_(lt.$$.fragment),hn=i(),Xr=s("p"),un=n("A single training/test example for simple sequence classification."),vn=i(),we=s("div"),_(it.$$.fragment),_n=i(),Sr=s("p"),gn=n("Serializes this instance to a JSON string."),Ls=i(),G=s("div"),_(ct.$$.fragment),bn=i(),Jr=s("p"),$n=n("A single set of features of data. Property names are the same names as the corresponding inputs to a model."),yn=i(),xe=s("div"),_(dt.$$.fragment),wn=i(),Zr=s("p"),xn=n("Serializes this instance to a JSON string."),zs=i(),se=s("h2"),Ee=s("a"),Ar=s("span"),_(pt.$$.fragment),En=i(),Nr=s("span"),Mn=n("GLUE"),Ds=i(),Me=s("p"),ft=s("a"),Pn=n("General Language Understanding Evaluation (GLUE)"),In=n(` is a benchmark that evaluates the
performance of models across a diverse set of existing NLU tasks. It was released together with the paper `),mt=s("a"),Tn=n(`GLUE: A
multi-task benchmark and analysis platform for natural language understanding`),Bs=i(),Kt=s("p"),kn=n(`This library hosts a total of 10 processors for the following tasks: MRPC, MNLI, MNLI (mismatched), CoLA, SST2, STSB,
QQP, QNLI, RTE and WNLI.`),Fs=i(),er=s("p"),Un=n("Those processors are:"),Gs=i(),P=s("ul"),Vr=s("li"),qr=s("code"),Xn=n("~data.processors.utils.MrpcProcessor"),Sn=i(),jr=s("li"),Lr=s("code"),Jn=n("~data.processors.utils.MnliProcessor"),Zn=i(),zr=s("li"),Dr=s("code"),An=n("~data.processors.utils.MnliMismatchedProcessor"),Nn=i(),Br=s("li"),Fr=s("code"),Vn=n("~data.processors.utils.Sst2Processor"),qn=i(),Gr=s("li"),Cr=s("code"),jn=n("~data.processors.utils.StsbProcessor"),Ln=i(),Qr=s("li"),Rr=s("code"),zn=n("~data.processors.utils.QqpProcessor"),Dn=i(),Wr=s("li"),Hr=s("code"),Bn=n("~data.processors.utils.QnliProcessor"),Fn=i(),Yr=s("li"),Or=s("code"),Gn=n("~data.processors.utils.RteProcessor"),Cn=i(),Kr=s("li"),es=s("code"),Qn=n("~data.processors.utils.WnliProcessor"),Cs=i(),Pe=s("p"),Rn=n(`Additionally, the following method can be used to load values from a data file and convert them to a list of
`),tr=s("a"),Wn=n("InputExample"),Hn=n("."),Qs=i(),ae=s("div"),_(ht.$$.fragment),Yn=i(),rr=s("p"),On=n("Loads a data file into a list of "),ts=s("code"),Kn=n("InputFeatures"),Rs=i(),oe=s("h2"),Ie=s("a"),rs=s("span"),_(ut.$$.fragment),el=i(),ss=s("span"),tl=n("XNLI"),Ws=i(),ne=s("p"),vt=s("a"),rl=n("The Cross-Lingual NLI Corpus (XNLI)"),sl=n(` is a benchmark that evaluates the
quality of cross-lingual text representations. XNLI is crowd-sourced dataset based on `),_t=s("a"),as=s("em"),al=n("MultiNLI"),ol=n(`: pairs of text are labeled with textual entailment annotations for 15
different languages (including both high-resource language such as English and low-resource languages such as Swahili).`),Hs=i(),gt=s("p"),nl=n("It was released together with the paper "),bt=s("a"),ll=n("XNLI: Evaluating Cross-lingual Sentence Representations"),Ys=i(),sr=s("p"),il=n("This library hosts the processor to load the XNLI data:"),Os=i(),ar=s("ul"),os=s("li"),ns=s("code"),cl=n("~data.processors.utils.XnliProcessor"),Ks=i(),or=s("p"),dl=n("Please note that since the gold labels are available on the test set, evaluation is performed on the test set."),ea=i(),Te=s("p"),pl=n("An example using these processors is given in the "),$t=s("a"),fl=n("run_xnli.py"),ml=n(" script."),ta=i(),le=s("h2"),ke=s("a"),ls=s("span"),_(yt.$$.fragment),hl=i(),is=s("span"),ul=n("SQuAD"),ra=i(),C=s("p"),wt=s("a"),vl=n("The Stanford Question Answering Dataset (SQuAD)"),_l=n(` is a benchmark that
evaluates the performance of models on question answering. Two versions are available, v1.1 and v2.0. The first version
(v1.1) was released together with the paper `),xt=s("a"),gl=n("SQuAD: 100,000+ Questions for Machine Comprehension of Text"),bl=n(". The second version (v2.0) was released alongside the paper "),Et=s("a"),$l=n(`Know What You Don\u2019t
Know: Unanswerable Questions for SQuAD`),yl=n("."),sa=i(),nr=s("p"),wl=n("This library hosts a processor for each of the two versions:"),aa=i(),ie=s("h3"),Ue=s("a"),cs=s("span"),_(Mt.$$.fragment),xl=i(),ds=s("span"),El=n("Processors"),oa=i(),lr=s("p"),Ml=n("Those processors are:"),na=i(),Xe=s("ul"),ps=s("li"),fs=s("code"),Pl=n("~data.processors.utils.SquadV1Processor"),Il=i(),ms=s("li"),hs=s("code"),Tl=n("~data.processors.utils.SquadV2Processor"),la=i(),Pt=s("p"),kl=n("They both inherit from the abstract class "),us=s("code"),Ul=n("~data.processors.utils.SquadProcessor"),ia=i(),A=s("div"),_(It.$$.fragment),Xl=i(),vs=s("p"),Sl=n(`Processor for the SQuAD data set. overridden by SquadV1Processor and SquadV2Processor, used by the version 1.1 and
version 2.0 of SQuAD, respectively.`),Jl=i(),Se=s("div"),_(Tt.$$.fragment),Zl=i(),_s=s("p"),Al=n("Returns the evaluation example from the data directory."),Nl=i(),O=s("div"),_(kt.$$.fragment),Vl=i(),Ut=s("p"),ql=n("Creates a list of "),gs=s("code"),jl=n("SquadExample"),Ll=n(" using a TFDS dataset."),zl=i(),_(Je.$$.fragment),Dl=i(),Ze=s("div"),_(Xt.$$.fragment),Bl=i(),bs=s("p"),Fl=n("Returns the training examples from the data directory."),ca=i(),Ae=s("p"),Gl=n(`Additionally, the following method can be used to convert SQuAD examples into
`),$s=s("code"),Cl=n("~data.processors.utils.SquadFeatures"),Ql=n(" that can be used as model inputs."),da=i(),Q=s("div"),_(St.$$.fragment),Rl=i(),ys=s("p"),Wl=n(`Converts a list of examples into a list of features that can be directly given as input to a model. It is
model-dependant and takes advantage of many of the tokenizer\u2019s features to create the model\u2019s inputs.`),Hl=i(),_(Ne.$$.fragment),pa=i(),Ve=s("p"),Yl=n(`These processors as well as the aforementioned method can be used with files containing the data as well as with the
`),ws=s("em"),Ol=n("tensorflow_datasets"),Kl=n(" package. Examples are given below."),fa=i(),ce=s("h3"),qe=s("a"),xs=s("span"),_(Jt.$$.fragment),ei=i(),Es=s("span"),ti=n("Example usage"),ma=i(),ir=s("p"),ri=n("Here is an example using the processors as well as the conversion method using data files:"),ha=i(),_(Zt.$$.fragment),ua=i(),je=s("p"),si=n("Using "),Ms=s("em"),ai=n("tensorflow_datasets"),oi=n(" is as easy as using a data file:"),va=i(),_(At.$$.fragment),_a=i(),Le=s("p"),ni=n("Another example using these processors is given in the "),Nt=s("a"),li=n("run_squad.py"),ii=n(" script."),this.h()},l(e){const d=dd('[data-svelte="svelte-1phssyn"]',document.head);h=a(d,"META",{name:!0,content:!0}),d.forEach(r),E=c(e),v=a(e,"H1",{class:!0});var Vt=o(v);u=a(Vt,"A",{id:!0,class:!0,href:!0});var Ps=o(u);M=a(Ps,"SPAN",{});var Is=o(M);g(m.$$.fragment,Is),Is.forEach(r),Ps.forEach(r),x=c(Vt),q=a(Vt,"SPAN",{});var Ts=o(q);J=l(Ts,"Processors"),Ts.forEach(r),Vt.forEach(r),U=c(e),j=a(e,"P",{});var ks=o(j);L=l(ks,"Processors can mean two different things in the Transformers library:"),ks.forEach(r),Z=c(e),B=a(e,"UL",{});var qt=o(B);z=a(qt,"LI",{});var cr=o(z);Lt=l(cr,"the objects that pre-process inputs for multi-modal models such as "),zt=a(cr,"A",{href:!0});var ui=o(zt);Ya=l(ui,"Wav2Vec2"),ui.forEach(r),Oa=l(cr,` (speech and text)
or `),Dt=a(cr,"A",{href:!0});var vi=o(Dt);Ka=l(vi,"CLIP"),vi.forEach(r),eo=l(cr," (text and vision)"),cr.forEach(r),to=c(qt),gr=a(qt,"LI",{});var _i=o(gr);ro=l(_i,"deprecated objects that were used in older versions of the library to preprocess data for GLUE or SQUAD."),_i.forEach(r),qt.forEach(r),Ss=c(e),te=a(e,"H2",{class:!0});var ba=o(te);de=a(ba,"A",{id:!0,class:!0,href:!0});var gi=o(de);br=a(gi,"SPAN",{});var bi=o(br);g(De.$$.fragment,bi),bi.forEach(r),gi.forEach(r),so=c(ba),$r=a(ba,"SPAN",{});var $i=o($r);ao=l($i,"Multi-modal processors"),$i.forEach(r),ba.forEach(r),Js=c(e),Bt=a(e,"P",{});var yi=o(Bt);oo=l(yi,`Any multi-modal model will require an object to encode or decode the data that groups several modalities (among text,
vision and audio). This is handled by objects called processors, which group together two or more processing objects
such as tokenizers (for the text modality), image processors (for vision) and feature extractors (for audio).`),yi.forEach(r),Zs=c(e),Ft=a(e,"P",{});var wi=o(Ft);no=l(wi,"Those processors inherit from the following base class that implements the saving and loading functionality:"),wi.forEach(r),As=c(e),X=a(e,"DIV",{class:!0});var D=o(X);g(Be.$$.fragment,D),lo=c(D),yr=a(D,"P",{});var xi=o(yr);io=l(xi,"This is a mixin used to provide saving/loading functionality for all processor classes."),xi.forEach(r),co=c(D),R=a(D,"DIV",{class:!0});var dr=o(R);g(Fe.$$.fragment,dr),po=c(dr),wr=a(dr,"P",{});var Ei=o(wr);fo=l(Ei,"Instantiate a processor associated with a pretrained model."),Ei.forEach(r),mo=c(dr),g(pe.$$.fragment,dr),dr.forEach(r),ho=c(D),W=a(D,"DIV",{class:!0});var pr=o(W);g(Ge.$$.fragment,pr),uo=c(pr),xr=a(pr,"P",{});var Mi=o(xr);vo=l(Mi,"Upload the processor files to the \u{1F917} Model Hub."),Mi.forEach(r),_o=c(pr),g(fe.$$.fragment,pr),pr.forEach(r),go=c(D),H=a(D,"DIV",{class:!0});var fr=o(H);g(Ce.$$.fragment,fr),bo=c(fr),Qe=a(fr,"P",{});var $a=o(Qe);$o=l($a,`Register this class with a given auto class. This should only be used for custom feature extractors as the ones
in the library are already mapped with `),Er=a($a,"CODE",{});var Pi=o(Er);yo=l(Pi,"AutoProcessor"),Pi.forEach(r),wo=l($a,"."),$a.forEach(r),xo=c(fr),g(me.$$.fragment,fr),fr.forEach(r),Eo=c(D),Y=a(D,"DIV",{class:!0});var mr=o(Y);g(Re.$$.fragment,mr),Mo=c(mr),We=a(mr,"P",{});var ya=o(We);Po=l(ya,`Saves the attributes of this processor (feature extractor, tokenizer\u2026) in the specified directory so that it
can be reloaded using the `),Gt=a(ya,"A",{href:!0});var Ii=o(Gt);Io=l(Ii,"from_pretrained()"),Ii.forEach(r),To=l(ya," method."),ya.forEach(r),ko=c(mr),g(he.$$.fragment,mr),mr.forEach(r),D.forEach(r),Ns=c(e),re=a(e,"H2",{class:!0});var wa=o(re);ue=a(wa,"A",{id:!0,class:!0,href:!0});var Ti=o(ue);Mr=a(Ti,"SPAN",{});var ki=o(Mr);g(He.$$.fragment,ki),ki.forEach(r),Ti.forEach(r),Uo=c(wa),Pr=a(wa,"SPAN",{});var Ui=o(Pr);Xo=l(Ui,"Deprecated processors"),Ui.forEach(r),wa.forEach(r),Vs=c(e),V=a(e,"P",{});var K=o(V);So=l(K,`All processors follow the same architecture which is that of the
`),Ct=a(K,"A",{href:!0});var Xi=o(Ct);Jo=l(Xi,"DataProcessor"),Xi.forEach(r),Zo=l(K,`. The processor returns a list of
`),Qt=a(K,"A",{href:!0});var Si=o(Qt);Ao=l(Si,"InputExample"),Si.forEach(r),No=l(K,`. These
`),Rt=a(K,"A",{href:!0});var Ji=o(Rt);Vo=l(Ji,"InputExample"),Ji.forEach(r),qo=l(K,` can be converted to
`),Wt=a(K,"A",{href:!0});var Zi=o(Wt);jo=l(Zi,"InputFeatures"),Zi.forEach(r),Lo=l(K," in order to be fed to the model."),K.forEach(r),qs=c(e),T=a(e,"DIV",{class:!0});var S=o(T);g(Ye.$$.fragment,S),zo=c(S),Ir=a(S,"P",{});var Ai=o(Ir);Do=l(Ai,"Base class for data converters for sequence classification data sets."),Ai.forEach(r),Bo=c(S),ve=a(S,"DIV",{class:!0});var xa=o(ve);g(Oe.$$.fragment,xa),Fo=c(xa),Ke=a(xa,"P",{});var Ea=o(Ke);Go=l(Ea,"Gets a collection of "),Ht=a(Ea,"A",{href:!0});var Ni=o(Ht);Co=l(Ni,"InputExample"),Ni.forEach(r),Qo=l(Ea," for the dev set."),Ea.forEach(r),xa.forEach(r),Ro=c(S),_e=a(S,"DIV",{class:!0});var Ma=o(_e);g(et.$$.fragment,Ma),Wo=c(Ma),Tr=a(Ma,"P",{});var Vi=o(Tr);Ho=l(Vi,"Gets an example from a dict with tensorflow tensors."),Vi.forEach(r),Ma.forEach(r),Yo=c(S),ge=a(S,"DIV",{class:!0});var Pa=o(ge);g(tt.$$.fragment,Pa),Oo=c(Pa),kr=a(Pa,"P",{});var qi=o(kr);Ko=l(qi,"Gets the list of labels for this data set."),qi.forEach(r),Pa.forEach(r),en=c(S),be=a(S,"DIV",{class:!0});var Ia=o(be);g(rt.$$.fragment,Ia),tn=c(Ia),st=a(Ia,"P",{});var Ta=o(st);rn=l(Ta,"Gets a collection of "),Yt=a(Ta,"A",{href:!0});var ji=o(Yt);sn=l(ji,"InputExample"),ji.forEach(r),an=l(Ta," for the test set."),Ta.forEach(r),Ia.forEach(r),on=c(S),$e=a(S,"DIV",{class:!0});var ka=o($e);g(at.$$.fragment,ka),nn=c(ka),ot=a(ka,"P",{});var Ua=o(ot);ln=l(Ua,"Gets a collection of "),Ot=a(Ua,"A",{href:!0});var Li=o(Ot);cn=l(Li,"InputExample"),Li.forEach(r),dn=l(Ua," for the train set."),Ua.forEach(r),ka.forEach(r),pn=c(S),ye=a(S,"DIV",{class:!0});var Xa=o(ye);g(nt.$$.fragment,Xa),fn=c(Xa),Ur=a(Xa,"P",{});var zi=o(Ur);mn=l(zi,`Some tensorflow_datasets datasets are not formatted the same way the GLUE datasets are. This method converts
examples to the correct format.`),zi.forEach(r),Xa.forEach(r),S.forEach(r),js=c(e),F=a(e,"DIV",{class:!0});var hr=o(F);g(lt.$$.fragment,hr),hn=c(hr),Xr=a(hr,"P",{});var Di=o(Xr);un=l(Di,"A single training/test example for simple sequence classification."),Di.forEach(r),vn=c(hr),we=a(hr,"DIV",{class:!0});var Sa=o(we);g(it.$$.fragment,Sa),_n=c(Sa),Sr=a(Sa,"P",{});var Bi=o(Sr);gn=l(Bi,"Serializes this instance to a JSON string."),Bi.forEach(r),Sa.forEach(r),hr.forEach(r),Ls=c(e),G=a(e,"DIV",{class:!0});var ur=o(G);g(ct.$$.fragment,ur),bn=c(ur),Jr=a(ur,"P",{});var Fi=o(Jr);$n=l(Fi,"A single set of features of data. Property names are the same names as the corresponding inputs to a model."),Fi.forEach(r),yn=c(ur),xe=a(ur,"DIV",{class:!0});var Ja=o(xe);g(dt.$$.fragment,Ja),wn=c(Ja),Zr=a(Ja,"P",{});var Gi=o(Zr);xn=l(Gi,"Serializes this instance to a JSON string."),Gi.forEach(r),Ja.forEach(r),ur.forEach(r),zs=c(e),se=a(e,"H2",{class:!0});var Za=o(se);Ee=a(Za,"A",{id:!0,class:!0,href:!0});var Ci=o(Ee);Ar=a(Ci,"SPAN",{});var Qi=o(Ar);g(pt.$$.fragment,Qi),Qi.forEach(r),Ci.forEach(r),En=c(Za),Nr=a(Za,"SPAN",{});var Ri=o(Nr);Mn=l(Ri,"GLUE"),Ri.forEach(r),Za.forEach(r),Ds=c(e),Me=a(e,"P",{});var Aa=o(Me);ft=a(Aa,"A",{href:!0,rel:!0});var Wi=o(ft);Pn=l(Wi,"General Language Understanding Evaluation (GLUE)"),Wi.forEach(r),In=l(Aa,` is a benchmark that evaluates the
performance of models across a diverse set of existing NLU tasks. It was released together with the paper `),mt=a(Aa,"A",{href:!0,rel:!0});var Hi=o(mt);Tn=l(Hi,`GLUE: A
multi-task benchmark and analysis platform for natural language understanding`),Hi.forEach(r),Aa.forEach(r),Bs=c(e),Kt=a(e,"P",{});var Yi=o(Kt);kn=l(Yi,`This library hosts a total of 10 processors for the following tasks: MRPC, MNLI, MNLI (mismatched), CoLA, SST2, STSB,
QQP, QNLI, RTE and WNLI.`),Yi.forEach(r),Fs=c(e),er=a(e,"P",{});var Oi=o(er);Un=l(Oi,"Those processors are:"),Oi.forEach(r),Gs=c(e),P=a(e,"UL",{});var k=o(P);Vr=a(k,"LI",{});var Ki=o(Vr);qr=a(Ki,"CODE",{});var ec=o(qr);Xn=l(ec,"~data.processors.utils.MrpcProcessor"),ec.forEach(r),Ki.forEach(r),Sn=c(k),jr=a(k,"LI",{});var tc=o(jr);Lr=a(tc,"CODE",{});var rc=o(Lr);Jn=l(rc,"~data.processors.utils.MnliProcessor"),rc.forEach(r),tc.forEach(r),Zn=c(k),zr=a(k,"LI",{});var sc=o(zr);Dr=a(sc,"CODE",{});var ac=o(Dr);An=l(ac,"~data.processors.utils.MnliMismatchedProcessor"),ac.forEach(r),sc.forEach(r),Nn=c(k),Br=a(k,"LI",{});var oc=o(Br);Fr=a(oc,"CODE",{});var nc=o(Fr);Vn=l(nc,"~data.processors.utils.Sst2Processor"),nc.forEach(r),oc.forEach(r),qn=c(k),Gr=a(k,"LI",{});var lc=o(Gr);Cr=a(lc,"CODE",{});var ic=o(Cr);jn=l(ic,"~data.processors.utils.StsbProcessor"),ic.forEach(r),lc.forEach(r),Ln=c(k),Qr=a(k,"LI",{});var cc=o(Qr);Rr=a(cc,"CODE",{});var dc=o(Rr);zn=l(dc,"~data.processors.utils.QqpProcessor"),dc.forEach(r),cc.forEach(r),Dn=c(k),Wr=a(k,"LI",{});var pc=o(Wr);Hr=a(pc,"CODE",{});var fc=o(Hr);Bn=l(fc,"~data.processors.utils.QnliProcessor"),fc.forEach(r),pc.forEach(r),Fn=c(k),Yr=a(k,"LI",{});var mc=o(Yr);Or=a(mc,"CODE",{});var hc=o(Or);Gn=l(hc,"~data.processors.utils.RteProcessor"),hc.forEach(r),mc.forEach(r),Cn=c(k),Kr=a(k,"LI",{});var uc=o(Kr);es=a(uc,"CODE",{});var vc=o(es);Qn=l(vc,"~data.processors.utils.WnliProcessor"),vc.forEach(r),uc.forEach(r),k.forEach(r),Cs=c(e),Pe=a(e,"P",{});var Na=o(Pe);Rn=l(Na,`Additionally, the following method can be used to load values from a data file and convert them to a list of
`),tr=a(Na,"A",{href:!0});var _c=o(tr);Wn=l(_c,"InputExample"),_c.forEach(r),Hn=l(Na,"."),Na.forEach(r),Qs=c(e),ae=a(e,"DIV",{class:!0});var Va=o(ae);g(ht.$$.fragment,Va),Yn=c(Va),rr=a(Va,"P",{});var ci=o(rr);On=l(ci,"Loads a data file into a list of "),ts=a(ci,"CODE",{});var gc=o(ts);Kn=l(gc,"InputFeatures"),gc.forEach(r),ci.forEach(r),Va.forEach(r),Rs=c(e),oe=a(e,"H2",{class:!0});var qa=o(oe);Ie=a(qa,"A",{id:!0,class:!0,href:!0});var bc=o(Ie);rs=a(bc,"SPAN",{});var $c=o(rs);g(ut.$$.fragment,$c),$c.forEach(r),bc.forEach(r),el=c(qa),ss=a(qa,"SPAN",{});var yc=o(ss);tl=l(yc,"XNLI"),yc.forEach(r),qa.forEach(r),Ws=c(e),ne=a(e,"P",{});var Us=o(ne);vt=a(Us,"A",{href:!0,rel:!0});var wc=o(vt);rl=l(wc,"The Cross-Lingual NLI Corpus (XNLI)"),wc.forEach(r),sl=l(Us,` is a benchmark that evaluates the
quality of cross-lingual text representations. XNLI is crowd-sourced dataset based on `),_t=a(Us,"A",{href:!0,rel:!0});var xc=o(_t);as=a(xc,"EM",{});var Ec=o(as);al=l(Ec,"MultiNLI"),Ec.forEach(r),xc.forEach(r),ol=l(Us,`: pairs of text are labeled with textual entailment annotations for 15
different languages (including both high-resource language such as English and low-resource languages such as Swahili).`),Us.forEach(r),Hs=c(e),gt=a(e,"P",{});var di=o(gt);nl=l(di,"It was released together with the paper "),bt=a(di,"A",{href:!0,rel:!0});var Mc=o(bt);ll=l(Mc,"XNLI: Evaluating Cross-lingual Sentence Representations"),Mc.forEach(r),di.forEach(r),Ys=c(e),sr=a(e,"P",{});var Pc=o(sr);il=l(Pc,"This library hosts the processor to load the XNLI data:"),Pc.forEach(r),Os=c(e),ar=a(e,"UL",{});var Ic=o(ar);os=a(Ic,"LI",{});var Tc=o(os);ns=a(Tc,"CODE",{});var kc=o(ns);cl=l(kc,"~data.processors.utils.XnliProcessor"),kc.forEach(r),Tc.forEach(r),Ic.forEach(r),Ks=c(e),or=a(e,"P",{});var Uc=o(or);dl=l(Uc,"Please note that since the gold labels are available on the test set, evaluation is performed on the test set."),Uc.forEach(r),ea=c(e),Te=a(e,"P",{});var ja=o(Te);pl=l(ja,"An example using these processors is given in the "),$t=a(ja,"A",{href:!0,rel:!0});var Xc=o($t);fl=l(Xc,"run_xnli.py"),Xc.forEach(r),ml=l(ja," script."),ja.forEach(r),ta=c(e),le=a(e,"H2",{class:!0});var La=o(le);ke=a(La,"A",{id:!0,class:!0,href:!0});var Sc=o(ke);ls=a(Sc,"SPAN",{});var Jc=o(ls);g(yt.$$.fragment,Jc),Jc.forEach(r),Sc.forEach(r),hl=c(La),is=a(La,"SPAN",{});var Zc=o(is);ul=l(Zc,"SQuAD"),Zc.forEach(r),La.forEach(r),ra=c(e),C=a(e,"P",{});var jt=o(C);wt=a(jt,"A",{href:!0,rel:!0});var Ac=o(wt);vl=l(Ac,"The Stanford Question Answering Dataset (SQuAD)"),Ac.forEach(r),_l=l(jt,` is a benchmark that
evaluates the performance of models on question answering. Two versions are available, v1.1 and v2.0. The first version
(v1.1) was released together with the paper `),xt=a(jt,"A",{href:!0,rel:!0});var Nc=o(xt);gl=l(Nc,"SQuAD: 100,000+ Questions for Machine Comprehension of Text"),Nc.forEach(r),bl=l(jt,". The second version (v2.0) was released alongside the paper "),Et=a(jt,"A",{href:!0,rel:!0});var Vc=o(Et);$l=l(Vc,`Know What You Don\u2019t
Know: Unanswerable Questions for SQuAD`),Vc.forEach(r),yl=l(jt,"."),jt.forEach(r),sa=c(e),nr=a(e,"P",{});var qc=o(nr);wl=l(qc,"This library hosts a processor for each of the two versions:"),qc.forEach(r),aa=c(e),ie=a(e,"H3",{class:!0});var za=o(ie);Ue=a(za,"A",{id:!0,class:!0,href:!0});var jc=o(Ue);cs=a(jc,"SPAN",{});var Lc=o(cs);g(Mt.$$.fragment,Lc),Lc.forEach(r),jc.forEach(r),xl=c(za),ds=a(za,"SPAN",{});var zc=o(ds);El=l(zc,"Processors"),zc.forEach(r),za.forEach(r),oa=c(e),lr=a(e,"P",{});var Dc=o(lr);Ml=l(Dc,"Those processors are:"),Dc.forEach(r),na=c(e),Xe=a(e,"UL",{});var Da=o(Xe);ps=a(Da,"LI",{});var Bc=o(ps);fs=a(Bc,"CODE",{});var Fc=o(fs);Pl=l(Fc,"~data.processors.utils.SquadV1Processor"),Fc.forEach(r),Bc.forEach(r),Il=c(Da),ms=a(Da,"LI",{});var Gc=o(ms);hs=a(Gc,"CODE",{});var Cc=o(hs);Tl=l(Cc,"~data.processors.utils.SquadV2Processor"),Cc.forEach(r),Gc.forEach(r),Da.forEach(r),la=c(e),Pt=a(e,"P",{});var pi=o(Pt);kl=l(pi,"They both inherit from the abstract class "),us=a(pi,"CODE",{});var Qc=o(us);Ul=l(Qc,"~data.processors.utils.SquadProcessor"),Qc.forEach(r),pi.forEach(r),ia=c(e),A=a(e,"DIV",{class:!0});var ee=o(A);g(It.$$.fragment,ee),Xl=c(ee),vs=a(ee,"P",{});var Rc=o(vs);Sl=l(Rc,`Processor for the SQuAD data set. overridden by SquadV1Processor and SquadV2Processor, used by the version 1.1 and
version 2.0 of SQuAD, respectively.`),Rc.forEach(r),Jl=c(ee),Se=a(ee,"DIV",{class:!0});var Ba=o(Se);g(Tt.$$.fragment,Ba),Zl=c(Ba),_s=a(Ba,"P",{});var Wc=o(_s);Al=l(Wc,"Returns the evaluation example from the data directory."),Wc.forEach(r),Ba.forEach(r),Nl=c(ee),O=a(ee,"DIV",{class:!0});var vr=o(O);g(kt.$$.fragment,vr),Vl=c(vr),Ut=a(vr,"P",{});var Fa=o(Ut);ql=l(Fa,"Creates a list of "),gs=a(Fa,"CODE",{});var Hc=o(gs);jl=l(Hc,"SquadExample"),Hc.forEach(r),Ll=l(Fa," using a TFDS dataset."),Fa.forEach(r),zl=c(vr),g(Je.$$.fragment,vr),vr.forEach(r),Dl=c(ee),Ze=a(ee,"DIV",{class:!0});var Ga=o(Ze);g(Xt.$$.fragment,Ga),Bl=c(Ga),bs=a(Ga,"P",{});var Yc=o(bs);Fl=l(Yc,"Returns the training examples from the data directory."),Yc.forEach(r),Ga.forEach(r),ee.forEach(r),ca=c(e),Ae=a(e,"P",{});var Ca=o(Ae);Gl=l(Ca,`Additionally, the following method can be used to convert SQuAD examples into
`),$s=a(Ca,"CODE",{});var Oc=o($s);Cl=l(Oc,"~data.processors.utils.SquadFeatures"),Oc.forEach(r),Ql=l(Ca," that can be used as model inputs."),Ca.forEach(r),da=c(e),Q=a(e,"DIV",{class:!0});var _r=o(Q);g(St.$$.fragment,_r),Rl=c(_r),ys=a(_r,"P",{});var Kc=o(ys);Wl=l(Kc,`Converts a list of examples into a list of features that can be directly given as input to a model. It is
model-dependant and takes advantage of many of the tokenizer\u2019s features to create the model\u2019s inputs.`),Kc.forEach(r),Hl=c(_r),g(Ne.$$.fragment,_r),_r.forEach(r),pa=c(e),Ve=a(e,"P",{});var Qa=o(Ve);Yl=l(Qa,`These processors as well as the aforementioned method can be used with files containing the data as well as with the
`),ws=a(Qa,"EM",{});var ed=o(ws);Ol=l(ed,"tensorflow_datasets"),ed.forEach(r),Kl=l(Qa," package. Examples are given below."),Qa.forEach(r),fa=c(e),ce=a(e,"H3",{class:!0});var Ra=o(ce);qe=a(Ra,"A",{id:!0,class:!0,href:!0});var td=o(qe);xs=a(td,"SPAN",{});var rd=o(xs);g(Jt.$$.fragment,rd),rd.forEach(r),td.forEach(r),ei=c(Ra),Es=a(Ra,"SPAN",{});var sd=o(Es);ti=l(sd,"Example usage"),sd.forEach(r),Ra.forEach(r),ma=c(e),ir=a(e,"P",{});var ad=o(ir);ri=l(ad,"Here is an example using the processors as well as the conversion method using data files:"),ad.forEach(r),ha=c(e),g(Zt.$$.fragment,e),ua=c(e),je=a(e,"P",{});var Wa=o(je);si=l(Wa,"Using "),Ms=a(Wa,"EM",{});var od=o(Ms);ai=l(od,"tensorflow_datasets"),od.forEach(r),oi=l(Wa," is as easy as using a data file:"),Wa.forEach(r),va=c(e),g(At.$$.fragment,e),_a=c(e),Le=a(e,"P",{});var Ha=o(Le);ni=l(Ha,"Another example using these processors is given in the "),Nt=a(Ha,"A",{href:!0,rel:!0});var nd=o(Nt);li=l(nd,"run_squad.py"),nd.forEach(r),ii=l(Ha," script."),Ha.forEach(r),this.h()},h(){f(h,"name","hf:doc:metadata"),f(h,"content",JSON.stringify(bd)),f(u,"id","processors"),f(u,"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"),f(u,"href","#processors"),f(v,"class","relative group"),f(zt,"href","../model_doc/wav2vec2"),f(Dt,"href","../model_doc/clip"),f(de,"id","transformers.ProcessorMixin"),f(de,"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"),f(de,"href","#transformers.ProcessorMixin"),f(te,"class","relative group"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Gt,"href","/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutProcessor.from_pretrained"),f(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ue,"id","transformers.DataProcessor"),f(ue,"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"),f(ue,"href","#transformers.DataProcessor"),f(re,"class","relative group"),f(Ct,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.DataProcessor"),f(Qt,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f(Rt,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f(Wt,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputFeatures"),f(Ht,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Yt,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ot,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ee,"id","transformers.glue_convert_examples_to_features"),f(Ee,"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"),f(Ee,"href","#transformers.glue_convert_examples_to_features"),f(se,"class","relative group"),f(ft,"href","https://gluebenchmark.com/"),f(ft,"rel","nofollow"),f(mt,"href","https://openreview.net/pdf?id=rJ4km2R5t7"),f(mt,"rel","nofollow"),f(tr,"href","/docs/transformers/v4.33.0/en/main_classes/processors#transformers.InputExample"),f(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ie,"id","xnli"),f(Ie,"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"),f(Ie,"href","#xnli"),f(oe,"class","relative group"),f(vt,"href","https://www.nyu.edu/projects/bowman/xnli/"),f(vt,"rel","nofollow"),f(_t,"href","http://www.nyu.edu/projects/bowman/multinli/"),f(_t,"rel","nofollow"),f(bt,"href","https://arxiv.org/abs/1809.05053"),f(bt,"rel","nofollow"),f($t,"href","https://github.com/huggingface/transformers/tree/main/examples/legacy/text-classification/run_xnli.py"),f($t,"rel","nofollow"),f(ke,"id","squad"),f(ke,"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"),f(ke,"href","#squad"),f(le,"class","relative group"),f(wt,"href","https://rajpurkar.github.io/SQuAD-explorer//"),f(wt,"rel","nofollow"),f(xt,"href","https://arxiv.org/abs/1606.05250"),f(xt,"rel","nofollow"),f(Et,"href","https://arxiv.org/abs/1806.03822"),f(Et,"rel","nofollow"),f(Ue,"id","transformers.data.processors.squad.SquadProcessor"),f(Ue,"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"),f(Ue,"href","#transformers.data.processors.squad.SquadProcessor"),f(ie,"class","relative group"),f(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(qe,"id","example-usage"),f(qe,"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"),f(qe,"href","#example-usage"),f(ce,"class","relative group"),f(Nt,"href","https://github.com/huggingface/transformers/tree/main/examples/legacy/question-answering/run_squad.py"),f(Nt,"rel","nofollow")},m(e,d){t(document.head,h),p(e,E,d),p(e,v,d),t(v,u),t(u,M),b(m,M,null),t(v,x),t(v,q),t(q,J),p(e,U,d),p(e,j,d),t(j,L),p(e,Z,d),p(e,B,d),t(B,z),t(z,Lt),t(z,zt),t(zt,Ya),t(z,Oa),t(z,Dt),t(Dt,Ka),t(z,eo),t(B,to),t(B,gr),t(gr,ro),p(e,Ss,d),p(e,te,d),t(te,de),t(de,br),b(De,br,null),t(te,so),t(te,$r),t($r,ao),p(e,Js,d),p(e,Bt,d),t(Bt,oo),p(e,Zs,d),p(e,Ft,d),t(Ft,no),p(e,As,d),p(e,X,d),b(Be,X,null),t(X,lo),t(X,yr),t(yr,io),t(X,co),t(X,R),b(Fe,R,null),t(R,po),t(R,wr),t(wr,fo),t(R,mo),b(pe,R,null),t(X,ho),t(X,W),b(Ge,W,null),t(W,uo),t(W,xr),t(xr,vo),t(W,_o),b(fe,W,null),t(X,go),t(X,H),b(Ce,H,null),t(H,bo),t(H,Qe),t(Qe,$o),t(Qe,Er),t(Er,yo),t(Qe,wo),t(H,xo),b(me,H,null),t(X,Eo),t(X,Y),b(Re,Y,null),t(Y,Mo),t(Y,We),t(We,Po),t(We,Gt),t(Gt,Io),t(We,To),t(Y,ko),b(he,Y,null),p(e,Ns,d),p(e,re,d),t(re,ue),t(ue,Mr),b(He,Mr,null),t(re,Uo),t(re,Pr),t(Pr,Xo),p(e,Vs,d),p(e,V,d),t(V,So),t(V,Ct),t(Ct,Jo),t(V,Zo),t(V,Qt),t(Qt,Ao),t(V,No),t(V,Rt),t(Rt,Vo),t(V,qo),t(V,Wt),t(Wt,jo),t(V,Lo),p(e,qs,d),p(e,T,d),b(Ye,T,null),t(T,zo),t(T,Ir),t(Ir,Do),t(T,Bo),t(T,ve),b(Oe,ve,null),t(ve,Fo),t(ve,Ke),t(Ke,Go),t(Ke,Ht),t(Ht,Co),t(Ke,Qo),t(T,Ro),t(T,_e),b(et,_e,null),t(_e,Wo),t(_e,Tr),t(Tr,Ho),t(T,Yo),t(T,ge),b(tt,ge,null),t(ge,Oo),t(ge,kr),t(kr,Ko),t(T,en),t(T,be),b(rt,be,null),t(be,tn),t(be,st),t(st,rn),t(st,Yt),t(Yt,sn),t(st,an),t(T,on),t(T,$e),b(at,$e,null),t($e,nn),t($e,ot),t(ot,ln),t(ot,Ot),t(Ot,cn),t(ot,dn),t(T,pn),t(T,ye),b(nt,ye,null),t(ye,fn),t(ye,Ur),t(Ur,mn),p(e,js,d),p(e,F,d),b(lt,F,null),t(F,hn),t(F,Xr),t(Xr,un),t(F,vn),t(F,we),b(it,we,null),t(we,_n),t(we,Sr),t(Sr,gn),p(e,Ls,d),p(e,G,d),b(ct,G,null),t(G,bn),t(G,Jr),t(Jr,$n),t(G,yn),t(G,xe),b(dt,xe,null),t(xe,wn),t(xe,Zr),t(Zr,xn),p(e,zs,d),p(e,se,d),t(se,Ee),t(Ee,Ar),b(pt,Ar,null),t(se,En),t(se,Nr),t(Nr,Mn),p(e,Ds,d),p(e,Me,d),t(Me,ft),t(ft,Pn),t(Me,In),t(Me,mt),t(mt,Tn),p(e,Bs,d),p(e,Kt,d),t(Kt,kn),p(e,Fs,d),p(e,er,d),t(er,Un),p(e,Gs,d),p(e,P,d),t(P,Vr),t(Vr,qr),t(qr,Xn),t(P,Sn),t(P,jr),t(jr,Lr),t(Lr,Jn),t(P,Zn),t(P,zr),t(zr,Dr),t(Dr,An),t(P,Nn),t(P,Br),t(Br,Fr),t(Fr,Vn),t(P,qn),t(P,Gr),t(Gr,Cr),t(Cr,jn),t(P,Ln),t(P,Qr),t(Qr,Rr),t(Rr,zn),t(P,Dn),t(P,Wr),t(Wr,Hr),t(Hr,Bn),t(P,Fn),t(P,Yr),t(Yr,Or),t(Or,Gn),t(P,Cn),t(P,Kr),t(Kr,es),t(es,Qn),p(e,Cs,d),p(e,Pe,d),t(Pe,Rn),t(Pe,tr),t(tr,Wn),t(Pe,Hn),p(e,Qs,d),p(e,ae,d),b(ht,ae,null),t(ae,Yn),t(ae,rr),t(rr,On),t(rr,ts),t(ts,Kn),p(e,Rs,d),p(e,oe,d),t(oe,Ie),t(Ie,rs),b(ut,rs,null),t(oe,el),t(oe,ss),t(ss,tl),p(e,Ws,d),p(e,ne,d),t(ne,vt),t(vt,rl),t(ne,sl),t(ne,_t),t(_t,as),t(as,al),t(ne,ol),p(e,Hs,d),p(e,gt,d),t(gt,nl),t(gt,bt),t(bt,ll),p(e,Ys,d),p(e,sr,d),t(sr,il),p(e,Os,d),p(e,ar,d),t(ar,os),t(os,ns),t(ns,cl),p(e,Ks,d),p(e,or,d),t(or,dl),p(e,ea,d),p(e,Te,d),t(Te,pl),t(Te,$t),t($t,fl),t(Te,ml),p(e,ta,d),p(e,le,d),t(le,ke),t(ke,ls),b(yt,ls,null),t(le,hl),t(le,is),t(is,ul),p(e,ra,d),p(e,C,d),t(C,wt),t(wt,vl),t(C,_l),t(C,xt),t(xt,gl),t(C,bl),t(C,Et),t(Et,$l),t(C,yl),p(e,sa,d),p(e,nr,d),t(nr,wl),p(e,aa,d),p(e,ie,d),t(ie,Ue),t(Ue,cs),b(Mt,cs,null),t(ie,xl),t(ie,ds),t(ds,El),p(e,oa,d),p(e,lr,d),t(lr,Ml),p(e,na,d),p(e,Xe,d),t(Xe,ps),t(ps,fs),t(fs,Pl),t(Xe,Il),t(Xe,ms),t(ms,hs),t(hs,Tl),p(e,la,d),p(e,Pt,d),t(Pt,kl),t(Pt,us),t(us,Ul),p(e,ia,d),p(e,A,d),b(It,A,null),t(A,Xl),t(A,vs),t(vs,Sl),t(A,Jl),t(A,Se),b(Tt,Se,null),t(Se,Zl),t(Se,_s),t(_s,Al),t(A,Nl),t(A,O),b(kt,O,null),t(O,Vl),t(O,Ut),t(Ut,ql),t(Ut,gs),t(gs,jl),t(Ut,Ll),t(O,zl),b(Je,O,null),t(A,Dl),t(A,Ze),b(Xt,Ze,null),t(Ze,Bl),t(Ze,bs),t(bs,Fl),p(e,ca,d),p(e,Ae,d),t(Ae,Gl),t(Ae,$s),t($s,Cl),t(Ae,Ql),p(e,da,d),p(e,Q,d),b(St,Q,null),t(Q,Rl),t(Q,ys),t(ys,Wl),t(Q,Hl),b(Ne,Q,null),p(e,pa,d),p(e,Ve,d),t(Ve,Yl),t(Ve,ws),t(ws,Ol),t(Ve,Kl),p(e,fa,d),p(e,ce,d),t(ce,qe),t(qe,xs),b(Jt,xs,null),t(ce,ei),t(ce,Es),t(Es,ti),p(e,ma,d),p(e,ir,d),t(ir,ri),p(e,ha,d),b(Zt,e,d),p(e,ua,d),p(e,je,d),t(je,si),t(je,Ms),t(Ms,ai),t(je,oi),p(e,va,d),b(At,e,d),p(e,_a,d),p(e,Le,d),t(Le,ni),t(Le,Nt),t(Nt,li),t(Le,ii),ga=!0},p(e,[d]){const Vt={};d&2&&(Vt.$$scope={dirty:d,ctx:e}),pe.$set(Vt);const Ps={};d&2&&(Ps.$$scope={dirty:d,ctx:e}),fe.$set(Ps);const Is={};d&2&&(Is.$$scope={dirty:d,ctx:e}),me.$set(Is);const Ts={};d&2&&(Ts.$$scope={dirty:d,ctx:e}),he.$set(Ts);const ks={};d&2&&(ks.$$scope={dirty:d,ctx:e}),Je.$set(ks);const qt={};d&2&&(qt.$$scope={dirty:d,ctx:e}),Ne.$set(qt)},i(e){ga||($(m.$$.fragment,e),$(De.$$.fragment,e),$(Be.$$.fragment,e),$(Fe.$$.fragment,e),$(pe.$$.fragment,e),$(Ge.$$.fragment,e),$(fe.$$.fragment,e),$(Ce.$$.fragment,e),$(me.$$.fragment,e),$(Re.$$.fragment,e),$(he.$$.fragment,e),$(He.$$.fragment,e),$(Ye.$$.fragment,e),$(Oe.$$.fragment,e),$(et.$$.fragment,e),$(tt.$$.fragment,e),$(rt.$$.fragment,e),$(at.$$.fragment,e),$(nt.$$.fragment,e),$(lt.$$.fragment,e),$(it.$$.fragment,e),$(ct.$$.fragment,e),$(dt.$$.fragment,e),$(pt.$$.fragment,e),$(ht.$$.fragment,e),$(ut.$$.fragment,e),$(yt.$$.fragment,e),$(Mt.$$.fragment,e),$(It.$$.fragment,e),$(Tt.$$.fragment,e),$(kt.$$.fragment,e),$(Je.$$.fragment,e),$(Xt.$$.fragment,e),$(St.$$.fragment,e),$(Ne.$$.fragment,e),$(Jt.$$.fragment,e),$(Zt.$$.fragment,e),$(At.$$.fragment,e),ga=!0)},o(e){y(m.$$.fragment,e),y(De.$$.fragment,e),y(Be.$$.fragment,e),y(Fe.$$.fragment,e),y(pe.$$.fragment,e),y(Ge.$$.fragment,e),y(fe.$$.fragment,e),y(Ce.$$.fragment,e),y(me.$$.fragment,e),y(Re.$$.fragment,e),y(he.$$.fragment,e),y(He.$$.fragment,e),y(Ye.$$.fragment,e),y(Oe.$$.fragment,e),y(et.$$.fragment,e),y(tt.$$.fragment,e),y(rt.$$.fragment,e),y(at.$$.fragment,e),y(nt.$$.fragment,e),y(lt.$$.fragment,e),y(it.$$.fragment,e),y(ct.$$.fragment,e),y(dt.$$.fragment,e),y(pt.$$.fragment,e),y(ht.$$.fragment,e),y(ut.$$.fragment,e),y(yt.$$.fragment,e),y(Mt.$$.fragment,e),y(It.$$.fragment,e),y(Tt.$$.fragment,e),y(kt.$$.fragment,e),y(Je.$$.fragment,e),y(Xt.$$.fragment,e),y(St.$$.fragment,e),y(Ne.$$.fragment,e),y(Jt.$$.fragment,e),y(Zt.$$.fragment,e),y(At.$$.fragment,e),ga=!1},d(e){r(h),e&&r(E),e&&r(v),w(m),e&&r(U),e&&r(j),e&&r(Z),e&&r(B),e&&r(Ss),e&&r(te),w(De),e&&r(Js),e&&r(Bt),e&&r(Zs),e&&r(Ft),e&&r(As),e&&r(X),w(Be),w(Fe),w(pe),w(Ge),w(fe),w(Ce),w(me),w(Re),w(he),e&&r(Ns),e&&r(re),w(He),e&&r(Vs),e&&r(V),e&&r(qs),e&&r(T),w(Ye),w(Oe),w(et),w(tt),w(rt),w(at),w(nt),e&&r(js),e&&r(F),w(lt),w(it),e&&r(Ls),e&&r(G),w(ct),w(dt),e&&r(zs),e&&r(se),w(pt),e&&r(Ds),e&&r(Me),e&&r(Bs),e&&r(Kt),e&&r(Fs),e&&r(er),e&&r(Gs),e&&r(P),e&&r(Cs),e&&r(Pe),e&&r(Qs),e&&r(ae),w(ht),e&&r(Rs),e&&r(oe),w(ut),e&&r(Ws),e&&r(ne),e&&r(Hs),e&&r(gt),e&&r(Ys),e&&r(sr),e&&r(Os),e&&r(ar),e&&r(Ks),e&&r(or),e&&r(ea),e&&r(Te),e&&r(ta),e&&r(le),w(yt),e&&r(ra),e&&r(C),e&&r(sa),e&&r(nr),e&&r(aa),e&&r(ie),w(Mt),e&&r(oa),e&&r(lr),e&&r(na),e&&r(Xe),e&&r(la),e&&r(Pt),e&&r(ia),e&&r(A),w(It),w(Tt),w(kt),w(Je),w(Xt),e&&r(ca),e&&r(Ae),e&&r(da),e&&r(Q),w(St),w(Ne),e&&r(pa),e&&r(Ve),e&&r(fa),e&&r(ce),w(Jt),e&&r(ma),e&&r(ir),e&&r(ha),w(Zt,e),e&&r(ua),e&&r(je),e&&r(va),w(At,e),e&&r(_a),e&&r(Le)}}}const bd={local:"processors",sections:[{local:"transformers.ProcessorMixin",title:"Multi-modal processors"},{local:"transformers.DataProcessor",title:"Deprecated processors"},{local:"transformers.glue_convert_examples_to_features",title:"GLUE"},{local:"xnli",title:"XNLI"},{local:"squad",sections:[{local:"transformers.data.processors.squad.SquadProcessor",title:"Processors"},{local:"example-usage",title:"Example usage"}],title:"SQuAD"}],title:"Processors"};function $d(N){return pd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Id extends ld{constructor(h){super();id(this,h,$d,gd,cd,{})}}export{Id as default,bd as metadata};
