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