Improving Topic Modeling for Textual Content with Knowledge Graph Embeddings

Marco Brambilla, Marco Brambilla 0001, Birant Altinel

Abstract

Traditional topic modeling techniques often struggle to capture deep semantic relationships, treating documents as unstructured "bags of words." This research explores enhancing Latent Dirichlet Allocation (LDA) by integrating external knowledge from Knowledge Graphs (KGs). By evaluating seven distinct embedding methods and densifying the underlying KG with syntactic dependency trees, the authors demonstrate significant improvements in topic coherence and document classification accuracy over standard LDA and existing hybrid models.

Introduction

Latent Dirichlet Allocation (LDA) is a cornerstone of topic modeling, yet it largely ignores the rich semantic connections between words unless they frequently co-occur within the same document. While recent advancements like KGE-LDA have attempted to bridge this gap using Knowledge Graph embeddings as prior knowledge, they often rely on a single embedding algorithm (TransE) and static, sparse knowledge bases like WordNet.

This paper addresses two primary research gaps:

  1. Embedding Diversity: Investigating whether the choice of representation algorithm for the knowledge graph significantly impacts topic quality.
  2. Graph Density: Determining if results can be improved by making the knowledge graph denser and more contextually relevant to the specific text corpus being analyzed.

Methodology

Integration Framework

The researchers utilized the KGE-LDA framework, which incorporates KG embeddings into the generative process of topic modeling. Two specific variations were tested: Model A (based on CI-LDA) and Model B (based on Corr-LDA).

Graphical representation of KGE-LDA Model A and Model B architectures.

Multi-relational Embedding Comparison

To test embedding diversity, the standard TransE method was replaced with six advanced alternatives: TransH, DistMult, PTransE, TransR, HolE, and Analogy. These models vary in how they handle complex relationships, such as one-to-many or symmetric relations, within the vector space.

Knowledge Graph Extension

The paper's most significant contribution is the "densification" of the knowledge graph. Rather than relying solely on a static lexical graph (WN18), the authors applied a dependency parser to the text corpus to extract syntactic relationships (e.g., subject-object dependencies). These were injected as new "dependency relations" into the KG, increasing its density by nearly 600%.

Process of extending a standard Knowledge Graph with syntactic dependency trees from a sentence.

Experimental Setup

  • Text Corpus: The 20-Newsgroups (20NG) dataset, consisting of approximately 18,800 documents across 20 categories.
  • Knowledge Graph: WN18, a subset of WordNet containing over 40,000 entities and 18 relation types.
  • Extended KG: A custom version of WN18 augmented with dependency relations from the 20NG corpus, resulting in 55 relation types and over 800,000 triplets.

Results and Discussion

Performance Metrics

  • Classification Accuracy: The configuration using the Analogy embedding with Model B achieved a 1.01% improvement in document classification over the baseline KGE-LDA.
  • Topic Coherence: The extended knowledge graph yielded superior average coherence scores, particularly for models with lower (K=20) and mid-range (K=40) topic counts.
  • Graph Growth: The dependency tree injection increased the WN18 graph size by 578%, adding 37 new relation types and providing significantly richer context.

Key Insights

  • Syntax as Semantic Glue: Integrating syntactic dependency trees bridges the gap between general dictionary knowledge and dataset-specific language usage, creating a more powerful representation for topic modeling.
  • The "Analogy" Advantage: The Analogy model emerged as the top performer among embedding methods, likely because it unifies multiple approaches and optimizes for analogical properties, providing a robust semantic space.
  • Complexity vs. Performance: While high-performing, models like HolE (Holographic Embeddings) are computationally expensive, requiring up to 17 hours to train compared to just 1 hour for TransE.

Conclusion

This study demonstrates that both the choice of embedding algorithm and the density of the underlying knowledge graph are critical factors in the success of KG-enhanced topic modeling. While the approach shows clear gains in accuracy and coherence, future work is needed to address the computational overhead of complex embeddings and to implement more sophisticated entity linking to handle word polysemy.

Summary updated

BibTeX
@inproceedings{brambilla2019improving,
  author = {Marco Brambilla and Marco Brambilla and Birant Altinel},
  title = {{Improving Topic Modeling for Textual Content with Knowledge Graph Embeddings}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
}
Figure