import{s as Ze,n as Ue,o as _e}from"../chunks/scheduler.d6170356.js";import{S as Le,i as Ie,g as s,s as n,r as f,A as We,h as r,f as l,c as a,j as ke,u as p,x as o,k as me,y as Je,a as i,v as u,d as m,t as g,w as c}from"../chunks/index.fcd4cc08.js";import{C as ge}from"../chunks/CodeBlock.db16bf50.js";import{H as q,E as Ce}from"../chunks/index.c1f68a2b.js";function Ge(ce){let d,E,P,V,b,Y,w,de=`<a href="https://github.com/flairNLP/flair" rel="nofollow">Flair</a> is a very simple framework for state-of-the-art NLP.
Developed by <a href="https://www.informatik.hu-berlin.de/en/forschung-en/gebiete/ml-en/" rel="nofollow">Humboldt University of Berlin</a> and friends.`,A,M,R,y,he='You can find <code>flair</code> models by filtering at the left of the <a href="https://huggingface.co/models?library=flair" rel="nofollow">models page</a>.',S,T,$e="All models on the Hub come with these useful features:",X,v,be="<li>An automatically generated model card with a brief description.</li> <li>An interactive widget you can use to play with the model directly in the browser.</li> <li>An Inference API that allows you to make inference requests.</li>",N,j,Q,H,we=`To get started, you can follow the <a href="https://github.com/flairNLP/flair?tab=readme-ov-file#requirements-and-installation" rel="nofollow">Flair installation guide</a>.
You can also use the following one-line install through pip:`,z,x,O,k,D,Z,Me="All <code>flair</code> models can easily be loaded from the Hub:",K,U,ee,_,ye="Once loaded, you can use <code>predict()</code> to perform inference:",te,L,le,I,Te="It outputs the following:",ie,W,ne,J,ve="If you want to load a specific Flair model, you can click <code>Use in Flair</code> in the model card and you will be given a working snippet!",ae,h,je='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-flair_snippet1.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-flair_snippet1-dark.png"/>',se,$,He='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-flair_snippet2.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-flair_snippet2-dark.png"/>',re,C,oe,G,xe='<li>Flair <a href="https://github.com/flairNLP/flair" rel="nofollow">repository</a></li> <li>Flair <a href="https://flairnlp.github.io/docs/intro" rel="nofollow">docs</a></li> <li>Official Flair <a href="https://huggingface.co/flair" rel="nofollow">models</a> on the Hub (mainly trained by <a href="https://huggingface.co/alanakbik" rel="nofollow">@alanakbik</a> and <a href="https://huggingface.co/stefan-it" rel="nofollow">@stefan-it</a>)</li>',fe,F,pe,B,ue;return b=new q({props:{title:"Using Flair at Hugging Face",local:"using-flair-at-hugging-face",headingTag:"h1"}}),M=new q({props:{title:"Exploring Flair in the Hub",local:"exploring-flair-in-the-hub",headingTag:"h2"}}),j=new q({props:{title:"Installation",local:"installation",headingTag:"h2"}}),x=new ge({props:{code:"JTI0JTIwcGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhaXI=",highlighted:'$ pip <span class="hljs-keyword">install</span> -U flair',wrap:!1}}),k=new q({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),U=new ge({props:{code:"ZnJvbSUyMGZsYWlyLmRhdGElMjBpbXBvcnQlMjBTZW50ZW5jZSUwQWZyb20lMjBmbGFpci5tb2RlbHMlMjBpbXBvcnQlMjBTZXF1ZW5jZVRhZ2dlciUwQSUwQSUyMyUyMGxvYWQlMjB0YWdnZXIlMEF0YWdnZXIlMjAlM0QlMjBTZXF1ZW5jZVRhZ2dlci5sb2FkKCUyMmZsYWlyJTJGbmVyLW11bHRpJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> flair.data <span class="hljs-keyword">import</span> Sentence
<span class="hljs-keyword">from</span> flair.models <span class="hljs-keyword">import</span> SequenceTagger

<span class="hljs-comment"># load tagger</span>
tagger = SequenceTagger.load(<span class="hljs-string">&quot;flair/ner-multi&quot;</span>)`,wrap:!1}}),L=new ge({props:{code:"c2VudGVuY2UlMjAlM0QlMjBTZW50ZW5jZSglMjJHZW9yZ2UlMjBXYXNoaW5ndG9uJTIwZ2luZyUyMG5hY2glMjBXYXNoaW5ndG9uLiUyMiklMEF0YWdnZXIucHJlZGljdChzZW50ZW5jZSklMEElMEElMjMlMjBwcmludCUyMHNlbnRlbmNlJTBBcHJpbnQoc2VudGVuY2Up",highlighted:`sentence = Sentence(<span class="hljs-string">&quot;George Washington ging nach Washington.&quot;</span>)
tagger.predict(sentence)

<span class="hljs-comment"># print sentence</span>
<span class="hljs-built_in">print</span>(sentence)`,wrap:!1}}),W=new ge({props:{code:"U2VudGVuY2UlNUI2JTVEJTNBJTIwJTIyR2VvcmdlJTIwV2FzaGluZ3RvbiUyMGdpbmclMjBuYWNoJTIwV2FzaGluZ3Rvbi4lMjIlMjAlRTIlODYlOTIlMjAlNUIlMjJHZW9yZ2UlMjBXYXNoaW5ndG9uJTIyJTJGUEVSJTJDJTIwJTIyV2FzaGluZ3RvbiUyMiUyRkxPQyU1RA==",highlighted:"Sentence[6]: &quot;George Washington ging nach Washington.&quot; → [&quot;George Washington&quot;/PER, &quot;Washington&quot;/LOC]",wrap:!1}}),C=new q({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),F=new Ce({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/flair.md"}}),{c(){d=s("meta"),E=n(),P=s("p"),V=n(),f(b.$$.fragment),Y=n(),w=s("p"),w.innerHTML=de,A=n(),f(M.$$.fragment),R=n(),y=s("p"),y.innerHTML=he,S=n(),T=s("p"),T.textContent=$e,X=n(),v=s("ol"),v.innerHTML=be,N=n(),f(j.$$.fragment),Q=n(),H=s("p"),H.innerHTML=we,z=n(),f(x.$$.fragment),O=n(),f(k.$$.fragment),D=n(),Z=s("p"),Z.innerHTML=Me,K=n(),f(U.$$.fragment),ee=n(),_=s("p"),_.innerHTML=ye,te=n(),f(L.$$.fragment),le=n(),I=s("p"),I.textContent=Te,ie=n(),f(W.$$.fragment),ne=n(),J=s("p"),J.innerHTML=ve,ae=n(),h=s("div"),h.innerHTML=je,se=n(),$=s("div"),$.innerHTML=He,re=n(),f(C.$$.fragment),oe=n(),G=s("ul"),G.innerHTML=xe,fe=n(),f(F.$$.fragment),pe=n(),B=s("p"),this.h()},l(e){const t=We("svelte-u9bgzb",document.head);d=r(t,"META",{name:!0,content:!0}),t.forEach(l),E=a(e),P=r(e,"P",{}),ke(P).forEach(l),V=a(e),p(b.$$.fragment,e),Y=a(e),w=r(e,"P",{"data-svelte-h":!0}),o(w)!=="svelte-1ozdbq5"&&(w.innerHTML=de),A=a(e),p(M.$$.fragment,e),R=a(e),y=r(e,"P",{"data-svelte-h":!0}),o(y)!=="svelte-91rtgq"&&(y.innerHTML=he),S=a(e),T=r(e,"P",{"data-svelte-h":!0}),o(T)!=="svelte-qgdcoc"&&(T.textContent=$e),X=a(e),v=r(e,"OL",{"data-svelte-h":!0}),o(v)!=="svelte-15umf4s"&&(v.innerHTML=be),N=a(e),p(j.$$.fragment,e),Q=a(e),H=r(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-troscu"&&(H.innerHTML=we),z=a(e),p(x.$$.fragment,e),O=a(e),p(k.$$.fragment,e),D=a(e),Z=r(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-xc3wwf"&&(Z.innerHTML=Me),K=a(e),p(U.$$.fragment,e),ee=a(e),_=r(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-mandx6"&&(_.innerHTML=ye),te=a(e),p(L.$$.fragment,e),le=a(e),I=r(e,"P",{"data-svelte-h":!0}),o(I)!=="svelte-7whdhn"&&(I.textContent=Te),ie=a(e),p(W.$$.fragment,e),ne=a(e),J=r(e,"P",{"data-svelte-h":!0}),o(J)!=="svelte-yhb4"&&(J.innerHTML=ve),ae=a(e),h=r(e,"DIV",{class:!0,"data-svelte-h":!0}),o(h)!=="svelte-kr6ze7"&&(h.innerHTML=je),se=a(e),$=r(e,"DIV",{class:!0,"data-svelte-h":!0}),o($)!=="svelte-1x3tft"&&($.innerHTML=He),re=a(e),p(C.$$.fragment,e),oe=a(e),G=r(e,"UL",{"data-svelte-h":!0}),o(G)!=="svelte-1fs4a6h"&&(G.innerHTML=xe),fe=a(e),p(F.$$.fragment,e),pe=a(e),B=r(e,"P",{}),ke(B).forEach(l),this.h()},h(){me(d,"name","hf:doc:metadata"),me(d,"content",Fe),me(h,"class","flex justify-center"),me($,"class","flex justify-center")},m(e,t){Je(document.head,d),i(e,E,t),i(e,P,t),i(e,V,t),u(b,e,t),i(e,Y,t),i(e,w,t),i(e,A,t),u(M,e,t),i(e,R,t),i(e,y,t),i(e,S,t),i(e,T,t),i(e,X,t),i(e,v,t),i(e,N,t),u(j,e,t),i(e,Q,t),i(e,H,t),i(e,z,t),u(x,e,t),i(e,O,t),u(k,e,t),i(e,D,t),i(e,Z,t),i(e,K,t),u(U,e,t),i(e,ee,t),i(e,_,t),i(e,te,t),u(L,e,t),i(e,le,t),i(e,I,t),i(e,ie,t),u(W,e,t),i(e,ne,t),i(e,J,t),i(e,ae,t),i(e,h,t),i(e,se,t),i(e,$,t),i(e,re,t),u(C,e,t),i(e,oe,t),i(e,G,t),i(e,fe,t),u(F,e,t),i(e,pe,t),i(e,B,t),ue=!0},p:Ue,i(e){ue||(m(b.$$.fragment,e),m(M.$$.fragment,e),m(j.$$.fragment,e),m(x.$$.fragment,e),m(k.$$.fragment,e),m(U.$$.fragment,e),m(L.$$.fragment,e),m(W.$$.fragment,e),m(C.$$.fragment,e),m(F.$$.fragment,e),ue=!0)},o(e){g(b.$$.fragment,e),g(M.$$.fragment,e),g(j.$$.fragment,e),g(x.$$.fragment,e),g(k.$$.fragment,e),g(U.$$.fragment,e),g(L.$$.fragment,e),g(W.$$.fragment,e),g(C.$$.fragment,e),g(F.$$.fragment,e),ue=!1},d(e){e&&(l(E),l(P),l(V),l(Y),l(w),l(A),l(R),l(y),l(S),l(T),l(X),l(v),l(N),l(Q),l(H),l(z),l(O),l(D),l(Z),l(K),l(ee),l(_),l(te),l(le),l(I),l(ie),l(ne),l(J),l(ae),l(h),l(se),l($),l(re),l(oe),l(G),l(fe),l(pe),l(B)),l(d),c(b,e),c(M,e),c(j,e),c(x,e),c(k,e),c(U,e),c(L,e),c(W,e),c(C,e),c(F,e)}}}const Fe='{"title":"Using Flair at Hugging Face","local":"using-flair-at-hugging-face","sections":[{"title":"Exploring Flair in the Hub","local":"exploring-flair-in-the-hub","sections":[],"depth":2},{"title":"Installation","local":"installation","sections":[],"depth":2},{"title":"Using existing models","local":"using-existing-models","sections":[],"depth":2},{"title":"Additional resources","local":"additional-resources","sections":[],"depth":2}],"depth":1}';function Pe(ce){return _e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ye extends Le{constructor(d){super(),Ie(this,d,Pe,Ge,Ze,{})}}export{Ye as component};
