Author Login Chief Editor Login Reviewer Login Editor Login Remote Office

Computer Engineering

   

LLM and Knowledge Graph-Enhanced Spatio-Temporal Narrative Methods for Historical Documents

  

  • Published:2026-07-30

面向历史文献的大模型图谱增强时空叙事方法研究

Abstract: As core carriers of human civilization and Red (revolutionary) culture, historical documents harbor densely packed spatiotemporal clues and intricately interwoven entity associations within their texts. However, conventional knowledge-organization methods in the digital humanities have long been constrained by bottlenecks such as the fragmentation of multi-source historical materials, the heterogeneity of narrative styles, and referential ambiguity among persons, places, times, and events. When general-purpose large language models (LLMs) are applied directly to historical text processing, the absence of domain-specific prior knowledge readily leads to inaccurate identification of entity boundaries. At the same time, the pervasive phenomena of homonymous entities (identical names denoting distinct entities) and synonymous entities (distinct names denoting an identical entity) cause traditional entity-alignment algorithms to confront a cost crisis in which computational complexity grows quadratically with scale during the comparison of massive numbers of graph nodes. Moreover, conventional retrieval-augmented generation (RAG) approaches overlook the implicit spatiotemporal topological constraints among texts and therefore frequently produce logical distortions when addressing narrative-style question answering, such as cross-period trajectory reconstruction and complex spatiotemporal transitions. In view of these challenges, this paper proposes a spatiotemporal narrative enhancement framework for historical documents that integrates large language models with knowledge graphs, aiming to achieve efficient structured extraction, high-precision association fusion, and deep spatiotemporal reasoning-based question answering over large-scale historical texts. The proposed framework adopts a hierarchical, collaborative design comprising three progressive core modules: knowledge extraction, entity alignment, and spatiotemporal narrative intelligent question answering. In the knowledge-extraction stage, in light of the dense proper nouns and idiosyncratic grammar characteristic of historical texts, a history-constrained prompt-chain framework is designed that decomposes the single extraction task into three cascaded stages—step-by-step reasoning prompting, domain prior-knowledge injection, and structured-output constraint correction. By introducing military terminology, historical place names, and a Ganzhi (sexagenary-cycle) chronology reference table into the context stream, the framework achieves precise, high-volume conversion of unstructured text into graph-structured data. In the entity-alignment stage, to eliminate the computational bottleneck in cross-source, multi-graph merging, a two-stage entity-alignment algorithm is proposed. The first stage introduces an index-optimized filtering mechanism that constructs a four-dimensional hybrid index covering textual aliases, life cycles, geographical-hierarchy mappings, and social topological relations; by means of a bucketing strategy, it converges the search space of nodes awaiting alignment to single digits, thereby compressing the overall time complexity of the algorithm from quadratic to linear. The second stage performs LLM-enhanced semantic discrimination, fusing the static and dynamic attribute features of candidate entities with multi-hop association networks to compute a composite similarity, and establishes a tiered, human-machine collaborative closed-loop decision process via a confidence-evaluation mechanism. In the question-answering stage, a spatiotemporal narrative graph RAG module is designed; through instruction fine-tuning or semantic parsing, natural-language queries are mapped into structured constraint conditions with explicit spatiotemporal boundaries, and a graph-database query language is dynamically generated to retrieve multi-hop associated spatiotemporal subgraphs from the global knowledge graph. The temporal evolution features and spatial topological structure are thereby conveyed in full to the generative model, driving it to produce spatiotemporal narrative text with rigorous logical chains and high interpretability. To validate the robustness and effectiveness of the proposed framework in practical settings, multi-dimensional empirical evaluations were conducted on the self-constructed Red historical-document dataset N4A-Hist, the publicly available historical dataset CHisIEC, and the multilingual general-purpose dataset DBP15K. Experimental results show that, on the knowledge-extraction task for unstructured text, the prompt-chain framework attains F1 scores of 94.8% and 92.1% on N4A-Hist and CHisIEC, respectively—improvements of 16.3% and 14.0% over the baseline of direct extraction by the base model—while ablation experiments confirm the decisive role of stepwise constraints in mitigating format hallucination. In cross-source entity-alignment testing, the two-stage algorithm achieves a Hits@1 of 91.3% and an MRR of 0.962 on N4A-Hist, with a total online runtime of only 0.8 hours; compared with the state-of-the-art LLM-based alignment methods ChatEA and LLM4EA and the traditional method EasyEA, it reduces runtime cost by more than 75% while maintaining comparable or higher accuracy. On the general-purpose datasetDBP15K, it likewise sustains a Hits@1 of 98.3% with a rapid convergence time of 4.2 hours, fully corroborating the superiority of the four-dimensional index in curbing the expansion of computational scale. In a question-answering test comprising 530 complex reasoning instructions, the spatiotemporal narrative graph RAG module raises answer accuracy on spatial-displacement questions and cross-period comprehensive-reasoning questions by substantial margins of 47% and 54%, respectively, relative to traditional vector-database retrieval. In summary, this study demonstrates that organically integrating the deep semantic representation capabilities of large language models with the rigorous topological structural knowledge of knowledge graphs constitutes an effective means of overcoming the bottlenecks of high ambiguity and strong spatiotemporal correlation in digital-humanities research on historical documents. While safeguarding the efficiency of automated processing workflows, the proposed framework mitigates the uncertainty risks of practical deployment through confidence filtering and multi-dimensional constraint mechanisms, thereby providing a highly feasible and academically valuable system-level solution for the digital reconstruction, deep semantic association, and intelligent knowledge services of massive, heterogeneous historical-document resources.

