Intelligent question answering methods, devices, computer equipment, storage media and products
By using a multi-agent architecture to collaboratively process structured and unstructured data queries, the system addresses the inefficiencies and instability of existing question-answering systems in handling complex questions, achieving more efficient and stable question-answering results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-06-02
AI Technical Summary
Existing question-answering systems based on large language models struggle to effectively combine structured and unstructured data for efficient querying and logical reasoning when dealing with complex questions, resulting in insufficient question-answering efficiency and stability.
A multi-agent architecture is adopted, in which the database query task for problem information is assigned to the first agent, the knowledge base query task is assigned to the second agent, and the logical reasoning and natural language processing tasks are assigned to the third agent. Through the collaboration of multiple agents to perform database query, knowledge base query and logical reasoning, a dynamic decision-making process is realized.
It improves the efficiency and stability of question answering, enabling it to better handle complex questions and provide comprehensive and reliable answer information.
Smart Images

Figure CN122133790A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an intelligent question answering method and device, a computer device, a storage medium and product. BACKGROUND
[0002] With the development of artificial intelligence technology, the application of large language models (LLM) based on artificial intelligence is more and more extensive. Therefore, natural language interface to database (NLIDB) based on LLM has become one of the important forms of human-computer interaction. SUMMARY
[0003] The embodiments of the present application provide an intelligent question answering method, device, computer device, storage medium and product. The technical solution is as follows: In one aspect, an intelligent question answering method is provided, which includes: displaying an intelligent question answering interface, the intelligent question answering interface being used to provide intelligent question answering services through multiple agents; based on an input operation on the intelligent question answering interface, obtaining input question information; based on the question information, performing sentence matching query in a structured database through a first agent to obtain a first query result, the structured database including multiple structured data, the first query result being used to represent whether candidate structured data is queried, and in the case that the first query result represents that the candidate structured data is queried, the first query result including the candidate structured data; based on the question information, performing semantic similarity query in an unstructured knowledge base through a second agent to obtain a second query result, the unstructured knowledge base including multiple unstructured knowledge, the second query result including candidate unstructured knowledge queried; based on the first query result and the second query result, determining candidate answer information through a third agent; performing logical reasoning and natural language generation on the candidate answer information to obtain first target answer information, the first target answer information being used to describe the candidate answer information through natural language, and the first target answer information containing a logical reasoning process of the candidate answer information.
[0004] In one possible implementation, based on the question information, performing sentence matching query in a structured database through a first agent to obtain a first query result includes: Based on the question information, a structured query statement is generated. The structured query statement includes the query intent, the target data type, and the context information of the question information. The target data type is the type of answer information queried from the question information. Based on the structured query statement, the first agent performs a statement matching query in the structured database to obtain the first query result.
[0005] In another possible implementation, the step of obtaining a second query result by performing a semantic similarity query in an unstructured knowledge base based on the query information through a second agent includes: Determine the first semantic information of the question information; Based on the first semantic information and the second semantic information of multiple unstructured knowledge included in the unstructured knowledge base, the second intelligent agent determines the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge. Based on the semantic similarity between the first semantic information and the second semantic information of the plurality of unstructured knowledge, candidate unstructured knowledge whose semantic similarity exceeds the similarity threshold is determined, and the second query result is obtained.
[0006] In another possible implementation, determining candidate answer information based on the first query result and the second query result includes: The candidate structured data is mapped to third semantic information; The third semantic information and the candidate unstructured knowledge are weighted and fused to obtain the candidate answer information.
[0007] In another possible implementation, the method further includes: Determine the confidence level and source information of the first target answer information; The first target answer information, the confidence level, and the source information are output on the intelligent question-and-answer interface.
[0008] In another possible implementation, the method further includes: If the confidence level of the candidate structured data is less than the first confidence threshold, the step of performing a semantic similarity query in the unstructured knowledge base based on the question information by a second agent to obtain a second query result is executed. If the confidence level of the candidate structured data is not less than the first confidence level threshold, logical reasoning and natural language generation are performed on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
[0009] On the other hand, an intelligent question-answering device is provided, the device comprising: The display module is used to display the intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents. The acquisition module is used to acquire the input question information based on the input operation on the intelligent question-and-answer interface; The first query module is used to perform a statement matching query in a structured database through a first intelligent agent based on the query information to obtain a first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data. The second query module is used to perform semantic similarity query in the unstructured knowledge base based on the question information through the second intelligent agent to obtain the second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items. The determination module is used to determine candidate answer information through a third intelligent agent based on the first query result and the second query result; The generation module is used to perform logical reasoning and natural language generation on the candidate answer information to obtain first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
[0010] In one possible implementation, the first query module is configured to generate a structured query statement based on the question information. The structured query statement includes a query intent, a target data type, and contextual information of the question information. The target data type is the type of answer information queried from the question information. Based on the structured query statement, a first agent performs a statement matching query in the structured database to obtain the first query result.
[0011] In another possible implementation, the second query module is used to determine the first semantic information of the question information; based on the first semantic information and the second semantic information of multiple unstructured knowledge included in the unstructured knowledge base, a second agent determines the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge; based on the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge, candidate unstructured knowledge whose semantic similarity exceeds a similarity threshold is determined, and the second query result is obtained.
[0012] In another possible implementation, the determining module is used to map the candidate structured data into third semantic information; and to perform weighted fusion of the third semantic information and the candidate unstructured knowledge to obtain the candidate answer information.
[0013] In another possible implementation, the device further includes: The output module is used to determine the confidence level and source information of the first target answer information; and to output the first target answer information, the confidence level, and the source information on the intelligent question-and-answer interface.
[0014] In another possible implementation, the second query module is used to perform a semantic similarity query in an unstructured knowledge base based on the question information when the confidence level of the candidate structured data is less than a first confidence threshold, thereby obtaining a second query result. The generation module is further configured to perform logical reasoning and natural language generation on the candidate structured data when the confidence level of the candidate structured data is not less than the first confidence level threshold, to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
[0015] On the other hand, a computer device is provided, the computer device including a main control module, the main control module including a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the above-mentioned intelligent question answering method.
[0016] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the storage medium, the at least one piece of program code being loaded and executed by a processor to implement the above-described intelligent question-answering method.
[0017] On the other hand, a computer program product is provided, the product storing at least one piece of program code, the at least one piece of program code being executed by a processor to implement the above-described intelligent question-answering method.
[0018] In this embodiment, a multi-agent system is introduced into the intelligent question-answering interface, assigning different tasks related to the question information to different agents. Specifically, the database query task for the question information is assigned to the first agent, the knowledge base query task is assigned to the second agent, and the tasks corresponding to logical reasoning and natural language processing are assigned to the third agent. This allows for a dynamic decision-making process of database query, knowledge base query, logical reasoning, and natural language processing through multiple agents, thereby improving the efficiency and stability of question answering.
[0019] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this disclosure. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating an exemplary embodiment of the intelligent question-answering method of this application; Figure 2 This is a flowchart illustrating an intelligent question-answering method in another exemplary embodiment of this application; Figure 3 This is a flowchart illustrating an intelligent question-answering method in another exemplary embodiment of this application; Figure 4 This is a block diagram illustrating an intelligent question-answering device according to an exemplary embodiment of this application; Figure 5 This is a block diagram illustrating a computer device in an exemplary embodiment of this application. Detailed Implementation
[0021] To make the technical solution and advantages of this application clearer, the embodiments of this application will be described in further detail below.
[0022] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0023] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0024] Please refer to Figure 1 The diagram illustrates a flowchart of an intelligent question-answering method according to an exemplary embodiment of this application. (Reference) Figure 1 The method includes: Step 101: The computer device displays an intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents.
[0025] The computer equipment can be an in-vehicle terminal, mobile phone, tablet computer, personal computer, multimedia playback device, wearable device, virtual reality device, augmented reality device, or mixed reality device, etc. Multiple intelligent agents include a first intelligent agent, a second intelligent agent, and a third intelligent agent. The first intelligent agent performs query tasks on a structured database, the second intelligent agent performs query tasks on an unstructured knowledge base, and the third intelligent agent fuses the first query result from the first intelligent agent and the second query result from the second intelligent agent.
[0026] The computer device detects whether the intelligent question-and-answer interface has detected an input operation. When the intelligent question-and-answer interface detects an input operation, step 102 is executed. In one possible implementation, the intelligent question-and-answer interface includes an input box. In response to the input box being triggered, the computer device determines that an input operation has been detected. In another possible implementation, the user can input question information via voice. Accordingly, upon receiving a wake word, the computer device determines that an input operation has been detected.
[0027] Step 102: The computer device obtains the input question information based on the input operation on the intelligent question-and-answer interface.
[0028] The question can be either voice or text; if the question is voice, it can be in natural language; if the question is text, it can be in natural sentences. For example, the question could be "The basis for calculating the drag coefficient of XX model".
[0029] In one possible implementation, after the computer device obtains the question information, it determines the complexity of the question information through a fourth intelligent agent. If the complexity of the question information is greater than a complexity threshold, steps 103-106 are executed. If the complexity of the question information is not greater than the complexity threshold, the computer device, based on the question information, performs a statement matching query in a structured database through a first intelligent agent to obtain a first query result. It then performs logical reasoning and natural language generation on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data using natural language and includes the logical analysis process of the candidate structured statements. Alternatively, if the complexity of the question information is not greater than the complexity threshold, the computer device, based on the question information, performs a semantic similarity query in an unstructured knowledge base through a second intelligent agent to obtain a second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the retrieved candidate unstructured knowledge items. It then performs logical reasoning and natural language generation on the unstructured knowledge items to obtain third target answer information. The third target answer information is used to describe the candidate unstructured knowledge items using natural language and includes the logical reasoning process of the candidate unstructured knowledge items.
[0030] In another possible implementation, after the computer device receives the question information, it determines the type of the question information through a fifth intelligent agent. If the question information is of type one, the computer device, based on the question information, performs a statement matching query in a structured database through the first intelligent agent to obtain a first query result. It then performs logical reasoning and natural language generation on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data using natural language and includes the logical analysis process of the candidate structured statements. In this case, type one is a database query type. If the question information is of type two, the computer device, based on the question information, performs a semantic similarity query in an unstructured knowledge base through the second intelligent agent to obtain a second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the retrieved candidate unstructured knowledge. It then performs logical reasoning and natural language generation on the unstructured knowledge to obtain third target answer information. The third target answer information is used to describe the candidate unstructured knowledge using natural language and includes the logical reasoning process of the candidate unstructured knowledge. In this case, type two is a knowledge base query type.
[0031] In this embodiment, the computer device can automatically determine whether to use database query, knowledge base retrieval, or a combination of both based on the query information, thereby enabling automated decision-making and task planning.
[0032] Step 103: Based on the query information, the computer device performs a statement matching query in the structured database through the first intelligent agent to obtain the first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data.
[0033] In one possible implementation, this step can be achieved by the following steps 1031 to 1032, including: Step 1031: The computer device generates a structured query statement based on the query information. The structured query statement includes the query intent, the target data type, and the context information of the query information. The target data type is the type of answer information queried from the query information.
[0034] The computer device includes a semantic understanding model. In this step, the computer device inputs the query information into the semantic understanding model and obtains the output query intent, target data type, and contextual information of the query information. Based on the query intent, target data type, and contextual information of the query information, a structured query statement is generated.
[0035] It's important to note that when a user submits a question for the first time, the structured query does not include the context information of the question. For example, if the question is "The calculation basis for the drag coefficient of XX model", the computer will determine the target data type as "technical parameter", the query intent as "calculation basis", and the structured query will be "SELECT coefficient, method FROM drag_table WHERE vehicle='P9'".
[0036] The computer device includes a Natural Language to SQL (Structured Query Language) model. In this step, the computer device inputs the query intent, target data type, and contextual information of the query into the Natural Language to SQL model to obtain the output structured query statement.
[0037] Step 1032: The computer device, based on the structured query statement, performs a statement matching query in the structured database through the first intelligent agent to obtain the first query result.
[0038] In one possible implementation, after the computer device determines the first query result, it can directly execute step 104; in another possible implementation, after the computer device determines the first query result, it determines whether the first query result is empty. If the first query result is empty, it executes step 104; if the first query result is not empty, the computer device performs logical reasoning and natural language generation on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statements.
[0039] In another possible implementation, after the computer device determines the first query result, it determines the confidence level of the first query result. If the confidence level of the first query result is less than a second confidence threshold, step 104 is executed. If the confidence level of the first query result is not less than the second confidence threshold, the computer device performs logical reasoning and natural language generation on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statements.
[0040] In another possible implementation, the computer device determines whether the structured query statement has failed to execute. If the structured query statement has failed to execute, step 104 is executed. If the structured query statement has not failed to execute, the confidence level of the first query result is determined. If the confidence level of the first query result is less than a second confidence threshold, step 104 is executed. If the confidence level of the first query result is not less than the second confidence threshold, the computer device performs logical reasoning and natural language generation on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
[0041] In this embodiment, if the structured query fails, the first query result is empty, or the confidence level of the first query result is less than the second confidence threshold, the first agent activates the second and third agents. The second agent executes step 104, and the third agent executes step 105, thereby dynamically planning subsequent tasks. The first agent can be a task agent, the second agent can be a retrieval agent, and the third agent can be a fusion agent.
[0042] Step 104: Based on the query information, the computer device performs a semantic similarity query in the unstructured knowledge base through the second intelligent agent to obtain the second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items.
[0043] The method described in this application can be widely applied to various scenarios such as enterprise knowledge base question answering, scientific research knowledge base retrieval, patent information analysis, quality problem diagnosis, and customer service knowledge recommendation, thereby providing a general solution for intelligent information retrieval. Therefore, the unstructured knowledge base can be at least one of an enterprise knowledge base, a scientific research knowledge base, a patent information knowledge base, a quality problem knowledge base, or a customer service knowledge base. In this application embodiment, taking an enterprise knowledge base as an example, the enterprise knowledge base includes unstructured knowledge documents such as wind tunnel test reports, CFD (Computational Fluid Dynamics) simulation files, and technical standards.
[0044] In one possible implementation, this step can be achieved by the following steps 1041 to 1043, including: Step 1041: The computer device determines the first semantic information of the query information.
[0045] The first semantic information can be the semantic vector of the question information.
[0046] Step 1042: The computer device determines the semantic similarity between the first semantic information and the second semantic information of multiple unstructured knowledge included in the unstructured knowledge base through a second intelligent agent, based on the first semantic information and the second semantic information of multiple unstructured knowledge.
[0047] Step 1043: The computer device determines candidate unstructured knowledge whose semantic similarity exceeds a similarity threshold based on the semantic similarity between the first semantic information and the second semantic information of multiple unstructured knowledge, and obtains the second query result.
[0048] The similarity threshold can be set and changed as needed. In this embodiment, the similarity threshold is not specifically limited. For example, the similarity threshold can be positively related to the accuracy requirement of the question information. That is, the higher the accuracy requirement of the question information, the larger the similarity threshold; the lower the accuracy requirement of the question information, the smaller the similarity threshold.
[0049] Step 105: The computer device determines candidate answer information through a third intelligent agent based on the first query result and the second query result.
[0050] The first query result includes candidate structured data, and the second query result includes candidate unstructured knowledge. Accordingly, step 105 can be: the computer device maps the candidate structured data into third semantic information; and the third semantic information and candidate unstructured knowledge are weighted and fused to obtain candidate answer information.
[0051] Before performing weighted fusion of third semantic information (at least one) and candidate unstructured knowledge (at least one), the computer device performs deduplication processing on the third semantic information (at least one) and candidate unstructured knowledge (at least one); then, it performs weighted fusion on the deduplicated third semantic information and the deduplicated candidate unstructured knowledge.
[0052] The number of candidate answer information is one or more; when the number of candidate answer information is more than one, the computer device determines the confidence level of the multiple candidate answer information, and based on the confidence level of the multiple candidate answer information, determines the candidate answer information with the highest confidence level from the multiple candidate answer information, and then executes step 106.
[0053] In this embodiment, the computer device combines the RAG (Retrieval-Augmented Generation) framework with semantic vector computing technology to establish a semantic layer mapping between structured databases and unstructured knowledge bases, thereby achieving cross-domain information fusion and making the sources of candidate answer information more comprehensive.
[0054] The third semantic information and the candidate unstructured knowledge correspond to the first weight and the second weight, respectively. In one possible implementation, the first weight and the second weight can be predetermined fixed values. In another possible implementation, the first weight and the second weight can be determined based on the confidence levels of the first query result and the second query result; for example, the computer device normalizes the confidence levels of the first query result and the second query result to obtain the first weight and the second weight. In yet another possible implementation, the first weight and the second weight can be determined based on the source information of the first query result and the second query result; for example, the computer device determines the first reliability of the source information of the first query result and the second reliability of the source information of the second query result, and normalizes the first reliability and the second reliability to obtain the first weight and the second weight.
[0055] In another possible implementation, the first weight and the second weight can be determined based on the first matching degree between the first query result and the query information and the second matching degree between the second query result and the query information; for example, a computer device determines the first matching degree between the first query result and the query information and the second matching degree between the second query result and the query information, and performs normalization processing on the first matching degree and the second matching degree to obtain the first weight and the second weight.
[0056] In another possible implementation, the first weight and the second weight can be determined based on the first reliability, the second reliability, the first matching degree, and the second matching degree; for example, the computer device obtains the first weight by weighted summing of the first reliability and the first matching degree, and obtains the second weight by weighted summing of the second reliability and the second matching degree.
[0057] Step 106: The computer device performs logical reasoning and natural language generation on the candidate answer information to obtain the first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
[0058] The computer device includes an LLM (Large Language Model), which is used to perform logical reasoning and natural language generation tasks. Accordingly, in this step, the computer device inputs candidate answer information into the Large Language Model, which generates a multi-step logical reasoning path based on the thought chain template, and generates the first target answer information based on the multi-step logical reasoning path and the candidate answer information.
[0059] For example, the third agent invokes a large language model and, guided by a thought chain template, generates a logical answer: "The drag coefficient of the XX model is mainly determined based on a combination of wind tunnel experiments and CFD simulation results. The drag coefficient measured in the wind tunnel experiment is normalized and then compared with the simulation data, and the error between the two is less than 3%. The final Cd calculation formula is Cd = Fd / (0.5 × ρ × v² × A)." For example, please refer to Figure 2 When a user asks a question, the system obtains the question information and performs intelligent scheduling based on it. The intelligent scheduling result is the invocation of a first intelligent agent (SQL agent) and a second intelligent agent (RAG agent). The first intelligent agent parses the question information into an SQL query statement based on the thought chain and queries the structured database based on the SQL query statement to obtain the first query result. The second intelligent agent converts the question information into a semantic vector and matches similar documents in the unstructured knowledge base based on the semantic vector to obtain the second query result. The third intelligent agent integrates the first query result and the second query result to obtain the final first target answer information.
[0060] In this step, by introducing the CoT (Chain-of-Thought) mechanism, the large language model is guided to perform multi-step logical reasoning during the answer generation process, ensuring that the output of the first target answer information is clear, logical, and provides interpretability support.
[0061] In one possible implementation, the computer device outputs the first target answer information on the intelligent question-and-answer interface. In another possible implementation, the computer device may also output the confidence level and source information of the first target answer information; correspondingly, step 106 may be: the computer device determines the confidence level and source information of the first target answer information; and outputs the first target answer information, confidence level, and source information on the intelligent question-and-answer interface.
[0062] The steps for a computer device to determine the confidence level of the first target answer information can be as follows: the computer device determines the confidence level of the candidate answer information, and determines the confidence level of the candidate answer information as the confidence level of the first target answer information.
[0063] The steps for a computer device to determine the confidence level of candidate answer information can be as follows: the computer device determines the confidence level of candidate structured data and the confidence level of unstructured knowledge, and performs a weighted sum of the confidence levels of candidate structured data and unstructured knowledge to obtain the confidence level of candidate answer information.
[0064] The source information for the first target answer includes the source information of candidate structured data and the source information of candidate unstructured knowledge. The source information of candidate unstructured knowledge can be document links of candidate unstructured knowledge.
[0065] In this embodiment of the application, the computer device outputs the first target answer information, confidence level and source information on the intelligent question-and-answer interface, thereby realizing the quantification (quantification through confidence level) and verifiability (verification through source information) of the first target answer information.
[0066] In one possible implementation, the computer device acquires user logs, determines feedback information of the first target answer from the user logs, and updates the first weight and the second weight based on the feedback information of the first target answer. In another possible implementation, the computer device acquires user logs, determines feedback information of the first target answer from the user logs, and updates the first confidence threshold and the second confidence threshold based on the feedback information of the first target answer.
[0067] In this embodiment of the application, the user logs of the computer device during operation are used to optimize the agent strategy (corresponding to the first confidence threshold and the second confidence threshold) and weight parameters (corresponding to the first weight and the second weight) through reinforcement learning, thereby gradually improving the system's adaptability and intelligence level.
[0068] In this embodiment, a multi-agent system is introduced into the intelligent question-answering interface, assigning different tasks related to the question information to different agents. Specifically, the database query task for the question information is assigned to the first agent, the knowledge base query task is assigned to the second agent, and the tasks corresponding to logical reasoning and natural language processing are assigned to the third agent. This allows for a dynamic decision-making process of database query, knowledge base query, logical reasoning, and natural language processing through multiple agents, thereby improving the efficiency and stability of question answering.
[0069] Please refer to Figure 3 The diagram illustrates a flowchart of an intelligent question-answering method according to an exemplary embodiment of this application. (Reference) Figure 3 The method includes: Step 301: The computer device displays an intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents.
[0070] In some embodiments, this step is the same as step 101, and will not be described again here.
[0071] Step 302: The computer device obtains the input question information based on the input operation on the intelligent question-and-answer interface.
[0072] In some embodiments, this step is the same as step 102, and will not be described again here.
[0073] Step 303: Based on the query information, the computer device performs a statement matching query in the structured database through the first intelligent agent to obtain the first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data.
[0074] In some embodiments, this step is the same as step 103, and will not be described again here.
[0075] Step 304: The computer device determines the confidence level of the candidate structured data.
[0076] The computer equipment determines the source information of the candidate structured data and, based on the source information, determines the confidence level of the candidate structured data; or, the computer equipment determines the matching degree between the candidate structured data and the query information and, based on the matching degree, determines the confidence level of the candidate structured data.
[0077] If the confidence level of the candidate structured data is less than the first confidence threshold, it indicates that the confidence level of the candidate structured data is low. In this case, it is necessary to supplement the candidate structured data with unstructured knowledge base, and then proceed to step 305. If the confidence level of the candidate structured data is not less than the first confidence threshold, it indicates that the confidence level of the candidate structured data is high. In this case, the final second target answer information can be determined directly based on the candidate structured data, and then proceed to step 308.
[0078] Step 305: When the confidence level of the candidate structured data is less than the first confidence threshold, the computer device performs a semantic similarity query in the unstructured knowledge base based on the query information through the second agent to obtain the second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items.
[0079] Step 306: The computer device determines candidate answer information through a third intelligent agent based on the first query result and the second query result.
[0080] In some embodiments, this step is the same as step 105, and will not be described again here.
[0081] Step 307: The computer device performs logical reasoning and natural language generation on the candidate answer information to obtain the first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
[0082] In some embodiments, this step is the same as step 106, and will not be described again here.
[0083] Step 308: If the confidence level of the candidate structured data is not less than the first confidence threshold, the computer device performs logical reasoning and natural language generation on the candidate structured data to obtain the second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
[0084] The process by which computer equipment performs logical reasoning and natural language generation on candidate structured data to obtain the second target answer information is similar to the process by which computer equipment performs logical reasoning and natural language generation on candidate answer information to obtain the first target answer information, and will not be described in detail here.
[0085] In this embodiment, a multi-agent system is introduced into the intelligent question-answering interface, assigning different tasks related to the question information to different agents. Specifically, the database query task for the question information is assigned to the first agent, the knowledge base query task is assigned to the second agent, and the tasks corresponding to logical reasoning and natural language processing are assigned to the third agent. This allows for a dynamic decision-making process of database query, knowledge base query, logical reasoning, and natural language processing through multiple agents, thereby improving the efficiency and stability of question answering.
[0086] Please refer to Figure 4 This illustration shows a block diagram of an intelligent question-answering device according to an exemplary embodiment of this application. The device includes: Display module 401 is used to display an intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents. The acquisition module 402 is used to acquire the input question information based on the input operation on the intelligent question-and-answer interface; The first query module 403 is used to perform a statement matching query in a structured database through a first intelligent agent based on the query information to obtain a first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data. The second query module 404 is used to perform a semantic similarity query in an unstructured knowledge base based on the question information by a second intelligent agent to obtain a second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items. The determination module 405 is used to determine candidate answer information through a third intelligent agent based on the first query result and the second query result; The generation module 406 is used to perform logical reasoning and natural language generation on the candidate answer information to obtain first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
[0087] In one possible implementation, the first query module 403 is configured to generate a structured query statement based on the question information, the structured query statement including query intent, target data type and context information of the question information, the target data type being the type of answer information queried from the question information; and based on the structured query statement, perform a statement matching query in the structured database through a first intelligent agent to obtain the first query result.
[0088] In another possible implementation, the second query module 404 is used to determine the first semantic information of the question information; based on the first semantic information and the second semantic information of multiple unstructured knowledge included in the unstructured knowledge base, a second agent determines the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge; based on the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge, candidate unstructured knowledge whose semantic similarity exceeds a similarity threshold is determined, and the second query result is obtained.
[0089] In another possible implementation, the determining module 405 is used to map the candidate structured data into third semantic information; and to perform weighted fusion of the third semantic information and the candidate unstructured knowledge to obtain the candidate answer information.
[0090] In another possible implementation, the device further includes: The output module is used to determine the confidence level and source information of the first target answer information; and to output the first target answer information, the confidence level, and the source information on the intelligent question-and-answer interface.
[0091] In another possible implementation, the second query module 404 is used to perform a semantic similarity query in an unstructured knowledge base based on the question information when the confidence level of the candidate structured data is less than a first confidence threshold, thereby obtaining a second query result. The generation module 406 is further configured to perform logical reasoning and natural language generation on the candidate structured data when the confidence level of the candidate structured data is not less than the first confidence level threshold, to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
[0092] In this embodiment, a multi-agent system is introduced into the intelligent question-answering interface, assigning different tasks related to the question information to different agents. Specifically, the database query task for the question information is assigned to the first agent, the knowledge base query task is assigned to the second agent, and the tasks corresponding to logical reasoning and natural language processing are assigned to the third agent. This allows for a dynamic decision-making process of database query, knowledge base query, logical reasoning, and natural language processing through multiple agents, thereby improving the efficiency and stability of question answering.
[0093] It should be noted that the intelligent question-answering device provided in the above embodiments is only illustrated by the division of the above functional modules when performing intelligent question-answering. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the intelligent question-answering device and the intelligent question-answering method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0094] Figure 5 This is a schematic diagram of a computer device according to an embodiment of this application. The computer device 500 can be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 500 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0095] Typically, computer device 500 includes a processor 501 and a memory 502.
[0096] Processor 501 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0097] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 502 are used to store at least one program code, which is executed by the processor 501 to implement the intelligent question-answering method provided in the method embodiments of this application.
[0098] In some embodiments, the computer device 500 may also optionally include a peripheral device interface 503 and at least one peripheral device. The processor 501, memory 502, and peripheral device interface 503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 504, a display screen 505, a camera assembly 506, an audio circuit 507, and a power supply 508.
[0099] Peripheral device interface 503 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 501 and memory 502. In some embodiments, processor 501, memory 502 and peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 501, memory 502 and peripheral device interface 503 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0100] The radio frequency (RF) circuit 504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 504 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 504 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 504 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0101] Display screen 505 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 505 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 501 for processing. In this case, display screen 505 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 505, disposed on the front panel of the computer device 500; in other embodiments, there may be at least two display screens, disposed on different surfaces of the computer device 500 or in a folded design; in still other embodiments, display screen 505 may be a flexible display screen, disposed on a curved or folded surface of the computer device 500. Furthermore, display screen 505 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 505 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0102] The camera assembly 506 is used to acquire images or videos. Optionally, the camera assembly 506 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 506 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0103] The audio circuit 507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 501 for processing, or input to the radio frequency circuit 504 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located in a different part of the computer device 500. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 507 may also include a headphone jack.
[0104] Power supply 508 is used to supply power to the various components in computer device 500. Power supply 508 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 508 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0105] In some embodiments, the computer device 500 further includes one or more sensors 509. The one or more sensors 509 include, but are not limited to, an accelerometer 510, a gyroscope 511, a pressure sensor 512, an optical sensor 513, and a proximity sensor 514.
[0106] Accelerometer 510 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by computer device 500. For example, accelerometer 510 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 501 can control display screen 505 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 510. Accelerometer 510 can also be used for games or for acquiring user motion data.
[0107] The gyroscope sensor 511 can detect the orientation and rotation angle of the computer device 500. The gyroscope sensor 511, in conjunction with the accelerometer sensor 510, can collect 3D motion data from the user on the computer device 500. Based on the data collected by the gyroscope sensor 511, the processor 501 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0108] The pressure sensor 512 can be disposed on the side bezel of the computer device 500 and / or on the lower layer of the display screen 505. When the pressure sensor 512 is disposed on the side bezel of the computer device 500, it can detect the user's grip signal on the computer device 500, and the processor 501 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 512. When the pressure sensor 512 is disposed on the lower layer of the display screen 505, the processor 501 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 505. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0109] An optical sensor 513 is used to collect ambient light intensity. In one embodiment, the processor 501 can control the display brightness of the display screen 505 based on the ambient light intensity collected by the optical sensor 513. Specifically, when the ambient light intensity is high, the display brightness of the display screen 505 is increased; when the ambient light intensity is low, the display brightness of the display screen 505 is decreased. In another embodiment, the processor 501 can also dynamically adjust the shooting parameters of the camera assembly 506 based on the ambient light intensity collected by the optical sensor 513.
[0110] The proximity sensor 514, also known as a distance sensor, is typically located on the front panel of the computer device 500. The proximity sensor 514 is used to detect the distance between the user and the front of the computer device 500. In one embodiment, when the proximity sensor 514 detects that the distance between the user and the front of the computer device 500 is gradually decreasing, the processor 501 controls the display screen 505 to switch from a screen-on state to a screen-off state; when the proximity sensor 514 detects that the distance between the user and the front of the computer device 500 is gradually increasing, the processor 501 controls the display screen 505 to switch from a screen-off state to a screen-on state.
[0111] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the computer device 500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0112] This application also provides a computer-readable storage medium storing at least one line of program code, which is loaded and executed by a processor to implement the intelligent question-answering method described in any of the above implementations. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device.
[0113] This application also provides a computer program product that stores at least one piece of program code, which is loaded and executed by a processor to implement the intelligent question-answering method shown in the above embodiments.
[0114] In some embodiments, the computer program product involved in the present application can be deployed and executed on a computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
[0115] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0116] The above description is only for the purpose of enabling those skilled in the art to understand the technical solution of this application, and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An intelligent question-answering method, characterized in that, The method includes: Displays an intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents; Based on the input operation on the intelligent question-and-answer interface, the input question information is obtained; Based on the question information, the first intelligent agent performs a statement matching query in the structured database to obtain a first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data. Based on the question information, a second agent performs a semantic similarity query in an unstructured knowledge base to obtain a second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items. Based on the first query result and the second query result, candidate answer information is determined by a third intelligent agent; Logical reasoning and natural language generation are performed on the candidate answer information to obtain first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
2. The method according to claim 1, characterized in that, The step of obtaining a first query result by performing a statement matching query in a structured database based on the query information through a first intelligent agent includes: Based on the question information, a structured query statement is generated. The structured query statement includes the query intent, the target data type, and the context information of the question information. The target data type is the type of answer information queried from the question information. Based on the structured query statement, the first agent performs a statement matching query in the structured database to obtain the first query result.
3. The method according to claim 1, characterized in that, Based on the question information, the second agent performs a semantic similarity query in an unstructured knowledge base to obtain a second query result, including: Determine the first semantic information of the question information; Based on the first semantic information and the second semantic information of multiple unstructured knowledge included in the unstructured knowledge base, the second intelligent agent determines the semantic similarity between the first semantic information and the second semantic information of the multiple unstructured knowledge. Based on the semantic similarity between the first semantic information and the second semantic information of the plurality of unstructured knowledge, candidate unstructured knowledge whose semantic similarity exceeds the similarity threshold is determined, and the second query result is obtained.
4. The method according to claim 1, characterized in that, The step of determining candidate answer information based on the first query result and the second query result includes: The candidate structured data is mapped to third semantic information; The third semantic information and the candidate unstructured knowledge are weighted and fused to obtain the candidate answer information.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Determine the confidence level and source information of the first target answer information; The first target answer information, the confidence level, and the source information are output on the intelligent question-and-answer interface.
6. The method according to any one of claims 1-4, characterized in that, The method further includes: If the confidence level of the candidate structured data is less than the first confidence threshold, the step of performing a semantic similarity query in the unstructured knowledge base based on the question information by a second agent to obtain a second query result is executed. If the confidence level of the candidate structured data is not less than the first confidence level threshold, logical reasoning and natural language generation are performed on the candidate structured data to obtain second target answer information. The second target answer information is used to describe the candidate structured data in natural language, and the second target answer information includes the logical analysis process of the candidate structured statement.
7. An intelligent question-and-answer device, characterized in that, The device includes: The display module is used to display the intelligent question-and-answer interface, which is used to provide intelligent question-and-answer services through multiple intelligent agents. The acquisition module is used to acquire the input question information based on the input operation on the intelligent question-and-answer interface; The first query module is used to perform a statement matching query in a structured database through a first intelligent agent based on the query information to obtain a first query result. The structured database includes multiple structured data. The first query result is used to indicate whether candidate structured data is found. If the first query result indicates that candidate structured data is found, the first query result includes the candidate structured data. The second query module is used to perform semantic similarity query in the unstructured knowledge base based on the question information through the second intelligent agent to obtain the second query result. The unstructured knowledge base includes multiple unstructured knowledge items, and the second query result includes the queried candidate unstructured knowledge items. The determination module is used to determine candidate answer information through a third intelligent agent based on the first query result and the second query result; The generation module is used to perform logical reasoning and natural language generation on the candidate answer information to obtain first target answer information. The first target answer information is used to describe the candidate answer information in natural language, and the first target answer information contains the logical reasoning process of the candidate answer information.
8. A computer device, characterized in that, The computer device includes a main control module, which includes a processor and a memory. The memory stores at least one piece of program code, which is loaded and executed by the processor to implement the intelligent question-answering method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the intelligent question-answering method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The product stores at least one piece of program code, which is executed by a processor to implement the intelligent question-answering method as described in any one of claims 1 to 6.