Buckets:

rtrm's picture
download
raw
7.13 kB
import{s as F,n as Y,o as K}from"../chunks/scheduler.893fe8c9.js";import{S as D,i as O,e as y,s as n,c as b,h as ee,a as M,d as s,b as l,f as Z,g as j,j as H,k as L,l as te,m as a,n as $,t as x,o as J,p as w}from"../chunks/index.6ee278c6.js";import{C as se,H as ae,E as ne}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.cabc613f.js";import{C as X}from"../chunks/CodeBlock.ca036db3.js";import{C as le}from"../chunks/CourseFloatingBanner.b902b8d5.js";function ie(P){let i,C,T,U,r,B,p,_,o,I,c,S="În cazul în care intenționați să utilizați un model preantrenat sau o versiune ajustată în producție, vă rugăm să fiți conștienți de faptul că, deși aceste modele sunt instrumente puternice, ele au anumite limitări. Cea mai importantă dintre acestea este că, pentru a permite preantrenarea pe cantități mari de date, cercetătorii deseori extrag tot conținutul pe care îl pot găsi, luând atât ce este mai bun, cât și ce este mai rău din ceea ce este disponibil pe internet.",V,u,q="Pentru a oferi o ilustrare rapidă, să ne întoarcem la exemplul unui pipeline <code>fill-mask</code> cu modelul BERT:",v,m,z,d,W,f,A='Atunci când i se cere să completeze cuvântul care lipsește din aceste două propoziții, modelul dă un singur răspuns fără gen (chelner/ chelneriță). Celelalte sunt ocupații asociate de obicei cu un anumit gen - și da, „prostituată” a ajuns în primele 5 posibilități pe care modelul le asociază cu „femeie” și „muncă”. Acest lucru se întâmplă chiar dacă BERT este unul dintre puținele modele Transformer care nu este construit prin extragerea de date de pe întregul internet, ci mai degrabă folosind date aparent neutre (este antrenat pe seturile de date <a href="https://huggingface.co/datasets/wikipedia" rel="nofollow">English Wikipedia</a> și <a href="https://huggingface.co/datasets/bookcorpus" rel="nofollow">BookCorpus</a>).',N,h,R="Prin urmare, atunci când utilizați aceste instrumente, este important să conștientizați că modelul original pe care îl utilizați ar putea genera cu ușurință conținut sexist, rasist sau homofob. Reglarea fină a modelului pe baza datelor dumneavoastră nu va elimina această prejudecată intrinsecă.",E,g,G,k,Q;return r=new se({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new ae({props:{title:"Prejudecăți și limitări",local:"prejudecăți-și-limitări",headingTag:"h1"}}),o=new le({props:{chapter:1,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter1/section8.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter1/section8.ipynb"}]}}),m=new X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdW5tYXNrZXIlMjAlM0QlMjBwaXBlbGluZSglMjJmaWxsLW1hc2slMjIlMkMlMjBtb2RlbCUzRCUyMmJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQXJlc3VsdCUyMCUzRCUyMHVubWFza2VyKCUyMlRoaXMlMjBtYW4lMjB3b3JrcyUyMGFzJTIwYSUyMCU1Qk1BU0slNUQuJTIyKSUwQXByaW50KCU1QnIlNUIlMjJ0b2tlbl9zdHIlMjIlNUQlMjBmb3IlMjByJTIwaW4lMjByZXN1bHQlNUQpJTBBJTBBcmVzdWx0JTIwJTNEJTIwdW5tYXNrZXIoJTIyVGhpcyUyMHdvbWFuJTIwd29ya3MlMjBhcyUyMGElMjAlNUJNQVNLJTVELiUyMiklMEFwcmludCglNUJyJTVCJTIydG9rZW5fc3RyJTIyJTVEJTIwZm9yJTIwciUyMGluJTIwcmVzdWx0JTVEKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
unmasker = pipeline(<span class="hljs-string">&quot;fill-mask&quot;</span>, model=<span class="hljs-string">&quot;bert-base-uncased&quot;</span>)
result = unmasker(<span class="hljs-string">&quot;This man works as a [MASK].&quot;</span>)
<span class="hljs-built_in">print</span>([r[<span class="hljs-string">&quot;token_str&quot;</span>] <span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> result])
result = unmasker(<span class="hljs-string">&quot;This woman works as a [MASK].&quot;</span>)
<span class="hljs-built_in">print</span>([r[<span class="hljs-string">&quot;token_str&quot;</span>] <span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> result])`,wrap:!1}}),d=new X({props:{code:"JTVCJ2xhd3llciclMkMlMjAnY2FycGVudGVyJyUyQyUyMCdkb2N0b3InJTJDJTIwJ3dhaXRlciclMkMlMjAnbWVjaGFuaWMnJTVEJTBBJTVCJ251cnNlJyUyQyUyMCd3YWl0cmVzcyclMkMlMjAndGVhY2hlciclMkMlMjAnbWFpZCclMkMlMjAncHJvc3RpdHV0ZSclNUQ=",highlighted:`[<span class="hljs-string">&#x27;lawyer&#x27;</span>, <span class="hljs-string">&#x27;carpenter&#x27;</span>, <span class="hljs-string">&#x27;doctor&#x27;</span>, <span class="hljs-string">&#x27;waiter&#x27;</span>, <span class="hljs-string">&#x27;mechanic&#x27;</span>]
[<span class="hljs-string">&#x27;nurse&#x27;</span>, <span class="hljs-string">&#x27;waitress&#x27;</span>, <span class="hljs-string">&#x27;teacher&#x27;</span>, <span class="hljs-string">&#x27;maid&#x27;</span>, <span class="hljs-string">&#x27;prostitute&#x27;</span>]`,wrap:!1}}),g=new ne({props:{source:"https://github.com/huggingface/course/blob/main/chapters/ro/chapter1/8.mdx"}}),{c(){i=y("meta"),C=n(),T=y("p"),U=n(),b(r.$$.fragment),B=n(),b(p.$$.fragment),_=n(),b(o.$$.fragment),I=n(),c=y("p"),c.textContent=S,V=n(),u=y("p"),u.innerHTML=q,v=n(),b(m.$$.fragment),z=n(),b(d.$$.fragment),W=n(),f=y("p"),f.innerHTML=A,N=n(),h=y("p"),h.textContent=R,E=n(),b(g.$$.fragment),G=n(),k=y("p"),this.h()},l(e){const t=ee("svelte-u9bgzb",document.head);i=M(t,"META",{name:!0,content:!0}),t.forEach(s),C=l(e),T=M(e,"P",{}),Z(T).forEach(s),U=l(e),j(r.$$.fragment,e),B=l(e),j(p.$$.fragment,e),_=l(e),j(o.$$.fragment,e),I=l(e),c=M(e,"P",{"data-svelte-h":!0}),H(c)!=="svelte-15osla8"&&(c.textContent=S),V=l(e),u=M(e,"P",{"data-svelte-h":!0}),H(u)!=="svelte-1dftyxp"&&(u.innerHTML=q),v=l(e),j(m.$$.fragment,e),z=l(e),j(d.$$.fragment,e),W=l(e),f=M(e,"P",{"data-svelte-h":!0}),H(f)!=="svelte-1siben5"&&(f.innerHTML=A),N=l(e),h=M(e,"P",{"data-svelte-h":!0}),H(h)!=="svelte-176e7a1"&&(h.textContent=R),E=l(e),j(g.$$.fragment,e),G=l(e),k=M(e,"P",{}),Z(k).forEach(s),this.h()},h(){L(i,"name","hf:doc:metadata"),L(i,"content",re)},m(e,t){te(document.head,i),a(e,C,t),a(e,T,t),a(e,U,t),$(r,e,t),a(e,B,t),$(p,e,t),a(e,_,t),$(o,e,t),a(e,I,t),a(e,c,t),a(e,V,t),a(e,u,t),a(e,v,t),$(m,e,t),a(e,z,t),$(d,e,t),a(e,W,t),a(e,f,t),a(e,N,t),a(e,h,t),a(e,E,t),$(g,e,t),a(e,G,t),a(e,k,t),Q=!0},p:Y,i(e){Q||(x(r.$$.fragment,e),x(p.$$.fragment,e),x(o.$$.fragment,e),x(m.$$.fragment,e),x(d.$$.fragment,e),x(g.$$.fragment,e),Q=!0)},o(e){J(r.$$.fragment,e),J(p.$$.fragment,e),J(o.$$.fragment,e),J(m.$$.fragment,e),J(d.$$.fragment,e),J(g.$$.fragment,e),Q=!1},d(e){e&&(s(C),s(T),s(U),s(B),s(_),s(I),s(c),s(V),s(u),s(v),s(z),s(W),s(f),s(N),s(h),s(E),s(G),s(k)),s(i),w(r,e),w(p,e),w(o,e),w(m,e),w(d,e),w(g,e)}}}const re='{"title":"Prejudecăți și limitări","local":"prejudecăți-și-limitări","sections":[],"depth":1}';function pe(P){return K(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fe extends D{constructor(i){super(),O(this,i,pe,ie,F,{})}}export{fe as component};

Xet Storage Details

Size:
7.13 kB
·
Xet hash:
50e383f2fea6e01e9757c492019062acf3b8debcfcc846ad27ebcf990e4ccd13

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.