SNU_IDS at SemEval-2019 Task 3: Addressing Training-Test Class Distribution Mismatch in Conversational Classification

Sanghwan Bae, Jihun Choi, Sang-goo LeearXiv 2019 · arXiv

TL;DR

Researchers from Seoul National University (SNU) tackle a common but tricky problem in machine learning: when your training data is perfectly balanced, but the real world (and your test set) is heavily skewed. By combining a novel semi-hierarchical neural architecture with distribution-alignment techniques like thresholding and cost-sensitive learning, they achieved a micro F1 score of 0.766 in the SemEval-2019 Contextual Emotion Detection task.

What Problem Does This Paper Address?

The paper focuses on Contextual Emotion Detection, specifically for the SemEval-2019 EmoContext task. The goal is to predict the emotion (Happy, Sad, Angry, or Others) of the final speaker in a three-turn text conversation.

The primary challenge isn't just understanding language; it's a distribution mismatch. In the provided training data, the classes are roughly balanced (50% "Others," 50% emotional). However, in the test set—which reflects real-world frequency—only 15% of utterances are emotional, while 85% are "Others." Standard models trained on balanced data tend to over-predict emotions, leading to poor performance on the actual test set. The authors argue that traditional "class imbalance" solutions don't quite fit because the imbalance only appears at test time, not during training.

Methods

The authors proposed a two-pronged approach: a robust neural architecture and statistical methods to align class distributions.

1. Semi-Hierarchical Architecture

To capture both the meaning of individual words and the flow of a conversation, the team designed a semi-hierarchical encoder:

  • Utterance Encoder: Each of the three turns is processed using a rich stack of embeddings, including Word2vec, character-level CNNs, emoji2vec, and contextualized ELMo embeddings. These are fed into stacked Bi-LSTMs with self-attention.
  • Context Encoder: The resulting utterance representations ($u_1, u_2, u_3$) are then passed through a higher-level Bi-LSTM to capture emotional transitions. They also include a specific feature ($u_1 - u_2 + u_3$) to explicitly model how emotions shift across turns.

Figure 1: Overall Architecture Figure 2: Utterance Encoder

2. Addressing the Mismatch

The team adapted three classic techniques to handle the distribution shift, assuming the validation set accurately reflects the test set's skew:

  • Sampling: Randomly oversampling or undersampling the training data to force its distribution to match the validation set.
  • Thresholding: Adjusting the model's output probabilities during inference by multiplying them by the estimated class ratio from the validation set.
  • Cost-Sensitive Learning: Modifying the cross-entropy loss function to penalize the model more heavily for misclassifying the majority "Others" class.

Datasets

The study uses the EmoContext dataset from SemEval-2019 Task 3.

  • Structure: 3-turn textual conversations.
  • Labels: Four classes—'happy', 'sad', 'angry', and 'others'.
  • The Mismatch: Training data is ~50% emotional, while validation and test data are only ~15% emotional.

Key Insights and Ideas

  • The "Others" Trap: Models trained on balanced data naturally assume emotions are common. By explicitly biasing the model toward the "Others" class (which is far more frequent in reality), performance jumps significantly.
  • Thresholding vs. Sampling: For deep learning models, the authors found that thresholding and cost-sensitive learning were more effective than undersampling. Undersampling reduces the total amount of data the model sees, which can hinder its ability to learn complex semantics.
  • Distribution Visualization: The authors demonstrated that their methods successfully pushed the model's predicted distribution to match the ground truth, as seen in Figure 3.
Figure 3: Class distributions on test data. Actual is from the ground truth labels and the others are from the predicted labels by each model. These are the averages of 10 results with random initialization.

Key Results

The proposed methods consistently outperformed the task organizers' baseline.

  • Single Model: Their best single-model approach (Cost-Sensitive) achieved a micro F1 of 0.739, compared to the organizer baseline of 0.587.
  • Ensemble: By combining multiple models (an ensemble of different methods), they reached a final micro F1 of 0.766.
  • Accuracy: While the baseline accuracy was around 0.914, their mixed ensemble pushed this to 0.933.
Table 2: Comparison of ensemble approaches

Limitations and Future Work

The authors note that their current approach relies heavily on the assumption that the validation set is a perfect proxy for the test set distribution. If the validation set is also biased or unrepresentative of the final deployment environment, these alignment techniques might fail.

For future work, the researchers plan to conduct more systematic experiments on diverse datasets to see if these distribution-alignment techniques generalize across different types of conversational AI tasks.

Summary updated

Abstract

We present several techniques to tackle the mismatch in class distributions between training and test data in the Contextual Emotion Detection task of SemEval 2019, by extending the existing methods for class imbalance problem. Reducing the distance between the distribution of prediction and ground truth, they consistently show positive effects on the performance. Also we propose a novel neural architecture which utilizes representation of overall context as well as of each utterance. The combination of the methods and the models achieved micro F1 score of about 0.766 on the final evaluation.
BibTeX
@misc{bae2019snu,
  author = {Sanghwan Bae and Jihun Choi and Sang-goo Lee},
  title = {{SNU\_IDS at SemEval-2019 Task 3: Addressing Training-Test Class Distribution Mismatch in Conversational Classification}},
  year = {2019},
  eprint = {1903.02163},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1903.02163},
}
Figure