Buckets:
| import{s as ce,o as he,n as ue}from"../chunks/scheduler.ddb4e551.js";import{S as $e,i as be,g as r,s as i,r as d,B as we,h as o,f as a,c as l,j as ge,u as m,x as u,k as pe,y as ye,a as n,v as g,d as p,t as c,w as h}from"../chunks/index.e16e4efa.js";import{T as ve}from"../chunks/Tip.20abb04f.js";import{H as j,E as xe}from"../chunks/index.e108c5ed.js";import{I as Te}from"../chunks/InferenceSnippet.8df18a84.js";function _e(S){let s,b='For more details about the <code>text-classification</code> task, check out its <a href="https://huggingface.co/tasks/text-classification" rel="nofollow">dedicated page</a>! You will find examples and related materials.';return{c(){s=r("p"),s.innerHTML=b},l(f){s=o(f,"P",{"data-svelte-h":!0}),u(s)!=="svelte-dggpky"&&(s.innerHTML=b)},m(f,R){n(f,s,R)},p:ue,d(f){f&&a(s)}}}function Pe(S){let s,b,f,R,w,z,y,ne="Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness.",U,$,G,v,D,x,ie='<li><a href="https://huggingface.co/distilbert/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">distilbert/distilbert-base-uncased-finetuned-sst-2-english</a>: A robust model trained for sentiment analysis.</li> <li><a href="https://huggingface.co/ProsusAI/finbert" rel="nofollow">ProsusAI/finbert</a>: A sentiment analysis model specialized in financial sentiment.</li> <li><a href="https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment-latest" rel="nofollow">cardiffnlp/twitter-roberta-base-sentiment-latest</a>: A sentiment analysis model specialized in analyzing tweets.</li> <li><a href="https://huggingface.co/papluca/xlm-roberta-base-language-detection" rel="nofollow">papluca/xlm-roberta-base-language-detection</a>: A model that can classify languages.</li> <li><a href="https://huggingface.co/meta-llama/Prompt-Guard-86M" rel="nofollow">meta-llama/Prompt-Guard-86M</a>: A model that can classify text generation attacks.</li>',F,T,le='Explore all available models and find the one that suits you best <a href="https://huggingface.co/models?inference=warm&pipeline_tag=text-classification&sort=trending" rel="nofollow">here</a>.',O,_,Y,P,K,M,W,A,J,I,se='<thead><tr><th align="left">Payload</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>inputs*</strong></td> <td align="left"><em>string</em></td> <td align="left">The text to classify</td></tr> <tr><td align="left"><strong>parameters</strong></td> <td align="left"><em>object</em></td> <td align="left"></td></tr> <tr><td align="left"><strong> function_to_apply</strong></td> <td align="left"><em>enum</em></td> <td align="left">Possible values: sigmoid, softmax, none.</td></tr> <tr><td align="left"><strong> top_k</strong></td> <td align="left"><em>integer</em></td> <td align="left">When specified, limits the output to the top K most probable classes.</td></tr></tbody>',N,H,re="Some options can be configured by passing headers to the Inference API. Here are the available headers:",Q,L,oe='<thead><tr><th align="left">Headers</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>authorization</strong></td> <td align="left"><em>string</em></td> <td align="left">Authentication header in the form <code>'Bearer: hf_****'</code> when <code>hf_****</code> is a personal user access token with Inference API permission. You can generate one from <a href="https://huggingface.co/settings/tokens" rel="nofollow">your settings page</a>.</td></tr> <tr><td align="left"><strong>x-use-cache</strong></td> <td align="left"><em>boolean, default to <code>true</code></em></td> <td align="left">There is a cache layer on the inference API to speed up requests we have already seen. Most models can use those results as they are deterministic (meaning the outputs will be the same anyway). However, if you use a nondeterministic model, you can set this parameter to prevent the caching mechanism from being used, resulting in a real new query. Read more about caching <a href="../parameters#caching%5D">here</a>.</td></tr> <tr><td align="left"><strong>x-wait-for-model</strong></td> <td align="left"><em>boolean, default to <code>false</code></em></td> <td align="left">If the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done. It is advised to only set this flag to true after receiving a 503 error, as it will limit hanging in your application to known places. Read more about model availability <a href="../overview#eligibility%5D">here</a>.</td></tr></tbody>',V,k,fe='For more information about Inference API headers, check out the parameters <a href="../parameters">guide</a>.',X,C,Z,q,de='<thead><tr><th align="left">Body</th> <th align="left"></th> <th align="left"></th></tr></thead> <tbody><tr><td align="left"><strong>(array)</strong></td> <td align="left"><em>object[]</em></td> <td align="left">Output is an array of objects.</td></tr> <tr><td align="left"><strong> label</strong></td> <td align="left"><em>string</em></td> <td align="left">The predicted class label.</td></tr> <tr><td align="left"><strong> score</strong></td> <td align="left"><em>number</em></td> <td align="left">The corresponding probability.</td></tr></tbody>',ee,E,te,B,ae;return w=new j({props:{title:"Text Classification",local:"text-classification",headingTag:"h2"}}),$=new ve({props:{$$slots:{default:[_e]},$$scope:{ctx:S}}}),v=new j({props:{title:"Recommended models",local:"recommended-models",headingTag:"h3"}}),_=new j({props:{title:"Using the API",local:"using-the-api",headingTag:"h3"}}),P=new Te({props:{pipeline:"text-classification",providersMapping:{"hf-inference":{modelId:"cardiffnlp/twitter-roberta-base-sentiment-latest",providerModelId:"cardiffnlp/twitter-roberta-base-sentiment-latest"}}}}),M=new j({props:{title:"API specification",local:"api-specification",headingTag:"h3"}}),A=new j({props:{title:"Request",local:"request",headingTag:"h4"}}),C=new j({props:{title:"Response",local:"response",headingTag:"h4"}}),E=new xe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/tasks/text-classification.md"}}),{c(){s=r("meta"),b=i(),f=r("p"),R=i(),d(w.$$.fragment),z=i(),y=r("p"),y.textContent=ne,U=i(),d($.$$.fragment),G=i(),d(v.$$.fragment),D=i(),x=r("ul"),x.innerHTML=ie,F=i(),T=r("p"),T.innerHTML=le,O=i(),d(_.$$.fragment),Y=i(),d(P.$$.fragment),K=i(),d(M.$$.fragment),W=i(),d(A.$$.fragment),J=i(),I=r("table"),I.innerHTML=se,N=i(),H=r("p"),H.textContent=re,Q=i(),L=r("table"),L.innerHTML=oe,V=i(),k=r("p"),k.innerHTML=fe,X=i(),d(C.$$.fragment),Z=i(),q=r("table"),q.innerHTML=de,ee=i(),d(E.$$.fragment),te=i(),B=r("p"),this.h()},l(e){const t=we("svelte-u9bgzb",document.head);s=o(t,"META",{name:!0,content:!0}),t.forEach(a),b=l(e),f=o(e,"P",{}),ge(f).forEach(a),R=l(e),m(w.$$.fragment,e),z=l(e),y=o(e,"P",{"data-svelte-h":!0}),u(y)!=="svelte-q5vj9y"&&(y.textContent=ne),U=l(e),m($.$$.fragment,e),G=l(e),m(v.$$.fragment,e),D=l(e),x=o(e,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-17g0kk8"&&(x.innerHTML=ie),F=l(e),T=o(e,"P",{"data-svelte-h":!0}),u(T)!=="svelte-1m4reo9"&&(T.innerHTML=le),O=l(e),m(_.$$.fragment,e),Y=l(e),m(P.$$.fragment,e),K=l(e),m(M.$$.fragment,e),W=l(e),m(A.$$.fragment,e),J=l(e),I=o(e,"TABLE",{"data-svelte-h":!0}),u(I)!=="svelte-eokrjx"&&(I.innerHTML=se),N=l(e),H=o(e,"P",{"data-svelte-h":!0}),u(H)!=="svelte-xa4wks"&&(H.textContent=re),Q=l(e),L=o(e,"TABLE",{"data-svelte-h":!0}),u(L)!=="svelte-2rfiu7"&&(L.innerHTML=oe),V=l(e),k=o(e,"P",{"data-svelte-h":!0}),u(k)!=="svelte-1ps9cb1"&&(k.innerHTML=fe),X=l(e),m(C.$$.fragment,e),Z=l(e),q=o(e,"TABLE",{"data-svelte-h":!0}),u(q)!=="svelte-1mk6wu5"&&(q.innerHTML=de),ee=l(e),m(E.$$.fragment,e),te=l(e),B=o(e,"P",{}),ge(B).forEach(a),this.h()},h(){pe(s,"name","hf:doc:metadata"),pe(s,"content",Me)},m(e,t){ye(document.head,s),n(e,b,t),n(e,f,t),n(e,R,t),g(w,e,t),n(e,z,t),n(e,y,t),n(e,U,t),g($,e,t),n(e,G,t),g(v,e,t),n(e,D,t),n(e,x,t),n(e,F,t),n(e,T,t),n(e,O,t),g(_,e,t),n(e,Y,t),g(P,e,t),n(e,K,t),g(M,e,t),n(e,W,t),g(A,e,t),n(e,J,t),n(e,I,t),n(e,N,t),n(e,H,t),n(e,Q,t),n(e,L,t),n(e,V,t),n(e,k,t),n(e,X,t),g(C,e,t),n(e,Z,t),n(e,q,t),n(e,ee,t),g(E,e,t),n(e,te,t),n(e,B,t),ae=!0},p(e,[t]){const me={};t&2&&(me.$$scope={dirty:t,ctx:e}),$.$set(me)},i(e){ae||(p(w.$$.fragment,e),p($.$$.fragment,e),p(v.$$.fragment,e),p(_.$$.fragment,e),p(P.$$.fragment,e),p(M.$$.fragment,e),p(A.$$.fragment,e),p(C.$$.fragment,e),p(E.$$.fragment,e),ae=!0)},o(e){c(w.$$.fragment,e),c($.$$.fragment,e),c(v.$$.fragment,e),c(_.$$.fragment,e),c(P.$$.fragment,e),c(M.$$.fragment,e),c(A.$$.fragment,e),c(C.$$.fragment,e),c(E.$$.fragment,e),ae=!1},d(e){e&&(a(b),a(f),a(R),a(z),a(y),a(U),a(G),a(D),a(x),a(F),a(T),a(O),a(Y),a(K),a(W),a(J),a(I),a(N),a(H),a(Q),a(L),a(V),a(k),a(X),a(Z),a(q),a(ee),a(te),a(B)),a(s),h(w,e),h($,e),h(v,e),h(_,e),h(P,e),h(M,e),h(A,e),h(C,e),h(E,e)}}}const Me='{"title":"Text Classification","local":"text-classification","sections":[{"title":"Recommended models","local":"recommended-models","sections":[],"depth":3},{"title":"Using the API","local":"using-the-api","sections":[],"depth":3},{"title":"API specification","local":"api-specification","sections":[{"title":"Request","local":"request","sections":[],"depth":4},{"title":"Response","local":"response","sections":[],"depth":4}],"depth":3}],"depth":2}';function Ae(S){return he(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qe extends $e{constructor(s){super(),be(this,s,Ae,Pe,ce,{})}}export{qe as component}; | |
Xet Storage Details
- Size:
- 9.67 kB
- Xet hash:
- ad76623f9e004a7f574e8b70ef26218d5a2299c70991396e7537d665683eceab
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.