A Web Scale Entity Extraction System

Xuanting Cai, Quanbin Ma, Jianyu Liu, Pan Li, Qi Zeng, Zhengkan Yang, Pushkar TripathiEMNLP 2021

Introduction

In modern recommendation and content discovery systems, entity extraction—the identification of people, places, and products within text—is a fundamental task. At Facebook (Meta), this task must be performed at an unprecedented scale, processing billions of documents daily across diverse languages and formats. This paper details the transition from isolated, task-specific models to a unified, multi-task Transformer-based architecture designed for high efficiency and accuracy in both "open-world" and "closed-world" scenarios.

System Architecture

The system handles two primary types of extraction tasks: open-world (new or unlisted entities) and closed-world (entities linked to a knowledge base like Wikipedia).

Open-World Extraction and Clustering

For entities without a predefined canonical list, such as emerging commercial products, the system employs a two-stage pipeline:

  1. Extraction Stage: A sequence-to-sequence model utilizes an XLM encoder paired with a Multi-Layer Perceptron (MLP) decoder. The choice of an MLP over a traditional Conditional Random Field (CRF) layer was driven by the need for maximum computational efficiency, with negligible impact on performance.
  2. Clustering Stage: To resolve different mentions of the same entity (e.g., "iPhone 13" vs. "Apple's latest phone"), a Siamese neural network predicts links between mentions. These links are then processed using the Louvain community detection algorithm to form canonical entity groups.

Closed-World Neural Linking

For known entities, the system uses a "mention tower" architecture. After generating candidates via a dictionary, the model compares the context of a mention against summarized Wikipedia entity embeddings using a broadcasted dot product to determine the correct link.

Architectural components: (a) Extraction stage, (b) Clustering stage via Siamese network, and (c) Neural linking tower.

The Unified Multi-Task Model

To address the resource constraints of web-scale processing, the architecture was consolidated from seven independent Transformer models into a single shared-encoder system. A large, shared XLM encoder serves multiple specialized "heads" for different tasks. This transition resulted in a 7x reduction in inference costs while serving as a form of multi-task regularization.

Data and Labeling Strategies

The system was trained on massive internal datasets spanning 11 languages and various document types, including structured web pages and advertisements.

A critical component of the training pipeline was the human labeling strategy. Researchers tested several consensus methods for token-level highlighting:

  • Majority: Tokens highlighted by most raters.
  • And: Tokens highlighted by all raters.
  • Or: Tokens highlighted by any rater.

The "Majority" strategy proved most effective, achieving an F1 score of 0.794 by effectively filtering noise from individual rater inconsistencies.

Results and Discussion

The implementation of the unified model and multi-task learning yielded significant improvements in both efficiency and accuracy:

  • Efficiency: Consolidating encoders reduced heavy inference costs by 85%.
  • Multilingual Performance: Fine-tuning on small amounts of target-language data (1/10th of the English set) provided a massive boost for non-Romance languages. For example, Vietnamese F1 scores rose from 0.049 (zero-shot) to 0.477.
  • Cross-Domain Synergy: Training on advertisements and web pages simultaneously improved performance on both, as the model learned to generalize features from clean ad text to noisier web content.

Conclusion

By moving to a unified Transformer architecture, the system successfully balances the extreme efficiency required for web-scale processing with the accuracy needed for complex entity extraction. Future work will explore increasing encoder capacity to mitigate potential task interference as more entity types are integrated into the shared architecture.

Summary updated

BibTeX
@inproceedings{cai2021web,
  author = {Xuanting Cai and Quanbin Ma and Jianyu Liu and Pan Li and Qi Zeng and Zhengkan Yang and Pushkar Tripathi},
  title = {{A Web Scale Entity Extraction System}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.7},
}
Figure