import{s as le,n as ie,o as se}from"../chunks/scheduler.d6170356.js";import{S as oe,i as re,g as s,s as l,r as x,A as me,h as o,f as a,c as i,j as ae,u as z,x as T,k as ne,y as pe,a as n,v,d as _,t as H,w as C}from"../chunks/index.fcd4cc08.js";import{C as fe}from"../chunks/CodeBlock.7b16bdef.js";import{H as J}from"../chunks/Heading.8660bd0e.js";function ue(X){let r,L,U,B,m,P,p,N="<code>stanza</code> is a collection of accurate and efficient tools for the linguistic analysis of many human languages. Starting from raw text to syntactic analysis and entity recognition, Stanza brings state-of-the-art NLP models to languages of your choosing.",S,f,I,u,O='You can find <code>stanza</code> models by filtering at the left of the <a href="https://huggingface.co/models?library=stanza&amp;sort=downloads" rel="nofollow">models page</a>. You can find over 70 models for different languages!',Y,d,Q="All models on the Hub come up with the following features:",E,h,K="<li>An automatically generated model card with a brief description and metadata tags that help for discoverability.</li> <li>An interactive widget you can use to play out with the model directly in the browser (for named entity recognition and part of speech).</li> <li>An Inference API that allows to make inference requests (for named entity recognition and part of speech).</li>",k,c,G,g,D="The <code>stanza</code> library automatically downloads models from the Hub. You can use <code>stanza.Pipeline</code> to download the model from the Hub and do inference.",A,w,R,$,V,y,ee='To add new official Stanza models, you can follow the process to <a href="https://stanfordnlp.github.io/stanza/new_language.html" rel="nofollow">add a new language</a> and then <a href="https://stanfordnlp.github.io/stanza/new_language.html#contributing-back-to-stanza" rel="nofollow">share your models with the Stanza team</a>. You can also find the official script to upload models to the Hub <a href="https://github.com/stanfordnlp/huggingface-models/blob/main/hugging_stanza.py" rel="nofollow">here</a>.',W,b,Z,M,te='<li><code>stanza</code> <a href="https://stanfordnlp.github.io/stanza/" rel="nofollow">docs</a>.</li>',q,j,F;return m=new J({props:{title:"Using Stanza at Hugging Face",local:"using-stanza-at-hugging-face",headingTag:"h1"}}),f=new J({props:{title:"Exploring Stanza in the Hub",local:"exploring-stanza-in-the-hub",headingTag:"h2"}}),c=new J({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),w=new fe({props:{code:"aW1wb3J0JTIwc3RhbnphJTBBJTBBbmxwJTIwJTNEJTIwc3RhbnphLlBpcGVsaW5lKCdlbicpJTIwJTIzJTIwZG93bmxvYWQlMjB0aCUyMEVuZ2xpc2glMjBtb2RlbCUyMGFuZCUyMGluaXRpYWxpemUlMjBhbiUyMEVuZ2xpc2glMjBuZXVyYWwlMjBwaXBlbGluZSUwQWRvYyUyMCUzRCUyMG5scCglMjJCYXJhY2slMjBPYmFtYSUyMHdhcyUyMGJvcm4lMjBpbiUyMEhhd2FpaS4lMjIpJTIwJTIzJTIwcnVuJTIwYW5ub3RhdGlvbiUyMG92ZXIlMjBhJTIwc2VudGVuY2U=",highlighted:`<span class="hljs-keyword">import</span> stanza

nlp = stanza.Pipeline(<span class="hljs-string">&#x27;en&#x27;</span>) <span class="hljs-comment"># download th English model and initialize an English neural pipeline</span>
doc = nlp(<span class="hljs-string">&quot;Barack Obama was born in Hawaii.&quot;</span>) <span class="hljs-comment"># run annotation over a sentence</span>`,wrap:!1}}),$=new J({props:{title:"Sharing your models",local:"sharing-your-models",headingTag:"h2"}}),b=new J({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),{c(){r=s("meta"),L=l(),U=s("p"),B=l(),x(m.$$.fragment),P=l(),p=s("p"),p.innerHTML=N,S=l(),x(f.$$.fragment),I=l(),u=s("p"),u.innerHTML=O,Y=l(),d=s("p"),d.textContent=Q,E=l(),h=s("ol"),h.innerHTML=K,k=l(),x(c.$$.fragment),G=l(),g=s("p"),g.innerHTML=D,A=l(),x(w.$$.fragment),R=l(),x($.$$.fragment),V=l(),y=s("p"),y.innerHTML=ee,W=l(),x(b.$$.fragment),Z=l(),M=s("ul"),M.innerHTML=te,q=l(),j=s("p"),this.h()},l(e){const t=me("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(a),L=i(e),U=o(e,"P",{}),ae(U).forEach(a),B=i(e),z(m.$$.fragment,e),P=i(e),p=o(e,"P",{"data-svelte-h":!0}),T(p)!=="svelte-1xx2mgs"&&(p.innerHTML=N),S=i(e),z(f.$$.fragment,e),I=i(e),u=o(e,"P",{"data-svelte-h":!0}),T(u)!=="svelte-gqdt7d"&&(u.innerHTML=O),Y=i(e),d=o(e,"P",{"data-svelte-h":!0}),T(d)!=="svelte-t2majo"&&(d.textContent=Q),E=i(e),h=o(e,"OL",{"data-svelte-h":!0}),T(h)!=="svelte-cl4nek"&&(h.innerHTML=K),k=i(e),z(c.$$.fragment,e),G=i(e),g=o(e,"P",{"data-svelte-h":!0}),T(g)!=="svelte-1fan0k"&&(g.innerHTML=D),A=i(e),z(w.$$.fragment,e),R=i(e),z($.$$.fragment,e),V=i(e),y=o(e,"P",{"data-svelte-h":!0}),T(y)!=="svelte-emvret"&&(y.innerHTML=ee),W=i(e),z(b.$$.fragment,e),Z=i(e),M=o(e,"UL",{"data-svelte-h":!0}),T(M)!=="svelte-uj93kt"&&(M.innerHTML=te),q=i(e),j=o(e,"P",{}),ae(j).forEach(a),this.h()},h(){ne(r,"name","hf:doc:metadata"),ne(r,"content",de)},m(e,t){pe(document.head,r),n(e,L,t),n(e,U,t),n(e,B,t),v(m,e,t),n(e,P,t),n(e,p,t),n(e,S,t),v(f,e,t),n(e,I,t),n(e,u,t),n(e,Y,t),n(e,d,t),n(e,E,t),n(e,h,t),n(e,k,t),v(c,e,t),n(e,G,t),n(e,g,t),n(e,A,t),v(w,e,t),n(e,R,t),v($,e,t),n(e,V,t),n(e,y,t),n(e,W,t),v(b,e,t),n(e,Z,t),n(e,M,t),n(e,q,t),n(e,j,t),F=!0},p:ie,i(e){F||(_(m.$$.fragment,e),_(f.$$.fragment,e),_(c.$$.fragment,e),_(w.$$.fragment,e),_($.$$.fragment,e),_(b.$$.fragment,e),F=!0)},o(e){H(m.$$.fragment,e),H(f.$$.fragment,e),H(c.$$.fragment,e),H(w.$$.fragment,e),H($.$$.fragment,e),H(b.$$.fragment,e),F=!1},d(e){e&&(a(L),a(U),a(B),a(P),a(p),a(S),a(I),a(u),a(Y),a(d),a(E),a(h),a(k),a(G),a(g),a(A),a(R),a(V),a(y),a(W),a(Z),a(M),a(q),a(j)),a(r),C(m,e),C(f,e),C(c,e),C(w,e),C($,e),C(b,e)}}}const de='{"title":"Using Stanza at Hugging Face","local":"using-stanza-at-hugging-face","sections":[{"title":"Exploring Stanza in the Hub","local":"exploring-stanza-in-the-hub","sections":[],"depth":2},{"title":"Using existing models","local":"using-existing-models","sections":[],"depth":2},{"title":"Sharing your models","local":"sharing-your-models","sections":[],"depth":2},{"title":"Additional resources","local":"additional-resources","sections":[],"depth":2}],"depth":1}';function he(X){return se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ye extends oe{constructor(r){super(),re(this,r,he,ue,le,{})}}export{ye as component};
