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