import{S as ah,i as ih,s as lh,e as l,k as o,w as f,t as s,M as hh,c as h,d as e,m as u,a as c,x as b,h as a,b as m,G as n,g as r,y,q as _,o as v,B as $,v as ch}from"../../chunks/vendor-hf-doc-builder.js";import{T as _e}from"../../chunks/Tip-hf-doc-builder.js";import{Y as rh}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Bs}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as E}from"../../chunks/CodeBlock-hf-doc-builder.js";import{C as ph}from"../../chunks/CourseFloatingBanner-hf-doc-builder.js";import"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function oh(G){let p,I,g,k,w,d,P,A,x,j,T,q,D,B;return{c(){p=l("p"),I=s("\u270E Theo m\u1EB7c \u0111\u1ECBnh, \u{1F917} Datasets s\u1EBD gi\u1EA3i n\xE9n c\xE1c t\u1EC7p c\u1EA7n thi\u1EBFt \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u. N\u1EBFu b\u1EA1n mu\u1ED1n b\u1EA3o to\xE0n dung l\u01B0\u1EE3ng \u1ED5 c\u1EE9ng, b\u1EA1n c\xF3 th\u1EC3 truy\u1EC1n "),g=l("code"),k=s("DownloadConfig(delete_extracted=True)"),w=s(" v\xE0o tham s\u1ED1 "),d=l("code"),P=s("download_config"),A=s(" c\u1EE7a "),x=l("code"),j=s("load_dataset()"),T=s(". Xem "),q=l("a"),D=s("t\xE0i li\u1EC7u"),B=s(" \u0111\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt."),this.h()},l(C){p=h(C,"P",{});var O=c(p);I=a(O,"\u270E Theo m\u1EB7c \u0111\u1ECBnh, \u{1F917} Datasets s\u1EBD gi\u1EA3i n\xE9n c\xE1c t\u1EC7p c\u1EA7n thi\u1EBFt \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u. N\u1EBFu b\u1EA1n mu\u1ED1n b\u1EA3o to\xE0n dung l\u01B0\u1EE3ng \u1ED5 c\u1EE9ng, b\u1EA1n c\xF3 th\u1EC3 truy\u1EC1n "),g=h(O,"CODE",{});var nt=c(g);k=a(nt,"DownloadConfig(delete_extracted=True)"),nt.forEach(e),w=a(O," v\xE0o tham s\u1ED1 "),d=h(O,"CODE",{});var K=c(d);P=a(K,"download_config"),K.forEach(e),A=a(O," c\u1EE7a "),x=h(O,"CODE",{});var M=c(x);j=a(M,"load_dataset()"),M.forEach(e),T=a(O,". Xem "),q=h(O,"A",{href:!0,rel:!0});var et=c(q);D=a(et,"t\xE0i li\u1EC7u"),et.forEach(e),B=a(O," \u0111\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt."),O.forEach(e),this.h()},h(){m(q,"href","https://huggingface.co/docs/datasets/package_reference/builder_classes.html?#datasets.utils.DownloadConfig"),m(q,"rel","nofollow")},m(C,O){r(C,p,O),n(p,I),n(p,g),n(g,k),n(p,w),n(p,d),n(d,P),n(p,A),n(p,x),n(x,j),n(p,T),n(p,q),n(q,D),n(p,B)},d(C){C&&e(p)}}}function uh(G){let p,I,g,k,w,d,P,A,x,j,T;return{c(){p=l("p"),I=s("\u270F\uFE0F "),g=l("strong"),k=s("Th\u1EED nghi\u1EC7m th\xF4i!"),w=s(" Ch\u1ECDn m\u1ED9t trong c\xE1c "),d=l("a"),P=s("t\u1EADp h\u1EE3p con"),A=s(" t\u1EEB Pile sao cho l\u1EDBn h\u01A1n RAM c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay ho\u1EB7c m\xE1y t\xEDnh \u0111\u1EC3 b\xE0n c\u1EE7a b\u1EA1n, t\u1EA3i n\xF3 v\u1EDBi \u{1F917} Datasets, v\xE0 \u0111o dung l\u01B0\u1EE3ng RAM \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng. L\u01B0u \xFD r\u1EB1ng \u0111\u1EC3 c\xF3 \u0111\u01B0\u1EE3c m\u1ED9t ph\xE9p \u0111o ch\xEDnh x\xE1c, b\u1EA1n s\u1EBD mu\u1ED1n th\u1EF1c hi\u1EC7n vi\u1EC7c n\xE0y trong m\u1ED9t quy tr\xECnh m\u1EDBi. B\u1EA1n c\xF3 th\u1EC3 t\xECm th\u1EA5y c\xE1c k\xEDch th\u01B0\u1EDBc \u0111\xE3 gi\u1EA3i n\xE9n c\u1EE7a t\u1EEBng t\u1EADp h\u1EE3p con trong B\u1EA3ng 1 c\u1EE7a "),x=l("a"),j=s("b\xE0i b\xE1o v\u1EC1 Pile"),T=s("."),this.h()},l(q){p=h(q,"P",{});var D=c(p);I=a(D,"\u270F\uFE0F "),g=h(D,"STRONG",{});var B=c(g);k=a(B,"Th\u1EED nghi\u1EC7m th\xF4i!"),B.forEach(e),w=a(D," Ch\u1ECDn m\u1ED9t trong c\xE1c "),d=h(D,"A",{href:!0,rel:!0});var C=c(d);P=a(C,"t\u1EADp h\u1EE3p con"),C.forEach(e),A=a(D," t\u1EEB Pile sao cho l\u1EDBn h\u01A1n RAM c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay ho\u1EB7c m\xE1y t\xEDnh \u0111\u1EC3 b\xE0n c\u1EE7a b\u1EA1n, t\u1EA3i n\xF3 v\u1EDBi \u{1F917} Datasets, v\xE0 \u0111o dung l\u01B0\u1EE3ng RAM \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng. L\u01B0u \xFD r\u1EB1ng \u0111\u1EC3 c\xF3 \u0111\u01B0\u1EE3c m\u1ED9t ph\xE9p \u0111o ch\xEDnh x\xE1c, b\u1EA1n s\u1EBD mu\u1ED1n th\u1EF1c hi\u1EC7n vi\u1EC7c n\xE0y trong m\u1ED9t quy tr\xECnh m\u1EDBi. B\u1EA1n c\xF3 th\u1EC3 t\xECm th\u1EA5y c\xE1c k\xEDch th\u01B0\u1EDBc \u0111\xE3 gi\u1EA3i n\xE9n c\u1EE7a t\u1EEBng t\u1EADp h\u1EE3p con trong B\u1EA3ng 1 c\u1EE7a "),x=h(D,"A",{href:!0,rel:!0});var O=c(x);j=a(O,"b\xE0i b\xE1o v\u1EC1 Pile"),O.forEach(e),T=a(D,"."),D.forEach(e),this.h()},h(){m(d,"href","https://the-eye.eu/public/AI/pile_preliminary_components/"),m(d,"rel","nofollow"),m(x,"href","https://arxiv.org/abs/2101.00027"),m(x,"rel","nofollow")},m(q,D){r(q,p,D),n(p,I),n(p,g),n(g,k),n(p,w),n(p,d),n(d,P),n(p,A),n(p,x),n(x,j),n(p,T)},d(q){q&&e(p)}}}function mh(G){let p,I,g,k,w,d,P;return{c(){p=l("p"),I=s("\u{1F4A1} Trong s\u1ED5 ghi ch\xE9p Jupyter, b\u1EA1n c\xF3 th\u1EC3 \u0111\u1ECBnh th\u1EDDi gian cho c\xE1c \xF4 b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng"),g=l("a"),k=s("h\xE0m ma thu\u1EADt "),w=l("code"),d=s("%%timeit"),P=s("."),this.h()},l(A){p=h(A,"P",{});var x=c(p);I=a(x,"\u{1F4A1} Trong s\u1ED5 ghi ch\xE9p Jupyter, b\u1EA1n c\xF3 th\u1EC3 \u0111\u1ECBnh th\u1EDDi gian cho c\xE1c \xF4 b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng"),g=h(x,"A",{href:!0,rel:!0});var j=c(g);k=a(j,"h\xE0m ma thu\u1EADt "),w=h(j,"CODE",{});var T=c(w);d=a(T,"%%timeit"),T.forEach(e),j.forEach(e),P=a(x,"."),x.forEach(e),this.h()},h(){m(g,"href","https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit"),m(g,"rel","nofollow")},m(A,x){r(A,p,x),n(p,I),n(p,g),n(g,k),n(g,w),n(w,d),n(p,P)},d(A){A&&e(p)}}}function gh(G){let p,I,g,k,w,d,P,A;return{c(){p=l("p"),I=s("\u{1F4A1} \u0110\u1EC3 t\u0103ng t\u1ED1c \u0111\u1ED9 tr\xECnh tokenize v\u1EDBi t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn, b\u1EA1n c\xF3 th\u1EC3 v\u01B0\u1EE3t qua "),g=l("code"),k=s("batched=True"),w=s(", nh\u01B0 ch\xFAng ta \u0111\xE3 th\u1EA5y trong ph\u1EA7n tr\u01B0\u1EDBc. N\xF3 s\u1EBD x\u1EED l\xFD h\xE0ng lo\u1EA1t c\xE1c v\xED d\u1EE5; k\xEDch th\u01B0\u1EDBc l\xF4 m\u1EB7c \u0111\u1ECBnh l\xE0 1,000 v\xE0 c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c ch\u1EC9 \u0111\u1ECBnh b\u1EB1ng tham s\u1ED1 "),d=l("code"),P=s("batch_size"),A=s(".")},l(x){p=h(x,"P",{});var j=c(p);I=a(j,"\u{1F4A1} \u0110\u1EC3 t\u0103ng t\u1ED1c \u0111\u1ED9 tr\xECnh tokenize v\u1EDBi t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn, b\u1EA1n c\xF3 th\u1EC3 v\u01B0\u1EE3t qua "),g=h(j,"CODE",{});var T=c(g);k=a(T,"batched=True"),T.forEach(e),w=a(j,", nh\u01B0 ch\xFAng ta \u0111\xE3 th\u1EA5y trong ph\u1EA7n tr\u01B0\u1EDBc. N\xF3 s\u1EBD x\u1EED l\xFD h\xE0ng lo\u1EA1t c\xE1c v\xED d\u1EE5; k\xEDch th\u01B0\u1EDBc l\xF4 m\u1EB7c \u0111\u1ECBnh l\xE0 1,000 v\xE0 c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c ch\u1EC9 \u0111\u1ECBnh b\u1EB1ng tham s\u1ED1 "),d=h(j,"CODE",{});var q=c(d);P=a(q,"batch_size"),q.forEach(e),A=a(j,"."),j.forEach(e)},m(x,j){r(x,p,j),n(p,I),n(p,g),n(g,k),n(p,w),n(p,d),n(d,P),n(p,A)},d(x){x&&e(p)}}}function dh(G){let p,I,g,k,w,d,P,A,x,j,T,q,D;return{c(){p=l("p"),I=s("\u270F\uFE0F "),g=l("strong"),k=s("Th\u1EED nghi\u1EC7m th\xF4i!"),w=s(" S\u1EED d\u1EE5ng m\u1ED9t trong nh\u1EEFng kho t\xE0i li\u1EC7u Common Crawl l\u1EDBn nh\u01B0 "),d=l("a"),P=l("code"),A=s("mc4"),x=s(" ho\u1EB7c "),j=l("a"),T=l("code"),q=s("oscar"),D=s(" \u0111\u1EC3 t\u1EA1o t\u1EADp d\u1EEF li\u1EC7u \u0111a ng\xF4n ng\u1EEF tr\u1EF1c tuy\u1EBFn th\u1EC3 hi\u1EC7n t\u1EF7 l\u1EC7 n\xF3i c\u1EE7a c\xE1c ng\xF4n ng\u1EEF \u1EDF qu\u1ED1c gia b\u1EA1n ch\u1ECDn. V\xED d\u1EE5: b\u1ED1n ng\xF4n ng\u1EEF qu\u1ED1c gia \u1EDF Th\u1EE5y S\u0129 l\xE0 ti\u1EBFng \u0110\u1EE9c, ti\u1EBFng Ph\xE1p, ti\u1EBFng \xDD v\xE0 ti\u1EBFng La M\xE3, v\xEC v\u1EADy b\u1EA1n c\xF3 th\u1EC3 th\u1EED t\u1EA1o m\u1ED9t kho ng\u1EEF li\u1EC7u ti\u1EBFng Th\u1EE5y S\u0129 b\u1EB1ng c\xE1ch l\u1EA5y m\u1EABu c\xE1c t\u1EADp h\u1EE3p con Oscar theo t\u1EF7 l\u1EC7 n\xF3i c\u1EE7a ch\xFAng."),this.h()},l(B){p=h(B,"P",{});var C=c(p);I=a(C,"\u270F\uFE0F "),g=h(C,"STRONG",{});var O=c(g);k=a(O,"Th\u1EED nghi\u1EC7m th\xF4i!"),O.forEach(e),w=a(C," S\u1EED d\u1EE5ng m\u1ED9t trong nh\u1EEFng kho t\xE0i li\u1EC7u Common Crawl l\u1EDBn nh\u01B0 "),d=h(C,"A",{href:!0,rel:!0});var nt=c(d);P=h(nt,"CODE",{});var K=c(P);A=a(K,"mc4"),K.forEach(e),nt.forEach(e),x=a(C," ho\u1EB7c "),j=h(C,"A",{href:!0,rel:!0});var M=c(j);T=h(M,"CODE",{});var et=c(T);q=a(et,"oscar"),et.forEach(e),M.forEach(e),D=a(C," \u0111\u1EC3 t\u1EA1o t\u1EADp d\u1EEF li\u1EC7u \u0111a ng\xF4n ng\u1EEF tr\u1EF1c tuy\u1EBFn th\u1EC3 hi\u1EC7n t\u1EF7 l\u1EC7 n\xF3i c\u1EE7a c\xE1c ng\xF4n ng\u1EEF \u1EDF qu\u1ED1c gia b\u1EA1n ch\u1ECDn. V\xED d\u1EE5: b\u1ED1n ng\xF4n ng\u1EEF qu\u1ED1c gia \u1EDF Th\u1EE5y S\u0129 l\xE0 ti\u1EBFng \u0110\u1EE9c, ti\u1EBFng Ph\xE1p, ti\u1EBFng \xDD v\xE0 ti\u1EBFng La M\xE3, v\xEC v\u1EADy b\u1EA1n c\xF3 th\u1EC3 th\u1EED t\u1EA1o m\u1ED9t kho ng\u1EEF li\u1EC7u ti\u1EBFng Th\u1EE5y S\u0129 b\u1EB1ng c\xE1ch l\u1EA5y m\u1EABu c\xE1c t\u1EADp h\u1EE3p con Oscar theo t\u1EF7 l\u1EC7 n\xF3i c\u1EE7a ch\xFAng."),C.forEach(e),this.h()},h(){m(d,"href","https://huggingface.co/datasets/mc4"),m(d,"rel","nofollow"),m(j,"href","https://huggingface.co/datasets/oscar"),m(j,"rel","nofollow")},m(B,C){r(B,p,C),n(p,I),n(p,g),n(g,k),n(p,w),n(p,d),n(d,P),n(P,A),n(p,x),n(p,j),n(j,T),n(T,q),n(p,D)},d(B){B&&e(p)}}}function fh(G){let p,I,g,k,w,d,P,A,x,j,T,q,D,B,C,O,nt,K,M,et,qn,Ms,Ns,Cn,Rs,Ss,ve,jt,$e,lt,Gs,kt,Ls,Hs,xe,st,ht,In,Et,Us,On,Fs,je,z,Ks,wt,Js,Vs,At,Ws,Qs,Tt,Ys,Zs,Dt,Xs,ta,Pt,na,ea,zn,sa,aa,ke,qt,Ee,ct,ia,fn,la,ha,we,Ct,Ae,It,Te,bn,ca,De,rt,Pe,yn,ra,qe,Ot,Ce,zt,Ie,_n,pa,Oe,at,pt,Bn,Bt,oa,Mn,ua,ze,J,ma,Mt,Nn,ga,da,Rn,fa,ba,Be,Nt,Me,ot,ya,Sn,_a,va,Ne,Rt,Re,St,Se,L,$a,Gn,xa,ja,Ln,ka,Ea,Hn,wa,Aa,Ge,Gt,Le,Lt,He,vn,Ta,Ue,ut,Fe,V,Da,Ht,Pa,qa,Ut,Ca,Ia,Ke,N,Oa,Un,za,Ba,Ft,Ma,Na,Kt,Fn,Ra,Sa,Jt,Ga,La,Je,Vt,Ve,Wt,We,W,Ha,Kn,Ua,Fa,Jn,Ka,Ja,Qe,mt,Ye,it,gt,Vn,Qt,Va,Wn,Wa,Ze,Q,Qa,Qn,Ya,Za,Yn,Xa,ti,Xe,Yt,ts,R,ni,Zn,ei,si,Xn,ai,ii,te,li,hi,ne,ci,ri,ns,Zt,es,Xt,ss,Y,pi,ee,oi,ui,$n,mi,gi,as,tn,is,nn,ls,dt,hs,H,di,se,fi,bi,ae,yi,_i,ie,vi,$i,cs,en,rs,sn,ps,U,xi,le,ji,ki,he,Ei,wi,ce,Ai,Ti,os,an,us,ln,ms,ft,Di,re,Pi,qi,gs,hn,ds,F,Ci,pe,Ii,Oi,oe,zi,Bi,ue,Mi,Ni,fs,cn,bs,rn,ys,bt,Ri,me,Si,Gi,_s,pn,vs,on,$s,Z,Li,ge,Hi,Ui,de,Fi,Ki,xs,xn,Ji,js,un,ks,mn,Es,yt,ws,jn,Vi,As;return d=new Bs({}),T=new ph({props:{chapter:5,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/vi/chapter5/section4.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/vi/chapter5/section4.ipynb"}]}}),jt=new rh({props:{id:"JwISwTCPPWo"}}),Et=new Bs({}),qt=new E({props:{code:"!pip install zstandard",highlighted:"!pip install zstandard"}}),Ct=new E({props:{code:`from datasets import load_dataset

