Skip to content

Sentiment Analyzer Operator

The Sentiment Analyzer LOP analyzes the sentiment of text input, providing scores and labels to indicate the emotional tone. It supports various analysis backends like Transformers, VADER, TextBlob, and Stanza, allowing you to choose the most suitable method for your needs. This operator can analyze full conversations, specific messages, or custom text, making it versatile for different use cases. The results are displayed in a table or summary format, offering insights into the sentiment trends of the analyzed text.

  • Python Packages:
    • transformers (if using Transformers backend)
    • vaderSentiment (if using VADER backend)
    • textblob (if using TextBlob backend)
    • stanza (if using Stanza backend) These can be installed via the ChatTD operator’s Python manager.
  • ChatTD Operator: Required and must be configured (utilized for get_sentiment_backend).
  • Input Table (DAT): Table containing conversation data. Required columns: id, role, message.
  • Backend-Specific Table (DAT):
    • vader_table: VADER scores (compound, pos, neg, neu).
    • transformers_table: Transformers label and score.
    • textblob_table: TextBlob polarity and subjectivity.
    • stanza_table: Stanza sentiment score.
  • Summary DAT: Table summarizing analysis results (average scores, etc.).
Analyze Mode (Analyzemode) op('sentiment').par.Analyzemode Menu
Default:
full_conversation
Options:
full_conversation, last_message, specific_message, custom_text
Message Index (Messageindex) op('sentiment').par.Messageindex Integer
Default:
1
Custom Text (Customtext) op('sentiment').par.Customtext String
Default:
None
Start Analysis (Analyze) op('sentiment').par.Analyze Pulse
Default:
None
Clear Results (Clear) op('sentiment').par.Clear Pulse
Default:
None
Status (Status) op('sentiment').par.Status String
Default:
None
Display Mode (Display) op('sentiment').par.Display Menu
Default:
sentiment_table
Options:
sentiment_table, summary
Analysis Backend (Backend) op('sentiment').par.Backend Menu
Default:
transformers
Options:
transformers, vader, textblob, stanza
Model Name (Modelname) op('sentiment').par.Modelname StrMenu
Default:
distilbert-base-uncased-finetuned-sst-2-english
Language (Language) op('sentiment').par.Language Menu
Default:
auto
Options:
auto, en, es, fr, de, it
Table Update Mode (Updatemode) op('sentiment').par.Updatemode Menu
Default:
append
Options:
append, replace, batch, clear
ChatTD Operator (Chattd) op('sentiment').par.Chattd OP
Default:
None
Bypass (Bypass) op('sentiment').par.Bypass Toggle
Default:
false
Show Built-in Parameters (Showbuiltin) op('sentiment').par.Showbuiltin Toggle
Default:
false
Version (Version) op('sentiment').par.Version String
Default:
None
Last Updated (Lastupdated) op('sentiment').par.Lastupdated String
Default:
None
Creator (Creator) op('sentiment').par.Creator String
Default:
None
Website (Website) op('sentiment').par.Website String
Default:
None
  • Backend Choice: Transformers models are generally more accurate but slower than VADER or TextBlob.
  • Input Size: Analyzing large conversations/texts takes longer. Use last_message or specific_message modes if performance is critical.
sentiment_op = op('sentiment1')
conv_dat = op('conversation_log')
sentiment_op.inputConnectors[0].connect(conv_dat)
sentiment_op.par.Analyzemode = 'full_conversation'
sentiment_op.par.Backend = 'vader'
sentiment_op.par.Analyze.pulse()
# Results in sentiment_op.op('vader_table')
sentiment_op = op('sentiment1')
sentiment_op.par.Analyzemode = 'custom_text'
sentiment_op.par.Customtext = "This movie was absolutely fantastic! Highly recommended."
sentiment_op.par.Backend = 'transformers'
sentiment_op.par.Modelname = 'distilbert-base-uncased-finetuned-sst-2-english' # Default is good for general English
sentiment_op.par.Analyze.pulse()
# Results in sentiment_op.op('transformers_table')
sentiment_op = op('sentiment1')
# ... perform analysis first ...
sentiment_op.par.Display = 'summary'
# Summary results in sentiment_op.op('summary_dat')
  • Analyzing customer feedback sentiment.
  • Monitoring social media for public opinion.
  • Tracking emotional trends in chat logs.
  • Real-time sentiment display in chatbots.
  • Flagging negative messages.