Ontology-Guided Extraction Builds Knowledge Graphs from Documents

Vaibhav Dangaich, Kevin Lewis, Kundeshwar Pundalik· August 3, 2026 View original

Key takeaways

  • Ontology-guided LLM extraction improves consistency and accuracy in knowledge graph construction.
  • A multi-stage refinement pipeline with deduplication is crucial for high-quality data.
  • Dynamic ontology injection significantly reduces overhead and enhances extraction relevance.
  • The system dramatically improves search recall and corrects various data quality defects.

Who benefits

IntelligenceHealthcareLegalFinancial ServicesGovernment

Summary

This paper presents a production extraction layer that converts heterogeneous document streams into validated knowledge graphs aligned to a formal ontology. It uses an ontology-guided LLM for extraction and a multi-stage refinement pipeline with deduplication, significantly improving search recall and correcting quality defects.

Large language models (LLMs) are adept at extracting entities and relationships from unstructured text, but they often produce inconsistent results, leading to fragmented vocabularies, duplicate entries, and conflated identities. This research introduces a robust, production-ready extraction layer designed to transform live streams of heterogeneous documents into a validated knowledge graph, meticulously aligned with a formal ontology. The system processes various document formats, including PDFs, spreadsheets, Office files, and images, routing them through specialized handlers. It employs a locally hosted Qwen3.5-9B model, fine-tuned on the target ontology, for a two-pass extraction of entities and relationships. A key innovation is its ontology-guided extraction mechanism: a relevant subset of the curated ontology is dynamically retrieved via embedding similarity and injected into the LLM prompt, drastically reducing catalog overhead compared to static domain slices. Following extraction, results undergo a five-stage refinement pipeline. This includes deterministic cleaning, merging across document chunks, a second pass for relationships, six distinct deduplication algorithms that operate without further model inference, and an embedding resolution subsystem with a conflict guard. Evaluation on intelligence corpora demonstrated a significant improvement in search recall from approximately 70% to 95% without false merges, while also rectifying seven classes of silent quality defects, from text truncation errors to systematic entity duplication.

Why it matters

Organizations dealing with vast amounts of unstructured data can leverage this system to build high-quality, consistent knowledge graphs, enabling more accurate search, better data integration, and enhanced decision-making.

How to implement this in your domain

  1. 1Assess current data extraction processes for inconsistencies, duplicates, and alignment issues with existing ontologies.
  2. 2Explore implementing an ontology-guided extraction layer using fine-tuned LLMs for specific document types.
  3. 3Design a multi-stage refinement pipeline for extracted data, incorporating deterministic cleaning and advanced deduplication algorithms.
  4. 4Integrate embedding similarity for dynamic ontology retrieval to optimize LLM prompting.
  5. 5Pilot the construction of a knowledge graph from a specific stream of heterogeneous documents to improve search and data quality.

Original post by Vaibhav Dangaich, Kevin Lewis, Kundeshwar Pundalik

"arXiv:2607.28662v1 Announce Type: new Abstract: Large language models extract entities and relationships from unstructured documents fluently but inconsistently: type vocabularies fracture across documents, the same person surfaces under several name variants, relationships dupli…"

View on X

Originally posted by Vaibhav Dangaich, Kevin Lewis, Kundeshwar Pundalik on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses