Neural Attentive Bag-of-Entities Model for Text Classification

Ikuya Yamada, Hiroyuki ShindoarXiv 2019

TL;DR

The Neural Attentive Bag-of-Entities (NABoE) model enhances text classification by using entities from a knowledge base (like Wikipedia) as unambiguous semantic signals. By combining a high-recall dictionary-based entity detector with a novel neural attention mechanism, the model achieves state-of-the-art results on standard benchmarks by focusing only on the most relevant and salient entities in a document.

What Problem Does This Paper Address?

Traditional text classification models primarily rely on words. However, words are inherently ambiguous—the word "Apple" could refer to a fruit, a multinational tech company, or a record label. While humans use context to disambiguate, machines often struggle.

Previous attempts to use Knowledge Base (KB) entities to solve this have faced two major hurdles:

  1. Disambiguation Errors: Existing entity linking systems often make mistakes when trying to map a name to a specific KB entry.
  2. Entity Salience: Not every entity mentioned in a text is actually important to its overall meaning. A passing mention of "Washington" in a sports article doesn't make the article about politics.

The authors propose a model that sidesteps complex pre-processing by using a "bag-of-entities" approach coupled with an attention mechanism that learns to pick out the most useful semantic signals.

Methods

The NABoE model operates in two main stages: detection and classification.

1. Entity Detection

Instead of using a complex entity linker, the authors use a simple dictionary-based approach. They map every word or phrase in a document to all possible referent entities in Wikipedia. For example, "Washington" would pull in both Washington, D.C. and George Washington. This ensures high recall, even if precision is initially low.

2. The NABoE Model

The core innovation is the neural attention mechanism. The model represents a document using a weighted average of entity embeddings. The weights are determined by two key features:

  • Cosine Similarity: The similarity between a candidate entity's embedding and the average embedding of all words in the document. This helps identify entities that are semantically related to the overall topic.
  • Commonness: The prior probability that a specific name refers to a specific entity (e.g., "Apple" refers to the company more often than the fruit in modern corpora).
Figure 1: Architecture of the NABoE-entity model.

The final document representation ($z_{full}$) is a simple sum of the word-based representation and the entity-based representation, which is then fed into a standard logistic regression classifier.

Datasets

The model was evaluated on three diverse tasks:

  • 20 Newsgroups (20NG): A standard dataset for topic classification across 20 categories.
  • R8: A subset of the Reuters-21578 corpus containing the eight most popular news classes.
  • Quiz Bowl: A factoid question-answering dataset where the goal is to predict the correct entity (answer) based on a descriptive question.

Key Insights and Ideas

  • Simplicity vs. Sophistication: Interestingly, the authors found that their simple dictionary-based detection outperformed off-the-shelf entity linkers like Wikifier or TAGME. This is because standard linkers often ignore "non-named entities" (like technical terms) that are actually highly informative for classification tasks.
  • Joint Optimization: The attention mechanism effectively performs entity linking and salience detection simultaneously. By weighting entities that are semantically close to the document's words, it naturally filters out irrelevant or incorrectly disambiguated entities.
  • Interpretability: Because the model uses attention, it is highly interpretable. We can inspect which entities the model "attended" to for a specific classification decision.
Top five influential entities for each class

Key Results

NABoE achieved state-of-the-art results across all tested datasets.

  • 20NG & R8: The "full" model (words + entities) outperformed all baselines, including word-only models like SWEM and other entity-aware models like TextEnt.
  • Ablation Studies: Removing the attention mechanism led to a significant drop in performance (e.g., F1 score on 20NG dropped from .856 to .817), proving that simply having a bag of entities isn't enough—you need to know which ones to ignore.
Results of the text classification task

Limitations and Future Work

While powerful, the model has some clear limitations:

  • Entity Diversity: The model struggled with classes like misc.forsale, where documents contain a vast, unpredictable variety of entities (different objects for sale), making it hard to find a consistent semantic signal.
  • Fine-grained Distinctions: Error analysis showed the model sometimes confused very similar classes, such as "corporate acquisitions" (acq) vs "corporate earnings" (earn), especially when a document contained entities that strongly pointed to the wrong class (e.g., an acquisition report mentioning interest rates).

For future work, the authors suggest integrating global entity coherence—ensuring that all selected entities in a document make sense together as a group—which could further improve disambiguation accuracy.

Summary updated

BibTeX
@misc{yamada2019neural,
  author = {Ikuya Yamada and Hiroyuki Shindo},
  title = {{Neural Attentive Bag-of-Entities Model for Text Classification}},
  year = {2019},
  eprint = {1909.01259},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.01259},
}

Loading related content...

Figure