节点 / builtin / ai / localai
Classify Text
Sort text into your own labels on-device — no training needed
此内容尚不支持你的语言。
Sort text into labels you make up, such as billing, bug report, other, with a model that runs in your browser. No training needed.
What it does
Section titled “What it does”Classify Text scores the Text against every label in Labels with a zero-shot model such as DeBERTa zero-shot, and returns the best label plus a score for each one. If even the best label scores below Confidence threshold, label is null, so you can send “none of the above” to its own branch.
By default the labels compete for one answer, so their scores add up to about 1. Turn on Allow several labels to score each label on its own, so several can be high at once. There is no cost per run and no API key.
When to use it
Section titled “When to use it”- Route incoming messages or tickets by topic or intent.
- Tag notes or scraped content with categories you invent on the spot.
- Get the Text Classifier result for free, privately and offline, without connecting a model.
For fixed sentiment or toxicity labels, Analyze Text is simpler.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Text | Long text | The text to classify. |
| Labels | Text | Any words you like, no training needed — e.g. billing, bug report, other. |
| Model | Model picker | Only zero-shot (NLI) models are listed here. |
| Allow several labels | Toggle | Score each label independently (several can be high) instead of making them compete for one answer. 默认值:Off |
| Confidence threshold | Number | Below this, label is null. 默认值:0.3 |
- Labels: separate labels with commas or new lines. Duplicates are ignored, whatever their case. An expression can also return a list, for example
{{ $input.categories }}. - Clear, descriptive labels work best:
refund requestbeatsmoney.
Outputs
Section titled “Outputs”-
Output
Each output item has these fields:
| Field | 类型 | What it holds |
|---|---|---|
| label | Text | The best label, or null below the threshold |
| score | Number | |
| labels | List of entries |
{ "label": "…", "score": 0, "labels": []}score is the best label’s score, reported even when label is null. labels lists every label as { label, score }, best first, which is useful with Allow several labels.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
The Model picker lists your installed zero-shot models first, then ones that download on first use. Manage them on the Local AI page.
Example workflow
Section titled “Example workflow”Sort the text you select into a category:
- Context Menu with Menu Contexts set to Selection.
- Classify Text with Text
{{ $input.selectionText }}, Labelsinvoice, meeting request, newsletter, otherand Model DeBERTa zero-shot. - Switch with one rule per label on
{{ $input.label }}. Items with anulllabel go to the Anything else fallback branch for manual review.
Common issues
Section titled “Common issues”- “Choose a zero-shot model to classify with.” Model is empty. Pick one.
- “Provide some text to classify.” Text is empty after expressions run.
- “Add at least one label (comma-separated).” Labels is empty, or the expression returned nothing.
labelis often null. Lower Confidence threshold, or make the labels more distinct.- Several labels look right. Turn on Allow several labels and read the scores in
labels.
Related nodes
Section titled “Related nodes”- Text Classifier: the AI agent version; connect a Local Classifier to run it on-device.
- Analyze Text: fixed sentiment and toxicity labels.
- Switch: route items by label.
- Summarize: condense long text first.