import{S as ap,i as tp,s as np,e as t,k as r,w as u,t as c,M as lp,c as n,d as e,m as p,a as l,x as d,h,b as m,G as a,g as o,y as f,L as ip,q as g,o as y,B as j,v as op}from"../chunks/vendor-hf-doc-builder.js";import{I as b}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as w}from"../chunks/CodeBlock-hf-doc-builder.js";function rp(so){let T,Ra,U,Q,qe,ws,En,Ne,$n,Aa,Os,Wn,za,se,qn,Sa,I,Y,Ge,Ms,Nn,Ce,Gn,Qa,ee,Cn,Ya,ae,_n,Xa,Z,X,_e,vs,Hn,He,Vn,La,te,Rn,Pa,M,Ve,An,zn,Re,Sn,Qn,Ae,Yn,Xn,ze,Ln,Fa,Js,Da,B,L,Se,xs,Pn,Qe,Fn,Ka,ne,Dn,Oa,le,Kn,st,ks,et,E,P,Ye,Ts,On,Xe,sl,at,F,el,ie,al,tl,tt,oe,nl,nt,D,Le,ll,il,Pe,ol,lt,$,K,Fe,Us,rl,De,pl,it,re,cl,ot,v,Ke,hl,ml,Oe,ul,dl,sa,fl,gl,ea,yl,rt,Is,pt,W,O,aa,Zs,jl,ta,bl,ct,pe,wl,ht,x,na,Ml,vl,la,Jl,xl,ia,kl,mt,Bs,ut,q,ss,oa,Es,Tl,ra,Ul,dt,ce,Il,ft,es,pa,Zl,Bl,$s,El,ca,$l,Wl,gt,he,ql,yt,Ws,jt,N,as,ha,qs,Nl,ma,Gl,bt,me,Cl,wt,ue,_l,Mt,ts,ua,Hl,Vl,da,Rl,vt,Ns,Jt,G,ns,fa,Gs,Al,ga,zl,xt,de,Sl,kt,C,ls,ya,Cs,Ql,ja,Yl,Tt,fe,Xl,Ut,is,_,Ll,ba,Pl,Fl,wa,Dl,Kl,Ol,J,si,Ma,ei,ai,va,ti,ni,Ja,li,ii,It,_s,Zt,H,os,xa,Hs,oi,ka,ri,Bt,rs,pi,ge,ci,hi,Et,ye,mi,$t,ps,Ta,ui,di,Ua,fi,Wt,Vs,qt,V,cs,Ia,Rs,gi,Za,yi,Nt,je,ji,Gt,be,bi,Ct,hs,Ba,wi,Mi,R,vi,we,Ji,xi,Me,ki,Ti,_t,As,Ht,A,ms,Ea,zs,Ui,$a,Ii,Vt,ve,Zi,Rt,Je,Bi,At,us,Wa,Ei,$i,Ss,Wi,xe,qi,Ni,zt,Qs,St,z,ds,qa,Ys,Gi,Na,Ci,Qt,ke,_i,Yt,Te,Hi,Xt,Xs,Lt,S,fs,Ga,Ls,Vi,Ca,Ri,Pt,Ue,Ai,Ft,Ie,zi,Dt,gs,Ps,_a,Si,Qi,Fs,Yi,Ds,Ha,Xi,Li,Ks,Kt,k,Pi,Ze,Fi,Di,Va,Ki,Oi,Ot;return ws=new b({}),Ms=new b({}),vs=new b({}),Js=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJhdWRpby1jbGFzc2lmaWNhdGlvbiUyMiUyQyUyMG1vZGVsJTNEJTIyc3VwZXJiJTJGaHViZXJ0LWJhc2Utc3VwZXJiLWVyJTIyKSUwQXByZWRzJTIwJTNEJTIwY2xhc3NpZmllciglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZOYXJzaWwlMkZhc3JfZHVtbXklMkZyZXNvbHZlJTJGbWFpbiUyRm1say5mbGFjJTIyKSUwQXByZWRzJTIwJTNEJTIwJTVCJTdCJTIyc2NvcmUlMjIlM0ElMjByb3VuZChwcmVkJTVCJTIyc2NvcmUlMjIlNUQlMkMlMjA0KSUyQyUyMCUyMmxhYmVsJTIyJTNBJTIwcHJlZCU1QiUyMmxhYmVsJTIyJTVEJTdEJTIwZm9yJTIwcHJlZCUyMGluJTIwcHJlZHMlNUQlMEFwcmVkcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(task=<span class="hljs-string">&quot;audio-classification&quot;</span>, model=<span class="hljs-string">&quot;superb/hubert-base-superb-er&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = classifier(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span>preds
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.4532</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;hap&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.3622</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;sad&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0943</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;neu&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0903</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;ang&#x27;</span>}]`}}),xs=new b({}),ks=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdHJhbnNjcmliZXIlMjAlM0QlMjBwaXBlbGluZSh0YXNrJTNEJTIyYXV0b21hdGljLXNwZWVjaC1yZWNvZ25pdGlvbiUyMiUyQyUyMG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1zbWFsbCUyMiklMEF0cmFuc2NyaWJlciglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZOYXJzaWwlMkZhc3JfZHVtbXklMkZyZXNvbHZlJTJGbWFpbiUyRm1say5mbGFjJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber = pipeline(task=<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, model=<span class="hljs-string">&quot;openai/whisper-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber(<span class="hljs-string">&quot;https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac&quot;</span>)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27; I have a dream that one day this nation will rise up and live out the true meaning of its creed.&#x27;</span>}`}}),Ts=new b({}),Us=new b({}),Is=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJpbWFnZS1jbGFzc2lmaWNhdGlvbiUyMiklMEFwcmVkcyUyMCUzRCUyMGNsYXNzaWZpZXIoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGcGlwZWxpbmUtY2F0LWNob25rLmpwZWclMjIlMEEpJTBBcHJlZHMlMjAlM0QlMjAlNUIlN0IlMjJzY29yZSUyMiUzQSUyMHJvdW5kKHByZWQlNUIlMjJzY29yZSUyMiU1RCUyQyUyMDQpJTJDJTIwJTIybGFiZWwlMjIlM0ElMjBwcmVkJTVCJTIybGFiZWwlMjIlNUQlN0QlMjBmb3IlMjBwcmVkJTIwaW4lMjBwcmVkcyU1RCUwQXByaW50KCpwcmVkcyUyQyUyMHNlcCUzRCUyMiU1Q24lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(task=<span class="hljs-string">&quot;image-classification&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = classifier(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(*preds, sep=<span class="hljs-string">&quot;\\n&quot;</span>)
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.4335</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;lynx, catamount&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0348</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cougar, puma, catamount, mountain lion, painter, panther, Felis concolor&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0324</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;snow leopard, ounce, Panthera uncia&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0239</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;Egyptian cat&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0229</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;tiger cat&#x27;</span>}`}}),Zs=new b({}),Bs=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBZGV0ZWN0b3IlMjAlM0QlMjBwaXBlbGluZSh0YXNrJTNEJTIyb2JqZWN0LWRldGVjdGlvbiUyMiklMEFwcmVkcyUyMCUzRCUyMGRldGVjdG9yKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTBBKSUwQXByZWRzJTIwJTNEJTIwJTVCJTdCJTIyc2NvcmUlMjIlM0ElMjByb3VuZChwcmVkJTVCJTIyc2NvcmUlMjIlNUQlMkMlMjA0KSUyQyUyMCUyMmxhYmVsJTIyJTNBJTIwcHJlZCU1QiUyMmxhYmVsJTIyJTVEJTJDJTIwJTIyYm94JTIyJTNBJTIwcHJlZCU1QiUyMmJveCUyMiU1RCU3RCUyMGZvciUyMHByZWQlMjBpbiUyMHByZWRzJTVEJTBBcHJlZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>detector = pipeline(task=<span class="hljs-string">&quot;object-detection&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = detector(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>], <span class="hljs-string">&quot;box&quot;</span>: pred[<span class="hljs-string">&quot;box&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span>preds
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9865</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cat&#x27;</span>,
  <span class="hljs-string">&#x27;box&#x27;</span>: {<span class="hljs-string">&#x27;xmin&#x27;</span>: <span class="hljs-number">178</span>, <span class="hljs-string">&#x27;ymin&#x27;</span>: <span class="hljs-number">154</span>, <span class="hljs-string">&#x27;xmax&#x27;</span>: <span class="hljs-number">882</span>, <span class="hljs-string">&#x27;ymax&#x27;</span>: <span class="hljs-number">598</span>}}]`}}),Es=new b({}),Ws=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBc2VnbWVudGVyJTIwJTNEJTIwcGlwZWxpbmUodGFzayUzRCUyMmltYWdlLXNlZ21lbnRhdGlvbiUyMiklMEFwcmVkcyUyMCUzRCUyMHNlZ21lbnRlciglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZwaXBlbGluZS1jYXQtY2hvbmsuanBlZyUyMiUwQSklMEFwcmVkcyUyMCUzRCUyMCU1QiU3QiUyMnNjb3JlJTIyJTNBJTIwcm91bmQocHJlZCU1QiUyMnNjb3JlJTIyJTVEJTJDJTIwNCklMkMlMjAlMjJsYWJlbCUyMiUzQSUyMHByZWQlNUIlMjJsYWJlbCUyMiU1RCU3RCUyMGZvciUyMHByZWQlMjBpbiUyMHByZWRzJTVEJTBBcHJpbnQoKnByZWRzJTJDJTIwc2VwJTNEJTIyJTVDbiUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>segmenter = pipeline(task=<span class="hljs-string">&quot;image-segmentation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = segmenter(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(*preds, sep=<span class="hljs-string">&quot;\\n&quot;</span>)
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9879</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;LABEL_184&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9973</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;snow&#x27;</span>}
{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9972</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cat&#x27;</span>}`}}),qs=new b({}),Ns=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBZGVwdGhfZXN0aW1hdG9yJTIwJTNEJTIwcGlwZWxpbmUodGFzayUzRCUyMmRlcHRoLWVzdGltYXRpb24lMjIpJTBBcHJlZHMlMjAlM0QlMjBkZXB0aF9lc3RpbWF0b3IoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGcGlwZWxpbmUtY2F0LWNob25rLmpwZWclMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>depth_estimator = pipeline(task=<span class="hljs-string">&quot;depth-estimation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = depth_estimator(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
<span class="hljs-meta">... </span>)`}}),Gs=new b({}),Cs=new b({}),_s=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJzZW50aW1lbnQtYW5hbHlzaXMlMjIpJTBBcHJlZHMlMjAlM0QlMjBjbGFzc2lmaWVyKCUyMkh1Z2dpbmclMjBGYWNlJTIwaXMlMjB0aGUlMjBiZXN0JTIwdGhpbmclMjBzaW5jZSUyMHNsaWNlZCUyMGJyZWFkISUyMiklMEFwcmVkcyUyMCUzRCUyMCU1QiU3QiUyMnNjb3JlJTIyJTNBJTIwcm91bmQocHJlZCU1QiUyMnNjb3JlJTIyJTVEJTJDJTIwNCklMkMlMjAlMjJsYWJlbCUyMiUzQSUyMHByZWQlNUIlMjJsYWJlbCUyMiU1RCU3RCUyMGZvciUyMHByZWQlMjBpbiUyMHByZWRzJTVEJTBBcHJlZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(task=<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = classifier(<span class="hljs-string">&quot;Hugging Face is the best thing since sliced bread!&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [{<span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>), <span class="hljs-string">&quot;label&quot;</span>: pred[<span class="hljs-string">&quot;label&quot;</span>]} <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds]
<span class="hljs-meta">&gt;&gt;&gt; </span>preds
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9991</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>}]`}}),Hs=new b({}),Vs=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJuZXIlMjIpJTBBcHJlZHMlMjAlM0QlMjBjbGFzc2lmaWVyKCUyMkh1Z2dpbmclMjBGYWNlJTIwaXMlMjBhJTIwRnJlbmNoJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBOZXclMjBZb3JrJTIwQ2l0eS4lMjIpJTBBcHJlZHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJlbnRpdHklMjIlM0ElMjBwcmVkJTVCJTIyZW50aXR5JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyc2NvcmUlMjIlM0ElMjByb3VuZChwcmVkJTVCJTIyc2NvcmUlMjIlNUQlMkMlMjA0KSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmluZGV4JTIyJTNBJTIwcHJlZCU1QiUyMmluZGV4JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyd29yZCUyMiUzQSUyMHByZWQlNUIlMjJ3b3JkJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyc3RhcnQlMjIlM0ElMjBwcmVkJTVCJTIyc3RhcnQlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJlbmQlMjIlM0ElMjBwcmVkJTVCJTIyZW5kJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwZm9yJTIwcHJlZCUyMGluJTIwcHJlZHMlMEElNUQlMEFwcmludCgqcHJlZHMlMkMlMjBzZXAlM0QlMjIlNUNuJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(task=<span class="hljs-string">&quot;ner&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = classifier(<span class="hljs-string">&quot;Hugging Face is a French company based in New York City.&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;entity&quot;</span>: pred[<span class="hljs-string">&quot;entity&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;index&quot;</span>: pred[<span class="hljs-string">&quot;index&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;word&quot;</span>: pred[<span class="hljs-string">&quot;word&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;start&quot;</span>: pred[<span class="hljs-string">&quot;start&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;end&quot;</span>: pred[<span class="hljs-string">&quot;end&quot;</span>],
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(*preds, sep=<span class="hljs-string">&quot;\\n&quot;</span>)
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9968</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Hu&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">2</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9293</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;##gging&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">7</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-ORG&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9763</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;Face&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">8</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">12</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-MISC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9983</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">6</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;French&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">18</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">24</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.999</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">10</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;New&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">42</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">45</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9987</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">11</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;York&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">46</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">50</span>}
{<span class="hljs-string">&#x27;entity&#x27;</span>: <span class="hljs-string">&#x27;I-LOC&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9992</span>, <span class="hljs-string">&#x27;index&#x27;</span>: <span class="hljs-number">12</span>, <span class="hljs-string">&#x27;word&#x27;</span>: <span class="hljs-string">&#x27;City&#x27;</span>, <span class="hljs-string">&#x27;start&#x27;</span>: <span class="hljs-number">51</span>, <span class="hljs-string">&#x27;end&#x27;</span>: <span class="hljs-number">55</span>}`}}),Rs=new b({}),As=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBcXVlc3Rpb25fYW5zd2VyZXIlMjAlM0QlMjBwaXBlbGluZSh0YXNrJTNEJTIycXVlc3Rpb24tYW5zd2VyaW5nJTIyKSUwQXByZWRzJTIwJTNEJTIwcXVlc3Rpb25fYW5zd2VyZXIoJTBBJTIwJTIwJTIwJTIwcXVlc3Rpb24lM0QlMjJXaGF0JTIwaXMlMjB0aGUlMjBuYW1lJTIwb2YlMjB0aGUlMjByZXBvc2l0b3J5JTNGJTIyJTJDJTBBJTIwJTIwJTIwJTIwY29udGV4dCUzRCUyMlRoZSUyMG5hbWUlMjBvZiUyMHRoZSUyMHJlcG9zaXRvcnklMjBpcyUyMGh1Z2dpbmdmYWNlJTJGdHJhbnNmb3JtZXJzJTIyJTJDJTBBKSUwQXByaW50KCUwQSUyMCUyMCUyMCUyMGYlMjJzY29yZSUzQSUyMCU3QnJvdW5kKHByZWRzJTVCJ3Njb3JlJyU1RCUyQyUyMDQpJTdEJTJDJTIwc3RhcnQlM0ElMjAlN0JwcmVkcyU1QidzdGFydCclNUQlN0QlMkMlMjBlbmQlM0ElMjAlN0JwcmVkcyU1QidlbmQnJTVEJTdEJTJDJTIwYW5zd2VyJTNBJTIwJTdCcHJlZHMlNUInYW5zd2VyJyU1RCU3RCUyMiUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>question_answerer = pipeline(task=<span class="hljs-string">&quot;question-answering&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = question_answerer(
<span class="hljs-meta">... </span>    question=<span class="hljs-string">&quot;What is the name of the repository?&quot;</span>,
<span class="hljs-meta">... </span>    context=<span class="hljs-string">&quot;The name of the repository is huggingface/transformers&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(
<span class="hljs-meta">... </span>    <span class="hljs-string">f&quot;score: <span class="hljs-subst">{<span class="hljs-built_in">round</span>(preds[<span class="hljs-string">&#x27;score&#x27;</span>], <span class="hljs-number">4</span>)}</span>, start: <span class="hljs-subst">{preds[<span class="hljs-string">&#x27;start&#x27;</span>]}</span>, end: <span class="hljs-subst">{preds[<span class="hljs-string">&#x27;end&#x27;</span>]}</span>, answer: <span class="hljs-subst">{preds[<span class="hljs-string">&#x27;answer&#x27;</span>]}</span>&quot;</span>
<span class="hljs-meta">... </span>)
score: <span class="hljs-number">0.9327</span>, start: <span class="hljs-number">30</span>, end: <span class="hljs-number">54</span>, answer: huggingface/transformers`}}),zs=new b({}),Qs=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBc3VtbWFyaXplciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJzdW1tYXJpemF0aW9uJTIyKSUwQXN1bW1hcml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySW4lMjB0aGlzJTIwd29yayUyQyUyMHdlJTIwcHJlc2VudGVkJTIwdGhlJTIwVHJhbnNmb3JtZXIlMkMlMjB0aGUlMjBmaXJzdCUyMHNlcXVlbmNlJTIwdHJhbnNkdWN0aW9uJTIwbW9kZWwlMjBiYXNlZCUyMGVudGlyZWx5JTIwb24lMjBhdHRlbnRpb24lMkMlMjByZXBsYWNpbmclMjB0aGUlMjByZWN1cnJlbnQlMjBsYXllcnMlMjBtb3N0JTIwY29tbW9ubHklMjB1c2VkJTIwaW4lMjBlbmNvZGVyLWRlY29kZXIlMjBhcmNoaXRlY3R1cmVzJTIwd2l0aCUyMG11bHRpLWhlYWRlZCUyMHNlbGYtYXR0ZW50aW9uLiUyMEZvciUyMHRyYW5zbGF0aW9uJTIwdGFza3MlMkMlMjB0aGUlMjBUcmFuc2Zvcm1lciUyMGNhbiUyMGJlJTIwdHJhaW5lZCUyMHNpZ25pZmljYW50bHklMjBmYXN0ZXIlMjB0aGFuJTIwYXJjaGl0ZWN0dXJlcyUyMGJhc2VkJTIwb24lMjByZWN1cnJlbnQlMjBvciUyMGNvbnZvbHV0aW9uYWwlMjBsYXllcnMuJTIwT24lMjBib3RoJTIwV01UJTIwMjAxNCUyMEVuZ2xpc2gtdG8tR2VybWFuJTIwYW5kJTIwV01UJTIwMjAxNCUyMEVuZ2xpc2gtdG8tRnJlbmNoJTIwdHJhbnNsYXRpb24lMjB0YXNrcyUyQyUyMHdlJTIwYWNoaWV2ZSUyMGElMjBuZXclMjBzdGF0ZSUyMG9mJTIwdGhlJTIwYXJ0LiUyMEluJTIwdGhlJTIwZm9ybWVyJTIwdGFzayUyMG91ciUyMGJlc3QlMjBtb2RlbCUyMG91dHBlcmZvcm1zJTIwZXZlbiUyMGFsbCUyMHByZXZpb3VzbHklMjByZXBvcnRlZCUyMGVuc2VtYmxlcy4lMjIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>summarizer = pipeline(task=<span class="hljs-string">&quot;summarization&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>summarizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;In this work, we presented the Transformer, the first sequence transduction model based entirely on attention, replacing the recurrent layers most commonly used in encoder-decoder architectures with multi-headed self-attention. For translation tasks, the Transformer can be trained significantly faster than architectures based on recurrent or convolutional layers. On both WMT 2014 English-to-German and WMT 2014 English-to-French translation tasks, we achieve a new state of the art. In the former task our best model outperforms even all previously reported ensembles.&quot;</span>
<span class="hljs-meta">... </span>)
[{<span class="hljs-string">&#x27;summary_text&#x27;</span>: <span class="hljs-string">&#x27; The Transformer is the first sequence transduction model based entirely on attention . It replaces the recurrent layers most commonly used in encoder-decoder architectures with multi-headed self-attention . For translation tasks, the Transformer can be trained significantly faster than architectures based on recurrent or convolutional layers .&#x27;</span>}]`}}),Ys=new b({}),Xs=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdGV4dCUyMCUzRCUyMCUyMnRyYW5zbGF0ZSUyMEVuZ2xpc2glMjB0byUyMEZyZW5jaCUzQSUyMEh1Z2dpbmclMjBGYWNlJTIwaXMlMjBhJTIwY29tbXVuaXR5LWJhc2VkJTIwb3Blbi1zb3VyY2UlMjBwbGF0Zm9ybSUyMGZvciUyMG1hY2hpbmUlMjBsZWFybmluZy4lMjIlMEF0cmFuc2xhdG9yJTIwJTNEJTIwcGlwZWxpbmUodGFzayUzRCUyMnRyYW5zbGF0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJ0NS1zbWFsbCUyMiklMEF0cmFuc2xhdG9yKHRleHQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;translate English to French: Hugging Face is a community-based open-source platform for machine learning.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>translator = pipeline(task=<span class="hljs-string">&quot;translation&quot;</span>, model=<span class="hljs-string">&quot;t5-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>translator(text)
[{<span class="hljs-string">&#x27;translation_text&#x27;</span>: <span class="hljs-string">&quot;Hugging Face est une tribune communautaire de l&#x27;apprentissage des machines.&quot;</span>}]`}}),Ls=new b({}),Fs=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySHVnZ2luZyUyMEZhY2UlMjBpcyUyMGElMjBjb21tdW5pdHktYmFzZWQlMjBvcGVuLXNvdXJjZSUyMHBsYXRmb3JtJTIwZm9yJTIwbWFjaGluZSUyMGxlYXJuaW5nLiUyMiUwQWdlbmVyYXRvciUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJ0ZXh0LWdlbmVyYXRpb24lMjIpJTBBZ2VuZXJhdG9yKHByb21wdCklMjAlMjAlMjMlMjBkb2N0ZXN0JTNBJTIwJTJCU0tJUA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hugging Face is a community-based open-source platform for machine learning.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = pipeline(task=<span class="hljs-string">&quot;text-generation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generator(prompt)  <span class="hljs-comment"># doctest: +SKIP</span>`}}),Ks=new w({props:{code:"dGV4dCUyMCUzRCUyMCUyMkh1Z2dpbmclMjBGYWNlJTIwaXMlMjBhJTIwY29tbXVuaXR5LWJhc2VkJTIwb3Blbi1zb3VyY2UlMjAlM0NtYXNrJTNFJTIwZm9yJTIwbWFjaGluZSUyMGxlYXJuaW5nLiUyMiUwQWZpbGxfbWFzayUyMCUzRCUyMHBpcGVsaW5lKHRhc2slM0QlMjJmaWxsLW1hc2slMjIpJTBBcHJlZHMlMjAlM0QlMjBmaWxsX21hc2sodGV4dCUyQyUyMHRvcF9rJTNEMSklMEFwcmVkcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnNjb3JlJTIyJTNBJTIwcm91bmQocHJlZCU1QiUyMnNjb3JlJTIyJTVEJTJDJTIwNCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0b2tlbiUyMiUzQSUyMHByZWQlNUIlMjJ0b2tlbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnRva2VuX3N0ciUyMiUzQSUyMHByZWQlNUIlMjJ0b2tlbl9zdHIlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJzZXF1ZW5jZSUyMiUzQSUyMHByZWQlNUIlMjJzZXF1ZW5jZSUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMGZvciUyMHByZWQlMjBpbiUyMHByZWRzJTBBJTVEJTBBcHJlZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Hugging Face is a community-based open-source &lt;mask&gt; for machine learning.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>fill_mask = pipeline(task=<span class="hljs-string">&quot;fill-mask&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = fill_mask(text, top_k=<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>preds = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;score&quot;</span>: <span class="hljs-built_in">round</span>(pred[<span class="hljs-string">&quot;score&quot;</span>], <span class="hljs-number">4</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;token&quot;</span>: pred[<span class="hljs-string">&quot;token&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;token_str&quot;</span>: pred[<span class="hljs-string">&quot;token_str&quot;</span>],
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;sequence&quot;</span>: pred[<span class="hljs-string">&quot;sequence&quot;</span>],
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> preds
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>preds
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.2236</span>,
  <span class="hljs-string">&#x27;token&#x27;</span>: <span class="hljs-number">1761</span>,
  <span class="hljs-string">&#x27;token_str&#x27;</span>: <span class="hljs-string">&#x27; platform&#x27;</span>,
  <span class="hljs-string">&#x27;sequence&#x27;</span>: <span class="hljs-string">&#x27;Hugging Face is a community-based open-source platform for machine learning.&#x27;</span>}]`}}),{c(){T=t("meta"),Ra=r(),U=t("h1"),Q=t("a"),qe=t("span"),u(ws.$$.fragment),En=r(),Ne=t("span"),$n=c("What \u{1F917} Transformers can do"),Aa=r(),Os=t("p"),Wn=c("\u{1F917} Transformers is a library of pretrained state-of-the-art models for natural language processing (NLP), computer vision, and audio and speech processing tasks. Not only does the library contain Transformer models, but it also has non-Transformer models like modern convolutional networks for computer vision tasks. If you look at some of the most popular consumer products today, like smartphones, apps, and televisions, odds are that some kind of deep learning technology is behind it. Want to remove a background object from a picture taken by your smartphone? This is an example of a panoptic segmentation task (don\u2019t worry if you don\u2019t know what this means yet, we\u2019ll describe it in the following sections!)."),za=r(),se=t("p"),qn=c("This page provides an overview of the different speech and audio, computer vision, and NLP tasks that can be solved with the \u{1F917} Transformers library in just three lines of code!"),Sa=r(),I=t("h2"),Y=t("a"),Ge=t("span"),u(Ms.$$.fragment),Nn=r(),Ce=t("span"),Gn=c("Audio"),Qa=r(),ee=t("p"),Cn=c("Audio and speech processing tasks are a little different from the other modalities mainly because audio as an input is a continuous signal. Unlike text, a raw audio waveform can\u2019t be neatly split into discrete chunks the way a sentence can be divided into words. To get around this, the raw audio signal is typically sampled at regular intervals. If you take more samples within an interval, the sampling rate is higher, and the audio more closely resembles the original audio source."),Ya=r(),ae=t("p"),_n=c("Previous approaches preprocessed the audio to extract useful features from it. It is now more common to start audio and speech processing tasks by directly feeding the raw audio waveform to a feature encoder to extract an audio representation. This simplifies the preprocessing step and allows the model to learn the most essential features."),Xa=r(),Z=t("h3"),X=t("a"),_e=t("span"),u(vs.$$.fragment),Hn=r(),He=t("span"),Vn=c("Audio classification"),La=r(),te=t("p"),Rn=c("Audio classification is a task that labels audio data from a predefined set of classes. It is a broad category with many specific applications, some of which include:"),Pa=r(),M=t("ul"),Ve=t("li"),An=c("acoustic scene classification: label audio with a scene label (\u201Coffice\u201D, \u201Cbeach\u201D, \u201Cstadium\u201D)"),zn=r(),Re=t("li"),Sn=c("acoustic event detection: label audio with a sound event label (\u201Ccar horn\u201D, \u201Cwhale calling\u201D, \u201Cglass breaking\u201D)"),Qn=r(),Ae=t("li"),Yn=c("tagging: label audio containing multiple sounds (birdsongs, speaker identification in a meeting)"),Xn=r(),ze=t("li"),Ln=c("music classification: label music with a genre label (\u201Cmetal\u201D, \u201Chip-hop\u201D, \u201Ccountry\u201D)"),Fa=r(),u(Js.$$.fragment),Da=r(),B=t("h3"),L=t("a"),Se=t("span"),u(xs.$$.fragment),Pn=r(),Qe=t("span"),Fn=c("Automatic speech recognition"),Ka=r(),ne=t("p"),Dn=c("Automatic speech recognition (ASR) transcribes speech into text. It is one of the most common audio tasks due partly to speech being such a natural form of human communication. Today, ASR systems are embedded in \u201Csmart\u201D technology products like speakers, phones, and cars. We can ask our virtual assistants to play music, set reminders, and tell us the weather."),Oa=r(),le=t("p"),Kn=c("But one of the key challenges Transformer architectures have helped with is in low-resource languages. By pretraining on large amounts of speech data, finetuning the model on only one hour of labeled speech data in a low-resource language can still produce high-quality results compared to previous ASR systems trained on 100x more labeled data."),st=r(),u(ks.$$.fragment),et=r(),E=t("h2"),P=t("a"),Ye=t("span"),u(Ts.$$.fragment),On=r(),Xe=t("span"),sl=c("Computer vision"),at=r(),F=t("p"),el=c("One of the first and earliest successful computer vision tasks was recognizing images of zip code numbers using a "),ie=t("a"),al=c("convolutional neural network (CNN)"),tl=c(". An image is composed of pixels, and each pixel has a numerical value. This makes it easy to represent an image as a matrix of pixel values. Each particular combination of pixel values describes the colors of an image."),tt=r(),oe=t("p"),nl=c("Two general ways computer vision tasks can be solved are:"),nt=r(),D=t("ol"),Le=t("li"),ll=c("Use convolutions to learn the hierarchical features of an image from low-level features to high-level abstract things."),il=r(),Pe=t("li"),ol=c("Split an image into patches and use a Transformer to gradually learn how each image patch is related to each other to form an image. Unlike the bottom-up approach favored by a CNN, this is kind of like starting out with a blurry image and then gradually bringing it into focus."),lt=r(),$=t("h3"),K=t("a"),Fe=t("span"),u(Us.$$.fragment),rl=r(),De=t("span"),pl=c("Image classification"),it=r(),re=t("p"),cl=c("Image classification labels an entire image from a predefined set of classes. Like most classification tasks, there are many practical use cases for image classification, some of which include:"),ot=r(),v=t("ul"),Ke=t("li"),hl=c("healthcare: label medical images to detect disease or monitor patient health"),ml=r(),Oe=t("li"),ul=c("environment: label satellite images to monitor deforestation, inform wildland management or detect wildfires"),dl=r(),sa=t("li"),fl=c("agriculture: label images of crops to monitor plant health or satellite images for land use monitoring"),gl=r(),ea=t("li"),yl=c("ecology: label images of animal or plant species to monitor wildlife populations or track endangered species"),rt=r(),u(Is.$$.fragment),pt=r(),W=t("h3"),O=t("a"),aa=t("span"),u(Zs.$$.fragment),jl=r(),ta=t("span"),bl=c("Object detection"),ct=r(),pe=t("p"),wl=c("Unlike image classification, object detection identifies multiple objects within an image and the objects\u2019 positions in an image (defined by the bounding box). Some example applications of object detection include:"),ht=r(),x=t("ul"),na=t("li"),Ml=c("self-driving vehicles: detect everyday traffic objects such as other vehicles, pedestrians, and traffic lights"),vl=r(),la=t("li"),Jl=c("remote sensing: disaster monitoring, urban planning, and weather forecasting"),xl=r(),ia=t("li"),kl=c("defect detection: detect cracks or structural damage in buildings, and manufacturing defects"),mt=r(),u(Bs.$$.fragment),ut=r(),q=t("h3"),ss=t("a"),oa=t("span"),u(Es.$$.fragment),Tl=r(),ra=t("span"),Ul=c("Image segmentation"),dt=r(),ce=t("p"),Il=c("Image segmentation is a pixel-level task that assigns every pixel in an image to a class. It differs from object detection, which uses bounding boxes to label and predict objects in an image because segmentation is more granular. Segmentation can detect objects at a pixel-level. There are several types of image segmentation:"),ft=r(),es=t("ul"),pa=t("li"),Zl=c("instance segmentation: in addition to labeling the class of an object, it also labels each distinct instance of an object (\u201Cdog-1\u201D, \u201Cdog-2\u201D)"),Bl=r(),$s=t("li"),El=c("panoptic segmentation: a combination of semantic and instance segmentation; it labels each pixel with a semantic class "),ca=t("strong"),$l=c("and"),Wl=c(" each distinct instance of an object"),gt=r(),he=t("p"),ql=c("Segmentation tasks are helpful in self-driving vehicles to create a pixel-level map of the world around them so they can navigate safely around pedestrians and other vehicles. It is also useful for medical imaging, where the task\u2019s finer granularity can help identify abnormal cells or organ features. Image segmentation can also be used in ecommerce to virtually try on clothes or create augmented reality experiences by overlaying objects in the real world through your camera."),yt=r(),u(Ws.$$.fragment),jt=r(),N=t("h3"),as=t("a"),ha=t("span"),u(qs.$$.fragment),Nl=r(),ma=t("span"),Gl=c("Depth estimation"),bt=r(),me=t("p"),Cl=c("Depth estimation predicts the distance of each pixel in an image from the camera. This computer vision task is especially important for scene understanding and reconstruction. For example, in self-driving cars, vehicles need to understand how far objects like pedestrians, traffic signs, and other vehicles are to avoid obstacles and collisions. Depth information is also helpful for constructing 3D representations from 2D images and can be used to create high-quality 3D representations of biological structures or buildings."),wt=r(),ue=t("p"),_l=c("There are two approaches to depth estimation:"),Mt=r(),ts=t("ul"),ua=t("li"),Hl=c("stereo: depths are estimated by comparing two images of the same image from slightly different angles"),Vl=r(),da=t("li"),Rl=c("monocular: depths are estimated from a single image"),vt=r(),u(Ns.$$.fragment),Jt=r(),G=t("h2"),ns=t("a"),fa=t("span"),u(Gs.$$.fragment),Al=r(),ga=t("span"),zl=c("Natural language processing"),xt=r(),de=t("p"),Sl=c("NLP tasks are among the most common types of tasks because text is such a natural way for us to communicate. To get text into a format recognized by a model, it needs to be tokenized. This means dividing a sequence of text into separate words or subwords (tokens) and then converting these tokens into numbers. As a result, you can represent a sequence of text as a sequence of numbers, and once you have a sequence of numbers, it can be input into a model to solve all sorts of NLP tasks!"),kt=r(),C=t("h3"),ls=t("a"),ya=t("span"),u(Cs.$$.fragment),Ql=r(),ja=t("span"),Yl=c("Text classification"),Tt=r(),fe=t("p"),Xl=c("Like classification tasks in any modality, text classification labels a sequence of text (it can be sentence-level, a paragraph, or a document) from a predefined set of classes. There are many practical applications for text classification, some of which include:"),Ut=r(),is=t("ul"),_=t("li"),Ll=c("sentiment analysis: label text according to some polarity like "),ba=t("code"),Pl=c("positive"),Fl=c(" or "),wa=t("code"),Dl=c("negative"),Kl=c(" which can inform and support decision-making in fields like politics, finance, and marketing"),Ol=r(),J=t("li"),si=c("content classification: label text according to some topic to help organize and filter information in news and social media feeds ("),Ma=t("code"),ei=c("weather"),ai=c(", "),va=t("code"),ti=c("sports"),ni=c(", "),Ja=t("code"),li=c("finance"),ii=c(", etc.)"),It=r(),u(_s.$$.fragment),Zt=r(),H=t("h3"),os=t("a"),xa=t("span"),u(Hs.$$.fragment),oi=r(),ka=t("span"),ri=c("Token classification"),Bt=r(),rs=t("p"),pi=c("In any NLP task, text is preprocessed by separating the sequence of text into individual words or subwords. These are known as "),ge=t("a"),ci=c("tokens"),hi=c(". Token classification assigns each token a label from a predefined set of classes."),Et=r(),ye=t("p"),mi=c("Two common types of token classification are:"),$t=r(),ps=t("ul"),Ta=t("li"),ui=c("named entity recognition (NER): label a token according to an entity category like organization, person, location or date. NER is especially popular in biomedical settings, where it can label genes, proteins, and drug names."),di=r(),Ua=t("li"),fi=c("part-of-speech tagging (POS): label a token according to its part-of-speech like noun, verb, or adjective. POS is useful for helping translation systems understand how two identical words are grammatically different (bank as a noun versus bank as a verb)."),Wt=r(),u(Vs.$$.fragment),qt=r(),V=t("h3"),cs=t("a"),Ia=t("span"),u(Rs.$$.fragment),gi=r(),Za=t("span"),yi=c("Question answering"),Nt=r(),je=t("p"),ji=c("Question answering is another token-level task that returns an answer to a question, sometimes with context (open-domain) and other times without context (closed-domain). This task happens whenever we ask a virtual assistant something like whether a restaurant is open. It can also provide customer or technical support and help search engines retrieve the relevant information you\u2019re asking for."),Gt=r(),be=t("p"),bi=c("There are two common types of question answering:"),Ct=r(),hs=t("ul"),Ba=t("li"),wi=c("extractive: given a question and some context, the answer is a span of text from the context the model must extract"),Mi=r(),R=t("li"),vi=c("abstractive: given a question and some context, the answer is generated from the context; this approach is handled by the "),we=t("a"),Ji=c("Text2TextGenerationPipeline"),xi=c(" instead of the "),Me=t("a"),ki=c("QuestionAnsweringPipeline"),Ti=c(" shown below"),_t=r(),u(As.$$.fragment),Ht=r(),A=t("h3"),ms=t("a"),Ea=t("span"),u(zs.$$.fragment),Ui=r(),$a=t("span"),Ii=c("Summarization"),Vt=r(),ve=t("p"),Zi=c("Summarization creates a shorter version of a text from a longer one while trying to preserve most of the meaning of the original document. Summarization is a sequence-to-sequence task; it outputs a shorter text sequence than the input. There are a lot of long-form documents that can be summarized to help readers quickly understand the main points. Legislative bills, legal and financial documents, patents, and scientific papers are a few examples of documents that could be summarized to save readers time and serve as a reading aid."),Rt=r(),Je=t("p"),Bi=c("Like question answering, there are two types of summarization:"),At=r(),us=t("ul"),Wa=t("li"),Ei=c("extractive: identify and extract the most important sentences from the original text"),$i=r(),Ss=t("li"),Wi=c("abstractive: generate the target summary (which may include new words not in the input document) from the original text; the "),xe=t("a"),qi=c("SummarizationPipeline"),Ni=c(" uses the abstractive approach"),zt=r(),u(Qs.$$.fragment),St=r(),z=t("h3"),ds=t("a"),qa=t("span"),u(Ys.$$.fragment),Gi=r(),Na=t("span"),Ci=c("Translation"),Qt=r(),ke=t("p"),_i=c("Translation converts a sequence of text in one language to another. It is important in helping people from different backgrounds communicate with each other, help translate content to reach wider audiences, and even be a learning tool to help people learn a new language. Along with summarization, translation is a sequence-to-sequence task, meaning the model receives an input sequence and returns a target output sequence."),Yt=r(),Te=t("p"),Hi=c("In the early days, translation models were mostly monolingual, but recently, there has been increasing interest in multilingual models that can translate between many pairs of languages."),Xt=r(),u(Xs.$$.fragment),Lt=r(),S=t("h3"),fs=t("a"),Ga=t("span"),u(Ls.$$.fragment),Vi=r(),Ca=t("span"),Ri=c("Language modeling"),Pt=r(),Ue=t("p"),Ai=c("Language modeling is a task that predicts a word in a sequence of text. It has become a very popular NLP task because a pretrained language model can be finetuned for many other downstream tasks. Lately, there has been a lot of interest in large language models (LLMs) which demonstrate zero- or few-shot learning. This means the model can solve tasks it wasn\u2019t explicitly trained to do! Language models can be used to generate fluent and convincing text, though you need to be careful since the text may not always be accurate."),Ft=r(),Ie=t("p"),zi=c("There are two types of language modeling:"),Dt=r(),gs=t("ul"),Ps=t("li"),_a=t("p"),Si=c("causal: the model\u2019s objective is to predict the next token in a sequence, and future tokens are masked"),Qi=r(),u(Fs.$$.fragment),Yi=r(),Ds=t("li"),Ha=t("p"),Xi=c("masked: the model\u2019s objective is to predict a masked token in a sequence with full access to the tokens in the sequence"),Li=r(),u(Ks.$$.fragment),Kt=r(),k=t("p"),Pi=c("Hopefully, this page has given you some more background information about all the types of tasks in each modality and the practical importance of each one. In the next "),Ze=t("a"),Fi=c("section"),Di=c(", you\u2019ll learn "),Va=t("strong"),Ki=c("how"),Oi=c(" \u{1F917} Transformers work to solve these tasks."),this.h()},l(s){const i=lp('[data-svelte="svelte-1phssyn"]',document.head);T=n(i,"META",{name:!0,content:!0}),i.forEach(e),Ra=p(s),U=n(s,"H1",{class:!0});var sn=l(U);Q=n(sn,"A",{id:!0,class:!0,href:!0});var eo=l(Q);qe=n(eo,"SPAN",{});var ao=l(qe);d(ws.$$.fragment,ao),ao.forEach(e),eo.forEach(e),En=p(sn),Ne=n(sn,"SPAN",{});var to=l(Ne);$n=h(to,"What \u{1F917} Transformers can do"),to.forEach(e),sn.forEach(e),Aa=p(s),Os=n(s,"P",{});var no=l(Os);Wn=h(no,"\u{1F917} Transformers is a library of pretrained state-of-the-art models for natural language processing (NLP), computer vision, and audio and speech processing tasks. Not only does the library contain Transformer models, but it also has non-Transformer models like modern convolutional networks for computer vision tasks. If you look at some of the most popular consumer products today, like smartphones, apps, and televisions, odds are that some kind of deep learning technology is behind it. Want to remove a background object from a picture taken by your smartphone? This is an example of a panoptic segmentation task (don\u2019t worry if you don\u2019t know what this means yet, we\u2019ll describe it in the following sections!)."),no.forEach(e),za=p(s),se=n(s,"P",{});var lo=l(se);qn=h(lo,"This page provides an overview of the different speech and audio, computer vision, and NLP tasks that can be solved with the \u{1F917} Transformers library in just three lines of code!"),lo.forEach(e),Sa=p(s),I=n(s,"H2",{class:!0});var en=l(I);Y=n(en,"A",{id:!0,class:!0,href:!0});var io=l(Y);Ge=n(io,"SPAN",{});var oo=l(Ge);d(Ms.$$.fragment,oo),oo.forEach(e),io.forEach(e),Nn=p(en),Ce=n(en,"SPAN",{});var ro=l(Ce);Gn=h(ro,"Audio"),ro.forEach(e),en.forEach(e),Qa=p(s),ee=n(s,"P",{});var po=l(ee);Cn=h(po,"Audio and speech processing tasks are a little different from the other modalities mainly because audio as an input is a continuous signal. Unlike text, a raw audio waveform can\u2019t be neatly split into discrete chunks the way a sentence can be divided into words. To get around this, the raw audio signal is typically sampled at regular intervals. If you take more samples within an interval, the sampling rate is higher, and the audio more closely resembles the original audio source."),po.forEach(e),Ya=p(s),ae=n(s,"P",{});var co=l(ae);_n=h(co,"Previous approaches preprocessed the audio to extract useful features from it. It is now more common to start audio and speech processing tasks by directly feeding the raw audio waveform to a feature encoder to extract an audio representation. This simplifies the preprocessing step and allows the model to learn the most essential features."),co.forEach(e),Xa=p(s),Z=n(s,"H3",{class:!0});var an=l(Z);X=n(an,"A",{id:!0,class:!0,href:!0});var ho=l(X);_e=n(ho,"SPAN",{});var mo=l(_e);d(vs.$$.fragment,mo),mo.forEach(e),ho.forEach(e),Hn=p(an),He=n(an,"SPAN",{});var uo=l(He);Vn=h(uo,"Audio classification"),uo.forEach(e),an.forEach(e),La=p(s),te=n(s,"P",{});var fo=l(te);Rn=h(fo,"Audio classification is a task that labels audio data from a predefined set of classes. It is a broad category with many specific applications, some of which include:"),fo.forEach(e),Pa=p(s),M=n(s,"UL",{});var ys=l(M);Ve=n(ys,"LI",{});var go=l(Ve);An=h(go,"acoustic scene classification: label audio with a scene label (\u201Coffice\u201D, \u201Cbeach\u201D, \u201Cstadium\u201D)"),go.forEach(e),zn=p(ys),Re=n(ys,"LI",{});var yo=l(Re);Sn=h(yo,"acoustic event detection: label audio with a sound event label (\u201Ccar horn\u201D, \u201Cwhale calling\u201D, \u201Cglass breaking\u201D)"),yo.forEach(e),Qn=p(ys),Ae=n(ys,"LI",{});var jo=l(Ae);Yn=h(jo,"tagging: label audio containing multiple sounds (birdsongs, speaker identification in a meeting)"),jo.forEach(e),Xn=p(ys),ze=n(ys,"LI",{});var bo=l(ze);Ln=h(bo,"music classification: label music with a genre label (\u201Cmetal\u201D, \u201Chip-hop\u201D, \u201Ccountry\u201D)"),bo.forEach(e),ys.forEach(e),Fa=p(s),d(Js.$$.fragment,s),Da=p(s),B=n(s,"H3",{class:!0});var tn=l(B);L=n(tn,"A",{id:!0,class:!0,href:!0});var wo=l(L);Se=n(wo,"SPAN",{});var Mo=l(Se);d(xs.$$.fragment,Mo),Mo.forEach(e),wo.forEach(e),Pn=p(tn),Qe=n(tn,"SPAN",{});var vo=l(Qe);Fn=h(vo,"Automatic speech recognition"),vo.forEach(e),tn.forEach(e),Ka=p(s),ne=n(s,"P",{});var Jo=l(ne);Dn=h(Jo,"Automatic speech recognition (ASR) transcribes speech into text. It is one of the most common audio tasks due partly to speech being such a natural form of human communication. Today, ASR systems are embedded in \u201Csmart\u201D technology products like speakers, phones, and cars. We can ask our virtual assistants to play music, set reminders, and tell us the weather."),Jo.forEach(e),Oa=p(s),le=n(s,"P",{});var xo=l(le);Kn=h(xo,"But one of the key challenges Transformer architectures have helped with is in low-resource languages. By pretraining on large amounts of speech data, finetuning the model on only one hour of labeled speech data in a low-resource language can still produce high-quality results compared to previous ASR systems trained on 100x more labeled data."),xo.forEach(e),st=p(s),d(ks.$$.fragment,s),et=p(s),E=n(s,"H2",{class:!0});var nn=l(E);P=n(nn,"A",{id:!0,class:!0,href:!0});var ko=l(P);Ye=n(ko,"SPAN",{});var To=l(Ye);d(Ts.$$.fragment,To),To.forEach(e),ko.forEach(e),On=p(nn),Xe=n(nn,"SPAN",{});var Uo=l(Xe);sl=h(Uo,"Computer vision"),Uo.forEach(e),nn.forEach(e),at=p(s),F=n(s,"P",{});var ln=l(F);el=h(ln,"One of the first and earliest successful computer vision tasks was recognizing images of zip code numbers using a "),ie=n(ln,"A",{href:!0});var Io=l(ie);al=h(Io,"convolutional neural network (CNN)"),Io.forEach(e),tl=h(ln,". An image is composed of pixels, and each pixel has a numerical value. This makes it easy to represent an image as a matrix of pixel values. Each particular combination of pixel values describes the colors of an image."),ln.forEach(e),tt=p(s),oe=n(s,"P",{});var Zo=l(oe);nl=h(Zo,"Two general ways computer vision tasks can be solved are:"),Zo.forEach(e),nt=p(s),D=n(s,"OL",{});var on=l(D);Le=n(on,"LI",{});var Bo=l(Le);ll=h(Bo,"Use convolutions to learn the hierarchical features of an image from low-level features to high-level abstract things."),Bo.forEach(e),il=p(on),Pe=n(on,"LI",{});var Eo=l(Pe);ol=h(Eo,"Split an image into patches and use a Transformer to gradually learn how each image patch is related to each other to form an image. Unlike the bottom-up approach favored by a CNN, this is kind of like starting out with a blurry image and then gradually bringing it into focus."),Eo.forEach(e),on.forEach(e),lt=p(s),$=n(s,"H3",{class:!0});var rn=l($);K=n(rn,"A",{id:!0,class:!0,href:!0});var $o=l(K);Fe=n($o,"SPAN",{});var Wo=l(Fe);d(Us.$$.fragment,Wo),Wo.forEach(e),$o.forEach(e),rl=p(rn),De=n(rn,"SPAN",{});var qo=l(De);pl=h(qo,"Image classification"),qo.forEach(e),rn.forEach(e),it=p(s),re=n(s,"P",{});var No=l(re);cl=h(No,"Image classification labels an entire image from a predefined set of classes. Like most classification tasks, there are many practical use cases for image classification, some of which include:"),No.forEach(e),ot=p(s),v=n(s,"UL",{});var js=l(v);Ke=n(js,"LI",{});var Go=l(Ke);hl=h(Go,"healthcare: label medical images to detect disease or monitor patient health"),Go.forEach(e),ml=p(js),Oe=n(js,"LI",{});var Co=l(Oe);ul=h(Co,"environment: label satellite images to monitor deforestation, inform wildland management or detect wildfires"),Co.forEach(e),dl=p(js),sa=n(js,"LI",{});var _o=l(sa);fl=h(_o,"agriculture: label images of crops to monitor plant health or satellite images for land use monitoring"),_o.forEach(e),gl=p(js),ea=n(js,"LI",{});var Ho=l(ea);yl=h(Ho,"ecology: label images of animal or plant species to monitor wildlife populations or track endangered species"),Ho.forEach(e),js.forEach(e),rt=p(s),d(Is.$$.fragment,s),pt=p(s),W=n(s,"H3",{class:!0});var pn=l(W);O=n(pn,"A",{id:!0,class:!0,href:!0});var Vo=l(O);aa=n(Vo,"SPAN",{});var Ro=l(aa);d(Zs.$$.fragment,Ro),Ro.forEach(e),Vo.forEach(e),jl=p(pn),ta=n(pn,"SPAN",{});var Ao=l(ta);bl=h(Ao,"Object detection"),Ao.forEach(e),pn.forEach(e),ct=p(s),pe=n(s,"P",{});var zo=l(pe);wl=h(zo,"Unlike image classification, object detection identifies multiple objects within an image and the objects\u2019 positions in an image (defined by the bounding box). Some example applications of object detection include:"),zo.forEach(e),ht=p(s),x=n(s,"UL",{});var Be=l(x);na=n(Be,"LI",{});var So=l(na);Ml=h(So,"self-driving vehicles: detect everyday traffic objects such as other vehicles, pedestrians, and traffic lights"),So.forEach(e),vl=p(Be),la=n(Be,"LI",{});var Qo=l(la);Jl=h(Qo,"remote sensing: disaster monitoring, urban planning, and weather forecasting"),Qo.forEach(e),xl=p(Be),ia=n(Be,"LI",{});var Yo=l(ia);kl=h(Yo,"defect detection: detect cracks or structural damage in buildings, and manufacturing defects"),Yo.forEach(e),Be.forEach(e),mt=p(s),d(Bs.$$.fragment,s),ut=p(s),q=n(s,"H3",{class:!0});var cn=l(q);ss=n(cn,"A",{id:!0,class:!0,href:!0});var Xo=l(ss);oa=n(Xo,"SPAN",{});var Lo=l(oa);d(Es.$$.fragment,Lo),Lo.forEach(e),Xo.forEach(e),Tl=p(cn),ra=n(cn,"SPAN",{});var Po=l(ra);Ul=h(Po,"Image segmentation"),Po.forEach(e),cn.forEach(e),dt=p(s),ce=n(s,"P",{});var Fo=l(ce);Il=h(Fo,"Image segmentation is a pixel-level task that assigns every pixel in an image to a class. It differs from object detection, which uses bounding boxes to label and predict objects in an image because segmentation is more granular. Segmentation can detect objects at a pixel-level. There are several types of image segmentation:"),Fo.forEach(e),ft=p(s),es=n(s,"UL",{});var hn=l(es);pa=n(hn,"LI",{});var Do=l(pa);Zl=h(Do,"instance segmentation: in addition to labeling the class of an object, it also labels each distinct instance of an object (\u201Cdog-1\u201D, \u201Cdog-2\u201D)"),Do.forEach(e),Bl=p(hn),$s=n(hn,"LI",{});var mn=l($s);El=h(mn,"panoptic segmentation: a combination of semantic and instance segmentation; it labels each pixel with a semantic class "),ca=n(mn,"STRONG",{});var Ko=l(ca);$l=h(Ko,"and"),Ko.forEach(e),Wl=h(mn," each distinct instance of an object"),mn.forEach(e),hn.forEach(e),gt=p(s),he=n(s,"P",{});var Oo=l(he);ql=h(Oo,"Segmentation tasks are helpful in self-driving vehicles to create a pixel-level map of the world around them so they can navigate safely around pedestrians and other vehicles. It is also useful for medical imaging, where the task\u2019s finer granularity can help identify abnormal cells or organ features. Image segmentation can also be used in ecommerce to virtually try on clothes or create augmented reality experiences by overlaying objects in the real world through your camera."),Oo.forEach(e),yt=p(s),d(Ws.$$.fragment,s),jt=p(s),N=n(s,"H3",{class:!0});var un=l(N);as=n(un,"A",{id:!0,class:!0,href:!0});var sr=l(as);ha=n(sr,"SPAN",{});var er=l(ha);d(qs.$$.fragment,er),er.forEach(e),sr.forEach(e),Nl=p(un),ma=n(un,"SPAN",{});var ar=l(ma);Gl=h(ar,"Depth estimation"),ar.forEach(e),un.forEach(e),bt=p(s),me=n(s,"P",{});var tr=l(me);Cl=h(tr,"Depth estimation predicts the distance of each pixel in an image from the camera. This computer vision task is especially important for scene understanding and reconstruction. For example, in self-driving cars, vehicles need to understand how far objects like pedestrians, traffic signs, and other vehicles are to avoid obstacles and collisions. Depth information is also helpful for constructing 3D representations from 2D images and can be used to create high-quality 3D representations of biological structures or buildings."),tr.forEach(e),wt=p(s),ue=n(s,"P",{});var nr=l(ue);_l=h(nr,"There are two approaches to depth estimation:"),nr.forEach(e),Mt=p(s),ts=n(s,"UL",{});var dn=l(ts);ua=n(dn,"LI",{});var lr=l(ua);Hl=h(lr,"stereo: depths are estimated by comparing two images of the same image from slightly different angles"),lr.forEach(e),Vl=p(dn),da=n(dn,"LI",{});var ir=l(da);Rl=h(ir,"monocular: depths are estimated from a single image"),ir.forEach(e),dn.forEach(e),vt=p(s),d(Ns.$$.fragment,s),Jt=p(s),G=n(s,"H2",{class:!0});var fn=l(G);ns=n(fn,"A",{id:!0,class:!0,href:!0});var or=l(ns);fa=n(or,"SPAN",{});var rr=l(fa);d(Gs.$$.fragment,rr),rr.forEach(e),or.forEach(e),Al=p(fn),ga=n(fn,"SPAN",{});var pr=l(ga);zl=h(pr,"Natural language processing"),pr.forEach(e),fn.forEach(e),xt=p(s),de=n(s,"P",{});var cr=l(de);Sl=h(cr,"NLP tasks are among the most common types of tasks because text is such a natural way for us to communicate. To get text into a format recognized by a model, it needs to be tokenized. This means dividing a sequence of text into separate words or subwords (tokens) and then converting these tokens into numbers. As a result, you can represent a sequence of text as a sequence of numbers, and once you have a sequence of numbers, it can be input into a model to solve all sorts of NLP tasks!"),cr.forEach(e),kt=p(s),C=n(s,"H3",{class:!0});var gn=l(C);ls=n(gn,"A",{id:!0,class:!0,href:!0});var hr=l(ls);ya=n(hr,"SPAN",{});var mr=l(ya);d(Cs.$$.fragment,mr),mr.forEach(e),hr.forEach(e),Ql=p(gn),ja=n(gn,"SPAN",{});var ur=l(ja);Yl=h(ur,"Text classification"),ur.forEach(e),gn.forEach(e),Tt=p(s),fe=n(s,"P",{});var dr=l(fe);Xl=h(dr,"Like classification tasks in any modality, text classification labels a sequence of text (it can be sentence-level, a paragraph, or a document) from a predefined set of classes. There are many practical applications for text classification, some of which include:"),dr.forEach(e),Ut=p(s),is=n(s,"UL",{});var yn=l(is);_=n(yn,"LI",{});var Ee=l(_);Ll=h(Ee,"sentiment analysis: label text according to some polarity like "),ba=n(Ee,"CODE",{});var fr=l(ba);Pl=h(fr,"positive"),fr.forEach(e),Fl=h(Ee," or "),wa=n(Ee,"CODE",{});var gr=l(wa);Dl=h(gr,"negative"),gr.forEach(e),Kl=h(Ee," which can inform and support decision-making in fields like politics, finance, and marketing"),Ee.forEach(e),Ol=p(yn),J=n(yn,"LI",{});var bs=l(J);si=h(bs,"content classification: label text according to some topic to help organize and filter information in news and social media feeds ("),Ma=n(bs,"CODE",{});var yr=l(Ma);ei=h(yr,"weather"),yr.forEach(e),ai=h(bs,", "),va=n(bs,"CODE",{});var jr=l(va);ti=h(jr,"sports"),jr.forEach(e),ni=h(bs,", "),Ja=n(bs,"CODE",{});var br=l(Ja);li=h(br,"finance"),br.forEach(e),ii=h(bs,", etc.)"),bs.forEach(e),yn.forEach(e),It=p(s),d(_s.$$.fragment,s),Zt=p(s),H=n(s,"H3",{class:!0});var jn=l(H);os=n(jn,"A",{id:!0,class:!0,href:!0});var wr=l(os);xa=n(wr,"SPAN",{});var Mr=l(xa);d(Hs.$$.fragment,Mr),Mr.forEach(e),wr.forEach(e),oi=p(jn),ka=n(jn,"SPAN",{});var vr=l(ka);ri=h(vr,"Token classification"),vr.forEach(e),jn.forEach(e),Bt=p(s),rs=n(s,"P",{});var bn=l(rs);pi=h(bn,"In any NLP task, text is preprocessed by separating the sequence of text into individual words or subwords. These are known as "),ge=n(bn,"A",{href:!0});var Jr=l(ge);ci=h(Jr,"tokens"),Jr.forEach(e),hi=h(bn,". Token classification assigns each token a label from a predefined set of classes."),bn.forEach(e),Et=p(s),ye=n(s,"P",{});var xr=l(ye);mi=h(xr,"Two common types of token classification are:"),xr.forEach(e),$t=p(s),ps=n(s,"UL",{});var wn=l(ps);Ta=n(wn,"LI",{});var kr=l(Ta);ui=h(kr,"named entity recognition (NER): label a token according to an entity category like organization, person, location or date. NER is especially popular in biomedical settings, where it can label genes, proteins, and drug names."),kr.forEach(e),di=p(wn),Ua=n(wn,"LI",{});var Tr=l(Ua);fi=h(Tr,"part-of-speech tagging (POS): label a token according to its part-of-speech like noun, verb, or adjective. POS is useful for helping translation systems understand how two identical words are grammatically different (bank as a noun versus bank as a verb)."),Tr.forEach(e),wn.forEach(e),Wt=p(s),d(Vs.$$.fragment,s),qt=p(s),V=n(s,"H3",{class:!0});var Mn=l(V);cs=n(Mn,"A",{id:!0,class:!0,href:!0});var Ur=l(cs);Ia=n(Ur,"SPAN",{});var Ir=l(Ia);d(Rs.$$.fragment,Ir),Ir.forEach(e),Ur.forEach(e),gi=p(Mn),Za=n(Mn,"SPAN",{});var Zr=l(Za);yi=h(Zr,"Question answering"),Zr.forEach(e),Mn.forEach(e),Nt=p(s),je=n(s,"P",{});var Br=l(je);ji=h(Br,"Question answering is another token-level task that returns an answer to a question, sometimes with context (open-domain) and other times without context (closed-domain). This task happens whenever we ask a virtual assistant something like whether a restaurant is open. It can also provide customer or technical support and help search engines retrieve the relevant information you\u2019re asking for."),Br.forEach(e),Gt=p(s),be=n(s,"P",{});var Er=l(be);bi=h(Er,"There are two common types of question answering:"),Er.forEach(e),Ct=p(s),hs=n(s,"UL",{});var vn=l(hs);Ba=n(vn,"LI",{});var $r=l(Ba);wi=h($r,"extractive: given a question and some context, the answer is a span of text from the context the model must extract"),$r.forEach(e),Mi=p(vn),R=n(vn,"LI",{});var $e=l(R);vi=h($e,"abstractive: given a question and some context, the answer is generated from the context; this approach is handled by the "),we=n($e,"A",{href:!0});var Wr=l(we);Ji=h(Wr,"Text2TextGenerationPipeline"),Wr.forEach(e),xi=h($e," instead of the "),Me=n($e,"A",{href:!0});var qr=l(Me);ki=h(qr,"QuestionAnsweringPipeline"),qr.forEach(e),Ti=h($e," shown below"),$e.forEach(e),vn.forEach(e),_t=p(s),d(As.$$.fragment,s),Ht=p(s),A=n(s,"H3",{class:!0});var Jn=l(A);ms=n(Jn,"A",{id:!0,class:!0,href:!0});var Nr=l(ms);Ea=n(Nr,"SPAN",{});var Gr=l(Ea);d(zs.$$.fragment,Gr),Gr.forEach(e),Nr.forEach(e),Ui=p(Jn),$a=n(Jn,"SPAN",{});var Cr=l($a);Ii=h(Cr,"Summarization"),Cr.forEach(e),Jn.forEach(e),Vt=p(s),ve=n(s,"P",{});var _r=l(ve);Zi=h(_r,"Summarization creates a shorter version of a text from a longer one while trying to preserve most of the meaning of the original document. Summarization is a sequence-to-sequence task; it outputs a shorter text sequence than the input. There are a lot of long-form documents that can be summarized to help readers quickly understand the main points. Legislative bills, legal and financial documents, patents, and scientific papers are a few examples of documents that could be summarized to save readers time and serve as a reading aid."),_r.forEach(e),Rt=p(s),Je=n(s,"P",{});var Hr=l(Je);Bi=h(Hr,"Like question answering, there are two types of summarization:"),Hr.forEach(e),At=p(s),us=n(s,"UL",{});var xn=l(us);Wa=n(xn,"LI",{});var Vr=l(Wa);Ei=h(Vr,"extractive: identify and extract the most important sentences from the original text"),Vr.forEach(e),$i=p(xn),Ss=n(xn,"LI",{});var kn=l(Ss);Wi=h(kn,"abstractive: generate the target summary (which may include new words not in the input document) from the original text; the "),xe=n(kn,"A",{href:!0});var Rr=l(xe);qi=h(Rr,"SummarizationPipeline"),Rr.forEach(e),Ni=h(kn," uses the abstractive approach"),kn.forEach(e),xn.forEach(e),zt=p(s),d(Qs.$$.fragment,s),St=p(s),z=n(s,"H3",{class:!0});var Tn=l(z);ds=n(Tn,"A",{id:!0,class:!0,href:!0});var Ar=l(ds);qa=n(Ar,"SPAN",{});var zr=l(qa);d(Ys.$$.fragment,zr),zr.forEach(e),Ar.forEach(e),Gi=p(Tn),Na=n(Tn,"SPAN",{});var Sr=l(Na);Ci=h(Sr,"Translation"),Sr.forEach(e),Tn.forEach(e),Qt=p(s),ke=n(s,"P",{});var Qr=l(ke);_i=h(Qr,"Translation converts a sequence of text in one language to another. It is important in helping people from different backgrounds communicate with each other, help translate content to reach wider audiences, and even be a learning tool to help people learn a new language. Along with summarization, translation is a sequence-to-sequence task, meaning the model receives an input sequence and returns a target output sequence."),Qr.forEach(e),Yt=p(s),Te=n(s,"P",{});var Yr=l(Te);Hi=h(Yr,"In the early days, translation models were mostly monolingual, but recently, there has been increasing interest in multilingual models that can translate between many pairs of languages."),Yr.forEach(e),Xt=p(s),d(Xs.$$.fragment,s),Lt=p(s),S=n(s,"H3",{class:!0});var Un=l(S);fs=n(Un,"A",{id:!0,class:!0,href:!0});var Xr=l(fs);Ga=n(Xr,"SPAN",{});var Lr=l(Ga);d(Ls.$$.fragment,Lr),Lr.forEach(e),Xr.forEach(e),Vi=p(Un),Ca=n(Un,"SPAN",{});var Pr=l(Ca);Ri=h(Pr,"Language modeling"),Pr.forEach(e),Un.forEach(e),Pt=p(s),Ue=n(s,"P",{});var Fr=l(Ue);Ai=h(Fr,"Language modeling is a task that predicts a word in a sequence of text. It has become a very popular NLP task because a pretrained language model can be finetuned for many other downstream tasks. Lately, there has been a lot of interest in large language models (LLMs) which demonstrate zero- or few-shot learning. This means the model can solve tasks it wasn\u2019t explicitly trained to do! Language models can be used to generate fluent and convincing text, though you need to be careful since the text may not always be accurate."),Fr.forEach(e),Ft=p(s),Ie=n(s,"P",{});var Dr=l(Ie);zi=h(Dr,"There are two types of language modeling:"),Dr.forEach(e),Dt=p(s),gs=n(s,"UL",{});var In=l(gs);Ps=n(In,"LI",{});var Zn=l(Ps);_a=n(Zn,"P",{});var Kr=l(_a);Si=h(Kr,"causal: the model\u2019s objective is to predict the next token in a sequence, and future tokens are masked"),Kr.forEach(e),Qi=p(Zn),d(Fs.$$.fragment,Zn),Zn.forEach(e),Yi=p(In),Ds=n(In,"LI",{});var Bn=l(Ds);Ha=n(Bn,"P",{});var Or=l(Ha);Xi=h(Or,"masked: the model\u2019s objective is to predict a masked token in a sequence with full access to the tokens in the sequence"),Or.forEach(e),Li=p(Bn),d(Ks.$$.fragment,Bn),Bn.forEach(e),In.forEach(e),Kt=p(s),k=n(s,"P",{});var We=l(k);Pi=h(We,"Hopefully, this page has given you some more background information about all the types of tasks in each modality and the practical importance of each one. In the next "),Ze=n(We,"A",{href:!0});var sp=l(Ze);Fi=h(sp,"section"),sp.forEach(e),Di=h(We,", you\u2019ll learn "),Va=n(We,"STRONG",{});var ep=l(Va);Ki=h(ep,"how"),ep.forEach(e),Oi=h(We," \u{1F917} Transformers work to solve these tasks."),We.forEach(e),this.h()},h(){m(T,"name","hf:doc:metadata"),m(T,"content",JSON.stringify(pp)),m(Q,"id","what-transformers-can-do"),m(Q,"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"),m(Q,"href","#what-transformers-can-do"),m(U,"class","relative group"),m(Y,"id","audio"),m(Y,"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"),m(Y,"href","#audio"),m(I,"class","relative group"),m(X,"id","audio-classification"),m(X,"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"),m(X,"href","#audio-classification"),m(Z,"class","relative group"),m(L,"id","automatic-speech-recognition"),m(L,"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"),m(L,"href","#automatic-speech-recognition"),m(B,"class","relative group"),m(P,"id","computer-vision"),m(P,"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"),m(P,"href","#computer-vision"),m(E,"class","relative group"),m(ie,"href","glossary#convolution"),m(K,"id","image-classification"),m(K,"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"),m(K,"href","#image-classification"),m($,"class","relative group"),m(O,"id","object-detection"),m(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(O,"href","#object-detection"),m(W,"class","relative group"),m(ss,"id","image-segmentation"),m(ss,"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"),m(ss,"href","#image-segmentation"),m(q,"class","relative group"),m(as,"id","depth-estimation"),m(as,"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"),m(as,"href","#depth-estimation"),m(N,"class","relative group"),m(ns,"id","natural-language-processing"),m(ns,"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"),m(ns,"href","#natural-language-processing"),m(G,"class","relative group"),m(ls,"id","text-classification"),m(ls,"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"),m(ls,"href","#text-classification"),m(C,"class","relative group"),m(os,"id","token-classification"),m(os,"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"),m(os,"href","#token-classification"),m(H,"class","relative group"),m(ge,"href","/glossary#token"),m(cs,"id","question-answering"),m(cs,"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"),m(cs,"href","#question-answering"),m(V,"class","relative group"),m(we,"href","/docs/transformers/v4.30.0/en/main_classes/pipelines#transformers.Text2TextGenerationPipeline"),m(Me,"href","/docs/transformers/v4.30.0/en/main_classes/pipelines#transformers.QuestionAnsweringPipeline"),m(ms,"id","summarization"),m(ms,"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"),m(ms,"href","#summarization"),m(A,"class","relative group"),m(xe,"href","/docs/transformers/v4.30.0/en/main_classes/pipelines#transformers.SummarizationPipeline"),m(ds,"id","translation"),m(ds,"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"),m(ds,"href","#translation"),m(z,"class","relative group"),m(fs,"id","language-modeling"),m(fs,"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"),m(fs,"href","#language-modeling"),m(S,"class","relative group"),m(Ze,"href","tasks_explained")},m(s,i){a(document.head,T),o(s,Ra,i),o(s,U,i),a(U,Q),a(Q,qe),f(ws,qe,null),a(U,En),a(U,Ne),a(Ne,$n),o(s,Aa,i),o(s,Os,i),a(Os,Wn),o(s,za,i),o(s,se,i),a(se,qn),o(s,Sa,i),o(s,I,i),a(I,Y),a(Y,Ge),f(Ms,Ge,null),a(I,Nn),a(I,Ce),a(Ce,Gn),o(s,Qa,i),o(s,ee,i),a(ee,Cn),o(s,Ya,i),o(s,ae,i),a(ae,_n),o(s,Xa,i),o(s,Z,i),a(Z,X),a(X,_e),f(vs,_e,null),a(Z,Hn),a(Z,He),a(He,Vn),o(s,La,i),o(s,te,i),a(te,Rn),o(s,Pa,i),o(s,M,i),a(M,Ve),a(Ve,An),a(M,zn),a(M,Re),a(Re,Sn),a(M,Qn),a(M,Ae),a(Ae,Yn),a(M,Xn),a(M,ze),a(ze,Ln),o(s,Fa,i),f(Js,s,i),o(s,Da,i),o(s,B,i),a(B,L),a(L,Se),f(xs,Se,null),a(B,Pn),a(B,Qe),a(Qe,Fn),o(s,Ka,i),o(s,ne,i),a(ne,Dn),o(s,Oa,i),o(s,le,i),a(le,Kn),o(s,st,i),f(ks,s,i),o(s,et,i),o(s,E,i),a(E,P),a(P,Ye),f(Ts,Ye,null),a(E,On),a(E,Xe),a(Xe,sl),o(s,at,i),o(s,F,i),a(F,el),a(F,ie),a(ie,al),a(F,tl),o(s,tt,i),o(s,oe,i),a(oe,nl),o(s,nt,i),o(s,D,i),a(D,Le),a(Le,ll),a(D,il),a(D,Pe),a(Pe,ol),o(s,lt,i),o(s,$,i),a($,K),a(K,Fe),f(Us,Fe,null),a($,rl),a($,De),a(De,pl),o(s,it,i),o(s,re,i),a(re,cl),o(s,ot,i),o(s,v,i),a(v,Ke),a(Ke,hl),a(v,ml),a(v,Oe),a(Oe,ul),a(v,dl),a(v,sa),a(sa,fl),a(v,gl),a(v,ea),a(ea,yl),o(s,rt,i),f(Is,s,i),o(s,pt,i),o(s,W,i),a(W,O),a(O,aa),f(Zs,aa,null),a(W,jl),a(W,ta),a(ta,bl),o(s,ct,i),o(s,pe,i),a(pe,wl),o(s,ht,i),o(s,x,i),a(x,na),a(na,Ml),a(x,vl),a(x,la),a(la,Jl),a(x,xl),a(x,ia),a(ia,kl),o(s,mt,i),f(Bs,s,i),o(s,ut,i),o(s,q,i),a(q,ss),a(ss,oa),f(Es,oa,null),a(q,Tl),a(q,ra),a(ra,Ul),o(s,dt,i),o(s,ce,i),a(ce,Il),o(s,ft,i),o(s,es,i),a(es,pa),a(pa,Zl),a(es,Bl),a(es,$s),a($s,El),a($s,ca),a(ca,$l),a($s,Wl),o(s,gt,i),o(s,he,i),a(he,ql),o(s,yt,i),f(Ws,s,i),o(s,jt,i),o(s,N,i),a(N,as),a(as,ha),f(qs,ha,null),a(N,Nl),a(N,ma),a(ma,Gl),o(s,bt,i),o(s,me,i),a(me,Cl),o(s,wt,i),o(s,ue,i),a(ue,_l),o(s,Mt,i),o(s,ts,i),a(ts,ua),a(ua,Hl),a(ts,Vl),a(ts,da),a(da,Rl),o(s,vt,i),f(Ns,s,i),o(s,Jt,i),o(s,G,i),a(G,ns),a(ns,fa),f(Gs,fa,null),a(G,Al),a(G,ga),a(ga,zl),o(s,xt,i),o(s,de,i),a(de,Sl),o(s,kt,i),o(s,C,i),a(C,ls),a(ls,ya),f(Cs,ya,null),a(C,Ql),a(C,ja),a(ja,Yl),o(s,Tt,i),o(s,fe,i),a(fe,Xl),o(s,Ut,i),o(s,is,i),a(is,_),a(_,Ll),a(_,ba),a(ba,Pl),a(_,Fl),a(_,wa),a(wa,Dl),a(_,Kl),a(is,Ol),a(is,J),a(J,si),a(J,Ma),a(Ma,ei),a(J,ai),a(J,va),a(va,ti),a(J,ni),a(J,Ja),a(Ja,li),a(J,ii),o(s,It,i),f(_s,s,i),o(s,Zt,i),o(s,H,i),a(H,os),a(os,xa),f(Hs,xa,null),a(H,oi),a(H,ka),a(ka,ri),o(s,Bt,i),o(s,rs,i),a(rs,pi),a(rs,ge),a(ge,ci),a(rs,hi),o(s,Et,i),o(s,ye,i),a(ye,mi),o(s,$t,i),o(s,ps,i),a(ps,Ta),a(Ta,ui),a(ps,di),a(ps,Ua),a(Ua,fi),o(s,Wt,i),f(Vs,s,i),o(s,qt,i),o(s,V,i),a(V,cs),a(cs,Ia),f(Rs,Ia,null),a(V,gi),a(V,Za),a(Za,yi),o(s,Nt,i),o(s,je,i),a(je,ji),o(s,Gt,i),o(s,be,i),a(be,bi),o(s,Ct,i),o(s,hs,i),a(hs,Ba),a(Ba,wi),a(hs,Mi),a(hs,R),a(R,vi),a(R,we),a(we,Ji),a(R,xi),a(R,Me),a(Me,ki),a(R,Ti),o(s,_t,i),f(As,s,i),o(s,Ht,i),o(s,A,i),a(A,ms),a(ms,Ea),f(zs,Ea,null),a(A,Ui),a(A,$a),a($a,Ii),o(s,Vt,i),o(s,ve,i),a(ve,Zi),o(s,Rt,i),o(s,Je,i),a(Je,Bi),o(s,At,i),o(s,us,i),a(us,Wa),a(Wa,Ei),a(us,$i),a(us,Ss),a(Ss,Wi),a(Ss,xe),a(xe,qi),a(Ss,Ni),o(s,zt,i),f(Qs,s,i),o(s,St,i),o(s,z,i),a(z,ds),a(ds,qa),f(Ys,qa,null),a(z,Gi),a(z,Na),a(Na,Ci),o(s,Qt,i),o(s,ke,i),a(ke,_i),o(s,Yt,i),o(s,Te,i),a(Te,Hi),o(s,Xt,i),f(Xs,s,i),o(s,Lt,i),o(s,S,i),a(S,fs),a(fs,Ga),f(Ls,Ga,null),a(S,Vi),a(S,Ca),a(Ca,Ri),o(s,Pt,i),o(s,Ue,i),a(Ue,Ai),o(s,Ft,i),o(s,Ie,i),a(Ie,zi),o(s,Dt,i),o(s,gs,i),a(gs,Ps),a(Ps,_a),a(_a,Si),a(Ps,Qi),f(Fs,Ps,null),a(gs,Yi),a(gs,Ds),a(Ds,Ha),a(Ha,Xi),a(Ds,Li),f(Ks,Ds,null),o(s,Kt,i),o(s,k,i),a(k,Pi),a(k,Ze),a(Ze,Fi),a(k,Di),a(k,Va),a(Va,Ki),a(k,Oi),Ot=!0},p:ip,i(s){Ot||(g(ws.$$.fragment,s),g(Ms.$$.fragment,s),g(vs.$$.fragment,s),g(Js.$$.fragment,s),g(xs.$$.fragment,s),g(ks.$$.fragment,s),g(Ts.$$.fragment,s),g(Us.$$.fragment,s),g(Is.$$.fragment,s),g(Zs.$$.fragment,s),g(Bs.$$.fragment,s),g(Es.$$.fragment,s),g(Ws.$$.fragment,s),g(qs.$$.fragment,s),g(Ns.$$.fragment,s),g(Gs.$$.fragment,s),g(Cs.$$.fragment,s),g(_s.$$.fragment,s),g(Hs.$$.fragment,s),g(Vs.$$.fragment,s),g(Rs.$$.fragment,s),g(As.$$.fragment,s),g(zs.$$.fragment,s),g(Qs.$$.fragment,s),g(Ys.$$.fragment,s),g(Xs.$$.fragment,s),g(Ls.$$.fragment,s),g(Fs.$$.fragment,s),g(Ks.$$.fragment,s),Ot=!0)},o(s){y(ws.$$.fragment,s),y(Ms.$$.fragment,s),y(vs.$$.fragment,s),y(Js.$$.fragment,s),y(xs.$$.fragment,s),y(ks.$$.fragment,s),y(Ts.$$.fragment,s),y(Us.$$.fragment,s),y(Is.$$.fragment,s),y(Zs.$$.fragment,s),y(Bs.$$.fragment,s),y(Es.$$.fragment,s),y(Ws.$$.fragment,s),y(qs.$$.fragment,s),y(Ns.$$.fragment,s),y(Gs.$$.fragment,s),y(Cs.$$.fragment,s),y(_s.$$.fragment,s),y(Hs.$$.fragment,s),y(Vs.$$.fragment,s),y(Rs.$$.fragment,s),y(As.$$.fragment,s),y(zs.$$.fragment,s),y(Qs.$$.fragment,s),y(Ys.$$.fragment,s),y(Xs.$$.fragment,s),y(Ls.$$.fragment,s),y(Fs.$$.fragment,s),y(Ks.$$.fragment,s),Ot=!1},d(s){e(T),s&&e(Ra),s&&e(U),j(ws),s&&e(Aa),s&&e(Os),s&&e(za),s&&e(se),s&&e(Sa),s&&e(I),j(Ms),s&&e(Qa),s&&e(ee),s&&e(Ya),s&&e(ae),s&&e(Xa),s&&e(Z),j(vs),s&&e(La),s&&e(te),s&&e(Pa),s&&e(M),s&&e(Fa),j(Js,s),s&&e(Da),s&&e(B),j(xs),s&&e(Ka),s&&e(ne),s&&e(Oa),s&&e(le),s&&e(st),j(ks,s),s&&e(et),s&&e(E),j(Ts),s&&e(at),s&&e(F),s&&e(tt),s&&e(oe),s&&e(nt),s&&e(D),s&&e(lt),s&&e($),j(Us),s&&e(it),s&&e(re),s&&e(ot),s&&e(v),s&&e(rt),j(Is,s),s&&e(pt),s&&e(W),j(Zs),s&&e(ct),s&&e(pe),s&&e(ht),s&&e(x),s&&e(mt),j(Bs,s),s&&e(ut),s&&e(q),j(Es),s&&e(dt),s&&e(ce),s&&e(ft),s&&e(es),s&&e(gt),s&&e(he),s&&e(yt),j(Ws,s),s&&e(jt),s&&e(N),j(qs),s&&e(bt),s&&e(me),s&&e(wt),s&&e(ue),s&&e(Mt),s&&e(ts),s&&e(vt),j(Ns,s),s&&e(Jt),s&&e(G),j(Gs),s&&e(xt),s&&e(de),s&&e(kt),s&&e(C),j(Cs),s&&e(Tt),s&&e(fe),s&&e(Ut),s&&e(is),s&&e(It),j(_s,s),s&&e(Zt),s&&e(H),j(Hs),s&&e(Bt),s&&e(rs),s&&e(Et),s&&e(ye),s&&e($t),s&&e(ps),s&&e(Wt),j(Vs,s),s&&e(qt),s&&e(V),j(Rs),s&&e(Nt),s&&e(je),s&&e(Gt),s&&e(be),s&&e(Ct),s&&e(hs),s&&e(_t),j(As,s),s&&e(Ht),s&&e(A),j(zs),s&&e(Vt),s&&e(ve),s&&e(Rt),s&&e(Je),s&&e(At),s&&e(us),s&&e(zt),j(Qs,s),s&&e(St),s&&e(z),j(Ys),s&&e(Qt),s&&e(ke),s&&e(Yt),s&&e(Te),s&&e(Xt),j(Xs,s),s&&e(Lt),s&&e(S),j(Ls),s&&e(Pt),s&&e(Ue),s&&e(Ft),s&&e(Ie),s&&e(Dt),s&&e(gs),j(Fs),j(Ks),s&&e(Kt),s&&e(k)}}}const pp={local:"what-transformers-can-do",sections:[{local:"audio",sections:[{local:"audio-classification",title:"Audio classification"},{local:"automatic-speech-recognition",title:"Automatic speech recognition"}],title:"Audio"},{local:"computer-vision",sections:[{local:"image-classification",title:"Image classification"},{local:"object-detection",title:"Object detection"},{local:"image-segmentation",title:"Image segmentation"},{local:"depth-estimation",title:"Depth estimation"}],title:"Computer vision"},{local:"natural-language-processing",sections:[{local:"text-classification",title:"Text classification"},{local:"token-classification",title:"Token classification"},{local:"question-answering",title:"Question answering"},{local:"summarization",title:"Summarization"},{local:"translation",title:"Translation"},{local:"language-modeling",title:"Language modeling"}],title:"Natural language processing"}],title:"What \u{1F917} Transformers can do"};function cp(so){return op(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dp extends ap{constructor(T){super();tp(this,T,cp,rp,np,{})}}export{dp as default,pp as metadata};