摘要: 历史文献作为人类文明与红色文化的核心载体,其文本内部蕴含着高度密集的时空线索与错综复杂的实体关联。然而,传统数字人文领域的知识组织方法长期面临多源史料碎片化、记述风格异构化以及人地时事指代模糊等瓶颈。通用大语言模型直接应用于历史文本处理时,极易因缺乏领域先验知识而导致实体边界识别失准;同时,历史实体普遍存在的同名异实与异名同实现象,使得传统实体对齐算法在海量图谱节点比对中面临计算复杂度随规模呈二次方增长的开销危机;此外,传统检索增强生成方法忽略了文本间隐式的时空拓扑约束,在应对跨时段历程梳理与复杂时空转移等叙事型问答时往往衍生逻辑失真。鉴于此,本文提出一种面向历史文献的大语言模型结合知识图谱的时空叙事增强框架,旨在实现大规模历史文本的高效结构化抽取、高精度关联融合以及深层次时空推理问答。 本文所提框架采取分层协同设计,包含知识抽取、实体对齐以及时空叙事智能问答三个递进式核心模块。在知识抽取阶段,针对历史文本专名密集且语法特殊的特征,设计了基于历史约束的提示词链框架,将单一的抽取任务解构为分步推理提示、领域先验知识注入以及结构化输出约束校正三个级联阶段,通过在上下文流中引入军事术语、历史地名及干支纪年对照表,实现非结构化文本向图结构数据的精准、大批量转化。在实体对齐阶段,为消除跨源多谱归并中的计算瓶颈,提出两阶段实体对齐算法。第一阶段引入索引优化筛选机制,构建涵盖文本别名、生命周期、地理层次映射及社会拓扑关系的四维混合索引,利用分桶策略将待对齐节点的搜索空间收敛至个位数,从而将整体算法的时间复杂度从平方级压缩至线性级;第二阶段执行大模型增强的语义判别,融合候选实体的动静态属性特征与多跳关联网络计算综合相似度,并借助置信度评估机制建立人机协同的分级决策闭环。在智能问答阶段,设计时空叙事图检索增强生成模块,通过指令微调或语义解析将自然语言查询映射为包含显式时空边界的结构化约束条件,动态生成面向图数据库的查询语言,进而从全局图谱中检索多跳关联的时空子图,将时序演进特征与空间拓扑结构完整传递至生成模型,驱动其生成具备严密逻辑链条与高可解释性的时空叙事文本。 为验证所提框架在实际场景下的鲁棒性与有效性,本文在自建红色历史文献数据集 N4A-Hist 以及公开历史数据集 CHisIEC 、多语言通用数据集 DBP15K 上进行了多维度的实证评估。实验结果表明,在面向非结构化文本的知识抽取任务中,提示词链框架在 N4A-Hist 和 CHisIEC 数据集上的 F1 指数分别达到 94.8% 和 92.1% ,较之基座模型直接抽取的基准性能分别提升了 16.3% 和 14.0% ,消融实验亦证实了分步约束对缓解格式幻觉的决定性作用。在跨源实体对齐测试中,两阶段实体对齐算法在 N4A-Hist 上的 Hits@1 达到 91.3% ,MRR 达到 0.962 ,且在线总耗时仅为 0.8 小时,相较于前沿的大模型对齐方法 ChatEA 、 LLM4EA 以及传统方法 EasyEA ,在保持同等或更高精度的前提下,运行开销缩短了 75% 以上,而在通用数据集 DBP15K 上同样保持了 98.3% 的 Hits@1 以及 4.2 小时的快速收敛表现,充分印证了四维索引在平抑计算规模扩张方面的优越性。在包含 530 条复杂推理指令的问答测试中,时空叙事图检索增强生成模块在空间位移型问题与跨时段综合推理型问题上的回答准确率较传统向量数据库检索分别大幅攀升了 47% 和 54% 。 综上所述,本文研究表明,将大语言模型深层的语义表征能力与知识图谱严谨的拓扑结构知识有机融合,是破解历史文献数字人文研究中高歧义性、强时空关联性瓶颈的有效途径。所提框架在保障自动化处理流转效率的同时,通过置信度过滤与多维约束机制平抑了技术落地中的不确定性风险,为海量、异构的历史文献资源