Skip to content
Catalog

cn8/text-classify

Send a `text` and a list of candidate `labels`, and get back the best-matching label,

Learn more about Zero-Shot Classification
Text NLPsyncInstant previewtextanalysisnlp

Try it

Text to classify
Candidate labelsType a label and press Enter.
sportspoliticstechnologyfinance

Result

Results show up here

The sample input is ready — just hit Run.

Overview

Send a text and a list of candidate labels, and get back the best-matching label, its confidence score, and an all_scores map of every label to its score. You define the labels at request time, so there's no training step and no model to manage. Responses are synchronous — one request, one result. Great for routing tickets, tagging content and detecting intent.

Key capabilities

Your own labels, no training

Provide any set of labels and each one is scored against the text — change them whenever you like.

Best label + full ranking

Get the single best label plus a complete label-to-score map for everything else.

One simple call

Send text and labels as JSON and get a structured result back.

Multilingual

Works across languages — keep your labels in the same language as the text for best results.

When to use it

Ticket routing

Sort support tickets into departments (billing / technical / sales) without a custom model.

Content tagging

Assign your own tags to articles, reviews or posts from any label set.

Intent detection

Detect user intent (greeting, question, complaint, request) from a label list.

Input & output

input

text: a string to classify, plus labels: an array of candidate labels.

JSON body

output

The top label, its score, and an all_scores map of every label to its score.

JSON

Guides & tips

How it works

  • You provide a text and a list of candidate labels.
  • Each label is scored against the text, and the best one is returned at data.label with its score.
  • The full ranking is available in all_scores — sort it by value to see how every label scored.

Tips

  • Send one text per request, along with the labels you want to score it against.
  • Keep the label set focused (around 3–20 labels). More labels means a bit more processing time, but the price is the same.
  • Use labels in the same language as the text.
  • To rank labels yourself, sort all_scores by value (descending) — the top entry matches data.label.
  • If you have example texts for each category, use Few-Shot Classification instead.

Specs

Latency
Typically 1–3 seconds (scales with the number of labels)
Async
false
Rate Limit
Per API key
Max Input
Up to roughly 512 tokens of text

Schema

Request body

textrequiredstring

The text to classify.

labelsrequiredarray<string>

Candidate labels — keep them in the same language as the text for best results.

Response

labelstring

Best-matching label.

scorenumber

Confidence of the top label, from 0 to 1.

all_scoresobject<string,number>

Map of every label to its score. Sort by value to rank the labels.

Pricing

Billed per request, regardless of the number of labels.

ServiceUnitPrice
Zero-Shot Classificationitem$0.006/request

FAQ

Related models