Skip to main content

Sentiment Analysis

Analyzes the sentiment of provided text using OpenAI models with multiple analysis types.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The connection ID for the OpenAI service.
  • Input Text - The text to analyze for sentiment.

Options

  • Model - The OpenAI model to use for sentiment analysis. Options include:
    • gpt-3.5-turbo
    • gpt-3.5-turbo-instruct
    • gpt-4-turbo
    • gpt-4
    • gpt-4-32k
  • Analysis Type - The type of sentiment analysis to perform. Options include:
    • Binary - Categorize as 'Positive' or 'Negative'
    • Scale-based - Rate on a scale from 1 (very negative) to 5 (very positive)
    • Emotion-based - Identify dominant emotion (joy, sadness, anger, surprise, neutral)
    • With Justification - Determine sentiment with explanation
  • Timeout (sec) - Timeout for the request. Only available with Robomotion Credits. Leave blank for default value (120+).

Output

  • Sentiment Result - The result of the sentiment analysis based on the selected analysis type.

How It Works

The Sentiment Analysis node uses OpenAI models to analyze the emotional tone of provided text. When executed, the node:

  1. Validates the provided Connection Id
  2. Prepares a system prompt based on the selected analysis type
  3. Sends the input text along with the prompt to the selected OpenAI model
  4. Processes the model's response to extract the sentiment analysis result
  5. Returns the sentiment result as output

Requirements

  • A valid OpenAI API key or Robomotion Credits
  • An active OpenAI connection
  • Input text to analyze

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection Id
  • Empty or invalid Input Text
  • OpenAI API errors
  • Timeout errors

Usage Notes

  • The default model is gpt-3.5-turbo, which provides a good balance of performance and cost
  • Different analysis types provide different levels of detail in sentiment evaluation
  • For best results, provide clear and emotionally expressive text
  • When using Robomotion Credits, the timeout can be customized for better performance