An Ontology-Guided, Deduplication-Aware Extraction Layer for Knowledge Graph Construction from Heterogeneous Documents
An Ontology-Guided, Deduplication-Aware Extraction Layer for Knowledge Graph Construction from Heterogeneous Documents
一种用于异构文档知识图谱构建的本体引导及去重感知提取层
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 duplicate, and distinct individuals who share a name risk silent conflation. 大型语言模型能够流畅地从非结构化文档中提取实体和关系,但往往缺乏一致性:类型词汇在不同文档间出现断层,同一个人以多种名称变体出现,关系存在重复,而同名的不同个体则面临被错误合并的风险。
This paper presents the design, implementation, and empirical refinement of a production extraction layer that converts a live document stream into a validated knowledge graph aligned to a formal ontology. 本文介绍了一个生产级提取层的设计、实现及实证优化,该系统能将实时文档流转换为与形式化本体对齐的验证知识图谱。
The system consumes document metadata from Kafka, routes PDF, spreadsheet, Office, and image content through handlers built for each format, and extracts entities and relationships in two passes using a locally hosted Qwen3.5-9B model tuned on the ontology. 该系统从 Kafka 获取文档元数据,通过针对不同格式构建的处理程序路由 PDF、电子表格、Office 文档及图像内容,并利用本地部署的、针对本体进行过微调的 Qwen3.5-9B 模型,分两轮提取实体和关系。
Its distinguishing component is ontology-guided extraction: the relevant slice of a curated ontology is retrieved live from a graph database by embedding similarity and injected into the extraction prompt, reducing catalog overhead by about 94 percent relative to static domain slices. 其核心特色在于“本体引导提取”:通过嵌入相似度从图数据库中实时检索相关本体片段,并将其注入提取提示词中,相较于静态领域切片,该方法将目录开销降低了约 94%。
Extracted results then pass through a refinement pipeline of five stages: deterministic cleaning, merging across chunks, a second pass for relationships, six deduplication algorithms that require no model inference, and an embedding resolution subsystem whose conflict guard no similarity score can override. 提取结果随后进入包含五个阶段的优化流水线:确定性清洗、跨块合并、关系二次提取、六种无需模型推理的去重算法,以及一个冲突保护机制不可被任何相似度分数覆盖的嵌入解析子系统。
Evaluation on intelligence corpora improved search recall from roughly 70 to 95 percent with no false merges, and corrected seven classes of silent quality defect, ranging from a bug that truncated source text by a single character to the systematic duplication of entities that carried title prefixes. 在情报语料库上的评估显示,搜索召回率从约 70% 提升至 95%,且未出现错误合并。此外,系统还修复了七类隐性质量缺陷,涵盖了从导致源文本截断一个字符的 Bug,到带有标题前缀的实体系统性重复等问题。