Method and system for generating questions and answers through knowledge graph enhanced retrieval in postal business field

By constructing high-purity knowledge blocks and lightweight knowledge graphs, and combining dynamic intent routing and dual-path hybrid retrieval, the problems of low recall accuracy and illusion in intelligent question-answering systems in postal services have been solved, achieving highly accurate question-answering services.

CN122021935APending Publication Date: 2026-05-12BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING UNIV OF POSTS & TELECOMM
Filing Date
2026-03-26
Publication Date
2026-05-12

Smart Images

  • Figure CN122021935A_ABST
    Figure CN122021935A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for generating questions and answers through knowledge graph enhanced retrieval in the field of postal business, and belongs to the technical field of information retrieval. The invention provides a two-way mixed retrieval and dynamic fine arrangement framework aiming at the problem that the existing large model is extremely easy to generate condition dislocation and factual illusion under multiple nesting rules. On the basis of constructing a vector library and a lightweight atlas, a multi-dimensional feature fusion dynamic mixed scoring model is innovatively introduced. And the system calculates an initial semantic similarity score and a map entity alignment score in parallel, sets a strong rule one-ticket override mechanism, and calculates a final office reordering score. According to the method, the flexible semantic features are forcibly constrained and rejected through a hard map rule, and absolutely matched rule fragments are intercepted to guide the generation of a large model. According to the method, the dislocation phenomenon in complex charge calculation is thoroughly eradicated, and the accuracy and compliance of business questions and answers are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, natural language processing, and information retrieval technology, specifically to a retrieval enhancement generation (RAG) method and system based on knowledge graphs to enhance retrieval accuracy and constrain the output of large models. It is particularly suitable for intelligent question-answering scenarios in postal and vertical business sectors with complex rules and extremely high rigor requirements. Background Technology

[0002] With the rapid development of large language models (LLMs), intelligent question answering systems have been widely used in various industries. However, in vertical business areas such as postal services, existing intelligent question answering solutions still face significant technical bottlenecks.

[0003] Currently, the main solutions for intelligent question answering in vertical domains are: first, to directly use a pre-trained large language model for zero-shot question answering; second, to use traditional retrieval augmented generation (RAG) technology, which involves storing document chunks in a vector database, retrieving context by calculating the vector similarity between the user's question and the document chunks, and then having a large model generate the answer.

[0004] The aforementioned existing technologies have the following serious shortcomings:

[0005] The illusion is severe and the compliance is poor: the large model lacks the constraint of an absolutely accurate external knowledge base. When faced with the postal service’s tariff standards, which have extremely high requirements for timeliness and accuracy, it is very easy to generate the illusion of fact and fabricate false amounts.

[0006] Lacking logical reasoning, traditional RAG (Real-Time Indexing) is prone to condition misalignment: it relies solely on fuzzy semantic similarity for retrieval. However, postal rates often contain multiple nested discrete logical conditions (e.g., specific origin province to destination province + weight exceeding a specified threshold + specific insurance amount, etc.). Pure vector retrieval cannot align logical conditions, often leading to the retrieval of rate regulations for the wrong province or weight range, resulting in extremely poor recall accuracy.

[0007] Significant data noise interference: Official postal business documents typically contain a large amount of structured noise such as tables of contents, page numbers, and broken rows in tables. Directly vectorizing these documents can lead to overlapping features in the retrieval space, further reducing the system's recall rate. Summary of the Invention

[0008] In order to overcome the shortcomings of traditional vector retrieval in the prior art, which cannot handle multiple logical constraints and large language models are prone to factual illusions, the purpose of this invention is to provide a knowledge graph-enhanced retrieval and question-answering method and system for the postal business field, so as to provide accurate, traceable and zero-illusion intelligent question-answering services under complex postal business rules.

[0009] To achieve the above objectives, the present invention provides the following technical solution:

[0010] A knowledge graph-enhanced retrieval and question-answering method for the postal service domain includes:

[0011] The user-input postal service documents are preprocessed and noise-reduced to obtain high-purity knowledge blocks;

[0012] The high-purity knowledge blocks are extracted from two sources to construct a vector database and a lightweight knowledge graph, respectively.

[0013] Receive user queries, identify the business intent of the user queries, and perform dynamic intent routing based on the business intent;

