Abstract
Modern sentiment analysis models excel at classification but often fail to explain the underlying logic of sentiment composition. This research proposes a Sentiment Composition Grammar (SCG) that treats sentence structure as a latent semantic tree. By explicitly modeling functional linguistic roles—such as negators and intensifiers—the model provides transparent explanations for complex sentiments. The resulting Sentiment Composition Module (SCM) achieves high accuracy on benchmarks like SST2 and demonstrates significant robustness in cross-domain adaptation tasks.
Introduction: Beyond the Black Box
While deep learning has revolutionized sentiment analysis, most state-of-the-art models remain "black boxes." They can identify a sentence as positive or negative but cannot articulate why. Traditional hierarchical approaches often use "untagged trees" or "sentiment trees" that merely assign polarity scores to nodes. However, these methods overlook the functional roles words play. For example, the word "not" is not inherently negative; it is a functional operator that reverses the sentiment of its target. To address this, we need a model that understands the grammar of sentiment composition.
The Sentiment Composition Module (SCM)
The authors introduce a Sentiment Composition Grammar (SCG) consisting of 11 semantic labels (3 sentimental and 8 functional) and 62 linguistically-grounded composition rules. Unlike previous methods, this grammar identifies roles like "Negator," "Priority Riser," and "Irrealis Blocker."
Because large-scale datasets lack ground-truth semantic trees, the model treats the tree structure as a latent variable. It utilizes the "inside algorithm"—a dynamic programming technique—to marginalize over all possible tree structures during training. This SCM can be integrated with standard encoders like BERT or BiLSTM, combining neural pattern recognition with structured linguistic logic. To ensure structural integrity, the authors use a syntactic parser and a small lexicon to regularize the model's tree generation.
Experimental Results
The model was evaluated on the Movie Reviews (MR) and Stanford Sentiment Treebank (SST2) datasets, as well as Amazon product reviews for cross-domain testing.
Performance and Robustness
On the SST2 benchmark, the BERT+SCM architecture achieved an accuracy of 92.31% for sentences. More importantly, the model showed superior performance in domain adaptation. When trained on one product category (e.g., Books) and tested on another (e.g., Electronics), the SCM-enhanced models consistently outperformed standard BiLSTMs and BERTs by approximately 1.5%. This suggests that the underlying linguistic rules of sentiment are more transferable across domains than raw statistical patterns.
Interpretability
The primary advantage of the SCM is its ability to generate human-readable semantic trees. These trees clearly illustrate how the model handles complex linguistic phenomena.
As shown in the figures, the model correctly identifies how a negator flips a sentiment or how a contrastive conjunction like "but" resolves conflicting sentiments between clauses. It also recognizes "irrealis blockers" (like "if"), which neutralize sentiments by framing them as hypothetical. Interestingly, the authors found that the most effective trees for sentiment analysis are often a hybrid of syntactic meaning and flexible sentiment flow.
Conclusion and Future Work
The Sentiment Composition Module provides a powerful framework for interpretable sentiment analysis. By grounding neural networks in a formal grammar, the model achieves both high performance and transparency. While the current $O(T^3)$ complexity of the inside algorithm poses challenges for very long documents, the success of this approach highlights the value of integrating linguistic knowledge into deep learning architectures. Future research will focus on expanding grammar coverage and optimizing the algorithm for longer-form text analysis.
Summary updated