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:
5
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:
Analysis complete
Display Mode (Display) op('sentiment').par.Display Menu
Default:
sentiment_table
Options:
sentiment_table, summary
Analysis Backend (Backend) op('sentiment').par.Backend Menu
Default:
vader
Options:
transformers, vader, textblob, stanza
Model Name (Modelname) op('sentiment').par.Modelname String
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:
clear
Options:
append, replace, batch, clear
ChatTD Operator (Chattd) op('sentiment').par.Chattd OP
Default:
/dot_lops/ChatTD
Bypass (Bypass) op('sentiment').par.Bypass Toggle
Default:
Off
Show Built-in Parameters (Showbuiltin) op('sentiment').par.Showbuiltin Toggle
Default:
Off
Version (Version) op('sentiment').par.Version String
Default:
1.0.0
Last Updated (Lastupdated) op('sentiment').par.Lastupdated String
Default:
2024-11-10
Creator (Creator) op('sentiment').par.Creator String
Default:
dotsimulate
Website (Website) op('sentiment').par.Website String
Default:
https://dotsimulate.com
  • 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.