[0014] Based on the routing results, a dual-path hybrid retrieval based on knowledge graph enhancement is performed to obtain rule fragments that absolutely match the user query;

[0015] The rule fragments are used as knowledge constraints, and a large language model is used to generate and output question-and-answer results with source citations.

[0016] Preferably, the step of preprocessing and denoising the postal service documents input by the user to obtain high-purity knowledge blocks includes:

[0017] Collect official document data from the target postal business area, and use a large language model to remove structured noise from the document data, including table of contents, page numbers, and table line breaks;

[0018] Based on semantic integrity, a sliding window strategy with overlap ratio is used to slice the denoised document data to obtain high-purity knowledge blocks with contextual logic.

[0019] Preferably, the construction of the vector database and the lightweight knowledge graph includes:

[0020] The high-purity knowledge blocks are transformed into high-dimensional vectors through an embedding model and stored in a vector database to support fuzzy semantic retrieval.

[0021] Extract core postal business elements from the high-purity knowledge block. The core business elements include business entities, business attributes, and business relationships.

[0022] The core business elements are linked in the form of triples to construct a lightweight knowledge graph that reflects the rules for calculating and restricting postal service fees.

[0023] Preferably, the step of receiving a user query, identifying the business intent of the user query, and performing dynamic intent routing based on the business intent includes:

[0024] Extract key entity information from user queries and assess the completeness of query conditions;

[0025] If the user query is determined to be a routine postal concept inquiry, the routing node will be directed to a single-path vector retrieval.

[0026] If it is determined that the user query involves specific weight, cost, or numerical rule calculations, the routing node will be directed to a dual-path hybrid retrieval based on knowledge graph enhancement.

[0027] Preferably, the step of performing a dual-path hybrid retrieval based on knowledge graph enhancement to obtain a rule fragment that absolutely matches the user query includes:

[0028] Coarse ranking stage: Calculate the vector similarity between the user query and each knowledge block in the vector database, and recall the top K candidate rule fragments;

[0029] Fine ranking stage: Trigger the lightweight knowledge graph and compare the entity conditions in the candidate rule fragments with the key entity information in the user query;

[0030] Forced filtering phase: Using the logical relationship paths in the knowledge graph, irrelevant fragments that conflict with the user's query conditions are removed from the candidate rule fragments, and rule fragments that match absolutely are retained.

[0031] Preferably, the step of using the rule fragment as a knowledge constraint and generating and outputting question-answering results with source tracing references using a large language model includes:

[0032] The absolutely matching rule fragments are concatenated with the user query to generate strongly binding prompt words;

[0033] The prompt words are input into a large language model deployed locally in physical isolation;

[0034] The large language model strictly follows the rule fragments in the prompt words to perform logical reasoning and generation, extracts the source information of the rule fragments, and outputs the final answer containing factual basis and source citation.

[0035] The beneficial effects of this invention are as follows:

[0036] (1) Greatly improves the retrieval accuracy under complex conditions: This invention innovatively introduces a knowledge graph logic fine ranking mechanism, which effectively solves the problem of "condition misalignment" that traditional RAG technology is prone to when facing multiple postal billing conditions (such as cross-province combination, first and subsequent overlap, etc.), and realizes accurate matching of complex rules.

[0037] (2) Completely eliminate the illusion of fact: This invention constructs a high-purity data foundation and imposes strong constraints on the generated model through graph rules, ensuring that the accuracy of tariffs and business compliance of the large model output are fundamentally guaranteed, while providing traceability capabilities.

[0038] (3) Meets data security and privacy protection requirements: The full-process architecture of this invention is highly decoupled, supports the deployment of open source large models in local physical isolation environment, and meets the rigid requirements of vertical business systems to prevent the leakage of sensitive data.

[0039] The core difference and inventive features of this invention compared to existing technologies are as follows:

[0040] (1) Existing technologies do not design lightweight knowledge graphs for postal services. This invention extracts the core elements of postal billing to construct a graph that perfectly adapts to discrete nested billing rules.

[0041] (2) Existing technologies lack dynamic intent routing mechanisms. This invention achieves dynamic switching of retrieval branches based on the completeness of the query entity, thereby improving the retrieval efficiency of the system.

[0042] (3) Existing technologies have not proposed a hybrid scoring algorithm that integrates a veto power. This invention is the first to propose a hybrid scoring algorithm that integrates a veto power. The mathematical model achieves a perfect fusion of semantic flexibility and rule rigidity, completely overcoming the problem of misaligned conditions in traditional large models for pricing queries. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the embodiments will be briefly introduced below.

