The invention relates to the technical field of large models, and discloses a
knowledge graph and retrieval enhancement-based government affair question-answering method and
system, and the method comprises the steps: carrying out the
information extraction of each government affair document, and obtaining text information, multi-
modal information and
metadata; fusing the information to obtain document information; performing entity
relationship extraction based on the document information to obtain entity, relationship and text key value pairs; constructing a government affair
knowledge graph based on the entity, the relationship and the text key value pair corresponding to each government affair document; based on the type of the user
query statement and the government affair
knowledge graph, adopting a retrieval enhancement technology to generate a query answer; and optimizing the query answer to generate a target answer. According to the method, through the multi-
modal information and the knowledge graph, the document content and the query intention are comprehensively understood, the question and answer accuracy is improved, the knowledge graph and a retrieval enhancement technology are fused, the illusion phenomenon of a large
language model is reduced, the answer accuracy is improved, the safety, accuracy and
readability of the answer are ensured through optimization, and the user experience is improved.