XenoGuard 4.0 Documentation

Classify Text

ActionStep Reference » OpenAI » Text » Classify Text

The OpenAI Text Classifier ActionStep is a powerful tool for classifying text based on predefined categories using OpenAI's AI models. It is useful for tasks such as sentiment analysis, topic categorization, intent recognition, and more.

[-] Hide
  1. Open the OpenAI node in the Workspace Explorer.
  2. In the OpenAI node, select the Classify Text ActionStep.

Parameters:

The ActionStep has the following input parameters:


Name Description
API Key
This is the key required to authenticate and access OpenAI's API for text classification.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Sentence
The specific sentence or text that needs to be classified.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Show Explanation
A boolean parameter that determines whether the AI should provide an explanation for its classification result.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [Boolean]
Timeout
Specifies the maximum duration, in milliseconds, that the ActionStep will wait for a response from the OpenAI API.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [Int64]
Sentence Classifications
A list of potential classifications or categories that the sentence could be classified into.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]

Results:

The ActionStep returns the following results:

name Description
Probability
This parameter shows the probability, in percentage, that the classification is accurate. It reflects the AI's confidence in its classification decision.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]
Allowed Context Values [String]
Class Index
The index of the classification category within the provided Sentence Classifications list that the AI determined to be the most likely.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]
Allowed Context Values [Int64]
Class Text
The text description of the most likely classification for the sentence.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]
Allowed Context Values [String]
Classifications
A detailed breakdown or list of all potential classifications with their respective probabilities, providing a comprehensive view of the AI's analysis.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]

Information

OpenAI's text classification is used to categorize text into predefined labels, aiding in understanding and organizing content. Applications include sentiment analysis to gauge customer opinions, topic sorting for content curation, intent detection for chatbots, and filtering for content moderation. It streamlines workflows by automating the categorization process, which is essential for handling large volumes of text data.

Example 1 (Customer Feedback Classification and Response Generation):

This ActionScript performs a two-step operation. The first part classifies a customer's feedback text using OpenAI's API, determining that the feedback primarily relates to "Delivery, delivery date, incomplete delivery" with a high probability. The second part of the script crafts a response letter to this feedback, using the sentence as an input to generate a reply text, again employing OpenAI's API to produce the content. The operation includes showing an explanation for the classification, involves a timeout setting for the API call, and concatenates the response for final output.

See other operations:

Chat
Generate Text