[0044] Figure 1 is a flowchart of the overall process of the knowledge graph-enhanced retrieval and question-answering system for the postal business field provided in an embodiment of the present invention;

[0045] Figure 2 is a block diagram illustrating the principle of dual-path hybrid retrieval and fine-sorting verification provided in an embodiment of the present invention;

[0046] Figure 3 is a flowchart of the dynamic hybrid scoring model provided in an embodiment of the present invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0048] Referring to Figure 1, this embodiment of the invention provides a knowledge graph-enhanced retrieval and question-answer generation method for the postal service field, the core execution steps of which are as follows:

[0049] Step 1: Business Document Acquisition and Noise Reduction Cleaning. The system acquires official postal service documents (such as tariff tables and processing rules in Word, PDF, and other formats). A large language model is used to remove structural noise such as table of contents, page numbers, and garbled characters, and knowledge is decomposed into atomic blocks. A sliding window strategy is used to segment the knowledge into blocks, obtaining high-purity knowledge chunks.

[0050] Step 2: Parallel construction of the knowledge base. On one hand, the text segmentation and vectorization unit performs high-dimensional vectorization of high-purity knowledge blocks through an embedding model and stores them in a vector database (such as ChromaDB). On the other hand, the entity and relation extraction unit extracts entities (such as business type, location, billing unit), attributes (such as weight threshold, pricing amount), and relations (such as containment, billing standard) from clean documents, constructing a lightweight domain graph in the form of triples.

[0051] Step 3: User Interaction and Dynamic Intent Routing. Receive the user's business query input and extract entities from the statement. If the user's question has incomplete entities or is only a conceptual query (e.g., "how to pack a package"), the intent routing module directs it to a pure vector coarse-sort branch; if it involves complex pricing and rule calculations, it directs it to a dual-path hybrid retrieval module.

[0052] Step 4: Dual-path hybrid retrieval and map ranking.

[0053] Referring to Figure 2, in the vector coarse ranking branch, the system recalls Top-K candidate rule fragments based on semantic similarity. Subsequently, it enters the graph fine ranking branch, where the graph verification and filtering unit uses the entity rules extracted in the previous stage (such as forcibly limiting the starting weight or the originating province) to forcibly remove conflicting fragments in the coarse ranking branch that have "condition misalignment", retaining only the absolutely accurate and unique business rule fragments.

[0054] In a preferred embodiment of the present invention, the map verification and filtering unit in step 4 specifically employs a dynamic hybrid scoring model based on multi-dimensional feature fusion to solve the problem of condition misalignment under multiple nested conditions. The specific logic is as follows:

[0055] (1) Initial semantic recall scoring:

[0056] Calculate user queries using a text feature extraction network based on a bidirectional encoder. Candidate blocks in vector database The cosine similarity is used to obtain the initial semantic score. The calculation formula is as follows:

[0057]

[0058] in, and These are the high-dimensional embedding vectors for user queries and candidate knowledge blocks, respectively. The range of values , which represents the fuzzy semantic similarity between user queries and rule fragments in a continuous vector space.

[0059] (2) Scoring of the accuracy of entity alignment in the graph (graph rule constraints):

[0060] The system divides the previously extracted business entities into three feature sets: geographical sets. Numerical sets Business type set Calculate the matching degree between entities in the candidate rule fragments and the entities queried by the user. :

[0061]

[0062] in, This refers to the dynamic penalty weight for the corresponding entity type. This is a Boolean matching function that takes the value when the entities are a perfect match. Otherwise take . This is a function for determining whether an input value strictly falls within a specified range. The range of values ​​is It represents the absolute alignment of discrete business entities (such as region, weight, business type).

[0063] (3) Final re-sorting scoring (integration and veto):

[0064] Introducing a veto penalty for graph conflict (If there is a mismatch in the core conditions) Final overall score It combines the flexibility of fuzzy semantics with the rigidity of graph rules:

[0065] in, and These are dynamic weighting coefficients, and they satisfy... In this embodiment, for the scenario of postal rate inquiry with strict rules, the system emphasizes the rigid constraints of the graph rules, therefore setting... (For example ). For strong rules, a single veto can be applied to penalty items when a core entity conflict is triggered. ;otherwise This mechanism is used to directly block the illusion of fact at a mathematical level. For absolute matching, the truncation threshold is set only when... Only then is the rule fragment considered absolutely credible evidence and output to the large language model.

