Classify text
classifyLabel a text's sentiment, emotion, or toxicity locally with a small chosen model, returning the top label and its 0–1 score.
Instructions
Classify a text's sentiment, emotion or toxicity, locally, with a small model chosen by model. Returns the top label with its score from 0 to 1, then every label's score. Use it to label one text; to compare two texts use similarity, and to order passages by relevance use rerank. Each model downloads on first use (90-700 MB) and then answers in milliseconds.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "classify"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to classify: a sentence to a few paragraphs. English, except for bert-sentiment-multilingual. | |
| model | No | Which classifier. distilbert-sentiment (default): positive or negative, fastest. roberta-sentiment: negative, neutral or positive, tuned on social media. distilroberta-emotion: 7 emotions (anger, disgust, fear, joy, neutral, sadness, surprise). roberta-emotions: 28 finer emotions, several can apply at once. toxic-bert: toxic, severe_toxic, obscene, threat, insult, identity_hate, each scored on its own. bert-sentiment-multilingual: 1 to 5 stars, for English, German, French, Spanish, Italian and Dutch. |