Table of Contents
Fetching ...

KGGen: Extracting Knowledge Graphs from Plain Text with Language Models

Belinda Mo, Kyssen Yu, Joshua Kazdan, Joan Cabezas, Proud Mpala, Lisa Yu, Chris Cundy, Charilaos Kanatsoulis, Sanmi Koyejo

TL;DR

KGGen tackles the scarcity of high-quality knowledge graphs by presenting a three-stage LM-based pipeline that extracts, aggregates, and de-duplicates plain-text-derived graphs to produce dense, reusable KGs. It introduces MINE, a dual-task benchmark for information retention and RAG effectiveness, and demonstrates superior fidelity and favorable scaling compared with OpenIE and GraphRAG across multiple language models. The approach emphasizes dense connectivity and entity/edge resolution to support embedding-based tasks, while remaining open-source and practically viable. Overall, KGGen offers a scalable, benchmark-supported solution to converting plain text into useful knowledge graphs for retrieval-augmented systems and downstream AI tasks.

Abstract

Recent interest in building foundation models for KGs has highlighted a fundamental challenge: knowledge-graph data is relatively scarce. The best-known KGs are primarily human-labeled, created by pattern-matching, or extracted using early NLP techniques. While human-generated KGs are in short supply, automatically extracted KGs are of questionable quality. We present a solution to this data scarcity problem in the form of a text-to-KG generator (KGGen), a package that uses language models to create high-quality graphs from plaintext. Unlike other KG extractors, KGGen clusters related entities to reduce sparsity in extracted KGs. KGGen is available as a Python library (\texttt{pip install kg-gen}), making it accessible to everyone. Along with KGGen, we release the first benchmark, Measure of of Information in Nodes and Edges (MINE), that tests an extractor's ability to produce a useful KG from plain text. We benchmark our new tool against existing extractors and demonstrate far superior performance.

KGGen: Extracting Knowledge Graphs from Plain Text with Language Models

TL;DR

KGGen tackles the scarcity of high-quality knowledge graphs by presenting a three-stage LM-based pipeline that extracts, aggregates, and de-duplicates plain-text-derived graphs to produce dense, reusable KGs. It introduces MINE, a dual-task benchmark for information retention and RAG effectiveness, and demonstrates superior fidelity and favorable scaling compared with OpenIE and GraphRAG across multiple language models. The approach emphasizes dense connectivity and entity/edge resolution to support embedding-based tasks, while remaining open-source and practically viable. Overall, KGGen offers a scalable, benchmark-supported solution to converting plain text into useful knowledge graphs for retrieval-augmented systems and downstream AI tasks.

Abstract

Recent interest in building foundation models for KGs has highlighted a fundamental challenge: knowledge-graph data is relatively scarce. The best-known KGs are primarily human-labeled, created by pattern-matching, or extracted using early NLP techniques. While human-generated KGs are in short supply, automatically extracted KGs are of questionable quality. We present a solution to this data scarcity problem in the form of a text-to-KG generator (KGGen), a package that uses language models to create high-quality graphs from plaintext. Unlike other KG extractors, KGGen clusters related entities to reduce sparsity in extracted KGs. KGGen is available as a Python library (\texttt{pip install kg-gen}), making it accessible to everyone. Along with KGGen, we release the first benchmark, Measure of of Information in Nodes and Edges (MINE), that tests an extractor's ability to produce a useful KG from plain text. We benchmark our new tool against existing extractors and demonstrate far superior performance.

Paper Structure

This paper contains 26 sections, 6 figures, 6 tables.

Figures (6)

  • Figure 1: KGGen extraction method
  • Figure 2: Evaluation process used in MINE-1
  • Figure 3: Distribution of MINE-1 scores across 100 articles for GraphRAG, OpenIE, and KGGen. Dotted vertical lines show average performance. KGGen scored $66.07\%$ on average, significantly outperforming GraphRag $47.80\%$ and OpenIE $29.84\%$.
  • Figure 5: Comparison between KGGen and GraphRag on MINE-2. The two methods perform comparably.
  • Figure 6: Visual comparison of KGs generated using KGGen, GraphRAG, and OpenIE. Results show that KGGen discovers more informative nodes to estimate a richer graph compared to GraphRAG, and collapses synonyms to discover a more informative graph than OpenIE.
  • ...and 1 more figures