[0066] Step 5: Constraining the Credible Generation of the Large Model. The high-purity reference text retrieved through hybrid retrieval is concatenated and assembled with the user's question, and graph constraint instructions are injected. The system forces the large language model to strictly adhere to the retrieved precise pricing and rules in its answers, extracting the supporting clauses, and finally outputting a zero-illusion professional answer with source citations.

[0067] The specific workflow of this invention will be described in detail through the following specific embodiments:

[0068] Example 1: Scenario of accurate postal rate query and calculation.

[0069] When a user enters the query: "I want to send a 1.5kg package from Beijing to Shanghai, how much will it cost by express delivery?"

[0070] The system first goes through the intent routing module, which identifies that the query contains complete origin, destination, weight, and service type entities, and determines it to be a "complex billing query".

[0071] Subsequently, the system extracts the core conditions of the current query through the graph (origin = Beijing, destination = Shanghai, weight = 1.5kg, service = express delivery).

[0072] During the vector coarse sorting stage, the system may recall a large number of fragments related to "inter-provincial express delivery rates";

[0073] After entering the fine sorting stage of the graph, the graph verification mechanism forcibly filters out interference items belonging to "ordinary letters" in the recalled segments, as well as inapplicable segments of "first weight within 1kg", accurately locking the billing formula and corresponding parameters of "first weight + subsequent weight".

[0074] Finally, the large model generates the final answer based on this unique and precise formula: "Hello, the first weight (1kg) of express delivery from Beijing to Shanghai is X yuan, and the additional weight (0.5kg) is Y yuan, for a total of Z yuan. (Based on Article 3 of the Domestic Express Delivery Rate Standard)."

[0075] The specific numerical calculation process is illustrated below:

[0076] Set weight parameters , Matching threshold .

[0077] (1) Initial semantic scoring: for “Beijing to Shanghai” "Express Delivery" and "Vector Recall of Most Similar Fragments" The cosine similarity score is calculated by the bidirectional encoder. .

