import{S as lt,i as ht,s as ct,e as n,k as c,w as qe,t as r,M as mt,c as o,d as t,m,a as s,x as Oe,h as l,b as u,F as a,g as h,y as Re,L as ft,q as We,o as Fe,B as Me,v as ut}from"../../chunks/vendor-1e8b365d.js";import{I as je}from"../../chunks/IconCopyLink-483c28ba.js";function dt(ze){let g,J,p,y,q,b,se,O,ie,D,P,re,K,w,x,R,E,le,W,he,Q,N,ce,V,$,me,X,f,L,F,fe,ue,de,T,M,ge,pe,we,I,j,ve,ye,xe,S,z,_e,be,Ee,G,B,ke,Pe,Y,A,Ne,Z,v,_,H,k,$e,U,Le,ee,C,Te,te;return b=new je({}),E=new je({}),k=new je({}),{c(){g=n("meta"),J=c(),p=n("h1"),y=n("a"),q=n("span"),qe(b.$$.fragment),se=c(),O=n("span"),ie=r("Natural Language Processing"),D=c(),P=n("p"),re=r("Before jumping into Transformer models, let\u2019s do a quick overview of what natural language processing is and why we care about it."),K=c(),w=n("h2"),x=n("a"),R=n("span"),qe(E.$$.fragment),le=c(),W=n("span"),he=r("What is NLP?"),Q=c(),N=n("p"),ce=r("NLP is a field of linguistics and machine learning focused on understanding everything related to human language. The aim of NLP tasks is not only to understand single words individually, but to be able to understand the context of those words."),V=c(),$=n("p"),me=r("The following is a list of common NLP tasks, with some examples of each:"),X=c(),f=n("ul"),L=n("li"),F=n("strong"),fe=r("Classifying whole sentences"),ue=r(": Getting the sentiment of a review, detecting if an email is spam, determining if a sentence is grammatically correct or whether two sentences are logically related or not"),de=c(),T=n("li"),M=n("strong"),ge=r("Classifying each word in a sentence"),pe=r(": Identifying the grammatical components of a sentence (noun, verb, adjective), or the named entities (person, location, organization)"),we=c(),I=n("li"),j=n("strong"),ve=r("Generating text content"),ye=r(": Completing a prompt with auto-generated text, filling in the blanks in a text with masked words"),xe=c(),S=n("li"),z=n("strong"),_e=r("Extracting an answer from a text"),be=r(": Given a question and a context, extracting the answer to the question based on the information provided in the context"),Ee=c(),G=n("li"),B=n("strong"),ke=r("Generating a new sentence from an input text"),Pe=r(": Translating a text into another language, summarizing a text"),Y=c(),A=n("p"),Ne=r("NLP isn\u2019t limited to written text though. It also tackles complex challenges in speech recognition and computer vision, such as generating a transcript of an audio sample or a description of an image."),Z=c(),v=n("h2"),_=n("a"),H=n("span"),qe(k.$$.fragment),$e=c(),U=n("span"),Le=r("Why is it challenging?"),ee=c(),C=n("p"),Te=r("Computers don\u2019t process information in the same way as humans. For example, when we read the sentence \u201CI am hungry,\u201D we can easily understand its meaning. Similarly, given two sentences such as \u201CI am hungry\u201D and \u201CI am sad,\u201D we\u2019re able to easily determine how similar they are. For machine learning (ML) models, such tasks are more difficult. The text needs to be processed in a way that enables the model to learn from it. And because language is complex, we need to think carefully about how this processing must be done. There has been a lot of research done on how to represent text, and we will look at some methods in the next chapter."),this.h()},l(e){const i=mt('[data-svelte="svelte-1phssyn"]',document.head);g=o(i,"META",{name:!0,content:!0}),i.forEach(t),J=m(e),p=o(e,"H1",{class:!0});var ae=s(p);y=o(ae,"A",{id:!0,class:!0,href:!0});var Be=s(y);q=o(Be,"SPAN",{});var He=s(q);Oe(b.$$.fragment,He),He.forEach(t),Be.forEach(t),se=m(ae),O=o(ae,"SPAN",{});var Ue=s(O);ie=l(Ue,"Natural Language Processing"),Ue.forEach(t),ae.forEach(t),D=m(e),P=o(e,"P",{});var Je=s(P);re=l(Je,"Before jumping into Transformer models, let\u2019s do a quick overview of what natural language processing is and why we care about it."),Je.forEach(t),K=m(e),w=o(e,"H2",{class:!0});var ne=s(w);x=o(ne,"A",{id:!0,class:!0,href:!0});var De=s(x);R=o(De,"SPAN",{});var Ke=s(R);Oe(E.$$.fragment,Ke),Ke.forEach(t),De.forEach(t),le=m(ne),W=o(ne,"SPAN",{});var Qe=s(W);he=l(Qe,"What is NLP?"),Qe.forEach(t),ne.forEach(t),Q=m(e),N=o(e,"P",{});var Ve=s(N);ce=l(Ve,"NLP is a field of linguistics and machine learning focused on understanding everything related to human language. The aim of NLP tasks is not only to understand single words individually, but to be able to understand the context of those words."),Ve.forEach(t),V=m(e),$=o(e,"P",{});var Xe=s($);me=l(Xe,"The following is a list of common NLP tasks, with some examples of each:"),Xe.forEach(t),X=m(e),f=o(e,"UL",{});var d=s(f);L=o(d,"LI",{});var Ie=s(L);F=o(Ie,"STRONG",{});var Ye=s(F);fe=l(Ye,"Classifying whole sentences"),Ye.forEach(t),ue=l(Ie,": Getting the sentiment of a review, detecting if an email is spam, determining if a sentence is grammatically correct or whether two sentences are logically related or not"),Ie.forEach(t),de=m(d),T=o(d,"LI",{});var Se=s(T);M=o(Se,"STRONG",{});var Ze=s(M);ge=l(Ze,"Classifying each word in a sentence"),Ze.forEach(t),pe=l(Se,": Identifying the grammatical components of a sentence (noun, verb, adjective), or the named entities (person, location, organization)"),Se.forEach(t),we=m(d),I=o(d,"LI",{});var Ge=s(I);j=o(Ge,"STRONG",{});var et=s(j);ve=l(et,"Generating text content"),et.forEach(t),ye=l(Ge,": Completing a prompt with auto-generated text, filling in the blanks in a text with masked words"),Ge.forEach(t),xe=m(d),S=o(d,"LI",{});var Ae=s(S);z=o(Ae,"STRONG",{});var tt=s(z);_e=l(tt,"Extracting an answer from a text"),tt.forEach(t),be=l(Ae,": Given a question and a context, extracting the answer to the question based on the information provided in the context"),Ae.forEach(t),Ee=m(d),G=o(d,"LI",{});var Ce=s(G);B=o(Ce,"STRONG",{});var at=s(B);ke=l(at,"Generating a new sentence from an input text"),at.forEach(t),Pe=l(Ce,": Translating a text into another language, summarizing a text"),Ce.forEach(t),d.forEach(t),Y=m(e),A=o(e,"P",{});var nt=s(A);Ne=l(nt,"NLP isn\u2019t limited to written text though. It also tackles complex challenges in speech recognition and computer vision, such as generating a transcript of an audio sample or a description of an image."),nt.forEach(t),Z=m(e),v=o(e,"H2",{class:!0});var oe=s(v);_=o(oe,"A",{id:!0,class:!0,href:!0});var ot=s(_);H=o(ot,"SPAN",{});var st=s(H);Oe(k.$$.fragment,st),st.forEach(t),ot.forEach(t),$e=m(oe),U=o(oe,"SPAN",{});var it=s(U);Le=l(it,"Why is it challenging?"),it.forEach(t),oe.forEach(t),ee=m(e),C=o(e,"P",{});var rt=s(C);Te=l(rt,"Computers don\u2019t process information in the same way as humans. For example, when we read the sentence \u201CI am hungry,\u201D we can easily understand its meaning. Similarly, given two sentences such as \u201CI am hungry\u201D and \u201CI am sad,\u201D we\u2019re able to easily determine how similar they are. For machine learning (ML) models, such tasks are more difficult. The text needs to be processed in a way that enables the model to learn from it. And because language is complex, we need to think carefully about how this processing must be done. There has been a lot of research done on how to represent text, and we will look at some methods in the next chapter."),rt.forEach(t),this.h()},h(){u(g,"name","hf:doc:metadata"),u(g,"content",JSON.stringify(gt)),u(y,"id","natural-language-processing"),u(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"),u(y,"href","#natural-language-processing"),u(p,"class","relative group"),u(x,"id","what-is-nlp"),u(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"),u(x,"href","#what-is-nlp"),u(w,"class","relative group"),u(_,"id","why-is-it-challenging"),u(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_,"href","#why-is-it-challenging"),u(v,"class","relative group")},m(e,i){a(document.head,g),h(e,J,i),h(e,p,i),a(p,y),a(y,q),Re(b,q,null),a(p,se),a(p,O),a(O,ie),h(e,D,i),h(e,P,i),a(P,re),h(e,K,i),h(e,w,i),a(w,x),a(x,R),Re(E,R,null),a(w,le),a(w,W),a(W,he),h(e,Q,i),h(e,N,i),a(N,ce),h(e,V,i),h(e,$,i),a($,me),h(e,X,i),h(e,f,i),a(f,L),a(L,F),a(F,fe),a(L,ue),a(f,de),a(f,T),a(T,M),a(M,ge),a(T,pe),a(f,we),a(f,I),a(I,j),a(j,ve),a(I,ye),a(f,xe),a(f,S),a(S,z),a(z,_e),a(S,be),a(f,Ee),a(f,G),a(G,B),a(B,ke),a(G,Pe),h(e,Y,i),h(e,A,i),a(A,Ne),h(e,Z,i),h(e,v,i),a(v,_),a(_,H),Re(k,H,null),a(v,$e),a(v,U),a(U,Le),h(e,ee,i),h(e,C,i),a(C,Te),te=!0},p:ft,i(e){te||(We(b.$$.fragment,e),We(E.$$.fragment,e),We(k.$$.fragment,e),te=!0)},o(e){Fe(b.$$.fragment,e),Fe(E.$$.fragment,e),Fe(k.$$.fragment,e),te=!1},d(e){t(g),e&&t(J),e&&t(p),Me(b),e&&t(D),e&&t(P),e&&t(K),e&&t(w),Me(E),e&&t(Q),e&&t(N),e&&t(V),e&&t($),e&&t(X),e&&t(f),e&&t(Y),e&&t(A),e&&t(Z),e&&t(v),Me(k),e&&t(ee),e&&t(C)}}}const gt={local:"natural-language-processing",sections:[{local:"what-is-nlp",title:"What is NLP?"},{local:"why-is-it-challenging",title:"Why is it challenging?"}],title:"Natural Language Processing"};function pt(ze){return ut(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yt extends lt{constructor(g){super();ht(this,g,pt,dt,ct,{})}}export{yt as default,gt as metadata};
