import{s as st,n as ot,o as rt}from"../chunks/scheduler.d6170356.js";import{S as mt,i as ut,g as s,s as l,r as x,A as ft,h as o,f as a,c as i,j as lt,u as z,x as v,k as it,y as pt,a as n,v as _,d as H,t as C,w as U}from"../chunks/index.fcd4cc08.js";import{C as dt}from"../chunks/CodeBlock.db16bf50.js";import{H as L,E as ht}from"../chunks/index.9f2da87a.js";function gt(N){let r,B,j,P,m,S,u,Q="<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.",I,f,E,p,K='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,D="All models on the Hub come up with the following features:",G,h,tt="<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,g,A,c,et="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.",R,$,V,w,W,b,at='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>.',Z,y,q,M,nt='<li><code>stanza</code> <a href="https://stanfordnlp.github.io/stanza/" rel="nofollow">docs</a>.</li>',F,T,X,J,O;return m=new L({props:{title:"Using Stanza at Hugging Face",local:"using-stanza-at-hugging-face",headingTag:"h1"}}),f=new L({props:{title:"Exploring Stanza in the Hub",local:"exploring-stanza-in-the-hub",headingTag:"h2"}}),g=new L({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),$=new dt({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}}),w=new L({props:{title:"Sharing your models",local:"sharing-your-models",headingTag:"h2"}}),y=new L({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),T=new ht({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/stanza.md"}}),{c(){r=s("meta"),B=l(),j=s("p"),P=l(),x(m.$$.fragment),S=l(),u=s("p"),u.innerHTML=Q,I=l(),x(f.$$.fragment),E=l(),p=s("p"),p.innerHTML=K,Y=l(),d=s("p"),d.textContent=D,G=l(),h=s("ol"),h.innerHTML=tt,k=l(),x(g.$$.fragment),A=l(),c=s("p"),c.innerHTML=et,R=l(),x($.$$.fragment),V=l(),x(w.$$.fragment),W=l(),b=s("p"),b.innerHTML=at,Z=l(),x(y.$$.fragment),q=l(),M=s("ul"),M.innerHTML=nt,F=l(),x(T.$$.fragment),X=l(),J=s("p"),this.h()},l(t){const e=ft("svelte-u9bgzb",document.head);r=o(e,"META",{name:!0,content:!0}),e.forEach(a),B=i(t),j=o(t,"P",{}),lt(j).forEach(a),P=i(t),z(m.$$.fragment,t),S=i(t),u=o(t,"P",{"data-svelte-h":!0}),v(u)!=="svelte-1xx2mgs"&&(u.innerHTML=Q),I=i(t),z(f.$$.fragment,t),E=i(t),p=o(t,"P",{"data-svelte-h":!0}),v(p)!=="svelte-gqdt7d"&&(p.innerHTML=K),Y=i(t),d=o(t,"P",{"data-svelte-h":!0}),v(d)!=="svelte-t2majo"&&(d.textContent=D),G=i(t),h=o(t,"OL",{"data-svelte-h":!0}),v(h)!=="svelte-cl4nek"&&(h.innerHTML=tt),k=i(t),z(g.$$.fragment,t),A=i(t),c=o(t,"P",{"data-svelte-h":!0}),v(c)!=="svelte-1fan0k"&&(c.innerHTML=et),R=i(t),z($.$$.fragment,t),V=i(t),z(w.$$.fragment,t),W=i(t),b=o(t,"P",{"data-svelte-h":!0}),v(b)!=="svelte-emvret"&&(b.innerHTML=at),Z=i(t),z(y.$$.fragment,t),q=i(t),M=o(t,"UL",{"data-svelte-h":!0}),v(M)!=="svelte-uj93kt"&&(M.innerHTML=nt),F=i(t),z(T.$$.fragment,t),X=i(t),J=o(t,"P",{}),lt(J).forEach(a),this.h()},h(){it(r,"name","hf:doc:metadata"),it(r,"content",ct)},m(t,e){pt(document.head,r),n(t,B,e),n(t,j,e),n(t,P,e),_(m,t,e),n(t,S,e),n(t,u,e),n(t,I,e),_(f,t,e),n(t,E,e),n(t,p,e),n(t,Y,e),n(t,d,e),n(t,G,e),n(t,h,e),n(t,k,e),_(g,t,e),n(t,A,e),n(t,c,e),n(t,R,e),_($,t,e),n(t,V,e),_(w,t,e),n(t,W,e),n(t,b,e),n(t,Z,e),_(y,t,e),n(t,q,e),n(t,M,e),n(t,F,e),_(T,t,e),n(t,X,e),n(t,J,e),O=!0},p:ot,i(t){O||(H(m.$$.fragment,t),H(f.$$.fragment,t),H(g.$$.fragment,t),H($.$$.fragment,t),H(w.$$.fragment,t),H(y.$$.fragment,t),H(T.$$.fragment,t),O=!0)},o(t){C(m.$$.fragment,t),C(f.$$.fragment,t),C(g.$$.fragment,t),C($.$$.fragment,t),C(w.$$.fragment,t),C(y.$$.fragment,t),C(T.$$.fragment,t),O=!1},d(t){t&&(a(B),a(j),a(P),a(S),a(u),a(I),a(E),a(p),a(Y),a(d),a(G),a(h),a(k),a(A),a(c),a(R),a(V),a(W),a(b),a(Z),a(q),a(M),a(F),a(X),a(J)),a(r),U(m,t),U(f,t),U(g,t),U($,t),U(w,t),U(y,t),U(T,t)}}}const ct='{"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 $t(N){return rt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends mt{constructor(r){super(),ut(this,r,$t,gt,st,{})}}export{Tt as component};
