Sentiment Classification towards Question-Answering with Hierarchical Matching Network

Chenlin Shen, Changlong Sun, Jingjing Wang, Yangyang Kang, Shoushan Li, Xiaozhong Liu, Luo Si, Min Zhang, Guodong Zhou

Introduction

In the landscape of e-commerce, the "Customer Questions & Answers" (QA) section serves as a vital repository of user-generated content. Unlike traditional reviews, these QA pairs represent a dynamic dialogue between potential buyers and experienced users. However, standard sentiment analysis tools often struggle with this format due to its non-sequential structure, contextual dependencies, and the frequent presence of mixed sentiments. To address these challenges, researchers from Soochow University and Alibaba Group introduced the Hierarchical Matching Network (HMN) at EMNLP 2018.

The Hierarchical Matching Network (HMN)

The HMN architecture is designed to treat questions and answers as related parallel units rather than a single linear sequence. The model operates in three distinct stages to capture the nuanced interactions within a QA pair.

The overall architecture of the Hierarchical Matching Network (HMN).
  1. Sentence Segmentation and Unit Construction: The model decomposes the question ($Q$) and answer ($A$) into individual sentences. It then constructs every possible $[Q_{sentence}, A_{sentence}]$ pair, ensuring that specific queries are matched with their corresponding responses regardless of their position in the text.
  2. QA Bidirectional Matching Layer: For each sentence pair, a Bi-LSTM encodes the constituent words. A bidirectional attention mechanism is then applied: Answer-to-Question Attention identifies relevant question segments for each answer sentence, while Question-to-Answer Attention pinpoints which parts of the answer directly respond to the question's prompts. These are fused into a "matching vector."
  3. Self-Matching Attention Layer: Recognizing that not all sentence pairs are equally informative, this layer assigns weights to the matching vectors. It focuses the model on the most salient parts of the dialogue to produce a final representation ($R$) for sentiment classification.

Experimental Setup and Dataset

The researchers introduced a high-quality annotated corpus consisting of 30,000 QA pairs from Alibaba's Taobao, spanning three domains: Beauty, Shoe, and Electronic. Notably, the dataset includes a Conflict category to account for answers that provide mixed feedback (e.g., positive about one feature but negative about another). The dataset achieved a high inter-annotator agreement (Kappa = 0.84), providing a robust benchmark for the task.

Results and Analysis

The HMN model was evaluated against several baselines, including standard LSTMs and sophisticated matching models like BiMPM.

Quantitative performance comparison of HMN against various baseline models.

As shown in the results, HMN consistently outperformed all baselines across all domains. The improvement was statistically significant (p-value < 0.05), demonstrating the effectiveness of the hierarchical matching approach. Qualitative analysis through attention visualization further confirmed that the model accurately aligns specific complaints or praises in the answer with the corresponding attributes mentioned in the question, even when they are separated by irrelevant text.

Conclusion

The Hierarchical Matching Network demonstrates that sentiment classification in QA pairs is fundamentally a matching problem rather than a simple sequence labeling task. By explicitly modeling the bidirectional relationship between sentences and acknowledging the complexity of "conflict" sentiments, HMN provides a robust framework for understanding nuanced customer feedback. Future work will explore deeper network structures and the application of this hierarchical approach to other QA-related tasks such as fact-checking and helpfulness prediction.

Summary updated

BibTeX
@inproceedings{shen2018sentiment,
  author = {Chenlin Shen and Changlong Sun and Jingjing Wang and Yangyang Kang and Shoushan Li and Xiaozhong Liu and Luo Si and Min Zhang and Guodong Zhou},
  title = {{Sentiment Classification towards Question-Answering with Hierarchical Matching Network}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1401},
}
Figure