Overview
The Dynamic Text Classifier node classifies input text into predefined categories using a language model. It is designed to help users automatically assign labels or tags to textual data based on custom category definitions. This node is useful in scenarios such as:
- Categorizing customer feedback or support tickets into topics.
- Tagging social media posts or reviews by sentiment or subject.
- Organizing documents or messages by themes for further processing.
The node sends the input text along with category information to an AI language model, which returns a structured JSON indicating which categories apply. It supports multi-class classification and fallback handling when no clear category matches.
Properties
| Name | Meaning |
|---|---|
| Text to Classify | The text string to be classified. Can be static or dynamically referenced from previous nodes. |
| Enabled Intents | An optional JSON array of enabled intents, each with name, description, and priority. Used to filter and prioritize categories during classification. |
| Categories | A collection of categories to classify the text into. Each category has a name and an optional description. Multiple categories can be added. |
| Options | A set of options controlling classification behavior: - Allow Multiple Classes To Be True (boolean): Whether multiple categories can be true simultaneously. - When No Clear Match (fallback): What to do if no category fits ( discard or output on an "Other" branch).- System Prompt Template (string): Custom prompt template sent to the language model. - Enable Auto-Fixing (boolean): Whether to enable automatic fixing of broken outputs by triggering an additional language model call. |
Output
The node outputs items grouped by category branches corresponding to the defined categories. Each output branch contains items classified as belonging to that category.
- The JSON output for each item is a boolean map indicating which categories are true for the input text.
- If fallback is set to
"other", an additional output branch named "Other" will contain items that did not match any category. - If fallback is
"discard", unmatched items are dropped from the output. - Binary data is not produced by this node.
Dependencies
- Requires an AI language model connection configured as an input to the node.
- Uses a structured output parser to enforce JSON format compliance.
- Optionally uses an auto-fixing parser that may trigger additional calls to the language model if the output is malformed.
- No external API keys or credentials beyond the AI language model connection are required.
Troubleshooting
Error: "At least one category must be defined"
Occurs if no categories are provided. Fix by adding at least one category in the node settings.Malformed JSON output from the language model
The node attempts to auto-fix broken outputs if enabled. Disable auto-fixing to debug or adjust the system prompt template for better formatting instructions.No items appear in output
Check the fallback option. If set to discard, items without a clear category are dropped. Consider setting fallback to output on "Other" branch to capture unmatched items.Incorrect classification results
Review the categories and their descriptions, and ensure the system prompt template clearly instructs the model on expected output format and categories.