Method and device for retrieving and answering questions based on a document structure tree
By constructing a business tree that conforms to the user's logical order, the document is guided by business principles. By filtering the candidate node set and matching levels, the answer is generated and the answer is obtained using a large language model.
Patent Information
- Application Number
- CN202510050486.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-01-13
AI Technical Summary
Existing intelligent customer service question-and-answer systems suffer from problems such as missing content, incorrect sorting, incorrect integration, and irrelevant answers when dealing with complex business processes and diverse scenarios. Furthermore, the cost of graph construction is high, making it difficult to achieve accurate and low-cost question-and-answer.
A large-scale retrieval question-answering method based on document structure trees is adopted. By constructing a business tree that conforms to the logical order of the document, the document is parsed, and the answer is generated by filtering the candidate node set and hierarchical matching. The large language model is used to generate the answer.
It achieves accurate, efficient, and low-cost question answers, supports quick responses that help users understand actual business processes, and also supports heuristic question answers for business processes that users do not understand, through heuristic question answering by filtering candidate node sets and hierarchically matching business trees.
Smart Images

Figure CN120104727B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of document intelligence, specifically relating to a large-scale model retrieval and question-answering method and apparatus based on a document structure tree. Background Technology
[0002] As an intelligent system capable of handling various common user questions online, the customer service Q&A system can significantly reduce the workload of human customer service representatives and improve service efficiency. It has always had great application value in public services, consumer consultation and other scenarios.
[0003] With the development of NLP technology, intelligent customer service systems are constantly evolving. Early intelligent customer service question-answering systems mainly consisted of FAQs based on common question-and-answer pairs and KBQA based on knowledge graphs. Essentially, both answered user questions by retrieving information from a local knowledge base. However, the scope of their responses was limited to content explicitly defined in the knowledge base. The quality of the knowledge base construction directly determined the effectiveness of the question-answering system, often requiring significant investment of human and material resources to continuously refine and improve it. Furthermore, due to the limited question parsing capabilities of small models, mismatches or inability to recall responses frequently occurred.
[0004] Retrieval enhancement systems based on large language models have brought new opportunities to intelligent question-answering systems. On the one hand, the effectiveness of using large language models to understand user questions far surpasses that of traditional small models, achieving true semantic understanding and greatly improving the recall rate of question-answering systems. On the other hand, relevant paragraphs, chapters, and even documents can be directly fed into the large language model for understanding and answering, reducing the need for manual construction of fine-grained knowledge bases in early question-answering systems. Furthermore, the GraphRAG system, which combines knowledge graphs with large language models, further performs graph-based parsing of the document objects to be understood, improving the quality of the system's output.
[0005] However, basic RAG systems often suffer from issues such as missing content, incorrect sorting, integration errors, and irrelevant answers, making it impossible to accurately answer questions. GraghRAG systems also still face problems such as high graph construction costs, difficulty in handling complex processes, and inability to perform targeted counter-questions.
[0006] Therefore, for online customer service scenarios, especially those with diverse business categories and complex processes, there is an urgent need for an accurate and low-cost question-answering method. Summary of the Invention
[0007] This invention is made to solve the above-mentioned problems, and aims to provide a large-scale model retrieval question-answering method and apparatus based on a document structure tree.
[0008] This invention provides a large-scale model retrieval question-answering method based on a document structure tree, used to generate answers to user questions based on multiple documents. It includes the following steps: Step S1, parsing each document to obtain a corresponding business tree; Step S2, for each business tree, converting the complete path from each root node to a leaf node into a corresponding path vector; Step S3, obtaining a candidate node set based on the user question and all path vectors, combined with a vector model; Step S4, determining whether to generate an answer based on the candidate node set. If yes, generating an answer based on the large language model and the candidate node set; otherwise, proceeding to Step S5; Step S5, performing hierarchical matching on all business trees based on the user question using the large language model to obtain hierarchical matching results; Step S6, generating an answer using the large language model combined with the hierarchical matching results. Here, the root node of the business tree is the main title of the corresponding document, and each leaf node of the business tree represents a specific content description within the document. Based on the hierarchical relationship, each title of the document is used as a node in the business tree. When a title is a parent node, its sub-titles are used as child nodes of that parent node.
[0009] The document structure tree-based large model retrieval question answering method provided by this invention may also have the following features: Step S3 includes the following sub-steps: Step S3-1, vectorize the user question to obtain the user question vector; Step S3-2, calculate the similarity between the user question vector and each path vector through the vector model; Step S3-3, filter the leaf nodes corresponding to the path vectors with similarity greater than a preset similarity threshold, and take all the filtered leaf nodes as a candidate node set.
[0010] The document structure tree-based large model retrieval question answering method provided by this invention may also have the following features: Step S4 includes the following sub-steps: Step S4-1, determine whether the candidate node set meets the preset judgment conditions. If yes, then execute step S4-2; if no, then execute step S5. Step S4-2, for each leaf node in the candidate node set, combine the leaf node with the user question and input it into the large language model to obtain the confidence level corresponding to the leaf node. Step S4-3, select the leaf node corresponding to the highest confidence level and combine it with the polishing prompt words and input it into the large language model to obtain the answer. The preset judgment conditions include at least one preset condition such as the total number of leaf nodes in the candidate node set not being greater than the preset number of nodes and the candidate node set not being an empty set.
[0011] The document structure tree-based large model retrieval question answering method provided by this invention may also have the following features: Step S5 includes the following sub-steps: Step S5-1, using the large language model to sequentially determine whether each root node is relevant to the user question, and taking the relevant root nodes as relevant nodes; Step S5-2, using the large language model to sequentially determine whether each child node corresponding to each relevant node is relevant to the user question, and taking the relevant child nodes as relevant nodes; Step S5-3, repeating Step S5-2 until a hierarchical matching result is obtained, the hierarchical matching result including: a single leaf node is relevant; all child nodes of a single parent node are relevant; all nodes are not relevant.
[0012] The large-scale retrieval question-answering method based on document structure tree provided by this invention may also have the following feature: when the hierarchical matching result shows that a single leaf node is relevant, the leaf node is combined with the polishing prompt words and input into the large language model to obtain the answer.
[0013] The large model retrieval question answering method based on document structure tree provided by the present invention may also have the following feature: the neighbor nodes of the leaf nodes are combined with the recommended prompt words and input into the large language model to generate recommendation information for the user's question.
[0014] The document structure tree-based large model retrieval question answering method provided by this invention may also have the following features: when the hierarchical matching result is that all child nodes of a single parent node are related, the large language model determines whether the user question corresponds to a single child node or multiple child nodes. When the user question corresponds to a single child node, all child nodes are combined with question prompts and input into the large language model to generate question information and display it to the user. The target node for obtaining the user's answer is then combined with all leaf nodes corresponding to the target node and polishing prompts and input into the large language model to obtain the answer. When the user question corresponds to multiple child nodes, all leaf nodes corresponding to all child nodes are combined with polishing prompts and input into the large language model to obtain the answer.
[0015] The large-scale retrieval question-answering method based on document structure tree provided by this invention may also have the following feature: when the hierarchical matching result is that all nodes are not related, the answer is the preset response content.
[0016] The large model retrieval question answering method based on document structure tree provided by the present invention may also have the following features: In step S5-2, when a single intermediate node is relevant, the child nodes corresponding to the intermediate node are combined with the question prompt words and input into the large language model to generate question information and display it to the user. The large language model sequentially judges whether the child nodes corresponding to the intermediate node are relevant to the user's response to the question information, and the child nodes with relevant information are regarded as relevant nodes.
[0017] This invention also provides a large-scale retrieval question-answering device based on a document structure tree, used to generate answers to user questions from multiple documents. It features the following characteristics: a business tree construction module, a path vector generation module, a candidate node filtering module, a judgment module, a hierarchy matching module, and an answer generation module. The business tree construction module parses each document to obtain its corresponding business tree. The path vector generation module converts the complete path from each root node to a leaf node in each business tree into a corresponding path vector. The candidate node filtering module includes a vector model to obtain a set of candidate nodes based on the user question and all path vectors, and then judges the results. The breakpoint module determines whether to generate an answer based on the candidate node set. If so, it generates an answer based on the large language model and the candidate node set. If not, it executes the hierarchical matching module. The hierarchical matching module performs hierarchical matching on all business trees based on the user's question using the large language model to obtain the hierarchical matching result. The answer generation module generates an answer by combining the large language model with the hierarchical matching result. The root node of the business tree is the main title of the corresponding document, and each leaf node of the business tree is a description of the specific content in the document. According to the hierarchical relationship, each title of the document is used as a node of the business tree. When a title is a parent node, each subtitle corresponding to that title is used as a child node corresponding to that parent node.
[0018] The role and effect of invention
[0019] According to the document structure tree-based large-model retrieval question-answering method and apparatus of the present invention, on the one hand, by constructing a business tree that conforms to the original logical order of the document and is free of loops, guidance is provided for the business corresponding to the document; on the other hand, by filtering the candidate node set and hierarchical matching, rapid responses are achieved in scenarios where the user already knows the business they are handling, and heuristic question answering is also supported in scenarios where the user is unfamiliar with the actual business process. Therefore, the document structure tree-based large-model retrieval question-answering method and apparatus of the present invention can achieve accurate, efficient, and low-cost question answers. Attached Figure Description
[0020] Figure 1 This is a block diagram of the large-scale model retrieval question-answering device in an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of the service tree in an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the process by which the candidate node filtering module generates a set of candidate nodes in an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of the workflow of the judgment module in an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of the process by which the hierarchical matching module generates hierarchical matching results in an embodiment of the present invention;
[0025] Figure 6 This is a flowchart illustrating the large-model retrieval question-answering method based on the document structure tree in an embodiment of the present invention. Detailed Implementation
[0026] To make the technical means, creative features, objectives and effects of the present invention easy to understand, the following embodiments, in conjunction with the accompanying drawings, provide a detailed description of the large-model retrieval question-answering method and apparatus based on the document structure tree of the present invention.
[0027] This embodiment provides a large-scale retrieval question-answering device based on a document structure tree, hereinafter referred to as the large-scale retrieval question-answering device, which is used to generate answers to user questions based on multiple documents.
[0028] Figure 1 This is a block diagram of the large model retrieval question-answering device in an embodiment of the present invention.
[0029] like Figure 1 As shown, the large model retrieval question answering device 100 includes a business tree construction module 11, a path vector generation module 12, a candidate node filtering module 13, a judgment module 14, a hierarchical matching module 15, an answer generation module 16, and a general control module 17 that controls the operation of the above modules.
[0030] The business tree construction module 11 is used to parse each document separately and obtain the corresponding business tree. In this embodiment, all business trees constitute a business forest.
[0031] In this business tree, the root node is the main title of the corresponding document. Each leaf node in the business tree describes a specific piece of content within the document. Based on the hierarchical relationship, each title of the document is used as a node in the business tree; when a title is a parent node, its subtitles become its child nodes.
[0032] In this embodiment, the business tree construction module 11 first analyzes the document's directory structure, extracting the main title, headings, and hierarchical relationships. Next, the business tree construction module 11 inserts child nodes under their corresponding parent nodes according to the chapter hierarchy. If a heading level is found to be deeper than the current heading, it indicates that it is a sub-chapter of the current chapter and needs to be inserted under the current node; if the level is shallower, it should be inserted under the node at the next higher level. Finally, the business tree construction module 11 stores the entire business tree in JSON format.
[0033] Furthermore, in this embodiment, each fragmented common problem that is not within the scope of the business tree content is taken as the root node, and the corresponding preset answer is taken as the leaf node corresponding to the root node, thereby forming a business tree for each common problem.
[0034] Figure 2 This is a schematic diagram of the service tree in an embodiment of the present invention.
[0035] like Figure 2 As shown, each box contains the content of the corresponding node, and arrows connect the parent node to its corresponding child node. The main title of the document is "Pension Insurance," and its corresponding child nodes include "Employee Pension Insurance," "Pension Insurance for Rural Residents Converted to Urban Residents," etc. The child nodes for "Employee Pension Insurance" include "Enrollment and Payment," "Account Management," etc. The child nodes for "Enrollment and Payment" include "Individual," "Employer," etc. The child nodes for "Individual" include "Individual," "Sole Proprietorship," etc. The child nodes for "Individual" include "Scope of Enrollment," "Location of Enrollment," "Contribution Ratio," etc., where "Scope of Enrollment," "Location of Enrollment," and "Contribution Ratio" contain detailed descriptions; these are leaf nodes.
[0036] The path vector generation module 12 is used to convert the complete path from each root node to a leaf node in each business tree into a corresponding path vector. For example, the complete path from the root node "pension insurance" to the leaf node "insurance scope" is "pension insurance - employee pension insurance - participation and payment - individual - individual - insurance scope". In this embodiment, the path vector is stored as the ID of the corresponding leaf node and is unified with the business forest.
[0037] The candidate node filtering module 13 includes a vector model for obtaining a set of candidate nodes based on the user's question and all path vectors, combined with the vector model.
[0038] Figure 3 This is a schematic diagram of the process by which the candidate node filtering module generates a set of candidate nodes in an embodiment of the present invention.
[0039] like Figure 3 As shown, the candidate node filtering module 13 generates a candidate node set by including the following steps:
[0040] Step S3-1: Vectorize the user problem to obtain the user problem vector.
[0041] Step S3-2: Calculate the similarity between the user's question vector and each path vector using a vector model. In this embodiment, the vector model is the BGE-M3 model.
[0042] Step S3-3: Filter the leaf nodes corresponding to path vectors with similarity greater than a preset similarity threshold, and use all the filtered leaf nodes as a candidate node set. In this embodiment, the preset similarity threshold is 0.4.
[0043] The judgment module 14 is used to determine whether to generate an answer based on the candidate node set. If yes, the answer is generated based on the large language model and the candidate node set. If no, the hierarchical matching module 15 is executed.
[0044] Figure 4 This is a schematic diagram of the workflow of the judgment module in an embodiment of the present invention.
[0045] like Figure 4 As shown, the workflow of the judgment module 14 includes the following steps:
[0046] Step S4-1: Determine whether the candidate node set meets the preset judgment conditions. If yes, proceed to step S4-2; otherwise, proceed to the hierarchical matching module 15.
[0047] The preset judgment conditions include at least one of the following: the total number of leaf nodes in the candidate node set is not greater than a preset number of nodes, and the candidate node set is not an empty set. In this embodiment, the preset judgment conditions are that the total number of leaf nodes in the candidate node set is not greater than the preset number of nodes and the candidate node set is not an empty set.
[0048] Step S4-2: For each leaf node in the candidate node set, combine the leaf node with the user question and input it into the large language model to obtain the confidence level corresponding to the leaf node.
[0049] Step S4-3: Select the leaf node corresponding to the highest confidence level, combine it with the polishing prompt word, and input it into the large language model to obtain the answer.
[0050] The hierarchical matching module 15 is used to perform hierarchical matching on all business trees based on the user's question and through the large language model to obtain the hierarchical matching result.
[0051] Figure 5 This is a schematic diagram of the process by which the hierarchical matching module generates hierarchical matching results in an embodiment of the present invention.
[0052] like Figure 5As shown, the hierarchical matching module 15 generates hierarchical matching results, including the following steps:
[0053] Step S5-1: Use the large language model to determine whether each root node is relevant to the user's question, and designate the relevant root nodes as related nodes.
[0054] Step S5-2: The large language model is used to determine whether each child node corresponding to each relevant node is relevant to the user's question, and the child nodes that are relevant are designated as relevant nodes.
[0055] In step S5-2, when a single intermediate node is relevant (i.e., none of its child nodes are relevant), the hierarchical matching module 15 combines the child nodes of the intermediate node with the rhetorical question prompt and inputs them into the large language model to generate rhetorical question information and display it to the user. Next, the hierarchical matching module 15 uses the large language model to sequentially determine whether each child node of the intermediate node is relevant to the user's response to the rhetorical question information, and designates the relevant child nodes as relevant nodes.
[0056] For example, when a user asks "How to pay pension insurance", the hierarchical matching module 15 performs hierarchical matching and finds an intermediate node whose complete path is "pension insurance - employee pension insurance - participation and payment", the hierarchical matching module 15 generates a follow-up question based on the sub-nodes "individual" and "unit" such as "Is the business handled by an individual or a unit?", and continues to generate follow-up questions based on the user's reply "individual handling" until a leaf node is matched or no leaf node is matched.
[0057] Step S5-3: Repeat step S5-2 until the hierarchical matching result is obtained.
[0058] The hierarchical matching results include: a single leaf node is correlated; all child nodes of a single parent node are correlated; and all nodes are uncorrelated.
[0059] The answer generation module 16 is used to generate answers by combining the hierarchical matching results with the large language model.
[0060] When the hierarchical matching result shows that a single leaf node is relevant, the answer generation module 16 combines the leaf node with the polishing prompt and inputs it into the large language model to obtain the answer. Further, the answer generation module 16 combines the neighboring nodes of the leaf node with the recommendation prompt and inputs them into the large language model to generate recommendation information for the user's question, thus providing the user with both the answer and relevant recommendation information simultaneously.
[0061] For example, if the hierarchical matching result for the user question "What are the conditions for an individual to participate in pension insurance" is a single leaf node, and the complete path of this leaf node is "pension insurance - employee pension insurance - participation and payment - individual - individual - scope of participation", then the answer generation module 16 will combine the specific description of the leaf node "scope of participation" with the polished prompt words and input it into the large language model to obtain the answer.
[0062] When the hierarchical matching result shows that all child nodes of a single parent node are related, the answer generation module 16 uses the large language model to determine whether the user's question corresponds to a single child node or multiple child nodes.
[0063] When a user's question corresponds to a single child node, the answer generation module 16 combines all child nodes with the question prompts and inputs them into the large language model to generate question information and displays the target node that the user has answered to the user. The module then combines all leaf nodes corresponding to the target node with the polishing prompts and inputs them into the large language model to obtain the answer.
[0064] For example, if a user asks, "I was previously unemployed and am planning to open a supermarket, how should I pay my pension insurance?", the complete path of the matched sub-nodes includes "Pension Insurance - Employee Pension Insurance - Enrollment and Payment - Individual - Individual" and "Pension Insurance - Employee Pension Insurance - Enrollment and Payment - Individual - Sole Proprietor". The answer generation module 16 will then generate the question, "Are you an individual or a sole proprietor?", allowing the user to choose between the sub-nodes "Individual" and "Sole Proprietor" as the target node.
[0065] When a user question corresponds to multiple child nodes, the answer generation module 16 combines all the leaf nodes corresponding to all child nodes with the polishing prompts and inputs them into the large language model to obtain the answer.
[0066] For example, the user question "What is the difference between individual and self-employed pension insurance?" yields a complete path for the matched sub-nodes that includes "Pension Insurance - Employee Pension Insurance - Enrollment and Payment - Individual - Individual" and "Pension Insurance - Employee Pension Insurance - Enrollment and Payment - Individual - Self-employed". Clearly, this user question requires a comprehensive answer considering factors such as the coverage, location, and contribution rate of both types of insurance. To address this, the answer generation module 16 combines the detailed descriptions of all leaf nodes with the user question and polished prompts, inputting them into the large language model to obtain a comprehensive answer.
[0067] When the hierarchical matching result indicates that all nodes are unrelated, the answer generation module 16 outputs a preset response. In this embodiment, the preset response is empty, meaning the answer generation module 16 does not respond to questions unrelated to the document.
[0068] The main control module 17 stores the control program that controls the operation of each module.
[0069] The following description, in conjunction with the accompanying drawings, illustrates the process of using the large-model retrieval question-answering device 100 to perform a large-model retrieval question-answering method based on a document structure tree.
[0070] Figure 6 This is a flowchart illustrating the large-model retrieval question-answering method based on the document structure tree in an embodiment of the present invention.
[0071] like Figure 6 As shown, the large-scale retrieval question-answering method based on the document structure tree includes the following steps:
[0072] Step S1: Use the business tree construction module 11 to parse each document and obtain the corresponding business tree.
[0073] Step S2: The path vector generation module 12 is used to convert the complete path from each root node to a leaf node in each business tree into a corresponding path vector.
[0074] Step S3: The candidate node filtering module 13 uses the user question and all path vectors, combined with the vector model, to obtain a set of candidate nodes.
[0075] Step S4: The judgment module 14 determines whether to generate an answer based on the candidate node set. If yes, the answer is generated based on the large language model and the candidate node set. If no, step S5 is executed.
[0076] Step S5: The hierarchical matching module 15 performs hierarchical matching on all business trees based on the user's question using a large language model to obtain the hierarchical matching result.
[0077] Step S6: The answer generation module 16 generates the answer by combining the large language model with the hierarchical matching results.
[0078] The role and effect of the embodiments
[0079] According to the document structure tree-based large-model retrieval question-answering method and apparatus involved in this embodiment, on the one hand, by constructing a business tree that conforms to the original logical order of the document and has no loops, guidance is provided for the business corresponding to the document; on the other hand, by filtering the candidate node set and hierarchical matching, rapid responses are achieved when the user knows the business they are handling, and heuristic question-answering is also supported when the user is unfamiliar with the actual business process. In summary, this method can achieve accurate, efficient, and low-cost question answers.
[0080] Furthermore, the business tree is obtained through directory-level data reconstruction, eliminating the need to consider chapter-level segmentation or reorganization at the semantic level, thus achieving lightweight data processing.
[0081] Furthermore, by generating rhetorical questions through matching nodes, rhetorical question prompts, and a large language model, the system proactively resolves all user-related business-related questions.
[0082] Those skilled in the art should understand that this invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to this invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A large-scale model retrieval and question-answering method based on a document structure tree, used to generate answers to user questions based on multiple documents, characterized in that, Includes the following steps: Step S1: Parse each of the aforementioned documents to obtain the corresponding business tree; Step S2: For each of the business trees, convert the complete path from each root node to a leaf node in the business tree into a corresponding path vector; Step S3: Based on the user question and all the path vectors, and combined with the vector model, obtain a set of candidate nodes; Step S4: Determine whether the answer is generated based on the candidate node set. If yes, generate the answer based on the large language model and the candidate node set. If no, proceed to step S5. Step S5: Based on the user question, perform hierarchical matching on all the business trees using the large language model to obtain the hierarchical matching result; Step S6: Generate the answer by combining the large language model with the hierarchical matching results. The root node of the business tree is the main title of the corresponding document. Each leaf node of the business tree describes a specific piece of content in the document. The titles of the document are used as nodes in the business tree based on the hierarchical relationship. When the title is the parent node, each of the subtitles corresponding to the title is a child node corresponding to the parent node.
2. The large-scale model retrieval and question-answering method based on document structure tree according to claim 1, characterized in that: in, Step S3 includes the following sub-steps: Step S3-1: Vectorize the user question to obtain the user question vector; Step S3-2: Calculate the similarity between the user question vector and each of the path vectors using the vector model; Step S3-3: Filter the leaf nodes corresponding to the path vectors with similarity greater than a preset similarity threshold, and use all the filtered leaf nodes as the candidate node set.
3. The large-scale retrieval question-answering method based on a document structure tree as described in claim 1, Its features are: Step S4 includes the following sub-steps: Step S4-1: Determine whether the candidate node set meets the preset judgment conditions. If yes, proceed to step S4-2; otherwise, proceed to step S5. Step S4-2: For each leaf node in the candidate node set, combine the leaf node with the user question and input it into the large language model to obtain the confidence level corresponding to the leaf node; Step S4-3: Select the leaf node corresponding to the highest confidence level and combine it with the polishing prompt word, then input it into the large language model to obtain the answer. The preset judgment conditions include at least one of the following preset conditions: the total number of leaf nodes in the candidate node set is not greater than the preset number of nodes, and the candidate node set is not an empty set.
4. The large-model retrieval and question-answering method based on a document structure tree as described in claim 1, Its features are: Step S5 includes the following sub-steps: Step S5-1: The large language model is used to determine whether each root node is related to the user question, and the root nodes that are related are designated as related nodes. Step S5-2: The large language model is used to sequentially determine whether each of the child nodes corresponding to each of the relevant nodes is related to the user question, and the child nodes that are related are taken as the relevant nodes. Step S5-3: Repeat step S5-2 until the hierarchical matching result is obtained. The hierarchical matching results include: Each of the aforementioned leaf nodes is correlated; All child nodes of a single parent node are related; All nodes are unrelated.
5. The large-model retrieval and question-answering method based on a document structure tree according to claim 4, characterized in that: in, When the hierarchical matching result indicates that a single leaf node is relevant, the leaf node is combined with the polishing prompt word and input into the large language model to obtain the answer.
6. The large-scale model retrieval and question-answering method based on a document structure tree according to claim 5, characterized in that: in, The neighboring nodes of the leaf nodes are combined with the recommended prompts and input into the large language model to generate recommendation information for the user's question.
7. The large-model retrieval and question-answering method based on a document structure tree according to claim 4, characterized in that: in, When the hierarchical matching result indicates that all child nodes of a single parent node are related, the large language model determines whether the user question corresponds to a single child node or multiple child nodes. When the user question corresponds to a single child node, all child nodes are combined with the rhetorical question prompts and input into the large language model to generate rhetorical question information and display the target node for obtaining the user's answer. Then, all leaf nodes corresponding to the target node are combined with the polishing prompts and input into the large language model to obtain the answer. When the user question corresponds to multiple child nodes, all leaf nodes corresponding to all child nodes are combined with the polishing prompts and input into the large language model to obtain the answer.
8. The large-scale model retrieval and question answering method based on document structure tree according to claim 4, characterized in that: in, When the hierarchical matching result is that all nodes are unrelated, the answer is a preset response.
9. The large-scale model retrieval and question answering method based on document structure tree according to claim 4, characterized in that: in, In step S5-2, when a single intermediate node is relevant, the child nodes corresponding to the intermediate node are combined with the rhetorical question prompts and input into the large language model to generate rhetorical question information and display it to the user. The large language model sequentially determines whether each child node corresponding to the intermediate node is related to the user's response to the question, and the child node with the relevant information is taken as the related node.
10. A large-scale model retrieval and question-answering device based on a document structure tree, used to generate answers to user questions based on multiple documents, characterized in that, include: The module includes a business tree construction module, a path vector generation module, a candidate node filtering module, a judgment module, a hierarchy matching module, and an answer generation module. The business tree construction module is used to parse each of the documents separately to obtain the corresponding business tree. The path vector generation module is used to convert the complete path from each root node to a leaf node in each of the business trees into a corresponding path vector. The candidate node filtering module includes a vector model for obtaining a set of candidate nodes based on the user question and all the path vectors, combined with the vector model. The judgment module is used to determine whether the answer should be generated based on the candidate node set. If yes, the answer is generated based on the large language model and the candidate node set; otherwise, the hierarchical matching module is executed. The hierarchical matching module is used to perform hierarchical matching on all the business trees according to the user question, using the large language model, to obtain the hierarchical matching result. The answer generation module is used to generate the answer by combining the large language model with the hierarchical matching results. The root node of the business tree is the main title of the corresponding document. Each leaf node of the business tree describes a specific piece of content in the document. The titles of the document are used as nodes in the business tree based on the hierarchical relationship. When the title is the parent node, each of the subtitles corresponding to the title is a child node corresponding to the parent node.
Citation Information
Patent Citations
Generative question answering method and device based on knowledge graph and storage medium
CN118069817A
Knowledge graph retrieval method and device, medium and product
CN118227668A