SemLa: A Visual Analysis System for Fine-Grained Text Classification

Munkhtulga Battogtokh, Cosmin Davidescu, Michael Luck, Rita BorgoAAAI 2024 · DOI

Introduction

Fine-grained text classification—distinguishing between highly similar categories like "cancel_order" and "refund_request"—presents a significant challenge for modern NLP models. While standard interpretability tools suffice for binary tasks, they often fail to provide the nuance required for high-complexity intent recognition. SemLa is a visual analysis system designed to bridge this gap, offering researchers tools to debug model weaknesses and understand the root causes of classification errors through multi-metric integration and contrastive visualizations.

The Challenge of Fine-Grained Classification

In fine-grained scenarios, embedding spaces become fragmented, making navigation difficult. Furthermore, existing Explainable AI (XAI) methods, such as LIME or Integrated Gradients, frequently produce conflicting explanations for the same prediction. Relying on a single metric can lead to a "false impression" of model logic. SemLa addresses these issues by providing a "safeguarded" view of feature importance and tools for navigating the semantic landscape.

The SemLa System

SemLa introduces three core visualization techniques to support model interpretability:

The three core components of SemLa: (a) Interactive local words for embedding space navigation, (b) Safeguarded explanation (VIFI), and (c) Fine-grained contrastive explanation.

1. Interactive Embedding Space with Local Word Landmarks

To navigate fragmented embedding spaces, SemLa uses a novel algorithm to identify "local words." By calculating the minimal hypercube containing occurrences of a feature, the system identifies words that act as landmarks for specific clusters. As users zoom or filter the map, these landmarks update, revealing the dominant terms in specific semantic regions.

2. Visually Integrated Feature Importance (VIFI)

To combat the "agreement problem" between different XAI methods, SemLa employs Visually Integrated Feature Importance (VIFI). This technique uses stacked bar charts to display contributions from multiple sources—such as Attention weights, Integrated Gradients, and LIME—simultaneously.

A detailed view of the Safeguarded Explanation (VIFI) showing how multiple XAI metrics (Attention, Integrated Gradient, Gradient, and LIME) contribute to the importance of individual words.

This "safeguarded" approach allows users to quickly identify whether different metrics agree on a word's importance, highlighting potential untrustworthiness in single-metric explanations.

3. Fine-grained Contrastive Explanations

Understanding why a model chose a "Fact" (the predicted class) over a "Foil" (a similar alternative) is crucial for debugging. SemLa uses Sankey-style links to visualize which features are shared between classes and which specific features pushed the model toward its final decision. This contrastive approach makes the root cause of misclassifications more apparent than traditional absolute importance charts.

Evaluation and Key Insights

SemLa was evaluated through case studies with industry experts in intent recognition. Key insights from these evaluations include:

  • The Agreement Problem: Experts found that stacking XAI metrics effectively highlighted disagreements, prompting more critical analysis of model logic.
  • Navigation as Debugging: The ability to see "local words" shift as they explored clusters helped developers identify where class boundaries were blurring.
  • Root Cause Analysis: Contrastive explanations were rated as more intuitive and useful for understanding errors compared to standard bar charts.

Conclusion and Future Work

SemLa demonstrates the value of multi-metric and contrastive visualizations for fine-grained text classification. While currently focused on lexical features, future work aims to incorporate more abstract features like named entities and high-level concepts to provide a more holistic view of model decision-making.

Summary updated

BibTeX
@inproceedings{battogtokh2024semla,
  author = {Munkhtulga Battogtokh and Cosmin Davidescu and Michael Luck and Rita Borgo},
  title = {{SemLa: A Visual Analysis System for Fine-Grained Text Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i21.30560},
}
Figure