Aller au contenu
Agentic Workflowdocs
v0.8.2Installer gratuitement

nœuds / builtin / ai / aiagents

Text Classifier

Classify text into one of a set of given categories using a LLM, or on-device with a Local Classifier

IA ExtensionApplication web

Ce contenu n’est pas encore disponible dans votre langue.

Put a text into one of the categories you list, with a chat model or on-device.

workflow · classify-and-route.awf 8 étapes

Classify and Route : un workflow de 8 étapes, qui commence par Run now et se termine par Other branch, avec 1 point de ramification.

Ouvrir dans AWFlow

Text Classifier reads Text and returns the best matching category from Categories in category. What you connect to Model decides how; there is no setting to switch:

  • A chat model (for example Chat OpenAI or Web LLM) is told to answer with exactly one category name and nothing else, or unknown when none fits.
  • A Local Classifier runs in your browser: free, private and offline. With a zero-shot model, your Categories are scored and the best one wins. With a fixed-label model (sentiment, toxicity), the model’s own labels are used and Categories is ignored. System message does not apply.

The node has one output. To send each category down its own path, follow it with a Switch.

  • Sort support requests into billing, technical, sales and route each to the right team.
  • Tag articles or emails by topic before you save them.
  • Detect the intent of a chat message (question, complaint, order).

To label tone only, use Sentiment Analysis. To classify on-device without a model node, use Classify Text.

RéglageTypeCe que cela fait
Text (obligatoire)Long textThe text to classify.
Categories (obligatoire)Long textComma-separated category names to classify the text into.
Options GroupThe options for the node.
Options › System message Long textThe system message to use.

Fill Text with an expression such as {{ $input.text }}. Write Categories as a comma-separated list, for example billing, technical, sales. Short, clearly different names give the most reliable results. Use System message to describe a category when its name alone is ambiguous, such as "sales" means questions about buying or pricing.

  • Output

Each output item has these fields:

FieldTypeWhat it holds
category AnyThe chosen category
scores Key-value pairsEvery label's score, on-device
Shape of an output item
{
"category": null,
"scores": {}
}

category is one of your category names, or unknown when none fits (or when the on-device model returns no label). scores is only there with a Local Classifier.

SlotAcceptsConnections
Model (obligatoire)chat model, local classifierOne node.

Connect a chat model, which holds its own API key, or a Local Classifier with a zero-shot model to classify on-device with your own categories.

  1. Get Selected Text reads a support email you highlighted, with Output field name text.
  2. Text Classifier with Text {{ $input.text }} and Categories billing, technical, sales, with an Chat OpenAI model on Model.
  3. Switch in Rules mode with one rule per category, each checking that {{ $input.category }} equals the category name, and Add A Fallback Branch on for unknown.
  4. Each branch posts to a different Slack channel.
  • category is often unknown. Your categories do not cover the texts you receive, or the names are vague. Add a category, or explain them in System message.
  • The category does not match your Switch rules. A chat model may change the capitalisation or add words. Add Answer with the category name exactly as written. in System message.
  • “Add at least one category: the zero-shot classifier scores the text against them.” A zero-shot Local Classifier is connected and Categories is empty.
  • “Model not found”. The connected chat model node is not set up: open it and choose a model and its credential.
Modifier cette page

Dernière mise à jour :

Was this page useful?
Demander à Aria à propos de Text Classifier