UniSA: Unified Generative Framework for Sentiment Analysis

Zaijing Li, Ting-En Lin, Yuchuan Wu, Meng Liu, Fengxiao Tang, Ming Zhao, Yongbin Li

Abstract

Sentiment analysis (SA) has traditionally been approached through specialized models tailored to specific subtasks, such as aspect-based analysis or emotion recognition in conversation. This fragmentation hinders the development of a general-purpose sentiment foundation model. We present UniSA, a unified generative framework that consolidates diverse SA tasks into a single multimodal model. By reframing sentiment analysis as a text-generation problem and employing task-specific prompting alongside novel pre-training strategies, UniSA achieves performance competitive with specialized state-of-the-art models and demonstrates robust few-shot generalization to unseen downstream tasks.

Introduction

The field of sentiment analysis is currently characterized by a variety of narrow subtasks. Researchers typically develop distinct architectures for Emotion Recognition in Conversation (ERC), which requires dialogue context; Aspect-Based Sentiment Analysis (ABSA), which targets specific entities; and Multimodal Sentiment Analysis (MSA), which fuses text, audio, and video. This specialization creates silos, making it difficult to share knowledge across related emotional domains.

The Challenge of Unification

Creating a unified "foundation model" for sentiment analysis involves overcoming three primary hurdles:

  1. Format Inconsistency: Different subtasks utilize varied input structures and output labels.
  2. Modality Alignment: Effectively integrating text, acoustic, and visual features is complex, particularly when data streams are incomplete.
  3. Dataset Bias: Subjective labeling schemes across different datasets introduce biases that complicate joint training.
Taxonomy of sentiment analysis tasks with corresponding examples and targets across main and downstream categories.

The UniSA Framework

UniSA addresses these challenges by adopting a generative Transformer architecture, utilizing BART-base as its backbone. The framework treats every sentiment task as a text-generation problem.

The UniSA architecture, featuring a multimodal transformer encoder and a generative decoder guided by task-specific prompts.

Key Technical Innovations

  • Task-Specific Prompting: To unify disparate formats, UniSA uses a prompt containing a task identifier, an answer set of possible labels, and input streams (text, audio, video, and context). The model then generates the sentiment label as text.
  • Multimodal Transformer Encoder: A single-stream bidirectional Transformer processes all modality features simultaneously, capturing intricate inter-modal interactions.
  • Modal Mask Training: During training, entire modalities are randomly masked. This forces the model to develop robust representations capable of handling real-world scenarios where certain data (e.g., video) might be missing.
  • Dataset Embeddings: Unique embeddings for each dataset are injected into the input to help the model distinguish between varying annotation styles and mitigate dataset-specific bias.
  • Two-Stage Pre-training: The model first undergoes coarse-grained pre-training focused on general sentiment polarity, using contrastive learning to group similar emotional states. This is followed by fine-grained "Cross-task Emotion Prediction" to learn nuanced emotional categories.

SAEval Benchmark

To evaluate the unified approach, the authors introduced SAEval, a comprehensive benchmark standardizing 12 popular sentiment analysis datasets. SAEval includes well-known datasets such as SemEval-2014/2016 (ABSA), MOSI/MOSEI (Multimodal), IEMOCAP/MELD (ERC), and SST-2/IMDB (Comment Analysis). This standardized dictionary format enables a rigorous "all-in-one" evaluation of unified models.

Performance and Generalization

UniSA demonstrates that a single unified model can match or exceed the performance of specialized state-of-the-art (SOTA) systems.

  • Multimodal Performance: On the MOSI dataset, UniSA achieved a 2-category accuracy of 84.11%, rivaling the specialized UniMSE SOTA (85.85%).
  • Conversational Context: On the IEMOCAP dataset, it reached a weighted F1 score of 64.46%, proving its efficacy in complex multimodal dialogues.
  • Few-Shot Generalization: UniSA shows remarkable zero-shot and few-shot capabilities on downstream tasks like Sarcasm and Hate Speech Detection. For instance, on the Sarcasmania dataset, it achieved an MF1 of 99.78 with minimal examples, outperforming general-purpose models like T5-base.

Conclusion

UniSA represents a significant step toward a foundation model for sentiment analysis. By leveraging the power of unified generative modeling, it captures "interrelated sentiment knowledge" that specialized models often miss. While subjective bias and backbone size remain areas for future improvement, UniSA proves that a unified approach is not only feasible but highly effective for cross-task emotional reasoning.

Summary updated

BibTeX
@inproceedings{li2023unisa,
  author = {Zaijing Li and Ting-En Lin and Yuchuan Wu and Meng Liu and Fengxiao Tang and Ming Zhao and Yongbin Li},
  title = {{UniSA: Unified Generative Framework for Sentiment Analysis}},
  booktitle = {ACM Multimedia},
  year = {2023},
  doi = {10.1145/3581783.3612336},
}

Loading related content...

Figure