import{s as Ue,n as _e,o as Ie}from"../chunks/scheduler.9cda857a.js";import{S as We,i as Ce,e as s,s as n,c as f,h as Je,a as r,d as l,b as a,f as Le,g as p,j as o,k as ce,l as Ge,m as i,n as m,t as u,o as g,p as c}from"../chunks/index.003612b0.js";import{C as Fe}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as de}from"../chunks/CodeBlock.a90632f1.js";import{H as E,E as Pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function Be(he){let d,V,B,Y,b,S,w,R,M,$e=`<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,y,X,T,be='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>.',N,v,we="All models on the Hub come with these useful features:",Q,j,Me="<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>",z,x,O,H,ye=`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:`,D,k,K,Z,ee,L,Te="All <code>flair</code> models can easily be loaded from the Hub:",te,U,le,_,ve="Once loaded, you can use <code>predict()</code> to perform inference:",ie,I,ne,W,je="It outputs the following:",ae,C,se,J,xe="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!",re,h,He='<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"/>',oe,$,ke='<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"/>',fe,G,pe,F,Ze='<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>',me,P,ue,q,ge;return b=new Fe({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new E({props:{title:"Using Flair at Hugging Face",local:"using-flair-at-hugging-face",headingTag:"h1"}}),y=new E({props:{title:"Exploring Flair in the Hub",local:"exploring-flair-in-the-hub",headingTag:"h2"}}),x=new E({props:{title:"Installation",local:"installation",headingTag:"h2"}}),k=new de({props:{code:"JTI0JTIwcGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhaXI=",highlighted:'$ pip <span class="hljs-keyword">install</span> -U flair',wrap:!1}}),Z=new E({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),U=new de({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}}),I=new de({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}}),C=new de({props:{code:"U2VudGVuY2UlNUI2JTVEJTNBJTIwJTIyR2VvcmdlJTIwV2FzaGluZ3RvbiUyMGdpbmclMjBuYWNoJTIwV2FzaGluZ3Rvbi4lMjIlMjAlRTIlODYlOTIlMjAlNUIlMjJHZW9yZ2UlMjBXYXNoaW5ndG9uJTIyJTJGUEVSJTJDJTIwJTIyV2FzaGluZ3RvbiUyMiUyRkxPQyU1RA==",highlighted:"Sentence[6]: &quot;George Washington ging nach Washington.&quot; → [&quot;George Washington&quot;/PER, &quot;Washington&quot;/LOC]",wrap:!1}}),G=new E({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),P=new Pe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/flair.md"}}),{c(){d=s("meta"),V=n(),B=s("p"),Y=n(),f(b.$$.fragment),S=n(),f(w.$$.fragment),R=n(),M=s("p"),M.innerHTML=$e,A=n(),f(y.$$.fragment),X=n(),T=s("p"),T.innerHTML=be,N=n(),v=s("p"),v.textContent=we,Q=n(),j=s("ol"),j.innerHTML=Me,z=n(),f(x.$$.fragment),O=n(),H=s("p"),H.innerHTML=ye,D=n(),f(k.$$.fragment),K=n(),f(Z.$$.fragment),ee=n(),L=s("p"),L.innerHTML=Te,te=n(),f(U.$$.fragment),le=n(),_=s("p"),_.innerHTML=ve,ie=n(),f(I.$$.fragment),ne=n(),W=s("p"),W.textContent=je,ae=n(),f(C.$$.fragment),se=n(),J=s("p"),J.innerHTML=xe,re=n(),h=s("div"),h.innerHTML=He,oe=n(),$=s("div"),$.innerHTML=ke,fe=n(),f(G.$$.fragment),pe=n(),F=s("ul"),F.innerHTML=Ze,me=n(),f(P.$$.fragment),ue=n(),q=s("p"),this.h()},l(e){const t=Je("svelte-u9bgzb",document.head);d=r(t,"META",{name:!0,content:!0}),t.forEach(l),V=a(e),B=r(e,"P",{}),Le(B).forEach(l),Y=a(e),p(b.$$.fragment,e),S=a(e),p(w.$$.fragment,e),R=a(e),M=r(e,"P",{"data-svelte-h":!0}),o(M)!=="svelte-1ozdbq5"&&(M.innerHTML=$e),A=a(e),p(y.$$.fragment,e),X=a(e),T=r(e,"P",{"data-svelte-h":!0}),o(T)!=="svelte-91rtgq"&&(T.innerHTML=be),N=a(e),v=r(e,"P",{"data-svelte-h":!0}),o(v)!=="svelte-qgdcoc"&&(v.textContent=we),Q=a(e),j=r(e,"OL",{"data-svelte-h":!0}),o(j)!=="svelte-15umf4s"&&(j.innerHTML=Me),z=a(e),p(x.$$.fragment,e),O=a(e),H=r(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-troscu"&&(H.innerHTML=ye),D=a(e),p(k.$$.fragment,e),K=a(e),p(Z.$$.fragment,e),ee=a(e),L=r(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-xc3wwf"&&(L.innerHTML=Te),te=a(e),p(U.$$.fragment,e),le=a(e),_=r(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-mandx6"&&(_.innerHTML=ve),ie=a(e),p(I.$$.fragment,e),ne=a(e),W=r(e,"P",{"data-svelte-h":!0}),o(W)!=="svelte-7whdhn"&&(W.textContent=je),ae=a(e),p(C.$$.fragment,e),se=a(e),J=r(e,"P",{"data-svelte-h":!0}),o(J)!=="svelte-yhb4"&&(J.innerHTML=xe),re=a(e),h=r(e,"DIV",{class:!0,"data-svelte-h":!0}),o(h)!=="svelte-kr6ze7"&&(h.innerHTML=He),oe=a(e),$=r(e,"DIV",{class:!0,"data-svelte-h":!0}),o($)!=="svelte-1x3tft"&&($.innerHTML=ke),fe=a(e),p(G.$$.fragment,e),pe=a(e),F=r(e,"UL",{"data-svelte-h":!0}),o(F)!=="svelte-1fs4a6h"&&(F.innerHTML=Ze),me=a(e),p(P.$$.fragment,e),ue=a(e),q=r(e,"P",{}),Le(q).forEach(l),this.h()},h(){ce(d,"name","hf:doc:metadata"),ce(d,"content",qe),ce(h,"class","flex justify-center"),ce($,"class","flex justify-center")},m(e,t){Ge(document.head,d),i(e,V,t),i(e,B,t),i(e,Y,t),m(b,e,t),i(e,S,t),m(w,e,t),i(e,R,t),i(e,M,t),i(e,A,t),m(y,e,t),i(e,X,t),i(e,T,t),i(e,N,t),i(e,v,t),i(e,Q,t),i(e,j,t),i(e,z,t),m(x,e,t),i(e,O,t),i(e,H,t),i(e,D,t),m(k,e,t),i(e,K,t),m(Z,e,t),i(e,ee,t),i(e,L,t),i(e,te,t),m(U,e,t),i(e,le,t),i(e,_,t),i(e,ie,t),m(I,e,t),i(e,ne,t),i(e,W,t),i(e,ae,t),m(C,e,t),i(e,se,t),i(e,J,t),i(e,re,t),i(e,h,t),i(e,oe,t),i(e,$,t),i(e,fe,t),m(G,e,t),i(e,pe,t),i(e,F,t),i(e,me,t),m(P,e,t),i(e,ue,t),i(e,q,t),ge=!0},p:_e,i(e){ge||(u(b.$$.fragment,e),u(w.$$.fragment,e),u(y.$$.fragment,e),u(x.$$.fragment,e),u(k.$$.fragment,e),u(Z.$$.fragment,e),u(U.$$.fragment,e),u(I.$$.fragment,e),u(C.$$.fragment,e),u(G.$$.fragment,e),u(P.$$.fragment,e),ge=!0)},o(e){g(b.$$.fragment,e),g(w.$$.fragment,e),g(y.$$.fragment,e),g(x.$$.fragment,e),g(k.$$.fragment,e),g(Z.$$.fragment,e),g(U.$$.fragment,e),g(I.$$.fragment,e),g(C.$$.fragment,e),g(G.$$.fragment,e),g(P.$$.fragment,e),ge=!1},d(e){e&&(l(V),l(B),l(Y),l(S),l(R),l(M),l(A),l(X),l(T),l(N),l(v),l(Q),l(j),l(z),l(O),l(H),l(D),l(K),l(ee),l(L),l(te),l(le),l(_),l(ie),l(ne),l(W),l(ae),l(se),l(J),l(re),l(h),l(oe),l($),l(fe),l(pe),l(F),l(me),l(ue),l(q)),l(d),c(b,e),c(w,e),c(y,e),c(x,e),c(k,e),c(Z,e),c(U,e),c(I,e),c(C,e),c(G,e),c(P,e)}}}const qe='{"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 Ee(he){return Ie(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xe extends We{constructor(d){super(),Ce(this,d,Ee,Be,Ue,{})}}export{Xe as component};
