Entity Set Co-Expansion in StackOverflow

Yu Zhang 0044, Yunyi Zhang 0001, Yucheng Jiang, Martin Michalski, Yu Deng, Lucian Popa, ChengXiang Zhai, Jiawei Han · DOI

Introduction

Entity Set Expansion (ESE) is a fundamental task in information extraction, where a system is provided with a small set of "seed" entities (e.g., Java, C++, PHP) and tasked with discovering other entities of the same type (e.g., Python, Rust) from a large, unstructured corpus. While general-purpose ESE systems have matured, the software domain—exemplified by platforms like StackOverflow—presents unique challenges. These include a niche, rapidly evolving vocabulary and the high risk of "semantic drift," where the expansion process accidentally pulls in entities from related but distinct categories.

This paper introduces SECOEXPAN, a novel framework designed specifically for the software engineering domain. By leveraging domain-specific language models and a simultaneous "co-expansion" strategy, SECOEXPAN maintains high precision across multiple entity categories while mitigating the common pitfalls of traditional ESE methods.

Methodology

SECOEXPAN distinguishes itself through two primary technical innovations: the use of competitive co-expansion and the integration of contextualized Pre-trained Language Model (PLM) embeddings.

Entity Set Co-Expansion

Traditional ESE systems typically expand one category in isolation. In contrast, SECOEXPAN expands multiple entity types (e.g., Operating System and Programming Language) simultaneously. This approach introduces a mechanism of "mutual exclusivity." During the expansion process, the framework treats other active entity sets as negative examples. If a candidate entity shows similarity to multiple categories, the system assigns it only to the set where it exhibits the highest confidence. This competitive environment effectively prevents "entity intrusion," where a general technical term might otherwise be incorrectly added to every specific list.

Contextualized PLM Embeddings

To better understand the nuances of technical text, SECOEXPAN utilizes BERTOverflow, a version of the BERT model fine-tuned on a massive corpus of StackOverflow posts. The framework generates two distinct types of embeddings for each candidate entity:

  1. Content Embeddings: These are derived from the tokens of the entity name itself. They are highly effective at capturing lexical similarities, such as recognizing that "Windows 10" is related to "Windows 7."
  2. Context Embeddings: These are generated by replacing the entity with a [MASK] token within a sentence. The model then represents the entity based on the surrounding technical context. This allows the system to identify entities that are semantically related but lexically diverse, such as finding "Debian" when the seed is "Windows."

Iterative Bootstrapping

The framework operates through an iterative process. In each cycle, the system identifies the most confident new entities, adds them to the existing seed sets, and recalculates similarities. This bootstrapping continues until the target set size is reached.

Experimental Setup

The researchers evaluated SECOEXPAN using a corpus derived from the StackExchange data dump, consisting of 1.26 million questions and answers, combined with the StackOverflowNER dataset. The candidate pool was constructed using AutoPhrase and spaCy, resulting in approximately 48,000 high-quality noun phrases.

The evaluation focused on four key software entity types:

  • LIBRARY
  • OS (Operating System)
  • APPLICATION
  • LANGUAGE

Results and Discussion

SECOEXPAN significantly outperformed established baselines, including SetExpan and CGExpan, across multiple metrics.

Quantitative Performance

  • Precision at 10 (P@10): The integrated version of SECOEXPAN (using both content and context embeddings) achieved a precision of 0.925, vastly outperforming CGExpan (0.775) and SetExpan (0.325).
  • Precision at 30 (P@30): The "Context-only" version of the framework maintained a high accuracy of 0.842, showcasing its robustness as the expansion set grows larger.

Qualitative Analysis

Qualitative reviews of the expanded sets revealed that older methods frequently picked up non-entity "noise" such as "local," "regular," or hardware specifications like "4 gb." SECOEXPAN successfully filtered these terms, maintaining clean, domain-relevant lists.

A key insight from the study was the trade-off between embedding types. While Content embeddings provide high precision for top-ranked results due to lexical overlap, Context embeddings are essential for discovering diverse entities that do not share name parts with the seeds.

Conclusion and Future Work

SECOEXPAN demonstrates that domain-specific fine-tuning and competitive co-expansion are vital for accurate entity extraction in technical domains. By enforcing mutual exclusivity between categories, the framework effectively manages semantic drift.

Future research directions include expanding the framework to handle more granular entity types, such as VERSION or DEVICE. Additionally, the authors propose using the high-quality sets generated by SECOEXPAN for "distant supervision," automatically labeling large datasets to train more advanced Named Entity Recognition (NER) models without the need for manual annotation.

Summary updated

BibTeX
@inproceedings{zhang2022entity,
  author = {Yu Zhang and Yunyi Zhang and Yucheng Jiang and Martin Michalski and Yu Deng and Lucian Popa and ChengXiang Zhai and Jiawei Han},
  title = {{Entity Set Co-Expansion in StackOverflow}},
  booktitle = {IEEE Big Data},
  year = {2022},
  url = {https://openreview.net/forum?id=U__COORrOq},
}
Figure