[0078] (2) Graph entity scoring: Extract query entities Beijing Shanghai , , Express delivery System comparison fragments The underlying graph rules, with complete regional matching ( ), Strictly falls within the first and second consecutive weight range ( ), business type matching ( The graph matching score was calculated. .

[0079] (3) Veto criterion: No conflict in the core conditions; .

[0080] (4) Final score and output: Final score .because The system absolutely accepts this fragment as the sole constraint for generating the large model. Verified on an internal standard benchmark set, under controlled testing scenarios, the factual illusion rate for complex rule-based question answering decreased significantly after introducing this graph ranking mechanism. Down to .

[0081] Based on the above method, embodiments of the present invention also provide a knowledge graph-enhanced retrieval and question-answering system for the postal service field, characterized in that it includes:

[0082] The data noise reduction module is used to preprocess and reduce noise from the postal business documents input by the user to obtain high-purity knowledge blocks;

[0083] The knowledge base construction module is used to extract the high-purity knowledge blocks from two sources and construct a vector database and a lightweight knowledge graph, respectively.

[0084] The intent routing module is used to receive user queries, identify the business intent of the user query, and perform dynamic intent routing based on the business intent;

[0085] The dual-path hybrid retrieval module is used to perform a knowledge graph-enhanced dual-path hybrid retrieval based on the routing results to obtain rule fragments that absolutely match the user query.

[0086] The large model constraint generation module is used to take the rule fragments as knowledge constraints, and use the large language model to generate and output question-and-answer results with source citations.

[0087] The present invention also provides a computer-readable storage medium and an electronic device for storing and running a computer program that implements the above-described method.

[0088] The above description of the embodiments is only for the purpose of helping to understand the method and core ideas of the present invention; at the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A knowledge graph-enhanced retrieval and question-answering method for the postal service sector, characterized in that, include: The user-input postal service documents are preprocessed and noise-reduced to obtain high-purity knowledge blocks; The high-purity knowledge blocks are extracted from two sources to construct a vector database and a lightweight knowledge graph, respectively. Receive user queries, identify the business intent of the user queries, and perform dynamic intent routing based on the business intent; Based on the routing results, a dual-path hybrid retrieval based on knowledge graph enhancement is performed to obtain rule fragments that absolutely match the user query; The rule fragments are used as knowledge constraints, and a large language model is used to generate and output question-and-answer results with source citations.

2. The method according to claim 1, characterized in that, The process of obtaining postal service documents input by the user, preprocessing and noise reduction to obtain high-purity knowledge blocks, specifically includes: Using a large language model as a structure parser, non-textual structured noise in document data is accurately identified and removed. The structured noise includes table of contents, page numbers, and cross-page table line breaks. A sliding window strategy with overlap ratio is used to perform semantic-level slicing on the denoised plain text. The step size of the sliding window is dynamically and adaptively adjusted according to the paragraph length of the postal business rules, and the final output is a high-purity knowledge block with complete contextual logic.

3. The method according to claim 1, characterized in that, The construction of the vector database and the lightweight knowledge graph includes the following: Vector library construction: By calling the Chinese domain-optimized embedding model, the high-purity knowledge blocks are transformed into high-dimensional dense vectors of fixed dimensions and stored in a vector database that supports approximate nearest neighbor search; Knowledge graph construction: Using entity recognition and relation extraction algorithms, the core elements of postal services are accurately extracted from the high-purity knowledge blocks. The core elements include region, weight range, tariff standard and service type. The above elements are then structured and associated in the form of triples to construct a lightweight knowledge graph that reflects discrete billing rules.

4. The knowledge graph-enhanced retrieval and question-answering method for the postal service field according to claim 1, characterized in that, The process of receiving a user query, identifying the business intent of the user query, and performing dynamic intent routing based on the business intent includes: Extract key entity information from user queries and assess the completeness of query conditions; If the user query is determined to be a routine postal concept inquiry, the routing node will be directed to a single-path vector retrieval. If it is determined that the user query involves specific weight, cost, or numerical rule calculations, the routing node will be directed to a dual-path hybrid retrieval based on knowledge graph enhancement.

5. The method according to claim 4, characterized in that, The execution of the knowledge graph-enhanced dual-path hybrid retrieval specifically includes a dynamic hybrid scoring model based on multi-dimensional feature fusion, whose score calculation and filtering mechanism is as follows: Extract the high-dimensional embedding vectors of the user query and candidate knowledge fragments, calculate their cosine similarity, and obtain the initial semantic score. ; The extracted business entities are divided into a geographic set, a numerical set, and a business type set. Boolean matching functions and numerical interval judgment functions are used to calculate the map entity matching score. ; Introducing a veto penalty for graph conflict If a candidate segment contains a core condition that conflicts with the user's query, then... It is negative infinity; Final overall score ,in and For the preset balance coefficient and satisfy Designed for postal service rate inquiry scenarios System interception Fragments exceeding a set threshold are considered absolute match rule fragments.

6. The knowledge graph-enhanced retrieval and question-answering method for the postal service field according to claim 1, characterized in that, The step of using the rule fragments as knowledge constraints and generating and outputting question-answering results with source tracing references using a large language model includes: The absolutely matching rule fragments are concatenated with the user query to generate a strongly binding prompt. The prompt words are input into a large language model deployed locally in physical isolation; The large language model strictly follows the rule fragments in the prompt words to perform logical reasoning and generation, extracts the source information of the rule fragments, and outputs the final answer containing factual basis and source citation.

7. A knowledge graph-enhanced retrieval and question-answering system for the postal service sector, characterized in that, include: The data noise reduction module is used to preprocess and reduce noise from the postal business documents input by the user to obtain high-purity knowledge blocks; The knowledge base construction module is used to extract the high-purity knowledge blocks from two sources and construct a vector database and a lightweight knowledge graph, respectively. The intent routing module is used to receive user queries, identify the business intent of the user query, and perform dynamic intent routing based on the business intent; The dual-path hybrid retrieval module is used to perform a knowledge graph-enhanced dual-path hybrid retrieval based on the routing results to obtain rule fragments that absolutely match the user query. The large model constraint generation module is used to take the rule fragments as knowledge constraints, and use the large language model to generate and output question-and-answer results with source citations.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the knowledge graph-enhanced retrieval and question-answering method for the postal business field as described in any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the knowledge graph-enhanced retrieval and question-answering method for the postal business field as described in any one of claims 1 to 6.