Skip to content

Sentiment Analyzer

v1.0.0

The Sentiment Analyzer LOP performs sentiment analysis on conversation histories or custom text, producing structured scores and labels that quantify emotional tone. It supports four analysis backends — VADER, Transformers (with multiple HuggingFace models), TextBlob, and Stanford NLP (Stanza) — each offering different tradeoffs between speed, accuracy, and the type of metrics produced.

  • Python Packages (installed automatically via ChatTD’s Python Manager depending on which backend you select):
    • vaderSentiment for the VADER backend
    • transformers for the Transformers backend
    • textblob for the TextBlob backend
    • stanza for the Stanford NLP backend

The operator reads from an internal input_table DAT. Wire a conversation table (with id, role, and message columns) into the operator so it can access message data for analysis.

One output carrying the active results table. The operator maintains four backend-specific internal tables and a summary table:

  • vader_table — compound, positive, negative, and neutral scores per message
  • transformers_table — classification label (e.g., POSITIVE/NEGATIVE) and confidence score per message, plus the model used
  • textblob_table — polarity (-1 to 1) and subjectivity (0 to 1) per message
  • stanza_table — sentiment score per message
  • summary_dat — aggregated statistics (averages, label counts) for the active backend
BackendStrengthsMetrics
VADERFast, rule-based, no model download neededCompound, positive, negative, neutral scores
TransformersMost accurate, multiple model choicesLabel + confidence score
TextBlobSimple, includes subjectivity analysisPolarity + subjectivity
Stanford NLPResearch-grade NLP pipelineSentiment score

When using the Transformers backend, you can choose from several pretrained models on the Sentiment page under ‘Model Name’. The default distilbert-base-uncased-finetuned-sst-2-english is a good general-purpose choice. For financial text, select finbert. For social media content, try twitter-roberta-base-sentiment-latest or bertweet-base-sentiment-analysis.

  1. Wire a conversation table DAT (with id, role, message columns) into the Sentiment Analyzer.
  2. On the Sentiment page, set ‘Analyze Mode’ to Full Conversation.
  3. Set ‘Analysis Backend’ to your preferred backend (e.g., VADER for speed, Transformers for accuracy).
  4. Pulse ‘Start Analysis’.
  5. Watch the ‘Status’ field — it will show “Analysis in progress” and then “Analysis complete”.
  6. Results appear in the corresponding backend table, visible in the operator viewer.
  1. On the Sentiment page, set ‘Analyze Mode’ to Custom Text.
  2. Enter your text in the ‘Custom Text’ field.
  3. Choose your ‘Analysis Backend’.
  4. Pulse ‘Start Analysis’.
  5. The result row appears in the active backend’s table with custom as the message ID and role.
  1. On the Sentiment page, set ‘Display Mode’ to Summary.
  2. The operator viewer switches to the summary table showing aggregated metrics for the current backend — average scores, total message counts, and (for Transformers) label distribution counts.
  1. Set ‘Table Update Mode’ to Append Results to accumulate results across multiple analysis runs.
  2. Each row includes a timestamp, so you can track how sentiment changes over the course of a conversation.
  3. Use Clear Before Analysis mode if you want fresh results each time.

The ‘Table Update Mode’ parameter controls how new results are written to the backend table:

  • Append Results — adds new rows after existing data (default)
  • Replace By Index — overwrites rows at matching positions from the input table
  • Batch Update — collects all results, then clears the table and writes them sorted by input order
  • Clear Before Analysis — clears the backend table before writing new results
  • Use VADER for real-time or high-throughput scenarios where speed matters more than nuanced accuracy.
  • Use Transformers when you need the most accurate classification and can tolerate slightly longer processing times (models are downloaded on first use).
  • Set ‘Analyze Mode’ to Last Message if you only need sentiment on the most recent message in a conversation, avoiding unnecessary reprocessing.
  • Use the Summary display mode to get a quick overview of sentiment trends without inspecting individual rows.
  • “Message index out of range” — When using ‘Specific Message Index’ mode, ensure the index is within the range of rows in your input table (starting from 1).
  • “Analysis already in progress” — Wait for the current analysis to finish before pulsing ‘Start Analysis’ again. Check the ‘Status’ field.
  • Slow first run with Transformers — The selected model is downloaded on first use. Subsequent runs are faster since the model is cached locally.
  • Empty results — Verify your input table has the expected id, role, and message columns and contains data rows.
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 Int
Default:
1
Range:
0 to 1
Slider Range:
1 to 10
Custom Text (Customtext) op('sentiment').par.Customtext Str
Default:
"" (Empty String)
Start Analysis (Analyze) op('sentiment').par.Analyze Pulse
Default:
False
Clear Results (Clear) op('sentiment').par.Clear Pulse
Default:
False
Status (Status) op('sentiment').par.Status Str
Default:
"" (Empty String)
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:
"" (Empty String)
Menu Options:
  • distilbert-base-uncased-finetuned-sst-2-english (distilbert-base-uncased-finetuned-sst-2-english)
  • twitter-roberta-base-sentiment-latest (cardiffnlp/twitter-roberta-base-sentiment-latest)
  • bertweet-base-sentiment-analysis (finiteautomata/bertweet-base-sentiment-analysis)
  • bert-base-multilingual-uncased-sentiment (nlptown/bert-base-multilingual-uncased-sentiment)
  • finbert (ProsusAI/finbert)
  • sentiment-roberta-large-english (siebert/sentiment-roberta-large-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
v1.0.02024-11-10

Initial release