Question and answer method, apparatus, device, medium, and program product
By constructing a question-answering model with hybrid indexing and multimodal reasoning capabilities, the problem of insufficient flexibility and accuracy in existing HTML document question-answering methods is solved, achieving accurate response to user intent and effective processing of multi-dimensional information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-31
AI Technical Summary
Existing HTML document question-and-answer methods cannot meet users' personalized needs, and have low flexibility and accuracy. In particular, when dealing with complex issues, it is difficult to understand the semantic relationships between information of different granularities in the document, especially in the context of customer service for telecommunications products, where user questions involve multi-dimensional information.
By constructing a hybrid index, combining the intent type of user questions, and utilizing reasoning capabilities such as table analysis, graph relationship analysis, knowledge question answering, and image search, the content is filtered and expanded to generate targeted answers.
It improves the accuracy and flexibility of Q&A, matching the type of answer content with user intent and meeting users' multi-dimensional information needs.
Smart Images

Figure CN122489693A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a question-answering method, apparatus, device, medium, and program product. Background Technology
[0002] Currently, with the rapid development of Internet technology, HyperText Markup Language (HTML) documents have become one of the main carriers of information publishing and transmission due to their structured characteristics.
[0003] In existing technologies, electronic devices can construct a question-and-answer knowledge base by extracting title and summary information from HTML documents. When responding to a user's question, the electronic device can retrieve the most similar question-and-answer pair in the knowledge base and generate an answer accordingly.
[0004] However, in the above methods, since the question-and-answer knowledge base is built from text fragments such as webpage titles and summaries, the answers output by electronic devices are usually in text form, which may not meet the personalized needs of users. For example, users may need answers in the form of table comparisons, resulting in low flexibility of question-and-answer. Summary of the Invention
[0005] This application provides a question-and-answer method, apparatus, device, medium, and program product for improving the flexibility of question-and-answer.
[0006] In a first aspect, embodiments of this application provide a question-answering method, which includes: inputting a user question into a question-answering model; and using the question-answering model to perform content search based on the user question to obtain a first content set;
[0007] This question-answering model uses the intent type corresponding to the user's question to invoke the reasoning ability that matches the intent type, filters the first content set, and obtains the first candidate answer. The reasoning ability includes at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question answering reasoning ability, and image search reasoning ability. Based on the intent type corresponding to the user's question and the first candidate answer, the question answer is output through this question-answering model.
[0008] The technical solution provided in this application brings at least the following beneficial effects: by calling the reasoning ability that matches the intent type based on the intent type corresponding to the user's question, the searched content is filtered, enabling the question-and-answer model to provide targeted answers based on the user's question, thereby improving the accuracy of question and answer; moreover, by using the intent type corresponding to the user's question, the content type of the question answer can be matched with the intent type, thereby improving the flexibility of question and answer.
[0009] One possible implementation involves using the question-answering model to filter the first content set based on the intent type corresponding to the user's question, thereby obtaining a first candidate answer. This includes: using the question-answering model to filter the first content set based on the intent type corresponding to the user's question, thereby obtaining a second candidate answer; and if the confidence level of the second candidate answer is greater than or equal to a preset threshold, then the second candidate answer is adopted as the first candidate answer.
[0010] Another possible implementation, the above method further includes: when the confidence level of the second candidate answer is less than the preset threshold, based on the intent type corresponding to the user question, calling the reasoning ability that matches the intent type to filter the second candidate answer to obtain a third candidate answer, until the confidence level of the third candidate answer is greater than or equal to the preset threshold, and then using the third candidate answer as the first candidate answer.
[0011] Another possible implementation involves the above-mentioned content search based on user questions to obtain a first content set, which includes: using the question-answering model, performing a joint search based on the user question and a hybrid index to obtain a second content set; the hybrid index is used to represent the mapping relationship between the document to be retrieved, the semantic vector corresponding to the document to be retrieved, and the semantic vector of the first knowledge graph corresponding to the document to be retrieved, which is constructed based on the titles, paragraphs, lists, tables, images, and links in the document to be retrieved; if the second content set does not satisfy the user intent corresponding to the user question, the second content set is expanded based on the knowledge graph using the question-answering model to obtain the first content set.
[0012] Another possible implementation, before obtaining the user's question, includes: inputting the document to be retrieved into the question-answering model; obtaining each element entity in the document to be retrieved, as well as the hierarchical relationship between each element entity, through the question-answering model, where the element entities include: title, paragraph, list, table, image, and link; and obtaining the first knowledge graph by treating each element entity as a node and the hierarchical relationship between each element entity as an edge through the question-answering model.
[0013] Another possible implementation, after obtaining the first knowledge graph as described above, further includes: vectorizing the first knowledge graph using the question-answering model to obtain a vectorized knowledge graph; vectorizing the document to be retrieved using the question-answering model to obtain a vectorized document to be retrieved; and constructing a bidirectional mapping relationship between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved using the question-answering model to obtain a hybrid index.
[0014] Secondly, embodiments of this application provide a question-answering device, including: an input module, a search module, a filtering module, and an output module. The input module is used to input user questions into the question-answering model.
[0015] The search module performs content searches based on user questions to obtain a first set of content. The filtering module, based on the intent type corresponding to the user question, invokes reasoning abilities matching the intent type to filter the first set of content and obtain first candidate answers; these reasoning abilities include at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question answering reasoning ability, and image search reasoning ability. The output module outputs the answer to the question based on the intent type corresponding to the user question and the first candidate answers.
[0016] One possible implementation is that the aforementioned filtering module is specifically used to filter the first content set based on the intent type corresponding to the user's question using the question-answering model, thereby obtaining a second candidate answer; if the confidence level of the second candidate answer is greater than or equal to a preset threshold, the second candidate answer is used as the first candidate answer.
[0017] In another possible implementation, the above-mentioned filtering module is further configured to, when the confidence level of the second candidate answer is less than the preset threshold, invoke the reasoning ability that matches the intent type based on the intent type corresponding to the user question to filter the second candidate answer and obtain a third candidate answer, until the confidence level of the third candidate answer is greater than or equal to the preset threshold, and then use the third candidate answer as the first candidate answer.
[0018] Another possible implementation involves the search module described above, which specifically performs a joint search based on the user's question and a hybrid index using the question-answering model to obtain a second content set. The hybrid index represents the mapping relationship between the document to be retrieved, the semantic vector corresponding to the document, and the semantic vector of the first knowledge graph corresponding to the document. This knowledge graph is constructed based on the titles, paragraphs, lists, tables, images, and links in the document to be retrieved. If the second content set does not satisfy the user's intent corresponding to the user's question, the question-answering model, based on the knowledge graph, expands the content of the second content set to obtain a first content set.
[0019] In another possible implementation, the question-answering device further includes a processing module. The input module is used to input the document to be retrieved into the question-answering model before the acquisition module acquires the user's question. The processing module is used to acquire each element entity in the document to be retrieved, as well as the hierarchical relationship between each element entity, through the question-answering model. The element entities include: titles, paragraphs, lists, tables, images, and links. Through the question-answering model, each element entity is treated as a node, and the hierarchical relationship between each element entity is treated as an edge, to obtain a first knowledge graph.
[0020] In another possible implementation, the above processing module is further used to vectorize the first knowledge graph after obtaining it through the question-answering model, thereby obtaining a vectorized knowledge graph; to vectorize the document to be retrieved through the question-answering model, thereby obtaining a vectorized document to be retrieved; and to construct a bidirectional mapping relationship between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved through the question-answering model, thereby obtaining a hybrid index.
[0021] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory stores a program or instructions executable on the processor, wherein the program or instructions, when executed by the processor, implement the method of the first aspect described above.
[0022] Fourthly, this application provides a readable storage medium on which a program or instructions are stored, which, when executed by a computer, implement the method of the first aspect described above.
[0023] Fifthly, this application provides a computer program product stored in a storage medium, which, when executed by a computer, implements the method described in the first aspect.
[0024] In a sixth aspect, embodiments of this application provide a chip including a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0025] The beneficial effects of the second to sixth aspects mentioned above are described in the corresponding description of the first aspect and will not be repeated here. Attached Figure Description
[0026] Figure 1 A schematic diagram of a network architecture for an application of a question-answering method provided in this application embodiment;
[0027] Figure 2 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0028] Figure 3A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0029] Figure 4 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0030] Figure 5 A flowchart illustrating another question-and-answer method provided in an embodiment of this application;
[0031] Figure 6 A flowchart illustrating yet another question-and-answer method provided in an embodiment of this application;
[0032] Figure 7 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0033] Figure 8 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;
[0034] Figure 9 This is a schematic diagram of the structure of a question-and-answer system provided in an embodiment of this application;
[0035] Figure 10 This is a schematic diagram of the structure of a question-and-answer device provided in an embodiment of this application;
[0036] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0038] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0039] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."
[0040] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0041] The present application provides a question-and-answer method, apparatus, device, medium, and program product that can be applied in question-and-answer scenarios.
[0042] With the explosive growth of internet information, HTML documents have become the primary carrier of information. Existing HTML document question-answering methods typically employ keyword matching or vector retrieval, treating documents as plain text and ignoring the inherent structural information of HTML (such as heading levels, tables, hyperlinks, etc.) and multimodal content (such as images and tabular data). This makes it difficult to accurately understand the semantic relationships between different granularities of information within a document when dealing with complex issues. This is especially true in telecommunications product customer service scenarios, where user questions often involve multi-dimensional information such as product parameter comparisons and applicable package conditions. Traditional methods cannot effectively integrate structured data with unstructured descriptions, resulting in low question-answering flexibility and accuracy.
[0043] To address the above issues, the current implementation plan mainly involves the following three aspects:
[0044] 1. Webpage Question Answering: This method crawls search results from internet search engines like Baidu, combines titles and summaries into question-and-answer pairs, and generates answers by referencing the most similar question-and-answer pairs using the Frequently Asked Questions (FaQ) approach. This solves the problem of search engines requiring users to perform secondary filtering of returned webpages. However, this method only parses the titles and summaries of search results to assemble question-and-answer pairs into a knowledge base, without deeply understanding the structure and content of the original webpages.
[0045] 2. Construction of a Structured Document Knowledge Base: This method constructs a structured document knowledge base by parsing structured documents such as Word and PDF into a tree structure and dynamically slicing them to generate document metadata. This approach addresses the semantic fragmentation and structural information loss issues that exist during structured document segmentation. However, this method focuses on understanding textual data and its hierarchical structure, and does not address multimodal data such as tables and images. Furthermore, it uses a tree structure to represent documents and does not address how to use multimodal knowledge graphs to describe them.
[0046] 3. Question Answering System Construction Based on Knowledge Graphs, Knowledge Bases, and Large Language Models: This method integrates knowledge graphs, knowledge bases, and large language models to construct a question answering system. While utilizing knowledge graphs and knowledge bases, the knowledge graph is a predefined domain knowledge graph and does not address how to convert documents into a knowledge graph. This method selectively returns only one of the following: a knowledge graph answer, a large language model answer, or a knowledge base answer. It also does not provide an in-depth explanation of multi-turn reasoning methods based on knowledge graph collaboration.
[0047] To address the aforementioned technical problems, embodiments of this application provide a question-answering method, apparatus, device, medium, and program product. By invoking reasoning capabilities matching the intent type corresponding to the user's question, the searched content is filtered, enabling the question-answering model to provide targeted answers based on the user's question, thereby improving the accuracy of question-answering. Furthermore, by matching the content type of the question answer with the intent type corresponding to the user's question, the flexibility of question-answering is enhanced.
[0048] The question-and-answer method, apparatus, device, medium, and program product provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0049] Figure 1 This illustration shows a network architecture for a question-answering method application provided in an embodiment of this application. For example... Figure 1 As shown, the network architecture includes a question-and-answer device 101 and a terminal device 102. The question-and-answer device 101 and the terminal device 102 are interconnected.
[0050] In some embodiments, the question-answering device 101 may be a server, a computer, or a processor or processing unit within a server or computer. The server may be a single server or a server cluster comprising multiple servers. It should be noted that the embodiments of this application do not limit the specific device form of the question-answering device 101. Figure 1 The question-and-answer device 101 is shown as a single server example.
[0051] In some embodiments, the terminal device may be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, personal computer (PC), ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., and the embodiments of this application do not specifically limit it. Figure 1 The example shown is a mobile phone, with terminal device 102 as an example.
[0052] In some embodiments, terminal device 102 sends a user question to question-answering device 101. Question-answering device 101 receives the user question sent by terminal device 102 and inputs the user question into a question-answering model. Then, through the question-answering model, it performs content search based on the user question to obtain a first content set. Next, through the question-answering model, based on the intent type corresponding to the user question, it invokes reasoning capabilities matching the intent type to filter the first content set and obtain a first candidate answer. The reasoning capabilities include at least one of the following: table analysis reasoning capability, graph relationship analysis reasoning capability, knowledge question-answering reasoning capability, and image search reasoning capability. Then, through the question-answering model, based on the intent type corresponding to the user question and the first candidate answer, it outputs the question answer. Finally, question-answering device 101 sends the question answer to terminal device 102.
[0053] It should be noted that the network architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As network architectures evolve, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0054] See Figure 2 This is a flowchart illustrating a question-and-answer method provided in an embodiment of this application. Figure 2 As shown, the question-and-answer method provided in this application embodiment can be implemented by the above-mentioned question-and-answer device, specifically including the following steps 201 to 204.
[0055] Step 201: The question-answering device inputs the user's question into the question-answering model.
[0056] In some embodiments, the user question can be input by the user; or, the user question can be sent to the question-and-answer device by other electronic devices. The specific method can be determined according to actual usage needs, and this application embodiment does not impose any limitations.
[0057] In some embodiments, the question-and-answer device may include an input box, which can be used to obtain user questions.
[0058] For example, the above input box can be a text input box or a voice input box.
[0059] In some embodiments, the question-answering model described above can be an artificial intelligence (AI) model or a neural network model. The specific model can be determined based on actual usage requirements, and this application embodiment does not impose any limitations.
[0060] Step 202: The question-answering device uses a question-answering model to search for content based on the user's question, and obtains the first content set.
[0061] In some embodiments, the question-answering model described above can perform content search on the document to be retrieved to obtain a first content set.
[0062] It should be noted that the specific process of step 202 above can be found in the following embodiments, and will not be repeated here to avoid repetition.
[0063] In some embodiments, combined with Figure 2 ,like Figure 3 As shown, step 202 specifically includes steps 301 and 302.
[0064] Step 301: The question-answering device uses a question-answering model to perform a joint search based on user questions and a hybrid index to obtain a second set of content.
[0065] In some embodiments, the hybrid index described above is used to characterize the mapping relationship between the document to be retrieved, the semantic vector corresponding to the document to be retrieved, and the semantic vector of the first knowledge graph corresponding to the document to be retrieved, which is constructed based on the titles, paragraphs, lists, tables, images, and links in the document to be retrieved.
[0066] In some embodiments, the question-answering device can vectorize user questions using a question-answering model to obtain question vectors, and then retrieve the second content set based on the question vectors in a hybrid index.
[0067] For example, the question-answering model can encode user questions into semantic vectors to obtain question vectors; then, it can perform retrieval in the hybrid index based on the question vectors, and return the top-K nodes with the highest vector similarity and their associated original text and graph subgraphs as a preliminary evidence set, i.e. the second content set mentioned above, where K is a positive integer.
[0068] For example, after a user's question is input into the question-answering model, the model can use a BERT classifier to identify the intent type (e.g., "compare packages") and use BiLSTM-CRF to extract entities such as "Package A" and "Package B". Next, a question vector is generated, and the top-10 most similar nodes are retrieved from the hybrid index. Simultaneously, the subgraphs associated with these nodes are queried through a graph database to obtain a second content set.
[0069] Step 302: If the second content set does not satisfy the user intent corresponding to the user's question, the question answering device expands the second content set based on the first knowledge graph using the question answering model to obtain the first content set.
[0070] In some embodiments, the question-answering model can check whether the second content set contains all the entities and entity relationships required by the user question, thereby determining whether the second content set satisfies the user intent corresponding to the user question.
[0071] For example, if a user question requires comparing the prices of two packages, but the evidence lacks price information for one of the packages, then it is determined that the second set of content does not satisfy the user intent corresponding to the user question.
[0072] In some embodiments, if the second content set does not satisfy the user intent corresponding to the user question, the question answering model can mark the missing information and, based on the missing information, use the graph structure of the first knowledge graph to perform multi-hop reasoning, expand related entities and paths along relation edges, and obtain more content sets.
[0073] In some embodiments, the question-answering model may also call upon external knowledge bases or supplementary content from other parts of the document.
[0074] For example, if a user's question requires comparing the prices of two packages, but the evidence lacks price information for one of the packages, the question-answering model is triggered to extend one hop outward along the "included price" relationship edge of the "package" node to obtain the missing price node.
[0075] In this embodiment, a question-answering model is used to search for content based on user questions, resulting in a first content set. The first content set is a second content set obtained by the question-answering device through a joint search using the question-answering model, based on the user questions and a hybrid index. If the second content set does not satisfy the user's intent corresponding to the user questions, the question-answering device expands the second content set based on a first knowledge graph using the question-answering model, thereby obtaining the first content set. This improves the completeness of content retrieval based on user questions.
[0076] Step 203: The question-answering device uses a question-answering model to filter the first set of content based on the intent type corresponding to the user's question, and obtains the first candidate answer.
[0077] In some embodiments, the above-mentioned reasoning ability includes at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question answering reasoning ability, and image search reasoning ability.
[0078] In some embodiments, the above intent types may include at least one of the following: table comparison intent type, image search intent type, or document summary intent type, etc. The specific type can be determined according to actual usage needs, and this application embodiment does not impose any limitations.
[0079] In some embodiments, the intent type described above may include a user need and the display format of the user's answer corresponding to the user need.
[0080] It should be noted that the specific process of step 203 above can be found in the following embodiments, and will not be repeated here to avoid repetition.
[0081] In some embodiments, combined with Figure 2 ,like Figure 4 As shown, step 203 can be implemented through steps 203a and 203b below.
[0082] Step 203a: The question-answering device uses a question-answering model to filter the first set of content based on the intent type corresponding to the user's question, and calls the reasoning ability that matches the intent type to obtain the second candidate answer.
[0083] In some embodiments, the aforementioned reasoning ability can be an atomic capability in a question-answering model.
[0084] In some embodiments, the question-answering device can use the atomic capability scheduling unit in the question-answering model to call the reasoning capability that matches the intent type corresponding to the user's question, and filter the first content set to obtain the second candidate answer.
[0085] For example, the atomic capability scheduling unit in the question-answering model can dynamically invoke one or a combination of the following atomic capabilities based on the intent type and the first content set:
[0086] Intelligent table analysis capabilities: Performs numerical calculations, comparisons, and filtering on table data; specifically implemented using Programmatic Tool Calling (PTC), which means that in a controlled code execution environment, the large model dynamically generates and executes analysis code based on the table structure and problem requirements, thereby achieving precise manipulation of table data and solving the problem of context constraints of large models.
[0087] Graph relationship analysis capabilities: querying paths, shortest distances, common attributes, etc. between entities.
[0088] Knowledge-based question-answering reasoning ability: logical reasoning based on knowledge graphs (e.g., inheritance, inclusion relationships).
[0089] Image search capability: Matches image descriptions and returns relevant images.
[0090] For example, if tabular data calculations are involved, the atomic capability scheduling unit activates the intelligent table analysis capability. This capability is implemented using the PTC (Programmatically Produced Control) approach: First, a large model (e.g., GPT-4) generates Python code (e.g., using the pandas library for filtering, aggregation, and comparison operations) based on the structured description of the current table (e.g., column names, data types) and the user's question. Then, the code is sent to an isolated sandbox execution environment (e.g., a Docker container or a restricted Python interpreter) to run, avoiding security risks. The execution results (e.g., numerical values, table subsets) are captured and returned to the scheduling unit. This approach ensures accuracy and scalability for operations on arbitrarily complex tables.
[0091] Meanwhile, if a relationship path query is needed, the graph relationship analysis capability is invoked, and a graph query language (such as Cypher) is used to retrieve the path in the knowledge graph; if logical reasoning is needed, the knowledge question answering reasoning capability is invoked, and reasoning is performed based on rules or graph neural networks; if images are needed, the image search capability is invoked, and the most relevant images are returned by matching image description vectors.
[0092] Step 203b: If the confidence level of the second candidate answer is greater than or equal to a preset threshold, the question answering device will use the second candidate answer as the first candidate answer.
[0093] In some embodiments, the confidence level described above can be used to indicate the degree of match between the second candidate answer and the user's question.
[0094] In some embodiments, the aforementioned preset threshold can be preset by the question-and-answer device; or, it can be user-defined. The specific threshold can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0095] In some embodiments, combined with Figure 2 ,like Figure 5 As shown, step 203 can be implemented through steps 203a and 203c as described below.
[0096] Step 203a: The question-answering device uses a question-answering model to filter the first set of content based on the intent type corresponding to the user's question, and calls the reasoning ability that matches the intent type to obtain the second candidate answer.
[0097] It should be noted that the specific process of step 203a above can be found in the above embodiments, and will not be repeated here to avoid repetition.
[0098] Step 203c: If the confidence level of the second candidate answer is less than the preset threshold, the question answering device calls the reasoning ability that matches the intent type based on the intent type of the user's question to filter the second candidate answer and obtain the third candidate answer. This process continues until the confidence level of the third candidate answer is greater than or equal to the preset threshold, at which point the third candidate answer is taken as the first candidate answer.
[0099] In some embodiments, the question-answering device may employ a loop mechanism, using the current reasoning result, i.e. the second candidate answer mentioned above, as new evidence, and continue to invoke atomic capabilities until a candidate answer that meets the confidence requirement is obtained.
[0100] In this embodiment, by determining whether the confidence level of the candidate answer meets a preset threshold, a loop mechanism is employed if the threshold is not met. The current reasoning result, i.e., the aforementioned second candidate answer, is used as new evidence, and atomic capabilities are continuously invoked until the confidence level of the candidate answer meets the preset threshold requirement. This ensures the accuracy of the candidate answers, thereby improving the accuracy of the question-answering device's responses to user questions.
[0101] Step 204: The question-answering device outputs the answer to the question based on the intent type corresponding to the user's question and the first candidate answer, using the question-answering model.
[0102] In some embodiments, the question-answering device may process the first candidate answer and output the question answer according to the display format corresponding to the intent type.
[0103] For example, the above data processing may include at least one of the following: deduplication, merging, and sorting.
[0104] For example, a question-answering model can deduplicate, merge, and sort the outputs from different atomic capabilities, and then convert the fused information into fluent natural language sentences based on a preset template as the final answer output.
[0105] In the question-answering method provided in this application embodiment, the question-answering device inputs a user question into a question-answering model; then, through the question-answering model, it performs content search based on the user question to obtain a first content set; next, through the question-answering model, based on the intent type corresponding to the user question, it invokes reasoning capabilities matching the intent type to filter the first content set and obtain a first candidate answer; the reasoning capabilities include at least one of the following: table analysis reasoning capability, graph relationship analysis reasoning capability, knowledge question-answering reasoning capability, and image search reasoning capability; finally, through the question-answering model, based on the intent type corresponding to the user question and the first candidate answer, it outputs the question answer. In this solution, by invoking reasoning capabilities matching the intent type based on the intent type corresponding to the user question to filter the searched content, the question-answering model can provide targeted answers based on the user question, improving the accuracy of question-answering; moreover, by using the intent type corresponding to the user question, the content type of the question answer can be matched with the intent type, thereby improving the flexibility of question-answering.
[0106] In some embodiments, combined with Figure 2 like Figure 6 As shown, prior to step 201 above, the question-and-answer method provided in this application embodiment further includes steps 401 to 403 as described below.
[0107] Step 401: The question-answering device inputs the document to be retrieved into the question-answering model.
[0108] In some embodiments, the document to be retrieved may be one or more documents.
[0109] In some embodiments, the document type of the document to be retrieved may be HTML, doc, or Portable Document Format (PDF). The specific type can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0110] In some embodiments, the document to be retrieved may be user-inputted; or, the document to be retrieved may be sent to the question-and-answer device by other electronic devices. The specific method can be determined according to actual usage requirements, and this application embodiment does not impose any limitations.
[0111] Step 402: The question-answering device obtains each element entity in the document to be retrieved, as well as the hierarchical relationship between each element entity, through the question-answering model.
[0112] In some embodiments, the aforementioned element entities include: headings, paragraphs, lists, tables, images, and links.
[0113] In some embodiments, the question-answering model can parse the DOM tree structure of the document to be retrieved, extract elements such as titles, paragraphs, lists, tables, images, and hyperlinks, and record the hierarchical relationships between elements. Then, natural language processing is performed on the text paragraphs in the document to be retrieved to identify entities and the relationships between entities; and structured parsing is performed on the table data in the document to be retrieved to generate linear descriptions, and the original table data is saved to a structured database; next, semantic description text is generated for the images in the document to be retrieved, and the images are saved to an image file server.
[0114] For example, the question-answering model can input an HTML document into the structure parsing unit, which obtains the hierarchical structure and content of each element by parsing the DOM tree. The multimodal information extraction unit performs NER on text paragraphs to identify entities (e.g., product names, parameter items) and relationships (e.g., "belongs to" or "has"); it uses rule-based or deep learning models to extract table headers, rows, and columns, and converts each cell into a triple description of (row number, column number, value); and it uses a pre-trained CNN+RNN model to generate natural language descriptions for images. The knowledge fusion unit stores this heterogeneous information in a graph database as entity nodes and relation edges, forming a knowledge graph. For example, a "package table" may be modeled as multiple "package" entity nodes, each node connected to multiple "service" entity nodes through "containment" relationships, while the table itself is associated with these entities as a "table" node, preserving the original structural information.
[0115] Step 403: The question-answering device uses a question-answering model to treat each element entity as a node and the hierarchical relationship between each element entity as an edge to obtain the first knowledge graph.
[0116] For example, the question-answering model associates the extracted entities, relationships, and modal descriptions to construct a knowledge graph centered on entity nodes and relationship edges. Nodes can correspond to titles, paragraphs, table cells, images, etc. in a document, while edges represent semantic relationships such as "contains," "describes," and "references," forming a knowledge representation that deeply integrates structure and semantics.
[0117] In this embodiment, the question-answering device inputs the document to be retrieved into the question-answering model. Through the model, it obtains each element entity in the document and the hierarchical relationships between them. Each element entity is treated as a node, and the hierarchical relationships between them are treated as edges, resulting in a first knowledge graph. This fusion of heterogeneous information into a unified knowledge representation solves the problem of missing structural information in existing methods.
[0118] In some embodiments, combined with Figure 6 like Figure 7 As shown, after step 403 above, the question-and-answer method provided in this application embodiment further includes steps 501 to 503 as described below.
[0119] Step 501: The question-answering device uses a question-answering model to vectorize the first knowledge graph, resulting in a vectorized knowledge graph.
[0120] It should be noted that the specific implementation process of step 501 above can be found in the description in the relevant technology. To avoid repetition, it will not be repeated here.
[0121] Step 502: The question-answering device uses a question-answering model to vectorize the document to be retrieved, thus obtaining the vectorized document to be retrieved.
[0122] It should be noted that the specific implementation process of step 502 above can be found in the description in the relevant technology. To avoid repetition, it will not be repeated here.
[0123] Step 503: The question-answering device constructs a bidirectional mapping relationship between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved through the question-answering model, thereby obtaining a hybrid index.
[0124] For example, the question-answering device can use a graph embedding model (such as GraphSAGE, GCN) to vectorize the nodes in the first knowledge graph, obtaining a low-dimensional dense vector for each entity node while preserving the topological information of the graph structure.
[0125] Then, the question-answering device can use a pre-trained semantic understanding model (such as Sentence-BERT) to encode the original text paragraphs, linearized table descriptions, and image description texts into semantic vectors, which are in the same semantic space as the graph node vectors.
[0126] Finally, the question-answering device can uniformly store graph node vectors, text vectors, and original text content, and establish a bidirectional mapping relationship to form a hybrid index of vector library, text library, and graph library, supporting joint retrieval based on vector similarity, keyword matching, and graph structure.
[0127] In this embodiment, the question-answering device uses a question-answering model to vectorize the first knowledge graph and the document to be retrieved, and constructs a bidirectional mapping relationship between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved, resulting in a hybrid index structure integrating "graph-vector-text". This effectively aligns multimodal information and improves the accuracy of deep semantic relationship reasoning.
[0128] The question-and-answer method of this application will be described below through specific embodiments.
[0129] like Figure 8 As shown, the implementation process of the question-and-answer method provided in this application embodiment includes the following S1 to S6:
[0130] S1. Question-answering device constructs HTML document knowledge graph.
[0131] For example, firstly, an HTML document is input into the structure parsing unit of the question-answering model, which obtains the hierarchical structure and content of each element by parsing the DOM tree. The multimodal information extraction unit performs NER on text paragraphs to identify entities (such as product names and parameter items) and relationships (such as "belongs to" and "has"). For tables, it uses rule-based or deep learning models to extract table headers, rows, and columns, and converts each cell into a triple description of (row number, column number, value). For images, it uses a pre-trained CNN+RNN model to generate natural language descriptions. The knowledge fusion unit stores this heterogeneous information in a graph database as entity nodes and relation edges, forming a knowledge graph. For example, a "package table" might be modeled as multiple "package" entity nodes, each node connected to multiple "service" entity nodes through "containment" relationships, while the table itself is associated with these entities as a "table" node, preserving the original structural information.
[0132] S2. Question-answering device constructs multi-level hybrid indexes.
[0133] Graph embedding models (such as GraphSAGE) vectorize each entity node in the knowledge graph, generating a 128-dimensional graph vector. Simultaneously, the Sentence-BERT model encodes the original text paragraphs, linearized table descriptions, and image descriptions into equally 128-dimensional semantic vectors. All vectors are stored uniformly in the Faiss vector library, and an inverted index is built from the vectors to the original text / graph nodes for fast retrieval.
[0134] S3, Question-answering device performs question understanding and retrieval.
[0135] After the user inputs a question, the intent recognition unit uses a BERT classifier to identify the question type (e.g., "compare packages"), and the entity extraction unit uses BiLSTM-CRF to extract entities such as "Package A" and "Package B". The question semantic encoder generates a question vector and retrieves the top-10 most similar nodes in the hybrid index. At the same time, it queries the subgraphs associated with these nodes through the graph database to obtain preliminary evidence.
[0136] S4. The question-and-answer device performs knowledge completeness assessment and expansion.
[0137] The knowledge completeness assessment unit checks whether the preliminary evidence contains all the entities and relationships required for the problem. For example, if the problem requires comparing the prices of two packages, but the evidence lacks price information for one of the packages, the graph knowledge expansion unit is triggered, extending one hop outward along the "Include Price" relation edge of the "Package" node to obtain the missing price node.
[0138] S5. Question-answering device performs multi-step collaborative reasoning.
[0139] Based on the problem type, the atomic capability scheduling unit decides which capabilities to invoke. If tabular data computation is involved, the intelligent table analysis capability is activated. This capability is implemented using PTC (Programmatic Tool Calling): First, a large model (such as GPT-4) generates a piece of Python code (e.g., using the pandas library for filtering, aggregation, and comparison operations) based on the structured description of the current table (e.g., column names, data types) and the user's problem. Then, the code is sent to an isolated sandbox execution environment (e.g., a Docker container or a restricted Python interpreter) to run, avoiding security risks. The execution results (e.g., numerical values, table subsets) are captured and returned to the scheduling unit. This approach ensures accuracy and scalability for arbitrarily complex table operations.
[0140] Simultaneously, if a relationship path query is needed, the graph relationship analysis capability is invoked, and a graph query language (such as Cypher) is used to retrieve the path in the knowledge graph; if logical reasoning is needed, the knowledge question answering reasoning capability is invoked, and reasoning is performed based on rules or graph neural networks; if images are needed, the image search capability is invoked, and the most relevant images are returned through image description vector matching. The iterative reasoning control unit merges the current reasoning results into the evidence set and re-evaluates the knowledge completeness until a preset number of iterations or a confidence threshold is reached.
[0141] S6. The question-and-answer device generates the answer.
[0142] The results fusion unit deduplicates and sorts the outputs from each capability module, for example, merging the numerical values obtained from table analysis with the relationship descriptions obtained from graph relationship analysis. The language generation unit generates the final natural language answer and returns it to the user based on templates (such as "The price of package A is X, the price of package B is Y, therefore package A is recommended") or using the T5 generation model.
[0143] Thus, by invoking reasoning capabilities that match the intent type corresponding to the user's question, the searched content is filtered, enabling the question-answering model to provide targeted answers based on the user's question, thereby improving the accuracy of question-answering. Moreover, by matching the content type of the question with the intent type corresponding to the user's question, the content type of the question answer can be matched with the intent type, thereby improving the flexibility of question-answering.
[0144] It should be noted that the descriptions of each step S1 to S6 in this embodiment can be found in the descriptions in the above embodiments, and will not be repeated here.
[0145] It should be noted that the above-described method embodiments, or the various possible implementations of the method embodiments, can be executed individually, or, provided there is no conflict, they can be combined with each other. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0146] Figure 9 This is a schematic diagram of the structure of a question-and-answer system provided in an embodiment of this application. Figure 9 As shown, the document system 800 may include: an HTML document knowledge graph construction module 801, a multi-level hybrid index construction module 802, a question understanding and retrieval module 803, a knowledge completeness judgment and expansion module 804, a multi-step collaborative reasoning module 805, and an answer generation module 806.
[0147] Among them, the HTML document knowledge graph construction module 801 is used to store heterogeneous information in the form of entity nodes and relation edges into the graph database to form a knowledge graph, which is applied to the above steps 401, 402, 403 and related schemes of steps 401, 402, 403.
[0148] The multi-level hybrid index building module 802 is used to build an inverted index from vector to original text / graph nodes, which facilitates fast retrieval and is applied to the above steps 501, 502, 503 and related schemes of steps 501, 502, 503.
[0149] The problem understanding and retrieval module 803 is used to identify the user's problem type, extract problem entities, query the subgraphs associated with these nodes through the graph database, obtain preliminary evidence, and apply it to the above steps 201, 202, 301 and related solutions of steps 201, 202, 301.
[0150] The knowledge completeness judgment and expansion module 804 is used to evaluate whether the preliminary evidence of the unit check contains all the entities and relationships required for the problem, obtain the missing information nodes, and apply them to the above step 302 and related solutions of step 302.
[0151] The multi-step collaborative reasoning module 805 is used to determine which atomic capabilities to invoke based on the question type, so that the answer meets the confidence requirements, and is applied to step 203 and related schemes mentioned above.
[0152] The answer generation module 806 is used to deduplicate and sort the outputs from each capability module, generate the final natural language answer and return it to the user, and is applied to step 204 and related schemes above.
[0153] It should be noted that for a detailed explanation of the steps performed by each module and their beneficial effects, please refer to the description in the above embodiments, which will not be repeated here.
[0154] As can be seen, the above mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the embodiments of this application provide corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0155] This application embodiment can divide the document device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0156] In some embodiments, this application also provides a question-answering device. The question-answering device may include one or more functional modules for implementing the question-answering method of the above method embodiments.
[0157] For example, Figure 10 This is a schematic diagram of a question-and-answer device provided in an embodiment of this application. Figure 10 As shown, the question-and-answer device 900 includes: an input module 901, a search module 902, a filtering module 903, and an output module 904.
[0158] The system comprises the following modules: Input module 901, which inputs user questions into the question-answering model; Search module 902, which performs content search based on the user questions to obtain a first set of content; Filtering module 903, which, based on the intent type corresponding to the user questions, invokes reasoning abilities matching the intent type to filter the first set of content and obtain a first candidate answer; wherein the reasoning abilities include at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question-answering reasoning ability, and image search reasoning ability; and Output module 904, which outputs the answer to the question based on the intent type corresponding to the user questions and the first candidate answer.
[0159] The question-answering device provided in this application, by invoking reasoning capabilities that match the intent type corresponding to the user's question, filters the searched content, enabling the question-answering model to provide targeted answers based on the user's question, thereby improving the accuracy of question-answering; moreover, by using the intent type corresponding to the user's question, the content type of the question answer can be matched with the intent type, thereby improving the flexibility of question-answering.
[0160] In some embodiments, the filtering module 903 is specifically used to filter the first content set by using the question-and-answer model based on the intent type corresponding to the user's question, and to obtain a second candidate answer; if the confidence level of the second candidate answer is greater than or equal to a preset threshold, the second candidate answer is used as the first candidate answer.
[0161] In another possible implementation, the filtering module 903 is further configured to, when the confidence level of the second candidate answer is less than the preset threshold, invoke the reasoning ability that matches the intent type based on the intent type of the user question to filter the second candidate answer and obtain a third candidate answer, until the confidence level of the third candidate answer is greater than or equal to the preset threshold, and then use the third candidate answer as the first candidate answer.
[0162] Another possible implementation is that the search module 902 described above is specifically used to perform a joint search based on the user question and the hybrid index through the question-answering model to obtain a second content set. The hybrid index is used to represent the mapping relationship between the document to be retrieved, the semantic vector corresponding to the document to be retrieved, and the semantic vector of the first knowledge graph corresponding to the document to be retrieved. The knowledge graph is constructed based on the titles, paragraphs, lists, tables, images, and links in the document to be retrieved. If the second content set does not satisfy the user intent corresponding to the user question, the second content set is expanded based on the knowledge graph through the question-answering model to obtain a first content set.
[0163] In another possible implementation, the question-answering device further includes a processing module. The input module 901 is further used to input the document to be retrieved into the question-answering model before the acquisition module acquires the user's question. The processing module is used to acquire each element entity in the document to be retrieved, as well as the hierarchical relationship between each element entity, through the question-answering model. The element entities include: titles, paragraphs, lists, tables, images, and links. Through the question-answering model, each element entity is treated as a node, and the hierarchical relationship between each element entity is treated as an edge, to obtain a first knowledge graph.
[0164] In another possible implementation, the above processing module is further used to vectorize the first knowledge graph after obtaining it through the question-answering model, thereby obtaining a vectorized knowledge graph; to vectorize the document to be retrieved through the question-answering model, thereby obtaining a vectorized document to be retrieved; and to construct a bidirectional mapping relationship between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved through the question-answering model, thereby obtaining a hybrid index.
[0165] It should be noted that the question-and-answer device can implement all the processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0166] In the case where the functions of the integrated modules described above are implemented in hardware, this application provides a possible structural schematic diagram of the electronic device involved in the above embodiments. For example... Figure 11 As shown, the electronic device 90 includes: a processor 92, a communication interface 93, and a bus 94. Optionally, the electronic device 90 may also include a memory 91.
[0167] Processor 92 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 92 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 92 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0168] Communication interface 93 is used to connect with other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0169] The memory 91 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0170] As one possible implementation, the memory 91 can exist independently of the processor 92. The memory 91 can be connected to the processor 92 via a bus 94 and is used to store instructions or program code. When the processor 92 calls and executes the instructions or program code stored in the memory 91, it can implement the question-and-answer method provided in the embodiments of this application.
[0171] In another possible implementation, the memory 91 can also be integrated with the processor 92.
[0172] Bus 94 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 94 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0173] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the service calling device can be divided into different functional modules to complete all or part of the functions described above.
[0174] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described question-and-answer method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0175] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0176] This application also provides a readable storage medium storing a program or instructions that, when executed by a computer, implement the question-and-answer method provided in the above embodiments. It is understood that all or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware; the readable storage medium can be any of the foregoing embodiments or memory; the readable storage medium can also be an external storage device of the service invocation device, such as a pluggable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, flash card, etc., equipped on the service invocation device. Further, the readable storage medium can include both internal storage units of the service invocation device and external storage devices. The readable storage medium is used to store the computer program and other programs and data required by the service invocation device. The readable storage medium can also be used to temporarily store data that has been output or will be output.
[0177] This application also provides a computer program product, which is stored in a storage medium and implements the question-and-answer method provided in the above embodiments when the computer program product is executed by a computer.
[0178] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0180] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A question and answer method, characterized by, include: Input user questions into the question-answering model; Using the question-and-answer model, a first content set is obtained by searching for content based on the user's question. Using the question-answering model, based on the intent type corresponding to the user's question, the reasoning ability matching the intent type is invoked to filter the first content set and obtain the first candidate answer; the reasoning ability includes at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question-answering reasoning ability, and image search reasoning ability; The question-answering model outputs the answer based on the intent type corresponding to the user's question and the first candidate answer.
2. The question and answer method of claim 1, wherein, The step of using the question-answering model, based on the intent type corresponding to the user's question, to invoke reasoning capabilities matching the intent type to filter the first content set and obtain a first candidate answer includes: Using the question-answering model, based on the intent type corresponding to the user's question, the reasoning ability matching the intent type is invoked to filter the first content set and obtain a second candidate answer; If the confidence level of the second candidate answer is greater than or equal to a preset threshold, the second candidate answer is adopted as the first candidate answer.
3. The question and answer method of claim 2, wherein, The method further includes: If the confidence level of the second candidate answer is less than the preset threshold, the reasoning ability matching the intent type is invoked based on the intent type of the user question to filter the second candidate answer and obtain a third candidate answer. This process continues until the confidence level of the third candidate answer is greater than or equal to the preset threshold, at which point the third candidate answer is adopted as the first candidate answer.
4. The question answering method of claim 1, wherein, The content search based on the user question yields a first content set, including: Using the question-answering model, a joint search is performed based on the user question and the hybrid index to obtain a second content set; the hybrid index is used to represent the mapping relationship between the document to be retrieved, the semantic vector corresponding to the document to be retrieved, and the semantic vector of the first knowledge graph corresponding to the document to be retrieved, the first knowledge graph is constructed based on the title, paragraph, list, table, image and link in the document to be retrieved; If the second content set does not satisfy the user intent corresponding to the user question, the second content set is expanded based on the knowledge graph using the question-answering model to obtain the first content set.
5. The question answering method of claim 1, wherein, Before obtaining the user's question, the method further includes: Input the document to be retrieved into the question-answering model; The question-answering model is used to obtain each element entity in the document to be retrieved, as well as the hierarchical relationship between each element entity. The element entities include: title, paragraph, list, table, image and link. Using the question-and-answer model, each element entity is treated as a node, and the hierarchical relationships between the element entities are treated as edges, thus obtaining the first knowledge graph.
6. The question and answer method of claim 5, wherein, After obtaining the first knowledge graph, the method further includes: The first knowledge graph is vectorized using the question-answering model to obtain the vectorized knowledge graph. The document to be retrieved is vectorized using the question-answering model to obtain the vectorized document to be retrieved. By using the question-answering model, a bidirectional mapping relationship is constructed between the document to be retrieved, the vectorized knowledge graph, and the vectorized document to be retrieved, resulting in a hybrid index.
7. A question and answer apparatus characterized by comprising: The question-and-answer device includes: an input module, a search module, a filtering module, and an output module; The input module is used to input user questions into the question-answering model; The search module is used to perform content search based on the user's question to obtain a first content set; The filtering module is used to filter the first content set based on the intent type corresponding to the user's question, and to obtain a first candidate answer by invoking the reasoning ability that matches the intent type; the reasoning ability includes at least one of the following: table analysis reasoning ability, graph relationship analysis reasoning ability, knowledge question answering reasoning ability, and image search reasoning ability. The output module is used to output the answer to the question based on the intent type corresponding to the user question and the first candidate answer.
8. An electronic device, comprising: It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the question-and-answer method as described in any one of claims 1-6.
9. A readable storage medium, characterized by, The readable storage medium stores a program or instructions that, when executed by a computer, implement the question-and-answer method as described in any one of claims 1-6.
10. A computer program product, characterised in that, The computer program product is stored in a storage medium, and when executed by a computer, the computer program product implements the question-and-answer method as described in any one of claims 1-6.