Categorize Text
The Categorize Text task is an AI module designed to classify text into predefined categories based on an analysis context. It can be used to label content, organize information, or apply specific taxonomies.
Configuration
- Contains the following main fields:
Text
- Specifies the text to categorize.
- Can include dynamic parameters for flexible input, e.g.: text to categorize and/or
#>parameter_string<#
Analysis Context
- Defines the prompt that helps the AI understand the text categorization criterion.
Categories
- List of categories available for classification.
- Each category is defined by:
- Name: Category identifier (e.g.
category_1). - Description: Natural language explanation of the category.
Usage
- Enter the text to categorize in the Text field, optionally using dynamic parameters.
- Define the Analysis Context to provide specific instructions on categorization.
- Configure the list of Categories, assigning appropriate names and descriptions.
Configuration Example
Text: "Analyze and categorize the following comment: #>user_comment<#" Analysis Context: "Classify the comment based on its intent (positive, neutral, negative)." Categories:
| Name | Description |
|---|---|
| positive | "Comment with a positive and constructive tone." |
| neutral | "Objective comment without a particular emotional tone." |
| negative | "Comment with a negative or critical tone." |
Output Parameter
Upon completion of its execution, this task exposes a single Output Parameter that can be reused in subsequent tasks.
- result: This parameter contains the main outcome of the operation.
- On success, it contains the category assigned to the text, represented as a string. Continuing with the example from the previous chapter, the result can take the values: positive, neutral, or negative.
- On failure, it will contain the error message that caused the task interruption (e.g. "Missing text to analyze").
- resultJson: Represents the task execution result in JSON format, including general information, configurations, and execution details.
- category: Contains the name of the assigned category.
- reason: Provides a detailed textual description of the logical reasoning followed by the AI model to assign the text to a specific category. This parameter is extremely useful for debugging, auditing, and understanding model behaviour.
- summary: Returns a concise summary of the content of the analyzed text, generated by the AI model.
- analysis: Contains the complete raw JSON response returned by the AI model. This parameter includes category, reason, and summary in a single structured object.
Notes
The Categorize Text task is a useful tool for automating the classification of textual content, improving information management and analysis in various application contexts.