Introduction
While general-purpose pre-trained language models like BERT and RoBERTa have revolutionized natural language processing, they often treat text as a sequence of tokens without fully capturing the underlying linguistic rules that govern sentiment. Standard models frequently overlook how context and part-of-speech (POS) tags influence word polarity. For example, the word "good" in "a good amount" (quantitative/neutral) carries a different sentiment weight than in "a good movie" (positive). Furthermore, there is often a disconnect between local word-level sentiment and the global sentiment of a sentence.
To address these challenges, we introduce SentiLARE (Sentiment-Aware Language REpresentation), a model designed to explicitly integrate linguistic knowledge—specifically POS tags and word-level sentiment—into the pre-training process.
Methodology
SentiLARE is built upon the RoBERTa architecture and incorporates two primary innovations: Context-Aware Knowledge Acquisition and a Label-Aware Masked Language Model (LA-MLM) objective.
Context-Aware Knowledge Acquisition
Unlike traditional sentiment lexicons that assign static polarities to words, SentiLARE employs a Context-aware Sentiment Attention mechanism. The process begins by labeling words with POS tags using the Stanford Tagger. The model then queries SentiWordNet for all possible sentiment senses of a given word. By calculating the similarity between the sentence context and the "gloss" (definition) of each sense using Sentence-BERT (SBERT), the model assigns a contextually appropriate sentiment polarity (Positive, Negative, or Neutral) to each word.
Label-Aware Masked Language Model (LA-MLM)
The core of SentiLARE's training is the LA-MLM objective, which utilizes sentence-level sentiment labels from large-scale review datasets to supervise learning through two sub-tasks:
- Early Fusion: Global sentiment labels are integrated as input embeddings. The model is tasked with predicting the masked word, its POS tag, and its word-level sentiment, forcing it to learn how global "mood" influences local linguistic choices.
- Late Supervision: Given masked text, the model must simultaneously predict the masked word's attributes and the global sentence-level sentiment from the
[CLS]token. This encourages the model to learn how local features aggregate into a global sentiment representation.
Experimental Setup
The model was pre-trained on the Yelp Dataset Challenge 2019, comprising approximately 6.7 million reviews. Evaluation was conducted across several benchmarks including sentence-level sentiment (SST, MR, IMDB, Yelp-2, and Yelp-5), aspect-level sentiment (SemEval 2014 and 2016), and general text matching tasks.
Key Results
SentiLARE achieved state-of-the-art (SOTA) results across nearly all tested benchmarks. Notably, on the Stanford Sentiment Treebank (SST), it reached 58.59% accuracy, significantly outperforming vanilla RoBERTa (54.89%) and other sentiment-enhanced models like SentiBERT (56.87%).
The model's performance in aspect-level tasks, such as Aspect Term Extraction (ATE), further demonstrates that integrating linguistic knowledge helps the model precisely identify targets of sentiment. Qualitative analysis also revealed that SentiLARE is superior at handling sentiment "shifts" (e.g., sentences containing contrastive conjunctions like "but"), where it correctly identifies polarity changes that vanilla models often miss.
Conclusion
SentiLARE demonstrates that linguistic knowledge is a powerful "force multiplier" for language models. By internalizing the relationship between syntax and sentiment during pre-training, the model achieves a deeper understanding of language that extends even to general text-matching tasks. Future work may explore applying this framework to broader emotional nuances, such as sarcasm or specific emotion detection.
Summary updated