# Qu\xE1 tr\xECnh n\xE0y m\u1EA5t m\u1ED9t v\xE0i ph\xFAt \u0111\u1EC3 ch\u1EA1y, v\xEC v\u1EADy h\xE3y l\xE0m c\u1ED1c tr\xE0 ho\u1EB7c c\xE0 ph\xEA trong khi ch\u1EDD \u0111\u1EE3i :)
data_files = "https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst"
pubmed_dataset = load_dataset("json", data_files=data_files, split="train")
pubmed_dataset`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-comment"># Qu\xE1 tr\xECnh n\xE0y m\u1EA5t m\u1ED9t v\xE0i ph\xFAt \u0111\u1EC3 ch\u1EA1y, v\xEC v\u1EADy h\xE3y l\xE0m c\u1ED1c tr\xE0 ho\u1EB7c c\xE0 ph\xEA trong khi ch\u1EDD \u0111\u1EE3i :)</span>
data_files = <span class="hljs-string">&quot;https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst&quot;</span>
pubmed_dataset = load_dataset(<span class="hljs-string">&quot;json&quot;</span>, data_files=data_files, split=<span class="hljs-string">&quot;train&quot;</span>)
pubmed_dataset`}}),It=new E({props:{code:`Dataset({
    features: ['meta', 'text'],
    num_rows: 15518009
})`,highlighted:`Dataset({
    features: [<span class="hljs-string">&#x27;meta&#x27;</span>, <span class="hljs-string">&#x27;text&#x27;</span>],
    num_rows: <span class="hljs-number">15518009</span>
})`}}),rt=new _e({props:{$$slots:{default:[oh]},$$scope:{ctx:G}}}),Ot=new E({props:{code:"pubmed_dataset[0]",highlighted:'pubmed_dataset[<span class="hljs-number">0</span>]'}}),zt=new E({props:{code:`{'meta': {'pmid': 11409574, 'language': 'eng'},
 'text': 'Epidemiology of hypoxaemia in children with acute lower respiratory infection.\\nTo determine the prevalence of hypoxaemia in children aged under 5 years suffering acute lower respiratory infections (ALRI), the risk factors for hypoxaemia in children under 5 years of age with ALRI, and the association of hypoxaemia with an increased risk of dying in children of the same age ...'}`,highlighted:`{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409574</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Epidemiology of hypoxaemia in children with acute lower respiratory infection.\\nTo determine the prevalence of hypoxaemia in children aged under 5 years suffering acute lower respiratory infections (ALRI), the risk factors for hypoxaemia in children under 5 years of age with ALRI, and the association of hypoxaemia with an increased risk of dying in children of the same age ...&#x27;</span>}`}}),Bt=new Bs({}),Nt=new E({props:{code:"!pip install psutil",highlighted:"!pip install psutil"}}),Rt=new E({props:{code:`import psutil

# Process.memory_info \u0111\u01B0\u1EE3c bi\u1EC3u th\u1ECB b\u1EB1ng bytes, sau \u0111\xF3 chuy\u1EC3n sang megabytes
print(f"RAM used: {psutil.Process().memory_info().rss / (1024 * 1024):.2f} MB")`,highlighted:`<span class="hljs-keyword">import</span> psutil

<span class="hljs-comment"># Process.memory_info \u0111\u01B0\u1EE3c bi\u1EC3u th\u1ECB b\u1EB1ng bytes, sau \u0111\xF3 chuy\u1EC3n sang megabytes</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;RAM used: <span class="hljs-subst">{psutil.Process().memory_info().rss / (<span class="hljs-number">1024</span> * <span class="hljs-number">1024</span>):<span class="hljs-number">.2</span>f}</span> MB&quot;</span>)`}}),St=new E({props:{code:"RAM used: 5678.33 MB",highlighted:'RAM used: <span class="hljs-number">5678.33</span> MB'}}),Gt=new E({props:{code:`print(f"Number of files in dataset : {pubmed_dataset.dataset_size}")
size_gb = pubmed_dataset.dataset_size / (1024**3)
print(f"Dataset size (cache file) : {size_gb:.2f} GB")`,highlighted:`<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Number of files in dataset : <span class="hljs-subst">{pubmed_dataset.dataset_size}</span>&quot;</span>)
size_gb = pubmed_dataset.dataset_size / (<span class="hljs-number">1024</span>**<span class="hljs-number">3</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Dataset size (cache file) : <span class="hljs-subst">{size_gb:<span class="hljs-number">.2</span>f}</span> GB&quot;</span>)`}}),Lt=new E({props:{code:`Number of files in dataset : 20979437051
Dataset size (cache file) : 19.54 GB`,highlighted:`Number of files <span class="hljs-keyword">in</span> dataset : <span class="hljs-number">20979437051</span>
Dataset size (cache file) : <span class="hljs-number">19.54</span> GB`}}),ut=new _e({props:{$$slots:{default:[uh]},$$scope:{ctx:G}}}),Vt=new E({props:{code:`import timeit

code_snippet = """batch_size = 1000

for idx in range(0, len(pubmed_dataset), batch_size):
    _ = pubmed_dataset[idx:idx + batch_size]
"""

time = timeit.timeit(stmt=code_snippet, number=1, globals=globals())
print(
    f"Iterated over {len(pubmed_dataset)} examples (about {size_gb:.1f} GB) in "
    f"{time:.1f}s, i.e. {size_gb/time:.3f} GB/s"
)`,highlighted:`<span class="hljs-keyword">import</span> timeit

code_snippet = <span class="hljs-string">&quot;&quot;&quot;batch_size = 1000

for idx in range(0, len(pubmed_dataset), batch_size):
    _ = pubmed_dataset[idx:idx + batch_size]
&quot;&quot;&quot;</span>

time = timeit.timeit(stmt=code_snippet, number=<span class="hljs-number">1</span>, <span class="hljs-built_in">globals</span>=<span class="hljs-built_in">globals</span>())
<span class="hljs-built_in">print</span>(
    <span class="hljs-string">f&quot;Iterated over <span class="hljs-subst">{<span class="hljs-built_in">len</span>(pubmed_dataset)}</span> examples (about <span class="hljs-subst">{size_gb:<span class="hljs-number">.1</span>f}</span> GB) in &quot;</span>
    <span class="hljs-string">f&quot;<span class="hljs-subst">{time:<span class="hljs-number">.1</span>f}</span>s, i.e. <span class="hljs-subst">{size_gb/time:<span class="hljs-number">.3</span>f}</span> GB/s&quot;</span>
)`}}),Wt=new E({props:{code:"'Iterated over 15518009 examples (about 19.5 GB) in 64.2s, i.e. 0.304 GB/s'",highlighted:'<span class="hljs-string">&#x27;Iterated over 15518009 examples (about 19.5 GB) in 64.2s, i.e. 0.304 GB/s&#x27;</span>'}}),mt=new _e({props:{$$slots:{default:[mh]},$$scope:{ctx:G}}}),Qt=new Bs({}),Yt=new E({props:{code:`pubmed_dataset_streamed = load_dataset(
    "json", data_files=data_files, split="train", streaming=True
)`,highlighted:`pubmed_dataset_streamed = load_dataset(
    <span class="hljs-string">&quot;json&quot;</span>, data_files=data_files, split=<span class="hljs-string">&quot;train&quot;</span>, streaming=<span class="hljs-literal">True</span>
)`}}),Zt=new E({props:{code:"next(iter(pubmed_dataset_streamed))",highlighted:'<span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(pubmed_dataset_streamed))'}}),Xt=new E({props:{code:`{'meta': {'pmid': 11409574, 'language': 'eng'},
 'text': 'Epidemiology of hypoxaemia in children with acute lower respiratory infection.\\nTo determine the prevalence of hypoxaemia in children aged under 5 years suffering acute lower respiratory infections (ALRI), the risk factors for hypoxaemia in children under 5 years of age with ALRI, and the association of hypoxaemia with an increased risk of dying in children of the same age ...'}`,highlighted:`{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409574</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Epidemiology of hypoxaemia in children with acute lower respiratory infection.\\nTo determine the prevalence of hypoxaemia in children aged under 5 years suffering acute lower respiratory infections (ALRI), the risk factors for hypoxaemia in children under 5 years of age with ALRI, and the association of hypoxaemia with an increased risk of dying in children of the same age ...&#x27;</span>}`}}),tn=new E({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
tokenized_dataset = pubmed_dataset_streamed.map(lambda x: tokenizer(x["text"]))
next(iter(tokenized_dataset))`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
tokenized_dataset = pubmed_dataset_streamed.<span class="hljs-built_in">map</span>(<span class="hljs-keyword">lambda</span> x: tokenizer(x[<span class="hljs-string">&quot;text&quot;</span>]))
<span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(tokenized_dataset))`}}),nn=new E({props:{code:"{'input_ids': [101, 4958, 5178, 4328, 6779, ...], 'attention_mask': [1, 1, 1, 1, 1, ...]}",highlighted:'{<span class="hljs-string">&#x27;input_ids&#x27;</span>: [<span class="hljs-number">101</span>, <span class="hljs-number">4958</span>, <span class="hljs-number">5178</span>, <span class="hljs-number">4328</span>, <span class="hljs-number">6779</span>, ...], <span class="hljs-string">&#x27;attention_mask&#x27;</span>: [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, ...]}'}}),dt=new _e({props:{$$slots:{default:[gh]},$$scope:{ctx:G}}}),en=new E({props:{code:`shuffled_dataset = pubmed_dataset_streamed.shuffle(buffer_size=10_000, seed=42)
next(iter(shuffled_dataset))`,highlighted:`shuffled_dataset = pubmed_dataset_streamed.shuffle(buffer_size=<span class="hljs-number">10_000</span>, seed=<span class="hljs-number">42</span>)
<span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(shuffled_dataset))`}}),sn=new E({props:{code:`{'meta': {'pmid': 11410799, 'language': 'eng'},
 'text': 'Randomized study of dose or schedule modification of granulocyte colony-stimulating factor in platinum-based chemotherapy for elderly patients with lung cancer ...'}`,highlighted:`{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11410799</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Randomized study of dose or schedule modification of granulocyte colony-stimulating factor in platinum-based chemotherapy for elderly patients with lung cancer ...&#x27;</span>}`}}),an=new E({props:{code:`dataset_head = pubmed_dataset_streamed.take(5)
list(dataset_head)`,highlighted:`dataset_head = pubmed_dataset_streamed.take(<span class="hljs-number">5</span>)
<span class="hljs-built_in">list</span>(dataset_head)`}}),ln=new E({props:{code:`[{'meta': {'pmid': 11409574, 'language': 'eng'},
  'text': 'Epidemiology of hypoxaemia in children with acute lower respiratory infection ...'},
 {'meta': {'pmid': 11409575, 'language': 'eng'},
  'text': 'Clinical signs of hypoxaemia in children with acute lower respiratory infection: indicators of oxygen therapy ...'},
 {'meta': {'pmid': 11409576, 'language': 'eng'},
  'text': "Hypoxaemia in children with severe pneumonia in Papua New Guinea ..."},
 {'meta': {'pmid': 11409577, 'language': 'eng'},
  'text': 'Oxygen concentrators and cylinders ...'},
 {'meta': {'pmid': 11409578, 'language': 'eng'},
  'text': 'Oxygen supply in rural africa: a personal experience ...'}]`,highlighted:`[{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409574</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Epidemiology of hypoxaemia in children with acute lower respiratory infection ...&#x27;</span>},
 {<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409575</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Clinical signs of hypoxaemia in children with acute lower respiratory infection: indicators of oxygen therapy ...&#x27;</span>},
 {<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409576</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&quot;Hypoxaemia in children with severe pneumonia in Papua New Guinea ...&quot;</span>},
 {<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409577</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Oxygen concentrators and cylinders ...&#x27;</span>},
 {<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409578</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Oxygen supply in rural africa: a personal experience ...&#x27;</span>}]`}}),hn=new E({props:{code:`# B\u1ECF qua 1,000 m\u1EABu \u0111\u1EA7u ti\xEAn v\xE0 \u0111\u01B0a ph\u1EA7n c\xF2n l\u1EA1i v\xE0o t\u1EADp hu\u1EA5n luy\u1EC7n
train_dataset = shuffled_dataset.skip(1000)
# L\u1EA5y 1,000 v\xED d\u1EE5 \u0111\u1EA7u ti\xEAn cho t\u1EADp ki\u1EC3m \u0111\u1ECBnh
validation_dataset = shuffled_dataset.take(1000)`,highlighted:`<span class="hljs-comment"># B\u1ECF qua 1,000 m\u1EABu \u0111\u1EA7u ti\xEAn v\xE0 \u0111\u01B0a ph\u1EA7n c\xF2n l\u1EA1i v\xE0o t\u1EADp hu\u1EA5n luy\u1EC7n</span>
train_dataset = shuffled_dataset.skip(<span class="hljs-number">1000</span>)
<span class="hljs-comment"># L\u1EA5y 1,000 v\xED d\u1EE5 \u0111\u1EA7u ti\xEAn cho t\u1EADp ki\u1EC3m \u0111\u1ECBnh</span>
validation_dataset = shuffled_dataset.take(<span class="hljs-number">1000</span>)`}}),cn=new E({props:{code:`law_dataset_streamed = load_dataset(
    "json",
    data_files="https://the-eye.eu/public/AI/pile_preliminary_components/FreeLaw_Opinions.jsonl.zst",
    split="train",
    streaming=True,
)
next(iter(law_dataset_streamed))`,highlighted:`law_dataset_streamed = load_dataset(
    <span class="hljs-string">&quot;json&quot;</span>,
    data_files=<span class="hljs-string">&quot;https://the-eye.eu/public/AI/pile_preliminary_components/FreeLaw_Opinions.jsonl.zst&quot;</span>,
    split=<span class="hljs-string">&quot;train&quot;</span>,
    streaming=<span class="hljs-literal">True</span>,
)
<span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(law_dataset_streamed))`}}),rn=new E({props:{code:`{'meta': {'case_ID': '110921.json',
  'case_jurisdiction': 'scotus.tar.gz',
  'date_created': '2010-04-28T17:12:49Z'},
 'text': '\\n461 U.S. 238 (1983)\\nOLIM ET AL.\\nv.\\nWAKINEKONA\\nNo. 81-1581.\\nSupreme Court of United States.\\nArgued January 19, 1983.\\nDecided April 26, 1983.\\nCERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT\\n*239 Michael A. Lilly, First Deputy Attorney General of Hawaii, argued the cause for petitioners. With him on the brief was James H. Dannenberg, Deputy Attorney General...'}`,highlighted:`{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;case_ID&#x27;</span>: <span class="hljs-string">&#x27;110921.json&#x27;</span>,
  <span class="hljs-string">&#x27;case_jurisdiction&#x27;</span>: <span class="hljs-string">&#x27;scotus.tar.gz&#x27;</span>,
  <span class="hljs-string">&#x27;date_created&#x27;</span>: <span class="hljs-string">&#x27;2010-04-28T17:12:49Z&#x27;</span>},
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;\\n461 U.S. 238 (1983)\\nOLIM ET AL.\\nv.\\nWAKINEKONA\\nNo. 81-1581.\\nSupreme Court of United States.\\nArgued January 19, 1983.\\nDecided April 26, 1983.\\nCERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT\\n*239 Michael A. Lilly, First Deputy Attorney General of Hawaii, argued the cause for petitioners. With him on the brief was James H. Dannenberg, Deputy Attorney General...&#x27;</span>}`}}),pn=new E({props:{code:`from itertools import islice
from datasets import interleave_datasets

combined_dataset = interleave_datasets([pubmed_dataset_streamed, law_dataset_streamed])
list(islice(combined_dataset, 2))`,highlighted:`<span class="hljs-keyword">from</span> itertools <span class="hljs-keyword">import</span> islice
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> interleave_datasets

combined_dataset = interleave_datasets([pubmed_dataset_streamed, law_dataset_streamed])
<span class="hljs-built_in">list</span>(islice(combined_dataset, <span class="hljs-number">2</span>))`}}),on=new E({props:{code:`[{'meta': {'pmid': 11409574, 'language': 'eng'},
  'text': 'Epidemiology of hypoxaemia in children with acute lower respiratory infection ...'},
 {'meta': {'case_ID': '110921.json',
   'case_jurisdiction': 'scotus.tar.gz',
   'date_created': '2010-04-28T17:12:49Z'},
  'text': '\\n461 U.S. 238 (1983)\\nOLIM ET AL.\\nv.\\nWAKINEKONA\\nNo. 81-1581.\\nSupreme Court of United States.\\nArgued January 19, 1983.\\nDecided April 26, 1983.\\nCERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT\\n*239 Michael A. Lilly, First Deputy Attorney General of Hawaii, argued the cause for petitioners. With him on the brief was James H. Dannenberg, Deputy Attorney General...'}]`,highlighted:`[{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pmid&#x27;</span>: <span class="hljs-number">11409574</span>, <span class="hljs-string">&#x27;language&#x27;</span>: <span class="hljs-string">&#x27;eng&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;Epidemiology of hypoxaemia in children with acute lower respiratory infection ...&#x27;</span>},
 {<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;case_ID&#x27;</span>: <span class="hljs-string">&#x27;110921.json&#x27;</span>,
   <span class="hljs-string">&#x27;case_jurisdiction&#x27;</span>: <span class="hljs-string">&#x27;scotus.tar.gz&#x27;</span>,
   <span class="hljs-string">&#x27;date_created&#x27;</span>: <span class="hljs-string">&#x27;2010-04-28T17:12:49Z&#x27;</span>},
  <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;\\n461 U.S. 238 (1983)\\nOLIM ET AL.\\nv.\\nWAKINEKONA\\nNo. 81-1581.\\nSupreme Court of United States.\\nArgued January 19, 1983.\\nDecided April 26, 1983.\\nCERTIORARI TO THE UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT\\n*239 Michael A. Lilly, First Deputy Attorney General of Hawaii, argued the cause for petitioners. With him on the brief was James H. Dannenberg, Deputy Attorney General...&#x27;</span>}]`}}),un=new E({props:{code:`base_url = "https://the-eye.eu/public/AI/pile/"
data_files = {
    "train": [base_url + "train/" + f"{idx:02d}.jsonl.zst" for idx in range(30)],
    "validation": base_url + "val.jsonl.zst",
    "test": base_url + "test.jsonl.zst",
}
pile_dataset = load_dataset("json", data_files=data_files, streaming=True)
next(iter(pile_dataset["train"]))`,highlighted:`base_url = <span class="hljs-string">&quot;https://the-eye.eu/public/AI/pile/&quot;</span>
data_files = {
    <span class="hljs-string">&quot;train&quot;</span>: [base_url + <span class="hljs-string">&quot;train/&quot;</span> + <span class="hljs-string">f&quot;<span class="hljs-subst">{idx:02d}</span>.jsonl.zst&quot;</span> <span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">30</span>)],
    <span class="hljs-string">&quot;validation&quot;</span>: base_url + <span class="hljs-string">&quot;val.jsonl.zst&quot;</span>,
    <span class="hljs-string">&quot;test&quot;</span>: base_url + <span class="hljs-string">&quot;test.jsonl.zst&quot;</span>,
}
pile_dataset = load_dataset(<span class="hljs-string">&quot;json&quot;</span>, data_files=data_files, streaming=<span class="hljs-literal">True</span>)
<span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(pile_dataset[<span class="hljs-string">&quot;train&quot;</span>]))`}}),mn=new E({props:{code:`{'meta': {'pile_set_name': 'Pile-CC'},
 'text': 'It is done, and submitted. You can play \u201CSurvival of the Tastiest\u201D on Android, and on the web...'}`,highlighted:`{<span class="hljs-string">&#x27;meta&#x27;</span>: {<span class="hljs-string">&#x27;pile_set_name&#x27;</span>: <span class="hljs-string">&#x27;Pile-CC&#x27;</span>},
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;It is done, and submitted. You can play \u201CSurvival of the Tastiest\u201D on Android, and on the web...&#x27;</span>}`}}),yt=new _e({props:{$$slots:{default:[dh]},$$scope:{ctx:G}}}),{c(){p=l("meta"),I=o(),g=l("h1"),k=l("a"),w=l("span"),f(d.$$.fragment),P=o(),A=l("span"),x=s("D\u1EEF li\u1EC7u l\u1EDBn? \u{1F917} B\u1ED9 d\u1EEF li\u1EC7u \u0111\u1EC3 gi\u1EA3i c\u1EE9u!"),j=o(),f(T.$$.fragment),q=o(),D=l("p"),B=s("Ng\xE0y nay, kh\xF4ng c\xF3 g\xEC l\u1EA1 khi b\u1EA1n \u0111ang l\xE0m vi\u1EC7c v\u1EDBi c\xE1c b\u1ED9 d\u1EEF li\u1EC7u nhi\u1EC1u gigabyte, \u0111\u1EB7c bi\u1EC7t n\u1EBFu b\u1EA1n \u0111ang c\xF3 k\u1EBF ho\u1EA1ch hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc m\u1ED9t m\xF4 h\xECnh Transformer nh\u01B0 BERT ho\u1EB7c GPT-2 t\u1EEB \u0111\u1EA7u. Trong nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p n\xE0y, th\u1EADm ch\xED "),C=l("em"),O=s("t\u1EA3i"),nt=s(" d\u1EEF li\u1EC7u c\xF3 th\u1EC3 l\xE0 m\u1ED9t th\xE1ch th\u1EE9c. V\xED d\u1EE5: kho d\u1EEF li\u1EC7u WebText \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng \u0111\u1EC3 hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc GPT-2 bao g\u1ED3m h\u01A1n 8 tri\u1EC7u t\xE0i li\u1EC7u v\xE0 40 GB v\u0103n b\u1EA3n - vi\u1EC7c t\u1EA3i d\u1EEF li\u1EC7u n\xE0y v\xE0o RAM c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay c\u1EE7a b\u1EA1n c\xF3 th\u1EC3 khi\u1EBFn b\u1EA1n b\u1ECB \u0111au tim!"),K=o(),M=l("p"),et=s("May m\u1EAFn thay, \u{1F917} Datasets \u0111\xE3 \u0111\u01B0\u1EE3c thi\u1EBFt k\u1EBF \u0111\u1EC3 kh\u1EAFc ph\u1EE5c nh\u1EEFng h\u1EA1n ch\u1EBF n\xE0y. N\xF3 gi\u1EA3i ph\xF3ng b\u1EA1n kh\u1ECFi c\xE1c v\u1EA5n \u0111\u1EC1 v\u1EC1 qu\u1EA3n l\xFD b\u1ED9 nh\u1EDB b\u1EB1ng c\xE1ch coi c\xE1c t\u1EADp d\u1EEF li\u1EC7u l\xE0 t\u1EC7p "),qn=l("em"),Ms=s("\xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),Ns=s(" v\xE0 tho\xE1t kh\u1ECFi gi\u1EDBi h\u1EA1n \u1ED5 c\u1EE9ng b\u1EB1ng c\xE1ch "),Cn=l("em"),Rs=s("truy\u1EC1n t\u1EA3i tr\u1EF1c ti\u1EBFp"),Ss=s(" c\xE1c m\u1EE5c trong m\u1ED9t kho ng\u1EEF li\u1EC7u."),ve=o(),f(jt.$$.fragment),$e=o(),lt=l("p"),Gs=s("Trong ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD kh\xE1m ph\xE1 c\xE1c t\xEDnh n\u0103ng n\xE0y c\u1EE7a \u{1F917} Datasets v\u1EDBi kho d\u1EEF li\u1EC7u 825 GB kh\u1ED5ng l\u1ED3 \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),kt=l("a"),Ls=s("Pile"),Hs=s(". B\u1EAFt \u0111\u1EA7u th\xF4i!"),xe=o(),st=l("h2"),ht=l("a"),In=l("span"),f(Et.$$.fragment),Us=o(),On=l("span"),Fs=s("Pile l\xE0 g\xEC?"),je=o(),z=l("p"),Ks=s("The Pile l\xE0 m\u1ED9t kho ng\u1EEF li\u1EC7u ti\u1EBFng Anh \u0111\u01B0\u1EE3c t\u1EA1o ra b\u1EDFi "),wt=l("a"),Js=s("EleutherAI"),Vs=s(" \u0111\u1EC3 hu\u1EA5n luy\u1EC7n c\xE1c m\xF4 h\xECnh ng\xF4n ng\u1EEF quy m\xF4 l\u1EDBn. N\xF3 bao g\u1ED3m m\u1ED9t lo\u1EA1t c\xE1c b\u1ED9 d\u1EEF li\u1EC7u, c\xE1c b\xE0i b\xE1o khoa h\u1ECDc tr\u1EA3i d\xE0i, kho m\xE3 GitHub v\xE0 v\u0103n b\u1EA3n web \u0111\u01B0\u1EE3c l\u1ECDc. Kho t\xE0i li\u1EC7u hu\u1EA5n luy\u1EC7n c\xF3 s\u1EB5n trong "),At=l("a"),Ws=s("kh\u1ED1i 14GB"),Qs=s(" v\xE0 b\u1EA1n c\u0169ng c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng m\u1ED9t s\u1ED1 "),Tt=l("a"),Ys=s("th\xE0nh ph\u1EA7n ri\xEAng l\u1EBB"),Zs=s(". H\xE3y b\u1EAFt \u0111\u1EA7u b\u1EB1ng c\xE1ch xem qua t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, t\u1EADp d\u1EEF li\u1EC7u t\xF3m t\u1EAFt t\u1EEB 15 tri\u1EC7u \u1EA5n ph\u1EA9m y sinh tr\xEAn "),Dt=l("a"),Xs=s("PubMed"),ta=s(". T\u1EADp d\u1EEF li\u1EC7u \u1EDF "),Pt=l("a"),na=s("\u0111\u1ECBnh d\u1EA1ng JSON Lines"),ea=s(" v\xE0 \u0111\u01B0\u1EE3c n\xE9n b\u1EB1ng th\u01B0 vi\u1EC7n "),zn=l("code"),sa=s("zstandard"),aa=s(", v\xEC v\u1EADy tr\u01B0\u1EDBc ti\xEAn ch\xFAng ta c\u1EA7n c\xE0i \u0111\u1EB7t:"),ke=o(),f(qt.$$.fragment),Ee=o(),ct=l("p"),ia=s("Ti\u1EBFp theo, ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u b\u1EB1ng ph\u01B0\u01A1ng ph\xE1p cho c\xE1c t\u1EC7p t\u1EEB xa m\xE0 ch\xFAng ta \u0111\xE3 h\u1ECDc trong "),fn=l("a"),la=s("ph\u1EA7n 2"),ha=s(":"),we=o(),f(Ct.$$.fragment),Ae=o(),f(It.$$.fragment),Te=o(),bn=l("p"),ca=s("Ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng c\xF3 15,518,009 h\xE0ng v\xE0 2 c\u1ED9t trong t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a ch\xFAng t\xF4i - \u0111\xF3 l\xE0 r\u1EA5t nhi\u1EC1u!"),De=o(),f(rt.$$.fragment),Pe=o(),yn=l("p"),ra=s("H\xE3y ki\u1EC3m tra n\u1ED9i dung c\u1EE7a m\u1EABu \u0111\u1EA7u ti\xEAn:"),qe=o(),f(Ot.$$.fragment),Ce=o(),f(zt.$$.fragment),Ie=o(),_n=l("p"),pa=s("\u0110\u01B0\u1EE3c r\u1ED3i, \u0111\xE2y gi\u1ED1ng nh\u01B0 ph\u1EA7n t\xF3m t\u1EAFt t\u1EEB m\u1ED9t b\xE0i b\xE1o y khoa. B\xE2y gi\u1EDD ch\xFAng ta h\xE3y xem ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng bao nhi\xEAu RAM \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u!"),Oe=o(),at=l("h2"),pt=l("a"),Bn=l("span"),f(Bt.$$.fragment),oa=o(),Mn=l("span"),ua=s("S\u1EF1 k\u1EF3 di\u1EC7u c\u1EE7a \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),ze=o(),J=l("p"),ma=s("M\u1ED9t c\xE1ch \u0111\u01A1n gi\u1EA3n \u0111\u1EC3 \u0111o m\u1EE9c s\u1EED d\u1EE5ng b\u1ED9 nh\u1EDB trong Python l\xE0 s\u1EED d\u1EE5ng th\u01B0 vi\u1EC7n "),Mt=l("a"),Nn=l("code"),ga=s("psutil"),da=s(", c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c c\xE0i \u0111\u1EB7t b\u1EB1ng "),Rn=l("code"),fa=s("pip"),ba=s(" nh\u01B0 sau:"),Be=o(),f(Nt.$$.fragment),Me=o(),ot=l("p"),ya=s("N\xF3 cung c\u1EA5p m\u1ED9t l\u1EDBp "),Sn=l("code"),_a=s("Process"),va=s(" cho ph\xE9p ch\xFAng ta ki\u1EC3m tra vi\u1EC7c s\u1EED d\u1EE5ng b\u1ED9 nh\u1EDB c\u1EE7a ti\u1EBFn tr\xECnh hi\u1EC7n t\u1EA1i nh\u01B0 sau:"),Ne=o(),f(Rt.$$.fragment),Re=o(),f(St.$$.fragment),Se=o(),L=l("p"),$a=s("\u1EDE \u0111\xE2y thu\u1ED9c t\xEDnh "),Gn=l("code"),xa=s("rss"),ja=s(" \u0111\u1EC1 c\u1EADp \u0111\u1EBFn "),Ln=l("em"),ka=s("resident set size"),Ea=s(", l\xE0 ph\u1EA7n b\u1ED9 nh\u1EDB m\xE0 m\u1ED9t ti\u1EBFn tr\xECnh chi\u1EBFm trong RAM. Ph\xE9p \u0111o n\xE0y c\u0169ng bao g\u1ED3m b\u1ED9 nh\u1EDB \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng b\u1EDFi tr\xECnh th\xF4ng d\u1ECBch Python v\xE0 c\xE1c th\u01B0 vi\u1EC7n m\xE0 ch\xFAng t\xF4i \u0111\xE3 t\u1EA3i, do \u0111\xF3, l\u01B0\u1EE3ng b\u1ED9 nh\u1EDB th\u1EF1c t\u1EBF \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u nh\u1ECF h\u01A1n m\u1ED9t ch\xFAt. \u0110\u1EC3 so s\xE1nh, h\xE3y xem t\u1EADp d\u1EEF li\u1EC7u tr\xEAn \u0111\u0129a l\u1EDBn nh\u01B0 th\u1EBF n\xE0o, s\u1EED d\u1EE5ng thu\u1ED9c t\xEDnh "),Hn=l("code"),wa=s("dataset_size"),Aa=s(". V\xEC k\u1EBFt qu\u1EA3 \u0111\u01B0\u1EE3c th\u1EC3 hi\u1EC7n b\u1EB1ng byte nh\u01B0 tr\u01B0\u1EDBc \u0111\xE2y, ch\xFAng t\xF4i c\u1EA7n chuy\u1EC3n \u0111\u1ED5i th\u1EE7 c\xF4ng n\xF3 th\xE0nh gigabyte:"),Ge=o(),f(Gt.$$.fragment),Le=o(),f(Lt.$$.fragment),He=o(),vn=l("p"),Ta=s("Tuy\u1EC7t v\u1EDDi - m\u1EB7c d\xF9 n\xF3 g\u1EA7n 20 GB, ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i v\xE0 truy c\u1EADp t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi RAM \xEDt h\u01A1n nhi\u1EC1u!"),Ue=o(),f(ut.$$.fragment),Fe=o(),V=l("p"),Da=s("N\u1EBFu b\u1EA1n \u0111\xE3 quen thu\u1ED9c v\u1EDBi Pandas, k\u1EBFt qu\u1EA3 n\xE0y c\xF3 th\u1EC3 g\xE2y b\u1EA5t ng\u1EDD v\xEC theo "),Ht=l("a"),Pa=s("quy t\u1EAFc ng\xF3n tay c\xE1i"),qa=s(" n\u1ED5i ti\u1EBFng c\u1EE7a Wes Kinney, b\u1EA1n th\u01B0\u1EDDng c\u1EA7n g\u1EA5p 5 g\u1EA5p 10 l\u1EA7n RAM so v\u1EDBi k\xEDch th\u01B0\u1EDBc c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n. V\u1EADy \u{1F917} Datasets gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 qu\u1EA3n l\xFD b\u1ED9 nh\u1EDB n\xE0y nh\u01B0 th\u1EBF n\xE0o? \u{1F917} Datasets coi m\u1ED7i t\u1EADp d\u1EEF li\u1EC7u nh\u01B0 m\u1ED9t "),Ut=l("a"),Ca=s("t\u1EC7p \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),Ia=s(", cung c\u1EA5p \xE1nh x\u1EA1 gi\u1EEFa RAM v\xE0 b\u1ED9 nh\u1EDB h\u1EC7 th\u1ED1ng t\u1EC7p cho ph\xE9p th\u01B0 vi\u1EC7n truy c\u1EADp v\xE0 ho\u1EA1t \u0111\u1ED9ng tr\xEAn c\xE1c ph\u1EA7n t\u1EED c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u m\xE0 kh\xF4ng c\u1EA7n t\u1EA3i \u0111\u1EA7y \u0111\u1EE7 v\xE0o b\u1ED9 nh\u1EDB."),Ke=o(),N=l("p"),Oa=s("C\xE1c t\u1EC7p \u0111\u01B0\u1EE3c \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB c\u0169ng c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c chia s\u1EBB tr\xEAn nhi\u1EC1u quy tr\xECnh, cho ph\xE9p c\xE1c ph\u01B0\u01A1ng th\u1EE9c nh\u01B0 "),Un=l("code"),za=s("Dataset.map()"),Ba=s(" \u0111\u01B0\u1EE3c th\u1EF1c thi song song m\xE0 kh\xF4ng c\u1EA7n di chuy\u1EC3n ho\u1EB7c sao ch\xE9p t\u1EADp d\u1EEF li\u1EC7u. B\xEAn c\u1EA1nh \u0111\xF3, t\u1EA5t c\u1EA3 c\xE1c kh\u1EA3 n\u0103ng n\xE0y \u0111\u1EC1u \u0111\u01B0\u1EE3c th\u1EF1c hi\u1EC7n b\u1EDFi \u0111\u1ECBnh d\u1EA1ng b\u1ED9 nh\u1EDB "),Ft=l("a"),Ma=s("Apache Arrow"),Na=s(" v\xE0 th\u01B0 vi\u1EC7n"),Kt=l("a"),Fn=l("code"),Ra=s("pyarrow"),Sa=s(", gi\xFAp t\u1EA3i v\xE0 x\u1EED l\xFD d\u1EEF li\u1EC7u nhanh nh\u01B0 ch\u1EDBp. (\u0110\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt v\u1EC1 Apache Arrow v\xE0 so s\xE1nh v\u1EDBi Pandas, h\xE3y xem "),Jt=l("a"),Ga=s("B\xE0i \u0111\u0103ng tr\xEAn blog c\u1EE7a Dejan Simic"),La=s(".) trong th\u1EF1c t\u1EBF, h\xE3y ch\u1EA1y m\u1ED9t b\xE0i ki\u1EC3m tra t\u1ED1c \u0111\u1ED9 nh\u1ECF b\u1EB1ng c\xE1ch l\u1EB7p l\u1EA1i t\u1EA5t c\u1EA3 c\xE1c ph\u1EA7n t\u1EED trong t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts:"),Je=o(),f(Vt.$$.fragment),Ve=o(),f(Wt.$$.fragment),We=o(),W=l("p"),Ha=s("\u1EDE \u0111\xE2y ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng m\xF4-\u0111un "),Kn=l("code"),Ua=s("timeit"),Fa=s(" c\u1EE7a Python \u0111\u1EC3 \u0111o th\u1EDDi gian th\u1EF1c thi \u0111\u01B0\u1EE3c th\u1EF1c hi\u1EC7n b\u1EDFi "),Jn=l("code"),Ka=s("code_snippet"),Ja=s(". Th\xF4ng th\u01B0\u1EDDng, b\u1EA1n s\u1EBD c\xF3 th\u1EC3 l\u1EB7p l\u1EA1i t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi t\u1ED1c \u0111\u1ED9 t\u1EEB v\xE0i ph\u1EA7n m\u01B0\u1EDDi GB/s \u0111\u1EBFn v\xE0i GB/s. \u0110i\u1EC1u n\xE0y ho\u1EA1t \u0111\u1ED9ng hi\u1EC7u qu\u1EA3 v\u1EDBi \u0111\u1EA1i \u0111a s\u1ED1 c\xE1c \u1EE9ng d\u1EE5ng, nh\u01B0ng \u0111\xF4i khi b\u1EA1n s\u1EBD ph\u1EA3i l\xE0m vi\u1EC7c v\u1EDBi m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u qu\xE1 l\u1EDBn, th\u1EADm ch\xED kh\xF4ng th\u1EC3 l\u01B0u tr\u1EEF tr\xEAn \u1ED5 c\u1EE9ng c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay c\u1EE7a b\u1EA1n. V\xED d\u1EE5: n\u1EBFu ch\xFAng t\xF4i c\u1ED1 g\u1EAFng t\u1EA3i xu\u1ED1ng to\xE0n b\u1ED9 Pile, ch\xFAng t\xF4i s\u1EBD c\u1EA7n 825 GB dung l\u01B0\u1EE3ng \u0111\u0129a tr\u1ED1ng! \u0110\u1EC3 x\u1EED l\xFD nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p n\xE0y, \u{1F917} Datasets cung c\u1EA5p t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn cho ph\xE9p ch\xFAng t\xF4i t\u1EA3i xu\u1ED1ng v\xE0 truy c\u1EADp c\xE1c ph\u1EA7n t\u1EED m\u1ED9t c\xE1ch nhanh ch\xF3ng m\xE0 kh\xF4ng c\u1EA7n t\u1EA3i xu\u1ED1ng to\xE0n b\u1ED9 t\u1EADp d\u1EEF li\u1EC7u. Ch\xFAng ta h\xE3y xem c\xE1ch n\xE0y ho\u1EA1t \u0111\u1ED9ng nh\u01B0 th\u1EBF n\xE0o."),Qe=o(),f(mt.$$.fragment),Ye=o(),it=l("h2"),gt=l("a"),Vn=l("span"),f(Qt.$$.fragment),Va=o(),Wn=l("span"),Wa=s("Truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u"),Ze=o(),Q=l("p"),Qa=s("\u0110\u1EC3 b\u1EADt t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u, b\u1EA1n ch\u1EC9 c\u1EA7n truy\u1EC1n tham s\u1ED1 "),Qn=l("code"),Ya=s("streaming=True"),Za=s(" v\xE0o h\xE0m "),Yn=l("code"),Xa=s("load_dataset()"),ti=s(". V\xED d\u1EE5: h\xE3y t\u1EA3i l\u1EA1i t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, nh\u01B0ng \u1EDF ch\u1EBF \u0111\u1ED9 ph\xE1t tr\u1EF1c tuy\u1EBFn:"),Xe=o(),f(Yt.$$.fragment),ts=o(),R=l("p"),ni=s("Thay v\xEC "),Zn=l("code"),ei=s("Dataset"),si=s(" quen thu\u1ED9c m\xE0 ch\xFAng ta \u0111\xE3 g\u1EB7p \u1EDF nh\u1EEFng n\u01A1i kh\xE1c trong ch\u01B0\u01A1ng n\xE0y, \u0111\u1ED1i t\u01B0\u1EE3ng \u0111\u01B0\u1EE3c tr\u1EA3 v\u1EC1 v\u1EDBi "),Xn=l("code"),ai=s("streaming=True"),ii=s(" l\xE0 m\u1ED9t "),te=l("code"),li=s("IterableDataset"),hi=s(". Nh\u01B0 c\xE1i t\xEAn cho th\u1EA5y, \u0111\u1EC3 truy c\u1EADp c\xE1c ph\u1EA7n t\u1EED c\u1EE7a m\u1ED9t "),ne=l("code"),ci=s("IterableDataset"),ri=s(", ch\xFAng ta c\u1EA7n ph\u1EA3i l\u1EB7p l\u1EA1i n\xF3. Ch\xFAng t\xF4i c\xF3 th\u1EC3 truy c\u1EADp ph\u1EA7n t\u1EED \u0111\u1EA7u ti\xEAn c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c ph\xE1t tr\u1EF1c tuy\u1EBFn c\u1EE7a ch\xFAng t\xF4i nh\u01B0 sau:"),ns=o(),f(Zt.$$.fragment),es=o(),f(Xt.$$.fragment),ss=o(),Y=l("p"),pi=s("C\xE1c ph\u1EA7n t\u1EED t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c truy\u1EC1n tr\u1EF1c tuy\u1EBFn c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c x\u1EED l\xFD nhanh ch\xF3ng b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),ee=l("code"),oi=s("IterableDataset.map()"),ui=s(", r\u1EA5t h\u1EEFu \xEDch trong qu\xE1 tr\xECnh hu\u1EA5n luy\u1EC7n n\u1EBFu b\u1EA1n c\u1EA7n tokenize c\xE1c \u0111\u1EA7u v\xE0o. Quy tr\xECnh ho\xE0n to\xE0n gi\u1ED1ng v\u1EDBi quy tr\xECnh ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng \u0111\u1EC3 tokenize t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a m\xECnh trong "),$n=l("a"),mi=s("Ch\u01B0\u01A1ng 3"),gi=s(", v\u1EDBi s\u1EF1 kh\xE1c bi\u1EC7t duy nh\u1EA5t l\xE0 c\xE1c \u0111\u1EA7u ra \u0111\u01B0\u1EE3c tr\u1EA3 v\u1EC1 t\u1EEBng c\xE1i m\u1ED9t:"),as=o(),f(tn.$$.fragment),is=o(),f(nn.$$.fragment),ls=o(),f(dt.$$.fragment),hs=o(),H=l("p"),di=s("B\u1EA1n c\u0169ng c\xF3 th\u1EC3 x\xE1o tr\u1ED9n m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c ph\xE1t tr\u1EF1c tuy\u1EBFn b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),se=l("code"),fi=s("IterableDataset.shuffle()"),bi=s(", nh\u01B0ng kh\xF4ng gi\u1ED1ng nh\u01B0 "),ae=l("code"),yi=s("Dataset.shuffle()"),_i=s(" \u0111i\u1EC1u n\xE0y ch\u1EC9 x\xE1o tr\u1ED9n c\xE1c ph\u1EA7n t\u1EED trong m\u1ED9t "),ie=l("code"),vi=s("buffer_size"),$i=s(" \u0111\u01B0\u1EE3c \u0111\u1ECBnh tr\u01B0\u1EDBc:"),cs=o(),f(en.$$.fragment),rs=o(),f(sn.$$.fragment),ps=o(),U=l("p"),xi=s("Trong v\xED d\u1EE5 n\xE0y, ch\xFAng ta \u0111\xE3 ch\u1ECDn m\u1ED9t m\u1EABu ng\u1EABu nhi\xEAn t\u1EEB 10,000 m\u1EABu \u0111\u1EA7u ti\xEAn trong b\u1ED9 \u0111\u1EC7m. Khi m\u1ED9t m\u1EABu \u0111\u01B0\u1EE3c truy c\u1EADp, v\u1ECB tr\xED c\u1EE7a n\xF3 trong b\u1ED9 \u0111\u1EC7m s\u1EBD \u0111\u01B0\u1EE3c l\u1EA5p \u0111\u1EA7y b\u1EB1ng v\xED d\u1EE5 ti\u1EBFp theo trong kho t\xE0i li\u1EC7u (t\u1EE9c l\xE0 v\xED d\u1EE5 th\u1EE9 10,001 trong tr\u01B0\u1EDDng h\u1EE3p tr\xEAn). B\u1EA1n c\u0169ng c\xF3 th\u1EC3 ch\u1ECDn c\xE1c ph\u1EA7n t\u1EED t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c truy\u1EC1n tr\u1EF1c tuy\u1EBFn b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng c\xE1c h\xE0m "),le=l("code"),ji=s("IterableDataset.take()"),ki=s(" v\xE0 "),he=l("code"),Ei=s("IterableDataset.skip()"),wi=s(", ho\u1EA1t \u0111\u1ED9ng theo c\xE1ch t\u01B0\u01A1ng t\u1EF1 nh\u01B0 "),ce=l("code"),Ai=s("Dataset.select()"),Ti=s(". V\xED d\u1EE5, \u0111\u1EC3 ch\u1ECDn 5 m\u1EABu \u0111\u1EA7u ti\xEAn trong t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, ch\xFAng ta c\xF3 th\u1EC3 l\xE0m nh\u01B0 sau:"),os=o(),f(an.$$.fragment),us=o(),f(ln.$$.fragment),ms=o(),ft=l("p"),Di=s("T\u01B0\u01A1ng t\u1EF1, b\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng h\xE0m "),re=l("code"),Pi=s("IterableDataset.skip()"),qi=s(" \u0111\u1EC3 t\u1EA1o c\xE1c t\u1EADp hu\u1EA5n luy\u1EC7n v\xE0 ki\u1EC3m \u0111\u1ECBnh t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u x\xE1o tr\u1ED9n nh\u01B0 sau:"),gs=o(),f(hn.$$.fragment),ds=o(),F=l("p"),Ci=s("H\xE3y ho\xE0n th\xE0nh vi\u1EC7c kh\xE1m ph\xE1 c\u1EE7a ch\xFAng ta v\u1EC1 vi\u1EC7c truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi m\u1ED9t \u1EE9ng d\u1EE5ng ph\u1ED5 bi\u1EBFn: k\u1EBFt h\u1EE3p nhi\u1EC1u t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi nhau \u0111\u1EC3 t\u1EA1o ra m\u1ED9t kho d\u1EEF li\u1EC7u duy nh\u1EA5t. \u{1F917} Datasets cung c\u1EA5p m\u1ED9t h\xE0m "),pe=l("code"),Ii=s("interleave_datasets()"),Oi=s(" \u0111\u1EC3 chuy\u1EC3n \u0111\u1ED5i danh s\xE1ch c\xE1c \u0111\u1ED1i t\u01B0\u1EE3ng "),oe=l("code"),zi=s("IterableDataset"),Bi=s(" th\xE0nh m\u1ED9t "),ue=l("code"),Mi=s("IterableDataset"),Ni=s(" duy nh\u1EA5t, trong \u0111\xF3 c\xE1c ph\u1EA7n t\u1EED c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u m\u1EDBi \u0111\u01B0\u1EE3c l\u1EA5y b\u1EB1ng c\xE1ch xen k\u1EBD gi\u1EEFa c\xE1c m\u1EABu g\u1ED1c. H\xE0m n\xE0y \u0111\u1EB7c bi\u1EC7t h\u1EEFu \xEDch khi b\u1EA1n \u0111ang c\u1ED1 g\u1EAFng k\u1EBFt h\u1EE3p c\xE1c t\u1EADp d\u1EEF li\u1EC7u l\u1EDBn, v\xEC v\u1EADy, \u0111\u1EC3 l\xE0m v\xED d\u1EE5, h\xE3y truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp con FreeLaw c\u1EE7a Pile, l\xE0 t\u1EADp d\u1EEF li\u1EC7u 51 GB v\u1EC1 c\xE1c \xFD ki\u1EBFn ph\xE1p l\xFD t\u1EEB c\xE1c t\xF2a \xE1n Hoa K\u1EF3:"),fs=o(),f(cn.$$.fragment),bs=o(),f(rn.$$.fragment),ys=o(),bt=l("p"),Ri=s("T\u1EADp d\u1EEF li\u1EC7u n\xE0y \u0111\u1EE7 l\u1EDBn \u0111\u1EC3 k\xEDch ho\u1EA1t RAM c\u1EE7a h\u1EA7u h\u1EBFt c\xE1c m\xE1y t\xEDnh x\xE1ch tay, nh\u01B0ng ch\xFAng ta v\u1EABn c\xF3 th\u1EC3 t\u1EA3i v\xE0 truy c\u1EADp n\xF3 m\xE0 kh\xF4ng ph\u1EA3i \u0111\u1ED5 m\u1ED3 h\xF4i! B\xE2y gi\u1EDD ch\xFAng ta h\xE3y k\u1EBFt h\u1EE3p c\xE1c m\u1EABu t\u1EEB b\u1ED9 d\u1EEF li\u1EC7u FreeLaw v\xE0 PubMed Abstracts v\u1EDBi h\xE0m "),me=l("code"),Si=s("interleave_datasets()"),Gi=s(":"),_s=o(),f(pn.$$.fragment),vs=o(),f(on.$$.fragment),$s=o(),Z=l("p"),Li=s("\u1EDE \u0111\xE2y ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng h\xE0m "),ge=l("code"),Hi=s("islice()"),Ui=s(" t\u1EEB m\xF4-\u0111un "),de=l("code"),Fi=s("itertools"),Ki=s(" c\u1EE7a Python \u0111\u1EC3 ch\u1ECDn hai m\u1EABu \u0111\u1EA7u ti\xEAn t\u1EEB t\u1EADp d\u1EEF li\u1EC7u k\u1EBFt h\u1EE3p v\xE0 ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng ch\xFAng kh\u1EDBp v\u1EDBi c\xE1c v\xED d\u1EE5 \u0111\u1EA7u ti\xEAn t\u1EEB m\u1ED7i trong hai t\u1EADp d\u1EEF li\u1EC7u ngu\u1ED3n."),xs=o(),xn=l("p"),Ji=s("Cu\u1ED1i c\xF9ng, n\u1EBFu b\u1EA1n mu\u1ED1n ph\xE1t tr\u1EF1c tuy\u1EBFn to\xE0n b\u1ED9 825 GB c\u1EE7a Pile, b\u1EA1n c\xF3 th\u1EC3 l\u1EA5y t\u1EA5t c\u1EA3 c\xE1c t\u1EC7p \u0111\xE3 chu\u1EA9n b\u1ECB nh\u01B0 sau:"),js=o(),f(un.$$.fragment),ks=o(),f(mn.$$.fragment),Es=o(),f(yt.$$.fragment),ws=o(),jn=l("p"),Vi=s("Gi\u1EDD \u0111\xE2y, b\u1EA1n c\xF3 t\u1EA5t c\u1EA3 c\xE1c c\xF4ng c\u1EE5 c\u1EA7n thi\u1EBFt \u0111\u1EC3 t\u1EA3i v\xE0 x\u1EED l\xFD c\xE1c t\u1EADp d\u1EEF li\u1EC7u \u1EDF m\u1ECDi h\xECnh d\u1EA1ng v\xE0 k\xEDch th\u01B0\u1EDBc - nh\u01B0ng tr\u1EEB khi b\u1EA1n \u0111\u1EB7c bi\u1EC7t may m\u1EAFn, s\u1EBD \u0111\u1EBFn m\u1ED9t th\u1EDDi \u0111i\u1EC3m trong h\xE0nh tr\xECnh NLP c\u1EE7a b\u1EA1n, n\u01A1i b\u1EA1n s\u1EBD ph\u1EA3i th\u1EF1c s\u1EF1 t\u1EA1o m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 v\u1EA5n \u0111\u1EC1 trong t\u1EA7m tay. \u0110\xF3 l\xE0 ch\u1EE7 \u0111\u1EC1 c\u1EE7a ph\u1EA7n ti\u1EBFp theo!"),this.h()},l(t){const i=hh('[data-svelte="svelte-1phssyn"]',document.head);p=h(i,"META",{name:!0,content:!0}),i.forEach(e),I=u(t),g=h(t,"H1",{class:!0});var gn=c(g);k=h(gn,"A",{id:!0,class:!0,href:!0});var fe=c(k);w=h(fe,"SPAN",{});var be=c(w);b(d.$$.fragment,be),be.forEach(e),fe.forEach(e),P=u(gn),A=h(gn,"SPAN",{});var ye=c(A);x=a(ye,"D\u1EEF li\u1EC7u l\u1EDBn? \u{1F917} B\u1ED9 d\u1EEF li\u1EC7u \u0111\u1EC3 gi\u1EA3i c\u1EE9u!"),ye.forEach(e),gn.forEach(e),j=u(t),b(T.$$.fragment,t),q=u(t),D=h(t,"P",{});var dn=c(D);B=a(dn,"Ng\xE0y nay, kh\xF4ng c\xF3 g\xEC l\u1EA1 khi b\u1EA1n \u0111ang l\xE0m vi\u1EC7c v\u1EDBi c\xE1c b\u1ED9 d\u1EEF li\u1EC7u nhi\u1EC1u gigabyte, \u0111\u1EB7c bi\u1EC7t n\u1EBFu b\u1EA1n \u0111ang c\xF3 k\u1EBF ho\u1EA1ch hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc m\u1ED9t m\xF4 h\xECnh Transformer nh\u01B0 BERT ho\u1EB7c GPT-2 t\u1EEB \u0111\u1EA7u. Trong nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p n\xE0y, th\u1EADm ch\xED "),C=h(dn,"EM",{});var Wi=c(C);O=a(Wi,"t\u1EA3i"),Wi.forEach(e),nt=a(dn," d\u1EEF li\u1EC7u c\xF3 th\u1EC3 l\xE0 m\u1ED9t th\xE1ch th\u1EE9c. V\xED d\u1EE5: kho d\u1EEF li\u1EC7u WebText \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng \u0111\u1EC3 hu\u1EA5n luy\u1EC7n tr\u01B0\u1EDBc GPT-2 bao g\u1ED3m h\u01A1n 8 tri\u1EC7u t\xE0i li\u1EC7u v\xE0 40 GB v\u0103n b\u1EA3n - vi\u1EC7c t\u1EA3i d\u1EEF li\u1EC7u n\xE0y v\xE0o RAM c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay c\u1EE7a b\u1EA1n c\xF3 th\u1EC3 khi\u1EBFn b\u1EA1n b\u1ECB \u0111au tim!"),dn.forEach(e),K=u(t),M=h(t,"P",{});var kn=c(M);et=a(kn,"May m\u1EAFn thay, \u{1F917} Datasets \u0111\xE3 \u0111\u01B0\u1EE3c thi\u1EBFt k\u1EBF \u0111\u1EC3 kh\u1EAFc ph\u1EE5c nh\u1EEFng h\u1EA1n ch\u1EBF n\xE0y. N\xF3 gi\u1EA3i ph\xF3ng b\u1EA1n kh\u1ECFi c\xE1c v\u1EA5n \u0111\u1EC1 v\u1EC1 qu\u1EA3n l\xFD b\u1ED9 nh\u1EDB b\u1EB1ng c\xE1ch coi c\xE1c t\u1EADp d\u1EEF li\u1EC7u l\xE0 t\u1EC7p "),qn=h(kn,"EM",{});var Qi=c(qn);Ms=a(Qi,"\xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),Qi.forEach(e),Ns=a(kn," v\xE0 tho\xE1t kh\u1ECFi gi\u1EDBi h\u1EA1n \u1ED5 c\u1EE9ng b\u1EB1ng c\xE1ch "),Cn=h(kn,"EM",{});var Yi=c(Cn);Rs=a(Yi,"truy\u1EC1n t\u1EA3i tr\u1EF1c ti\u1EBFp"),Yi.forEach(e),Ss=a(kn," c\xE1c m\u1EE5c trong m\u1ED9t kho ng\u1EEF li\u1EC7u."),kn.forEach(e),ve=u(t),b(jt.$$.fragment,t),$e=u(t),lt=h(t,"P",{});var Ts=c(lt);Gs=a(Ts,"Trong ph\u1EA7n n\xE0y, ch\xFAng ta s\u1EBD kh\xE1m ph\xE1 c\xE1c t\xEDnh n\u0103ng n\xE0y c\u1EE7a \u{1F917} Datasets v\u1EDBi kho d\u1EEF li\u1EC7u 825 GB kh\u1ED5ng l\u1ED3 \u0111\u01B0\u1EE3c g\u1ECDi l\xE0 "),kt=h(Ts,"A",{href:!0,rel:!0});var Zi=c(kt);Ls=a(Zi,"Pile"),Zi.forEach(e),Hs=a(Ts,". B\u1EAFt \u0111\u1EA7u th\xF4i!"),Ts.forEach(e),xe=u(t),st=h(t,"H2",{class:!0});var Ds=c(st);ht=h(Ds,"A",{id:!0,class:!0,href:!0});var Xi=c(ht);In=h(Xi,"SPAN",{});var tl=c(In);b(Et.$$.fragment,tl),tl.forEach(e),Xi.forEach(e),Us=u(Ds),On=h(Ds,"SPAN",{});var nl=c(On);Fs=a(nl,"Pile l\xE0 g\xEC?"),nl.forEach(e),Ds.forEach(e),je=u(t),z=h(t,"P",{});var S=c(z);Ks=a(S,"The Pile l\xE0 m\u1ED9t kho ng\u1EEF li\u1EC7u ti\u1EBFng Anh \u0111\u01B0\u1EE3c t\u1EA1o ra b\u1EDFi "),wt=h(S,"A",{href:!0,rel:!0});var el=c(wt);Js=a(el,"EleutherAI"),el.forEach(e),Vs=a(S," \u0111\u1EC3 hu\u1EA5n luy\u1EC7n c\xE1c m\xF4 h\xECnh ng\xF4n ng\u1EEF quy m\xF4 l\u1EDBn. N\xF3 bao g\u1ED3m m\u1ED9t lo\u1EA1t c\xE1c b\u1ED9 d\u1EEF li\u1EC7u, c\xE1c b\xE0i b\xE1o khoa h\u1ECDc tr\u1EA3i d\xE0i, kho m\xE3 GitHub v\xE0 v\u0103n b\u1EA3n web \u0111\u01B0\u1EE3c l\u1ECDc. Kho t\xE0i li\u1EC7u hu\u1EA5n luy\u1EC7n c\xF3 s\u1EB5n trong "),At=h(S,"A",{href:!0,rel:!0});var sl=c(At);Ws=a(sl,"kh\u1ED1i 14GB"),sl.forEach(e),Qs=a(S," v\xE0 b\u1EA1n c\u0169ng c\xF3 th\u1EC3 t\u1EA3i xu\u1ED1ng m\u1ED9t s\u1ED1 "),Tt=h(S,"A",{href:!0,rel:!0});var al=c(Tt);Ys=a(al,"th\xE0nh ph\u1EA7n ri\xEAng l\u1EBB"),al.forEach(e),Zs=a(S,". H\xE3y b\u1EAFt \u0111\u1EA7u b\u1EB1ng c\xE1ch xem qua t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, t\u1EADp d\u1EEF li\u1EC7u t\xF3m t\u1EAFt t\u1EEB 15 tri\u1EC7u \u1EA5n ph\u1EA9m y sinh tr\xEAn "),Dt=h(S,"A",{href:!0,rel:!0});var il=c(Dt);Xs=a(il,"PubMed"),il.forEach(e),ta=a(S,". T\u1EADp d\u1EEF li\u1EC7u \u1EDF "),Pt=h(S,"A",{href:!0,rel:!0});var ll=c(Pt);na=a(ll,"\u0111\u1ECBnh d\u1EA1ng JSON Lines"),ll.forEach(e),ea=a(S," v\xE0 \u0111\u01B0\u1EE3c n\xE9n b\u1EB1ng th\u01B0 vi\u1EC7n "),zn=h(S,"CODE",{});var hl=c(zn);sa=a(hl,"zstandard"),hl.forEach(e),aa=a(S,", v\xEC v\u1EADy tr\u01B0\u1EDBc ti\xEAn ch\xFAng ta c\u1EA7n c\xE0i \u0111\u1EB7t:"),S.forEach(e),ke=u(t),b(qt.$$.fragment,t),Ee=u(t),ct=h(t,"P",{});var Ps=c(ct);ia=a(Ps,"Ti\u1EBFp theo, ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u b\u1EB1ng ph\u01B0\u01A1ng ph\xE1p cho c\xE1c t\u1EC7p t\u1EEB xa m\xE0 ch\xFAng ta \u0111\xE3 h\u1ECDc trong "),fn=h(Ps,"A",{href:!0});var cl=c(fn);la=a(cl,"ph\u1EA7n 2"),cl.forEach(e),ha=a(Ps,":"),Ps.forEach(e),we=u(t),b(Ct.$$.fragment,t),Ae=u(t),b(It.$$.fragment,t),Te=u(t),bn=h(t,"P",{});var rl=c(bn);ca=a(rl,"Ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng c\xF3 15,518,009 h\xE0ng v\xE0 2 c\u1ED9t trong t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a ch\xFAng t\xF4i - \u0111\xF3 l\xE0 r\u1EA5t nhi\u1EC1u!"),rl.forEach(e),De=u(t),b(rt.$$.fragment,t),Pe=u(t),yn=h(t,"P",{});var pl=c(yn);ra=a(pl,"H\xE3y ki\u1EC3m tra n\u1ED9i dung c\u1EE7a m\u1EABu \u0111\u1EA7u ti\xEAn:"),pl.forEach(e),qe=u(t),b(Ot.$$.fragment,t),Ce=u(t),b(zt.$$.fragment,t),Ie=u(t),_n=h(t,"P",{});var ol=c(_n);pa=a(ol,"\u0110\u01B0\u1EE3c r\u1ED3i, \u0111\xE2y gi\u1ED1ng nh\u01B0 ph\u1EA7n t\xF3m t\u1EAFt t\u1EEB m\u1ED9t b\xE0i b\xE1o y khoa. B\xE2y gi\u1EDD ch\xFAng ta h\xE3y xem ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng bao nhi\xEAu RAM \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u!"),ol.forEach(e),Oe=u(t),at=h(t,"H2",{class:!0});var qs=c(at);pt=h(qs,"A",{id:!0,class:!0,href:!0});var ul=c(pt);Bn=h(ul,"SPAN",{});var ml=c(Bn);b(Bt.$$.fragment,ml),ml.forEach(e),ul.forEach(e),oa=u(qs),Mn=h(qs,"SPAN",{});var gl=c(Mn);ua=a(gl,"S\u1EF1 k\u1EF3 di\u1EC7u c\u1EE7a \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),gl.forEach(e),qs.forEach(e),ze=u(t),J=h(t,"P",{});var En=c(J);ma=a(En,"M\u1ED9t c\xE1ch \u0111\u01A1n gi\u1EA3n \u0111\u1EC3 \u0111o m\u1EE9c s\u1EED d\u1EE5ng b\u1ED9 nh\u1EDB trong Python l\xE0 s\u1EED d\u1EE5ng th\u01B0 vi\u1EC7n "),Mt=h(En,"A",{href:!0,rel:!0});var dl=c(Mt);Nn=h(dl,"CODE",{});var fl=c(Nn);ga=a(fl,"psutil"),fl.forEach(e),dl.forEach(e),da=a(En,", c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c c\xE0i \u0111\u1EB7t b\u1EB1ng "),Rn=h(En,"CODE",{});var bl=c(Rn);fa=a(bl,"pip"),bl.forEach(e),ba=a(En," nh\u01B0 sau:"),En.forEach(e),Be=u(t),b(Nt.$$.fragment,t),Me=u(t),ot=h(t,"P",{});var Cs=c(ot);ya=a(Cs,"N\xF3 cung c\u1EA5p m\u1ED9t l\u1EDBp "),Sn=h(Cs,"CODE",{});var yl=c(Sn);_a=a(yl,"Process"),yl.forEach(e),va=a(Cs," cho ph\xE9p ch\xFAng ta ki\u1EC3m tra vi\u1EC7c s\u1EED d\u1EE5ng b\u1ED9 nh\u1EDB c\u1EE7a ti\u1EBFn tr\xECnh hi\u1EC7n t\u1EA1i nh\u01B0 sau:"),Cs.forEach(e),Ne=u(t),b(Rt.$$.fragment,t),Re=u(t),b(St.$$.fragment,t),Se=u(t),L=h(t,"P",{});var _t=c(L);$a=a(_t,"\u1EDE \u0111\xE2y thu\u1ED9c t\xEDnh "),Gn=h(_t,"CODE",{});var _l=c(Gn);xa=a(_l,"rss"),_l.forEach(e),ja=a(_t," \u0111\u1EC1 c\u1EADp \u0111\u1EBFn "),Ln=h(_t,"EM",{});var vl=c(Ln);ka=a(vl,"resident set size"),vl.forEach(e),Ea=a(_t,", l\xE0 ph\u1EA7n b\u1ED9 nh\u1EDB m\xE0 m\u1ED9t ti\u1EBFn tr\xECnh chi\u1EBFm trong RAM. Ph\xE9p \u0111o n\xE0y c\u0169ng bao g\u1ED3m b\u1ED9 nh\u1EDB \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng b\u1EDFi tr\xECnh th\xF4ng d\u1ECBch Python v\xE0 c\xE1c th\u01B0 vi\u1EC7n m\xE0 ch\xFAng t\xF4i \u0111\xE3 t\u1EA3i, do \u0111\xF3, l\u01B0\u1EE3ng b\u1ED9 nh\u1EDB th\u1EF1c t\u1EBF \u0111\u01B0\u1EE3c s\u1EED d\u1EE5ng \u0111\u1EC3 t\u1EA3i t\u1EADp d\u1EEF li\u1EC7u nh\u1ECF h\u01A1n m\u1ED9t ch\xFAt. \u0110\u1EC3 so s\xE1nh, h\xE3y xem t\u1EADp d\u1EEF li\u1EC7u tr\xEAn \u0111\u0129a l\u1EDBn nh\u01B0 th\u1EBF n\xE0o, s\u1EED d\u1EE5ng thu\u1ED9c t\xEDnh "),Hn=h(_t,"CODE",{});var $l=c(Hn);wa=a($l,"dataset_size"),$l.forEach(e),Aa=a(_t,". V\xEC k\u1EBFt qu\u1EA3 \u0111\u01B0\u1EE3c th\u1EC3 hi\u1EC7n b\u1EB1ng byte nh\u01B0 tr\u01B0\u1EDBc \u0111\xE2y, ch\xFAng t\xF4i c\u1EA7n chuy\u1EC3n \u0111\u1ED5i th\u1EE7 c\xF4ng n\xF3 th\xE0nh gigabyte:"),_t.forEach(e),Ge=u(t),b(Gt.$$.fragment,t),Le=u(t),b(Lt.$$.fragment,t),He=u(t),vn=h(t,"P",{});var xl=c(vn);Ta=a(xl,"Tuy\u1EC7t v\u1EDDi - m\u1EB7c d\xF9 n\xF3 g\u1EA7n 20 GB, ch\xFAng ta c\xF3 th\u1EC3 t\u1EA3i v\xE0 truy c\u1EADp t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi RAM \xEDt h\u01A1n nhi\u1EC1u!"),xl.forEach(e),Ue=u(t),b(ut.$$.fragment,t),Fe=u(t),V=h(t,"P",{});var wn=c(V);Da=a(wn,"N\u1EBFu b\u1EA1n \u0111\xE3 quen thu\u1ED9c v\u1EDBi Pandas, k\u1EBFt qu\u1EA3 n\xE0y c\xF3 th\u1EC3 g\xE2y b\u1EA5t ng\u1EDD v\xEC theo "),Ht=h(wn,"A",{href:!0,rel:!0});var jl=c(Ht);Pa=a(jl,"quy t\u1EAFc ng\xF3n tay c\xE1i"),jl.forEach(e),qa=a(wn," n\u1ED5i ti\u1EBFng c\u1EE7a Wes Kinney, b\u1EA1n th\u01B0\u1EDDng c\u1EA7n g\u1EA5p 5 g\u1EA5p 10 l\u1EA7n RAM so v\u1EDBi k\xEDch th\u01B0\u1EDBc c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a b\u1EA1n. V\u1EADy \u{1F917} Datasets gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 qu\u1EA3n l\xFD b\u1ED9 nh\u1EDB n\xE0y nh\u01B0 th\u1EBF n\xE0o? \u{1F917} Datasets coi m\u1ED7i t\u1EADp d\u1EEF li\u1EC7u nh\u01B0 m\u1ED9t "),Ut=h(wn,"A",{href:!0,rel:!0});var kl=c(Ut);Ca=a(kl,"t\u1EC7p \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"),kl.forEach(e),Ia=a(wn,", cung c\u1EA5p \xE1nh x\u1EA1 gi\u1EEFa RAM v\xE0 b\u1ED9 nh\u1EDB h\u1EC7 th\u1ED1ng t\u1EC7p cho ph\xE9p th\u01B0 vi\u1EC7n truy c\u1EADp v\xE0 ho\u1EA1t \u0111\u1ED9ng tr\xEAn c\xE1c ph\u1EA7n t\u1EED c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u m\xE0 kh\xF4ng c\u1EA7n t\u1EA3i \u0111\u1EA7y \u0111\u1EE7 v\xE0o b\u1ED9 nh\u1EDB."),wn.forEach(e),Ke=u(t),N=h(t,"P",{});var X=c(N);Oa=a(X,"C\xE1c t\u1EC7p \u0111\u01B0\u1EE3c \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB c\u0169ng c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c chia s\u1EBB tr\xEAn nhi\u1EC1u quy tr\xECnh, cho ph\xE9p c\xE1c ph\u01B0\u01A1ng th\u1EE9c nh\u01B0 "),Un=h(X,"CODE",{});var El=c(Un);za=a(El,"Dataset.map()"),El.forEach(e),Ba=a(X," \u0111\u01B0\u1EE3c th\u1EF1c thi song song m\xE0 kh\xF4ng c\u1EA7n di chuy\u1EC3n ho\u1EB7c sao ch\xE9p t\u1EADp d\u1EEF li\u1EC7u. B\xEAn c\u1EA1nh \u0111\xF3, t\u1EA5t c\u1EA3 c\xE1c kh\u1EA3 n\u0103ng n\xE0y \u0111\u1EC1u \u0111\u01B0\u1EE3c th\u1EF1c hi\u1EC7n b\u1EDFi \u0111\u1ECBnh d\u1EA1ng b\u1ED9 nh\u1EDB "),Ft=h(X,"A",{href:!0,rel:!0});var wl=c(Ft);Ma=a(wl,"Apache Arrow"),wl.forEach(e),Na=a(X," v\xE0 th\u01B0 vi\u1EC7n"),Kt=h(X,"A",{href:!0,rel:!0});var Al=c(Kt);Fn=h(Al,"CODE",{});var Tl=c(Fn);Ra=a(Tl,"pyarrow"),Tl.forEach(e),Al.forEach(e),Sa=a(X,", gi\xFAp t\u1EA3i v\xE0 x\u1EED l\xFD d\u1EEF li\u1EC7u nhanh nh\u01B0 ch\u1EDBp. (\u0110\u1EC3 bi\u1EBFt th\xEAm chi ti\u1EBFt v\u1EC1 Apache Arrow v\xE0 so s\xE1nh v\u1EDBi Pandas, h\xE3y xem "),Jt=h(X,"A",{href:!0,rel:!0});var Dl=c(Jt);Ga=a(Dl,"B\xE0i \u0111\u0103ng tr\xEAn blog c\u1EE7a Dejan Simic"),Dl.forEach(e),La=a(X,".) trong th\u1EF1c t\u1EBF, h\xE3y ch\u1EA1y m\u1ED9t b\xE0i ki\u1EC3m tra t\u1ED1c \u0111\u1ED9 nh\u1ECF b\u1EB1ng c\xE1ch l\u1EB7p l\u1EA1i t\u1EA5t c\u1EA3 c\xE1c ph\u1EA7n t\u1EED trong t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts:"),X.forEach(e),Je=u(t),b(Vt.$$.fragment,t),Ve=u(t),b(Wt.$$.fragment,t),We=u(t),W=h(t,"P",{});var An=c(W);Ha=a(An,"\u1EDE \u0111\xE2y ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng m\xF4-\u0111un "),Kn=h(An,"CODE",{});var Pl=c(Kn);Ua=a(Pl,"timeit"),Pl.forEach(e),Fa=a(An," c\u1EE7a Python \u0111\u1EC3 \u0111o th\u1EDDi gian th\u1EF1c thi \u0111\u01B0\u1EE3c th\u1EF1c hi\u1EC7n b\u1EDFi "),Jn=h(An,"CODE",{});var ql=c(Jn);Ka=a(ql,"code_snippet"),ql.forEach(e),Ja=a(An,". Th\xF4ng th\u01B0\u1EDDng, b\u1EA1n s\u1EBD c\xF3 th\u1EC3 l\u1EB7p l\u1EA1i t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi t\u1ED1c \u0111\u1ED9 t\u1EEB v\xE0i ph\u1EA7n m\u01B0\u1EDDi GB/s \u0111\u1EBFn v\xE0i GB/s. \u0110i\u1EC1u n\xE0y ho\u1EA1t \u0111\u1ED9ng hi\u1EC7u qu\u1EA3 v\u1EDBi \u0111\u1EA1i \u0111a s\u1ED1 c\xE1c \u1EE9ng d\u1EE5ng, nh\u01B0ng \u0111\xF4i khi b\u1EA1n s\u1EBD ph\u1EA3i l\xE0m vi\u1EC7c v\u1EDBi m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u qu\xE1 l\u1EDBn, th\u1EADm ch\xED kh\xF4ng th\u1EC3 l\u01B0u tr\u1EEF tr\xEAn \u1ED5 c\u1EE9ng c\u1EE7a m\xE1y t\xEDnh x\xE1ch tay c\u1EE7a b\u1EA1n. V\xED d\u1EE5: n\u1EBFu ch\xFAng t\xF4i c\u1ED1 g\u1EAFng t\u1EA3i xu\u1ED1ng to\xE0n b\u1ED9 Pile, ch\xFAng t\xF4i s\u1EBD c\u1EA7n 825 GB dung l\u01B0\u1EE3ng \u0111\u0129a tr\u1ED1ng! \u0110\u1EC3 x\u1EED l\xFD nh\u1EEFng tr\u01B0\u1EDDng h\u1EE3p n\xE0y, \u{1F917} Datasets cung c\u1EA5p t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn cho ph\xE9p ch\xFAng t\xF4i t\u1EA3i xu\u1ED1ng v\xE0 truy c\u1EADp c\xE1c ph\u1EA7n t\u1EED m\u1ED9t c\xE1ch nhanh ch\xF3ng m\xE0 kh\xF4ng c\u1EA7n t\u1EA3i xu\u1ED1ng to\xE0n b\u1ED9 t\u1EADp d\u1EEF li\u1EC7u. Ch\xFAng ta h\xE3y xem c\xE1ch n\xE0y ho\u1EA1t \u0111\u1ED9ng nh\u01B0 th\u1EBF n\xE0o."),An.forEach(e),Qe=u(t),b(mt.$$.fragment,t),Ye=u(t),it=h(t,"H2",{class:!0});var Is=c(it);gt=h(Is,"A",{id:!0,class:!0,href:!0});var Cl=c(gt);Vn=h(Cl,"SPAN",{});var Il=c(Vn);b(Qt.$$.fragment,Il),Il.forEach(e),Cl.forEach(e),Va=u(Is),Wn=h(Is,"SPAN",{});var Ol=c(Wn);Wa=a(Ol,"Truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u"),Ol.forEach(e),Is.forEach(e),Ze=u(t),Q=h(t,"P",{});var Tn=c(Q);Qa=a(Tn,"\u0110\u1EC3 b\u1EADt t\xEDnh n\u0103ng ph\xE1t tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u, b\u1EA1n ch\u1EC9 c\u1EA7n truy\u1EC1n tham s\u1ED1 "),Qn=h(Tn,"CODE",{});var zl=c(Qn);Ya=a(zl,"streaming=True"),zl.forEach(e),Za=a(Tn," v\xE0o h\xE0m "),Yn=h(Tn,"CODE",{});var Bl=c(Yn);Xa=a(Bl,"load_dataset()"),Bl.forEach(e),ti=a(Tn,". V\xED d\u1EE5: h\xE3y t\u1EA3i l\u1EA1i t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, nh\u01B0ng \u1EDF ch\u1EBF \u0111\u1ED9 ph\xE1t tr\u1EF1c tuy\u1EBFn:"),Tn.forEach(e),Xe=u(t),b(Yt.$$.fragment,t),ts=u(t),R=h(t,"P",{});var tt=c(R);ni=a(tt,"Thay v\xEC "),Zn=h(tt,"CODE",{});var Ml=c(Zn);ei=a(Ml,"Dataset"),Ml.forEach(e),si=a(tt," quen thu\u1ED9c m\xE0 ch\xFAng ta \u0111\xE3 g\u1EB7p \u1EDF nh\u1EEFng n\u01A1i kh\xE1c trong ch\u01B0\u01A1ng n\xE0y, \u0111\u1ED1i t\u01B0\u1EE3ng \u0111\u01B0\u1EE3c tr\u1EA3 v\u1EC1 v\u1EDBi "),Xn=h(tt,"CODE",{});var Nl=c(Xn);ai=a(Nl,"streaming=True"),Nl.forEach(e),ii=a(tt," l\xE0 m\u1ED9t "),te=h(tt,"CODE",{});var Rl=c(te);li=a(Rl,"IterableDataset"),Rl.forEach(e),hi=a(tt,". Nh\u01B0 c\xE1i t\xEAn cho th\u1EA5y, \u0111\u1EC3 truy c\u1EADp c\xE1c ph\u1EA7n t\u1EED c\u1EE7a m\u1ED9t "),ne=h(tt,"CODE",{});var Sl=c(ne);ci=a(Sl,"IterableDataset"),Sl.forEach(e),ri=a(tt,", ch\xFAng ta c\u1EA7n ph\u1EA3i l\u1EB7p l\u1EA1i n\xF3. Ch\xFAng t\xF4i c\xF3 th\u1EC3 truy c\u1EADp ph\u1EA7n t\u1EED \u0111\u1EA7u ti\xEAn c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c ph\xE1t tr\u1EF1c tuy\u1EBFn c\u1EE7a ch\xFAng t\xF4i nh\u01B0 sau:"),tt.forEach(e),ns=u(t),b(Zt.$$.fragment,t),es=u(t),b(Xt.$$.fragment,t),ss=u(t),Y=h(t,"P",{});var Dn=c(Y);pi=a(Dn,"C\xE1c ph\u1EA7n t\u1EED t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c truy\u1EC1n tr\u1EF1c tuy\u1EBFn c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c x\u1EED l\xFD nhanh ch\xF3ng b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),ee=h(Dn,"CODE",{});var Gl=c(ee);oi=a(Gl,"IterableDataset.map()"),Gl.forEach(e),ui=a(Dn,", r\u1EA5t h\u1EEFu \xEDch trong qu\xE1 tr\xECnh hu\u1EA5n luy\u1EC7n n\u1EBFu b\u1EA1n c\u1EA7n tokenize c\xE1c \u0111\u1EA7u v\xE0o. Quy tr\xECnh ho\xE0n to\xE0n gi\u1ED1ng v\u1EDBi quy tr\xECnh ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng \u0111\u1EC3 tokenize t\u1EADp d\u1EEF li\u1EC7u c\u1EE7a m\xECnh trong "),$n=h(Dn,"A",{href:!0});var Ll=c($n);mi=a(Ll,"Ch\u01B0\u01A1ng 3"),Ll.forEach(e),gi=a(Dn,", v\u1EDBi s\u1EF1 kh\xE1c bi\u1EC7t duy nh\u1EA5t l\xE0 c\xE1c \u0111\u1EA7u ra \u0111\u01B0\u1EE3c tr\u1EA3 v\u1EC1 t\u1EEBng c\xE1i m\u1ED9t:"),Dn.forEach(e),as=u(t),b(tn.$$.fragment,t),is=u(t),b(nn.$$.fragment,t),ls=u(t),b(dt.$$.fragment,t),hs=u(t),H=h(t,"P",{});var vt=c(H);di=a(vt,"B\u1EA1n c\u0169ng c\xF3 th\u1EC3 x\xE1o tr\u1ED9n m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c ph\xE1t tr\u1EF1c tuy\u1EBFn b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng "),se=h(vt,"CODE",{});var Hl=c(se);fi=a(Hl,"IterableDataset.shuffle()"),Hl.forEach(e),bi=a(vt,", nh\u01B0ng kh\xF4ng gi\u1ED1ng nh\u01B0 "),ae=h(vt,"CODE",{});var Ul=c(ae);yi=a(Ul,"Dataset.shuffle()"),Ul.forEach(e),_i=a(vt," \u0111i\u1EC1u n\xE0y ch\u1EC9 x\xE1o tr\u1ED9n c\xE1c ph\u1EA7n t\u1EED trong m\u1ED9t "),ie=h(vt,"CODE",{});var Fl=c(ie);vi=a(Fl,"buffer_size"),Fl.forEach(e),$i=a(vt," \u0111\u01B0\u1EE3c \u0111\u1ECBnh tr\u01B0\u1EDBc:"),vt.forEach(e),cs=u(t),b(en.$$.fragment,t),rs=u(t),b(sn.$$.fragment,t),ps=u(t),U=h(t,"P",{});var $t=c(U);xi=a($t,"Trong v\xED d\u1EE5 n\xE0y, ch\xFAng ta \u0111\xE3 ch\u1ECDn m\u1ED9t m\u1EABu ng\u1EABu nhi\xEAn t\u1EEB 10,000 m\u1EABu \u0111\u1EA7u ti\xEAn trong b\u1ED9 \u0111\u1EC7m. Khi m\u1ED9t m\u1EABu \u0111\u01B0\u1EE3c truy c\u1EADp, v\u1ECB tr\xED c\u1EE7a n\xF3 trong b\u1ED9 \u0111\u1EC7m s\u1EBD \u0111\u01B0\u1EE3c l\u1EA5p \u0111\u1EA7y b\u1EB1ng v\xED d\u1EE5 ti\u1EBFp theo trong kho t\xE0i li\u1EC7u (t\u1EE9c l\xE0 v\xED d\u1EE5 th\u1EE9 10,001 trong tr\u01B0\u1EDDng h\u1EE3p tr\xEAn). B\u1EA1n c\u0169ng c\xF3 th\u1EC3 ch\u1ECDn c\xE1c ph\u1EA7n t\u1EED t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u01B0\u1EE3c truy\u1EC1n tr\u1EF1c tuy\u1EBFn b\u1EB1ng c\xE1ch s\u1EED d\u1EE5ng c\xE1c h\xE0m "),le=h($t,"CODE",{});var Kl=c(le);ji=a(Kl,"IterableDataset.take()"),Kl.forEach(e),ki=a($t," v\xE0 "),he=h($t,"CODE",{});var Jl=c(he);Ei=a(Jl,"IterableDataset.skip()"),Jl.forEach(e),wi=a($t,", ho\u1EA1t \u0111\u1ED9ng theo c\xE1ch t\u01B0\u01A1ng t\u1EF1 nh\u01B0 "),ce=h($t,"CODE",{});var Vl=c(ce);Ai=a(Vl,"Dataset.select()"),Vl.forEach(e),Ti=a($t,". V\xED d\u1EE5, \u0111\u1EC3 ch\u1ECDn 5 m\u1EABu \u0111\u1EA7u ti\xEAn trong t\u1EADp d\u1EEF li\u1EC7u PubMed Abstracts, ch\xFAng ta c\xF3 th\u1EC3 l\xE0m nh\u01B0 sau:"),$t.forEach(e),os=u(t),b(an.$$.fragment,t),us=u(t),b(ln.$$.fragment,t),ms=u(t),ft=h(t,"P",{});var Os=c(ft);Di=a(Os,"T\u01B0\u01A1ng t\u1EF1, b\u1EA1n c\xF3 th\u1EC3 s\u1EED d\u1EE5ng h\xE0m "),re=h(Os,"CODE",{});var Wl=c(re);Pi=a(Wl,"IterableDataset.skip()"),Wl.forEach(e),qi=a(Os," \u0111\u1EC3 t\u1EA1o c\xE1c t\u1EADp hu\u1EA5n luy\u1EC7n v\xE0 ki\u1EC3m \u0111\u1ECBnh t\u1EEB m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u x\xE1o tr\u1ED9n nh\u01B0 sau:"),Os.forEach(e),gs=u(t),b(hn.$$.fragment,t),ds=u(t),F=h(t,"P",{});var xt=c(F);Ci=a(xt,"H\xE3y ho\xE0n th\xE0nh vi\u1EC7c kh\xE1m ph\xE1 c\u1EE7a ch\xFAng ta v\u1EC1 vi\u1EC7c truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi m\u1ED9t \u1EE9ng d\u1EE5ng ph\u1ED5 bi\u1EBFn: k\u1EBFt h\u1EE3p nhi\u1EC1u t\u1EADp d\u1EEF li\u1EC7u v\u1EDBi nhau \u0111\u1EC3 t\u1EA1o ra m\u1ED9t kho d\u1EEF li\u1EC7u duy nh\u1EA5t. \u{1F917} Datasets cung c\u1EA5p m\u1ED9t h\xE0m "),pe=h(xt,"CODE",{});var Ql=c(pe);Ii=a(Ql,"interleave_datasets()"),Ql.forEach(e),Oi=a(xt," \u0111\u1EC3 chuy\u1EC3n \u0111\u1ED5i danh s\xE1ch c\xE1c \u0111\u1ED1i t\u01B0\u1EE3ng "),oe=h(xt,"CODE",{});var Yl=c(oe);zi=a(Yl,"IterableDataset"),Yl.forEach(e),Bi=a(xt," th\xE0nh m\u1ED9t "),ue=h(xt,"CODE",{});var Zl=c(ue);Mi=a(Zl,"IterableDataset"),Zl.forEach(e),Ni=a(xt," duy nh\u1EA5t, trong \u0111\xF3 c\xE1c ph\u1EA7n t\u1EED c\u1EE7a t\u1EADp d\u1EEF li\u1EC7u m\u1EDBi \u0111\u01B0\u1EE3c l\u1EA5y b\u1EB1ng c\xE1ch xen k\u1EBD gi\u1EEFa c\xE1c m\u1EABu g\u1ED1c. H\xE0m n\xE0y \u0111\u1EB7c bi\u1EC7t h\u1EEFu \xEDch khi b\u1EA1n \u0111ang c\u1ED1 g\u1EAFng k\u1EBFt h\u1EE3p c\xE1c t\u1EADp d\u1EEF li\u1EC7u l\u1EDBn, v\xEC v\u1EADy, \u0111\u1EC3 l\xE0m v\xED d\u1EE5, h\xE3y truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp con FreeLaw c\u1EE7a Pile, l\xE0 t\u1EADp d\u1EEF li\u1EC7u 51 GB v\u1EC1 c\xE1c \xFD ki\u1EBFn ph\xE1p l\xFD t\u1EEB c\xE1c t\xF2a \xE1n Hoa K\u1EF3:"),xt.forEach(e),fs=u(t),b(cn.$$.fragment,t),bs=u(t),b(rn.$$.fragment,t),ys=u(t),bt=h(t,"P",{});var zs=c(bt);Ri=a(zs,"T\u1EADp d\u1EEF li\u1EC7u n\xE0y \u0111\u1EE7 l\u1EDBn \u0111\u1EC3 k\xEDch ho\u1EA1t RAM c\u1EE7a h\u1EA7u h\u1EBFt c\xE1c m\xE1y t\xEDnh x\xE1ch tay, nh\u01B0ng ch\xFAng ta v\u1EABn c\xF3 th\u1EC3 t\u1EA3i v\xE0 truy c\u1EADp n\xF3 m\xE0 kh\xF4ng ph\u1EA3i \u0111\u1ED5 m\u1ED3 h\xF4i! B\xE2y gi\u1EDD ch\xFAng ta h\xE3y k\u1EBFt h\u1EE3p c\xE1c m\u1EABu t\u1EEB b\u1ED9 d\u1EEF li\u1EC7u FreeLaw v\xE0 PubMed Abstracts v\u1EDBi h\xE0m "),me=h(zs,"CODE",{});var Xl=c(me);Si=a(Xl,"interleave_datasets()"),Xl.forEach(e),Gi=a(zs,":"),zs.forEach(e),_s=u(t),b(pn.$$.fragment,t),vs=u(t),b(on.$$.fragment,t),$s=u(t),Z=h(t,"P",{});var Pn=c(Z);Li=a(Pn,"\u1EDE \u0111\xE2y ch\xFAng ta \u0111\xE3 s\u1EED d\u1EE5ng h\xE0m "),ge=h(Pn,"CODE",{});var th=c(ge);Hi=a(th,"islice()"),th.forEach(e),Ui=a(Pn," t\u1EEB m\xF4-\u0111un "),de=h(Pn,"CODE",{});var nh=c(de);Fi=a(nh,"itertools"),nh.forEach(e),Ki=a(Pn," c\u1EE7a Python \u0111\u1EC3 ch\u1ECDn hai m\u1EABu \u0111\u1EA7u ti\xEAn t\u1EEB t\u1EADp d\u1EEF li\u1EC7u k\u1EBFt h\u1EE3p v\xE0 ch\xFAng ta c\xF3 th\u1EC3 th\u1EA5y r\u1EB1ng ch\xFAng kh\u1EDBp v\u1EDBi c\xE1c v\xED d\u1EE5 \u0111\u1EA7u ti\xEAn t\u1EEB m\u1ED7i trong hai t\u1EADp d\u1EEF li\u1EC7u ngu\u1ED3n."),Pn.forEach(e),xs=u(t),xn=h(t,"P",{});var eh=c(xn);Ji=a(eh,"Cu\u1ED1i c\xF9ng, n\u1EBFu b\u1EA1n mu\u1ED1n ph\xE1t tr\u1EF1c tuy\u1EBFn to\xE0n b\u1ED9 825 GB c\u1EE7a Pile, b\u1EA1n c\xF3 th\u1EC3 l\u1EA5y t\u1EA5t c\u1EA3 c\xE1c t\u1EC7p \u0111\xE3 chu\u1EA9n b\u1ECB nh\u01B0 sau:"),eh.forEach(e),js=u(t),b(un.$$.fragment,t),ks=u(t),b(mn.$$.fragment,t),Es=u(t),b(yt.$$.fragment,t),ws=u(t),jn=h(t,"P",{});var sh=c(jn);Vi=a(sh,"Gi\u1EDD \u0111\xE2y, b\u1EA1n c\xF3 t\u1EA5t c\u1EA3 c\xE1c c\xF4ng c\u1EE5 c\u1EA7n thi\u1EBFt \u0111\u1EC3 t\u1EA3i v\xE0 x\u1EED l\xFD c\xE1c t\u1EADp d\u1EEF li\u1EC7u \u1EDF m\u1ECDi h\xECnh d\u1EA1ng v\xE0 k\xEDch th\u01B0\u1EDBc - nh\u01B0ng tr\u1EEB khi b\u1EA1n \u0111\u1EB7c bi\u1EC7t may m\u1EAFn, s\u1EBD \u0111\u1EBFn m\u1ED9t th\u1EDDi \u0111i\u1EC3m trong h\xE0nh tr\xECnh NLP c\u1EE7a b\u1EA1n, n\u01A1i b\u1EA1n s\u1EBD ph\u1EA3i th\u1EF1c s\u1EF1 t\u1EA1o m\u1ED9t t\u1EADp d\u1EEF li\u1EC7u \u0111\u1EC3 gi\u1EA3i quy\u1EBFt v\u1EA5n \u0111\u1EC1 v\u1EA5n \u0111\u1EC1 trong t\u1EA7m tay. \u0110\xF3 l\xE0 ch\u1EE7 \u0111\u1EC1 c\u1EE7a ph\u1EA7n ti\u1EBFp theo!"),sh.forEach(e),this.h()},h(){m(p,"name","hf:doc:metadata"),m(p,"content",JSON.stringify(bh)),m(k,"id","d-liu-ln-b-d-liu-gii-cu"),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","#d-liu-ln-b-d-liu-gii-cu"),m(g,"class","relative group"),m(kt,"href","https://pile.eleuther.ai"),m(kt,"rel","nofollow"),m(ht,"id","pile-l-g"),m(ht,"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(ht,"href","#pile-l-g"),m(st,"class","relative group"),m(wt,"href","https://www.eleuther.ai"),m(wt,"rel","nofollow"),m(At,"href","https://the-eye.eu/public/AI/pile/"),m(At,"rel","nofollow"),m(Tt,"href","https://the-eye.eu/public/AI/pile_preliminary_components/"),m(Tt,"rel","nofollow"),m(Dt,"href","https://pubmed.ncbi.nlm.nih.gov/"),m(Dt,"rel","nofollow"),m(Pt,"href","https://jsonlines.org"),m(Pt,"rel","nofollow"),m(fn,"href","/course/chapter5/2"),m(pt,"id","s-k-diu-ca-nh-x-b-nh"),m(pt,"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(pt,"href","#s-k-diu-ca-nh-x-b-nh"),m(at,"class","relative group"),m(Mt,"href","https://psutil.readthedocs.io/en/latest/"),m(Mt,"rel","nofollow"),m(Ht,"href","https://wesmckinney.com/blog/apache-arrow-pandas-internals/"),m(Ht,"rel","nofollow"),m(Ut,"href","https://en.wikipedia.org/wiki/Memory-mapped_file"),m(Ut,"rel","nofollow"),m(Ft,"href","https://arrow.apache.org"),m(Ft,"rel","nofollow"),m(Kt,"href","https://arrow.apache.org/docs/python/index.html"),m(Kt,"rel","nofollow"),m(Jt,"href","https://towardsdatascience.com/apache-arrow-read-dataframe-with-zero-memory-69634092b1a"),m(Jt,"rel","nofollow"),m(gt,"id","truyn-trc-tuyn-tp-d-liu"),m(gt,"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(gt,"href","#truyn-trc-tuyn-tp-d-liu"),m(it,"class","relative group"),m($n,"href","/course/chapter3")},m(t,i){n(document.head,p),r(t,I,i),r(t,g,i),n(g,k),n(k,w),y(d,w,null),n(g,P),n(g,A),n(A,x),r(t,j,i),y(T,t,i),r(t,q,i),r(t,D,i),n(D,B),n(D,C),n(C,O),n(D,nt),r(t,K,i),r(t,M,i),n(M,et),n(M,qn),n(qn,Ms),n(M,Ns),n(M,Cn),n(Cn,Rs),n(M,Ss),r(t,ve,i),y(jt,t,i),r(t,$e,i),r(t,lt,i),n(lt,Gs),n(lt,kt),n(kt,Ls),n(lt,Hs),r(t,xe,i),r(t,st,i),n(st,ht),n(ht,In),y(Et,In,null),n(st,Us),n(st,On),n(On,Fs),r(t,je,i),r(t,z,i),n(z,Ks),n(z,wt),n(wt,Js),n(z,Vs),n(z,At),n(At,Ws),n(z,Qs),n(z,Tt),n(Tt,Ys),n(z,Zs),n(z,Dt),n(Dt,Xs),n(z,ta),n(z,Pt),n(Pt,na),n(z,ea),n(z,zn),n(zn,sa),n(z,aa),r(t,ke,i),y(qt,t,i),r(t,Ee,i),r(t,ct,i),n(ct,ia),n(ct,fn),n(fn,la),n(ct,ha),r(t,we,i),y(Ct,t,i),r(t,Ae,i),y(It,t,i),r(t,Te,i),r(t,bn,i),n(bn,ca),r(t,De,i),y(rt,t,i),r(t,Pe,i),r(t,yn,i),n(yn,ra),r(t,qe,i),y(Ot,t,i),r(t,Ce,i),y(zt,t,i),r(t,Ie,i),r(t,_n,i),n(_n,pa),r(t,Oe,i),r(t,at,i),n(at,pt),n(pt,Bn),y(Bt,Bn,null),n(at,oa),n(at,Mn),n(Mn,ua),r(t,ze,i),r(t,J,i),n(J,ma),n(J,Mt),n(Mt,Nn),n(Nn,ga),n(J,da),n(J,Rn),n(Rn,fa),n(J,ba),r(t,Be,i),y(Nt,t,i),r(t,Me,i),r(t,ot,i),n(ot,ya),n(ot,Sn),n(Sn,_a),n(ot,va),r(t,Ne,i),y(Rt,t,i),r(t,Re,i),y(St,t,i),r(t,Se,i),r(t,L,i),n(L,$a),n(L,Gn),n(Gn,xa),n(L,ja),n(L,Ln),n(Ln,ka),n(L,Ea),n(L,Hn),n(Hn,wa),n(L,Aa),r(t,Ge,i),y(Gt,t,i),r(t,Le,i),y(Lt,t,i),r(t,He,i),r(t,vn,i),n(vn,Ta),r(t,Ue,i),y(ut,t,i),r(t,Fe,i),r(t,V,i),n(V,Da),n(V,Ht),n(Ht,Pa),n(V,qa),n(V,Ut),n(Ut,Ca),n(V,Ia),r(t,Ke,i),r(t,N,i),n(N,Oa),n(N,Un),n(Un,za),n(N,Ba),n(N,Ft),n(Ft,Ma),n(N,Na),n(N,Kt),n(Kt,Fn),n(Fn,Ra),n(N,Sa),n(N,Jt),n(Jt,Ga),n(N,La),r(t,Je,i),y(Vt,t,i),r(t,Ve,i),y(Wt,t,i),r(t,We,i),r(t,W,i),n(W,Ha),n(W,Kn),n(Kn,Ua),n(W,Fa),n(W,Jn),n(Jn,Ka),n(W,Ja),r(t,Qe,i),y(mt,t,i),r(t,Ye,i),r(t,it,i),n(it,gt),n(gt,Vn),y(Qt,Vn,null),n(it,Va),n(it,Wn),n(Wn,Wa),r(t,Ze,i),r(t,Q,i),n(Q,Qa),n(Q,Qn),n(Qn,Ya),n(Q,Za),n(Q,Yn),n(Yn,Xa),n(Q,ti),r(t,Xe,i),y(Yt,t,i),r(t,ts,i),r(t,R,i),n(R,ni),n(R,Zn),n(Zn,ei),n(R,si),n(R,Xn),n(Xn,ai),n(R,ii),n(R,te),n(te,li),n(R,hi),n(R,ne),n(ne,ci),n(R,ri),r(t,ns,i),y(Zt,t,i),r(t,es,i),y(Xt,t,i),r(t,ss,i),r(t,Y,i),n(Y,pi),n(Y,ee),n(ee,oi),n(Y,ui),n(Y,$n),n($n,mi),n(Y,gi),r(t,as,i),y(tn,t,i),r(t,is,i),y(nn,t,i),r(t,ls,i),y(dt,t,i),r(t,hs,i),r(t,H,i),n(H,di),n(H,se),n(se,fi),n(H,bi),n(H,ae),n(ae,yi),n(H,_i),n(H,ie),n(ie,vi),n(H,$i),r(t,cs,i),y(en,t,i),r(t,rs,i),y(sn,t,i),r(t,ps,i),r(t,U,i),n(U,xi),n(U,le),n(le,ji),n(U,ki),n(U,he),n(he,Ei),n(U,wi),n(U,ce),n(ce,Ai),n(U,Ti),r(t,os,i),y(an,t,i),r(t,us,i),y(ln,t,i),r(t,ms,i),r(t,ft,i),n(ft,Di),n(ft,re),n(re,Pi),n(ft,qi),r(t,gs,i),y(hn,t,i),r(t,ds,i),r(t,F,i),n(F,Ci),n(F,pe),n(pe,Ii),n(F,Oi),n(F,oe),n(oe,zi),n(F,Bi),n(F,ue),n(ue,Mi),n(F,Ni),r(t,fs,i),y(cn,t,i),r(t,bs,i),y(rn,t,i),r(t,ys,i),r(t,bt,i),n(bt,Ri),n(bt,me),n(me,Si),n(bt,Gi),r(t,_s,i),y(pn,t,i),r(t,vs,i),y(on,t,i),r(t,$s,i),r(t,Z,i),n(Z,Li),n(Z,ge),n(ge,Hi),n(Z,Ui),n(Z,de),n(de,Fi),n(Z,Ki),r(t,xs,i),r(t,xn,i),n(xn,Ji),r(t,js,i),y(un,t,i),r(t,ks,i),y(mn,t,i),r(t,Es,i),y(yt,t,i),r(t,ws,i),r(t,jn,i),n(jn,Vi),As=!0},p(t,[i]){const gn={};i&2&&(gn.$$scope={dirty:i,ctx:t}),rt.$set(gn);const fe={};i&2&&(fe.$$scope={dirty:i,ctx:t}),ut.$set(fe);const be={};i&2&&(be.$$scope={dirty:i,ctx:t}),mt.$set(be);const ye={};i&2&&(ye.$$scope={dirty:i,ctx:t}),dt.$set(ye);const dn={};i&2&&(dn.$$scope={dirty:i,ctx:t}),yt.$set(dn)},i(t){As||(_(d.$$.fragment,t),_(T.$$.fragment,t),_(jt.$$.fragment,t),_(Et.$$.fragment,t),_(qt.$$.fragment,t),_(Ct.$$.fragment,t),_(It.$$.fragment,t),_(rt.$$.fragment,t),_(Ot.$$.fragment,t),_(zt.$$.fragment,t),_(Bt.$$.fragment,t),_(Nt.$$.fragment,t),_(Rt.$$.fragment,t),_(St.$$.fragment,t),_(Gt.$$.fragment,t),_(Lt.$$.fragment,t),_(ut.$$.fragment,t),_(Vt.$$.fragment,t),_(Wt.$$.fragment,t),_(mt.$$.fragment,t),_(Qt.$$.fragment,t),_(Yt.$$.fragment,t),_(Zt.$$.fragment,t),_(Xt.$$.fragment,t),_(tn.$$.fragment,t),_(nn.$$.fragment,t),_(dt.$$.fragment,t),_(en.$$.fragment,t),_(sn.$$.fragment,t),_(an.$$.fragment,t),_(ln.$$.fragment,t),_(hn.$$.fragment,t),_(cn.$$.fragment,t),_(rn.$$.fragment,t),_(pn.$$.fragment,t),_(on.$$.fragment,t),_(un.$$.fragment,t),_(mn.$$.fragment,t),_(yt.$$.fragment,t),As=!0)},o(t){v(d.$$.fragment,t),v(T.$$.fragment,t),v(jt.$$.fragment,t),v(Et.$$.fragment,t),v(qt.$$.fragment,t),v(Ct.$$.fragment,t),v(It.$$.fragment,t),v(rt.$$.fragment,t),v(Ot.$$.fragment,t),v(zt.$$.fragment,t),v(Bt.$$.fragment,t),v(Nt.$$.fragment,t),v(Rt.$$.fragment,t),v(St.$$.fragment,t),v(Gt.$$.fragment,t),v(Lt.$$.fragment,t),v(ut.$$.fragment,t),v(Vt.$$.fragment,t),v(Wt.$$.fragment,t),v(mt.$$.fragment,t),v(Qt.$$.fragment,t),v(Yt.$$.fragment,t),v(Zt.$$.fragment,t),v(Xt.$$.fragment,t),v(tn.$$.fragment,t),v(nn.$$.fragment,t),v(dt.$$.fragment,t),v(en.$$.fragment,t),v(sn.$$.fragment,t),v(an.$$.fragment,t),v(ln.$$.fragment,t),v(hn.$$.fragment,t),v(cn.$$.fragment,t),v(rn.$$.fragment,t),v(pn.$$.fragment,t),v(on.$$.fragment,t),v(un.$$.fragment,t),v(mn.$$.fragment,t),v(yt.$$.fragment,t),As=!1},d(t){e(p),t&&e(I),t&&e(g),$(d),t&&e(j),$(T,t),t&&e(q),t&&e(D),t&&e(K),t&&e(M),t&&e(ve),$(jt,t),t&&e($e),t&&e(lt),t&&e(xe),t&&e(st),$(Et),t&&e(je),t&&e(z),t&&e(ke),$(qt,t),t&&e(Ee),t&&e(ct),t&&e(we),$(Ct,t),t&&e(Ae),$(It,t),t&&e(Te),t&&e(bn),t&&e(De),$(rt,t),t&&e(Pe),t&&e(yn),t&&e(qe),$(Ot,t),t&&e(Ce),$(zt,t),t&&e(Ie),t&&e(_n),t&&e(Oe),t&&e(at),$(Bt),t&&e(ze),t&&e(J),t&&e(Be),$(Nt,t),t&&e(Me),t&&e(ot),t&&e(Ne),$(Rt,t),t&&e(Re),$(St,t),t&&e(Se),t&&e(L),t&&e(Ge),$(Gt,t),t&&e(Le),$(Lt,t),t&&e(He),t&&e(vn),t&&e(Ue),$(ut,t),t&&e(Fe),t&&e(V),t&&e(Ke),t&&e(N),t&&e(Je),$(Vt,t),t&&e(Ve),$(Wt,t),t&&e(We),t&&e(W),t&&e(Qe),$(mt,t),t&&e(Ye),t&&e(it),$(Qt),t&&e(Ze),t&&e(Q),t&&e(Xe),$(Yt,t),t&&e(ts),t&&e(R),t&&e(ns),$(Zt,t),t&&e(es),$(Xt,t),t&&e(ss),t&&e(Y),t&&e(as),$(tn,t),t&&e(is),$(nn,t),t&&e(ls),$(dt,t),t&&e(hs),t&&e(H),t&&e(cs),$(en,t),t&&e(rs),$(sn,t),t&&e(ps),t&&e(U),t&&e(os),$(an,t),t&&e(us),$(ln,t),t&&e(ms),t&&e(ft),t&&e(gs),$(hn,t),t&&e(ds),t&&e(F),t&&e(fs),$(cn,t),t&&e(bs),$(rn,t),t&&e(ys),t&&e(bt),t&&e(_s),$(pn,t),t&&e(vs),$(on,t),t&&e($s),t&&e(Z),t&&e(xs),t&&e(xn),t&&e(js),$(un,t),t&&e(ks),$(mn,t),t&&e(Es),$(yt,t),t&&e(ws),t&&e(jn)}}}const bh={local:"d-liu-ln-b-d-liu-gii-cu",sections:[{local:"pile-l-g",title:"Pile l\xE0 g\xEC?"},{local:"s-k-diu-ca-nh-x-b-nh",title:"S\u1EF1 k\u1EF3 di\u1EC7u c\u1EE7a \xE1nh x\u1EA1 b\u1ED9 nh\u1EDB"},{local:"truyn-trc-tuyn-tp-d-liu",title:"Truy\u1EC1n tr\u1EF1c tuy\u1EBFn t\u1EADp d\u1EEF li\u1EC7u"}],title:"D\u1EEF li\u1EC7u l\u1EDBn? \u{1F917} B\u1ED9 d\u1EEF li\u1EC7u \u0111\u1EC3 gi\u1EA3i c\u1EE9u!"};function yh(G){return ch(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wh extends ah{constructor(p){super();ih(this,p,yh,fh,lh,{})}}export{wh as default,bh as metadata};
