Multi-round dialogue method based on large model and thinking chain and related equipment
By adopting a multi-round dialogue method based on large models and thinking chains in the BI system, complex problems of user input are solved, and the traditional BI system is difficult to understand user intentions is achieved, achieving higher query results accuracy and user experience.
Patent Information
- Application Number
- CN202411861570.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-05-13
AI Technical Summary
Traditional BI systems have difficulty in accurately understanding user intentions, resulting in poor accuracy of query results, especially when dealing with complex inputs, multi-table associations, cross-domain analysis or real-time data monitoring.
Using a multi-round dialogue method based on large-scale models and thinking chains, the problem text input by the user is decomposed into a sub-task set containing multiple sub-tasks through the large-scale model, and the integrity and clarity of the sub-task set are verified through the pre-constructed verification knowledge graph to ensure that the problem text is clear and complete enough.
It improves the accuracy of the determination of answer text, reduces the problem of inaccurate answer text caused by user fuzzy input, and improves the processing efficiency and user experience of the BI system.
Smart Images

Figure CN119988541A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a multi-round dialogue method based on a large model and thought chain and related equipment. Background Art
[0002] Business intelligence technology aims to help enterprises extract useful information from large amounts of data to support decision-making and business optimization. In the current intelligent transformation of business intelligence (BI) systems, the ambiguity and complexity of input are still prominent, affecting the user experience and actual application effect of the system.
[0003] BI systems usually rely on user input queries and instructions to generate data analysis results. However, when the user input is not clearly expressed, lacks specific details, or contains ambiguous instructions, it is difficult for the system to accurately understand the user's intentions, which can easily lead to incorrect analysis or irrelevant query results. At the same time, BI systems show great limitations when processing complex inputs such as multi-level and nested queries, especially in scenarios that require multi-table associations, cross-domain analysis, or real-time data monitoring. Complex input requires the BI system to have efficient task decomposition and multi-step logical reasoning capabilities. The predefined query mode of the traditional BI architecture is difficult to flexibly respond to such requirements, resulting in slow response of the BI system and inability to provide comprehensive decision support. Summary of the invention
[0004] In view of this, the purpose of this application is to propose a multi-round dialogue method and related equipment based on a large model and thought chain to solve the problem that traditional BI systems are difficult to accurately understand user intentions, resulting in poor accuracy of query results.
[0005] Based on the above purpose, the first aspect of the present application provides a multi-round dialogue method based on a large model and a thought chain, comprising:
[0006] Receive question text entered by the user;
[0007] Inputting the question text into the big model, and decomposing the question text into a subtask set including a plurality of subtasks through the big model;
[0008] Verifying the subtask set through a pre-built verification knowledge graph to determine whether the question text meets a preset condition; wherein the preset condition is used to determine whether the question text is clear and complete;
[0009] In response to determining that the question text meets a preset condition, a match is searched in a database according to the subtask set to determine an answer text corresponding to the question text.
[0010] Based on the same inventive concept, the second aspect of the present application provides a multi-round dialogue device based on a large model and a thought chain, comprising:
[0011] A receiving module is configured to receive a question text input by a user;
[0012] A decomposition module is configured to input the question text into the large model, and decompose the question text into a subtask set including a plurality of subtasks through the large model;
[0013] A determination module is configured to verify the subtask set through a pre-built verification knowledge graph to determine whether the question text meets a preset condition; wherein the preset condition is used to determine whether the question text is clear and complete;
[0014] The query module is configured to query a match in a database according to the subtask set in response to determining that the question text meets a preset condition, and determine an answer text corresponding to the question text.
[0015] Based on the same inventive concept, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described in the first aspect when executing the computer program.
[0016] Based on the same inventive concept, the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0017] As can be seen from the above, the multi-round dialogue method and related equipment based on the big model and thought chain provided by the present application include receiving a question text input by a user, inputting the question text into the big model, and decomposing the question text into a subtask set containing multiple subtasks through the big model. After receiving the question text, the big model can decompose the complex problem into a series of simple and manageable subtasks, so that it is easier to find a solution. The subtask set is verified by a pre-built verification knowledge graph to determine whether the question text meets the preset conditions; wherein the preset conditions are used to determine whether the question text is clear and complete. The verification knowledge graph can accurately verify whether the question text is clear, and the clarity of the question text directly affects the accuracy of the subsequent answer text. In response to determining that the question text meets the preset conditions, it means that the question text is clear enough and contains information that can achieve accurate query. According to the subtask set, the query match is searched in the database to determine the answer text corresponding to the question text. The method of the present application can improve the accuracy of answer text determination and reduce the problem of inaccurate answer text caused by fuzzy input by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of a multi-round dialogue method based on a large model and a thought chain according to an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a process of determining an answer text according to a subtask set query in an embodiment of the present application;
[0021] Figure 3 A flowchart of a multi-round dialogue method based on a large model and a thought chain according to another embodiment of the present application;
[0022] Figure 4 This is a schematic diagram of the structure of a multi-round dialogue device based on a large model and a thought chain according to an embodiment of the present application;
[0023] Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0025] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0026] As described in the background technology, the BI system integrates a large model. When the user inputs a vague question, the large model may not be able to accurately understand the user's intention, thus affecting the quality and accuracy of the answer. To solve these problems, the BI system needs to enhance its natural language understanding, multi-level query processing, and multi-round dialogue capabilities to better support users' fuzzy input and complex query needs.
[0027] The multi-round dialogue method based on a large model and a thinking chain proposed in this application, after receiving the question text input by the user, semantically understands the question text and decomposes the task through the thinking chain, breaking down the complex problems in the question text into a series of simple and manageable subtasks, so that it is easier to find a solution. At the same time, data relationship knowledge graphs and intent knowledge graphs are also introduced. For subtasks, first retrieve the relevant intents and required parameters from the intent knowledge graph, then determine whether the required parameters exist and whether there is a correlation between the parameters through the data relationship knowledge graph, and then judge whether the question text is clear. If it is not clear, multiple rounds of dialogue and counter-question clarification mechanisms are adopted to make the user input clearer. The above method can improve the accuracy of the large model's answers and reduce the problem of inaccurate answer texts due to fuzzy input.
[0028] After the information is clear, the graph-enhanced big language model will call the knowledge graph to find the most appropriate solution to the question text. This application uses the graph-enhanced big language model to intelligently generate corresponding graph query statements (Graph Query Language, GQL) for each subtask. This can greatly optimize the user experience while improving the performance of the BI system. As the subtasks are solved one by one, the graph-enhanced big language model will gradually build a comprehensive understanding of complex problems. The graph-enhanced big language model integrates the results to form a complete answer text, which is output in the form of a dialogue, improving the processing efficiency and intelligence level of the BI system.
[0029] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0030] This application proposes a multi-round dialogue method based on a large model and thought chain. Figure 1 , including the following steps:
[0031] Step 102: Receive question text input by the user.
[0032] Specifically, the user can input the question text through the query interface of the client, and the user input module of the client is responsible for receiving and processing various input information provided by the user. The user input module provides the user with a friendly query interface and interactive method, so that the user can conveniently input the question text. The question text can be a natural language sentence. For example, the question text input by the user is "query the number of events that occurred in a certain city in 2023".
[0033] Step 104: input the question text into the big model, and use the big model to decompose the question text into a subtask set including multiple subtasks.
[0034] Specifically, the big model acquires natural language understanding capabilities through pre-training. Pre-training means letting the big model learn on a large amount of unlabeled text data, which covers a wide range of content from daily conversations to professional literature, so that the big model can capture the deep-level characteristics and laws of language.
[0035] The core of the large model is usually based on the Transformer architecture, and the core mechanism of the Transformer is the multi-head self-attention mechanism. The power of the large model lies in its deep neural network architecture and advanced training algorithms. The large model is usually composed of hundreds of millions of parameters and can process highly complex language information. In the pre-training stage, the large model learns the grammatical structure, semantic relations, and contextual dependencies of the language, thereby forming a comprehensive and profound understanding of the language.
[0036] Through the big model's ability to think about logical relationships, the problem text is broken down into a subtask set containing multiple subtasks. These subtasks are usually more specific, clear, and easier to solve individually. There is a logical order or priority between multiple subtasks. After the subtask set is determined, the multiple subtasks in the subtask set can be solved and processed in sequence.
[0037] Step 106: verify the subtask set through a pre-constructed verification knowledge graph to determine whether the question text meets preset conditions; wherein the preset conditions are used to determine whether the question text is clear and complete.
[0038] Specifically, the verification knowledge graph is pre-built, and the verification knowledge graph includes the intent knowledge graph and the data relationship knowledge graph. The intent knowledge graph contains common problems and intents in multiple scenarios, and the data relationship knowledge graph contains the associations between data. The intent knowledge graph can help large models better understand and handle subtasks with ambiguous intents. The data relationship knowledge graph can reveal the association and structure between data and help understand the intrinsic connections between data.
[0039] Therefore, by verifying the knowledge graph, it is possible to determine whether the subtasks in the subtask set have clear intentions, whether they contain the necessary parameters required for subsequent search and matching, or whether there are unclear terms, etc. If after verification, it is determined that the question text has unclear intentions, lacks the necessary parameters for search and matching, or contains unclear terms, it can be determined that the question text does not meet the preset conditions, that is, the question text is not clear and complete. On the contrary, it can be determined that the question text meets the preset conditions and is clear and complete enough.
[0040] Step 108: In response to determining that the question text satisfies a preset condition, searching for a match in a database according to the subtask set to determine an answer text corresponding to the question text.
[0041] Specifically, if it is determined that the question text meets the preset conditions, a search and match can be performed based on the question text to provide the answer text required by the user. Based on the question text, a match is queried in the database, and information associated with the question text is determined through the database. After the associated information is sorted, the answer text is obtained.
[0042] Based on the above steps 102 to 108, the multi-round dialogue method based on the big model and the thinking chain provided in this embodiment includes receiving a question text input by a user, inputting the question text into the big model, and decomposing the question text into a subtask set containing multiple subtasks through the big model. After receiving the question text, the big model can decompose the complex problem into a series of simple and manageable subtasks, so that it is easier to find a solution. The subtask set is verified by a pre-built verification knowledge graph to determine whether the question text meets the preset conditions; wherein the preset conditions are used to determine whether the question text is clear and complete. The verification knowledge graph can accurately verify whether the question text is clear, and the clarity of the question text directly affects the accuracy of the subsequent answer text. In response to determining that the question text meets the preset conditions, it means that the question text is clear enough and contains information that can achieve accurate query. According to the subtask set, the database is queried for matching and the answer text corresponding to the question text is determined. The accuracy of answer text determination is improved, and the problem of inaccurate answer text caused by fuzzy input by the user is reduced.
[0043] In some embodiments, decomposing the question text into a subtask set comprising a plurality of subtasks by using a large model includes:
[0044] Perform semantic analysis on the question text through the large model to determine the core intent;
[0045] Based on the core intention, the problem text is divided into tasks through a thought chain mechanism to generate a subtask set including multiple subtasks.
[0046] In this embodiment, the question text is firstly deeply semantically parsed through the big model to analyze the grammatical structure, semantic relationship and contextual dependency of the question text, and then the core intent of the question text is determined. For example, if the question text input by the user is "Which region has the most events in 2023", the core intent is determined to be the number of events compared.
[0047] Chain of Thought is an AI prompt word strategy used to improve the performance of large models in complex reasoning tasks, such as arithmetic reasoning, common sense reasoning, and symbolic reasoning. Chain of Thought refers to breaking down logically complex problems and forming a complete thinking process through a series of logically related thinking.
[0048] The first step of the thinking chain mechanism is problem analysis. Based on the core intention, the big model will conduct an in-depth analysis of the problem to understand its background, requirements and key elements. On this basis, the big model will try to break down the problem into multiple subtasks. These subtasks are usually more specific, clear, and easier to solve individually. The second step is to solve these subtasks in sequence according to a certain logical order or priority. The thinking chain carefully breaks down complex problems into multiple simple and easy-to-handle subtasks. This kind of decomposition helps to gradually get to the essence of the problem and improve the efficiency of problem solving. There is a clear logical relationship between the thinking steps after decomposition, which is usually manifested as causal relationships, progressive relationships, etc. These logical relationships ensure the coherence and consistency of the thinking process. The reasoning process is displayed through the thinking chain, making the reasoning process of the model transparent and explainable, which increases the user's trust and satisfaction with the model. The thinking chain also guides the large language model to get more accurate answers through this process. This guidance helps the model to use the same logic and methods for reasoning when solving similar problems.
[0049] According to the reasoning process of the thought chain, multiple subtasks are generated, and the multiple subtasks are merged into a subtask set. Through the method of this embodiment, the large model performs in-depth semantic analysis on the question text, thereby accurately extracting the core intention behind the user query. The thought chain reasoning mechanism further plays a role, and can cleverly decompose the complex question text raised by the user into multiple interrelated and easy-to-handle subtasks, so that the BI system can solve these subtasks one by one in a more systematic and organized manner, thereby effectively responding to and solving complex problems.
[0050] In some embodiments, the verification knowledge graph includes an intention knowledge graph and a data relationship knowledge graph; the subtask set is verified by the pre-built verification knowledge graph to determine whether the question text meets the preset conditions, including:
[0051] Verifying the integrity of the subtask set through the intention knowledge graph;
[0052] Performing consistency verification on the subtask set through the data relationship knowledge graph;
[0053] In response to the subtask set passing the integrity verification and passing the consistency verification, it is determined that the question text meets a preset condition.
[0054] Specifically, the intent knowledge graph can help large models better understand and handle issues involving intent ambiguity. The data relationship knowledge graph focuses on revealing the correlation and structure between data, helping large models understand the intrinsic connection between data. The data relationship knowledge graph assigns attribute values that describe the essence or meaning of each entity to each entity. These attribute values are used to accurately define and explain the specific meaning of each entity in the graph. Both the intent knowledge graph and the data relationship knowledge graph are pre-built.
[0055] The method for constructing the intent knowledge graph specifically includes: first clarifying user needs, determining application scenarios and goals, and constructing a graph structure containing multi-level intent nodes and relationships by analyzing common problems and intentions of users in different scenarios. The intent knowledge graph contains the core needs of users, such as data query, comparison, ranking, etc. Exemplarily, the nodes in the intent knowledge graph include: data query, data comparison, data ranking, etc. The node attributes (relationships) in the intent knowledge graph include: node identifier (ID), intent description, user input example, and default time value, etc.
[0056] The method for constructing a data relationship knowledge graph specifically includes: ① Using a database driver to connect to different types of databases to obtain data, and clean the data to remove duplicate, erroneous and invalid data. ② Extract entities, extract relationships and assign attributes to the data. ③ Define the format of the data relationship knowledge graph to clarify the types, structures and relationships of various elements in the graph (including nodes, edges and the attributes they carry). ④ Map the data and attribute assignments extracted in step ② according to the graph definition format, and integrate entities, attributes and relationships into a data relationship knowledge graph. Exemplarily, the nodes in the data relationship knowledge graph include "region", "event" and "time", and the attributes corresponding to "region" include region ID, region name, etc. The attributes corresponding to "event" include time ID and event type, etc. The attributes corresponding to "time" include year and quarter, etc. There is a corresponding relationship between the node "region" and the node "event", region→event (event occurs in the region). There is a corresponding relationship between the node "event" and "time", event→time (event occurrence time).
[0057] The integrity of the subtask set is verified by using the intention knowledge graph, specifically including:
[0058] Match the subtask set with the intent knowledge graph to determine the query intent, and determine the required query parameters based on the query intent; and verify the integrity of the subtask set based on the query parameters.
[0059] Completeness verification refers to determining whether the parameters provided by the user are sufficient, such as whether the conditions, ranges or other parameters required for the query are missing. The intent knowledge graph is called by the big model, the subtask set is matched with the intent knowledge graph, the possible query intent is determined, and then the required query parameters are determined based on the query intent.
[0060] Matching methods include:
[0061] ① Direct matching: Determine whether the subtask set directly corresponds to an intent node in the intent knowledge graph. For example, the subtasks in the subtask set include "query the number of events in region 1 in 2023", which directly matches the intent node "data query" in the intent knowledge graph. The required query parameters include time, region ID, and event type.
[0062] ② Multiple matching: If the subtask set cannot directly correspond to a certain intent node in the intent knowledge graph, the multiple matching method can be used. Through the association relationship between intent nodes, the possible intent chain can be gradually inferred. When processing input, the intent knowledge graph also demonstrates the ability to cope with fuzzy input. When the information in the subtask set is slightly vague or not specific enough, the intent knowledge graph can use its rich internal intent definitions and associations to perform intelligent reasoning and judgment. Not only can it capture the key information in the subtask set, but it can also infer the user's most likely true intention based on context and common usage. This ability makes the intent knowledge graph more flexible and intelligent when processing natural language queries, and can provide users with more accurate and personalized services. For example, the subtasks in the subtask set include "the number of events in area 1 and area 2 in the last three months, which one has changed more", and it is obvious that the subtask cannot be directly matched to the intent node in the intent knowledge graph. At this time, it is necessary to first determine the intent of the first step through analysis: data query (querying the number of events in area 1 and area 2 in the last three months), and the required parameters include time, area ID, and event type. The purpose of the second step: data ranking (ranking the results of changes in the number of regional events).
[0063] After determining the query parameters, make sure the subtask set passes integrity verification, including:
[0064] In response to the query parameter being included in the subtask set, it is determined that the subtask set passes the integrity verification. Check whether all query parameters are included in the subtask set. If included, it indicates that there is no missing query parameter problem in the subtask set, and it is determined that the subtask set passes the integrity verification. If all query parameters are not included in the subtask set, it indicates that there is a missing query parameter problem in the subtask set, and it is determined that the subtask set does not pass the integrity verification.
[0065] The consistency verification of the subtask set is performed through the data relationship knowledge graph, including:
[0066] Based on the query parameters, a search and match is performed in the data relationship knowledge graph to verify the consistency of the subtask set.
[0067] The data relationship knowledge graph contains the association relationship between data. The consistency verification is to verify whether the parameters corresponding to the intention of the user input match the data in the data relationship knowledge graph, that is, to determine whether there is an association between the query parameters or whether they are reasonable. The function of the data relationship knowledge graph is parameter verification and structure verification. The specific search and matching process is: match the query parameters with the entities and attributes in the data relationship knowledge graph, check whether the query parameters exist and whether the relationship between the query parameters is reasonable. Exemplarily, verify whether the query parameters exist in the data relationship knowledge graph. If not, it means that the query parameters are invalid parameters. For example, verify whether there is a connection relationship between two query parameters. If not, it means that the relationship between the query parameters is unreasonable.
[0068] Accordingly, the subtask set passes the consistency verification, including:
[0069] In response to the existence of entities and attributes related to the query parameters in the data relationship knowledge graph, it is determined that the subtask set passes the consistency verification.
[0070] After the search matches, if it is determined that entities and attributes related to the query parameters exist in the data relationship knowledge graph, the subtask set is determined to pass the consistency verification. If there are query parameters in the query parameters that do not exist in the data relationship knowledge graph, it means that the query parameters belong to undefined terms or newly created words, and the question text entered by the user has unclear information and does not meet the preset conditions.
[0071] Through the method of this embodiment, the user's query intention and the parameters required for the query can be accurately determined. Through integrity verification, it can be determined whether the subtask set contains all the parameters required for accurate query. If not, it is determined that the question text lacks key information, the question text information is unclear, and does not meet the preset conditions. Through consistency verification, it can be determined whether the relationship between the query parameters required by the user's query intention is reasonable, and whether undefined words appear. If undefined words appear, it is determined that the question text information is unclear and does not meet the preset conditions. The verification method of verifying the knowledge graph in this embodiment is conducive to improving the accuracy of subsequent queries, thereby improving the accuracy of the answer text and ensuring the user experience.
[0072] In some embodiments, the database includes a graph database; the step of searching for matches in the database according to the subtask set to determine the answer text corresponding to the question text includes:
[0073] The subtask set is input into the knowledge graph enhanced large model, and a graph query statement is output through the knowledge graph enhanced large model; a query is performed in the graph database according to the graph query statement to obtain an answer text corresponding to the question text.
[0074] Specifically, after determining that the question text information is clear, the answer text can be further matched according to the subtask set, and the answer text can be fed back to the user. The database in this embodiment is a graph database, which includes a data relationship knowledge graph, an intention knowledge graph, and other domain knowledge graphs. The graph query statement is constructed by enhancing the large model through the knowledge graph, and the corresponding answer text is obtained by searching and matching in the graph database according to the graph query statement.
[0075] The knowledge graph enhanced big model is a big language model enhanced by the knowledge graph. Although the big language model has excellent natural language generation capabilities, it often faces some challenges in knowledge-intensive tasks, such as the possibility of generating illusions or factual errors. Therefore, in some specific scenarios, it is necessary to supplement the big language model with external knowledge information, and enhance the capabilities of the big model through graph enhancement, which is called the knowledge graph enhanced big model. The knowledge graph (KG) stores a large amount of structured knowledge information and is often used in knowledge-intensive task scenarios. It is also widely used to supplement the knowledge information of the big language model.
[0076] In this embodiment, for each subtask, the knowledge graph-enhanced big model intelligently generates the corresponding graph query language (GQL), which is a structured query statement. The knowledge graph-enhanced big model follows the context constraints and semantic logic provided by the knowledge graph when generating graph query statements. The graph query statements carry the structural relationship of the knowledge graph, which can avoid generating inaccurate queries.
[0077] When generating graph query statements, the knowledge graph enhanced big model will dynamically select the appropriate query template according to the task requirements. The knowledge graph enhanced big model will not only generate statements based on the standard query template, but also adjust the template according to the specific needs of the user. The intelligently generated graph query statements can accurately match the specific needs of each subtask. This means that users do not need to manually write complex query statements. The BI system equipped with the knowledge graph enhanced big model can automatically generate the optimal query solution based on the user's intentions, greatly reducing the threshold for use. Intelligently generated graph query statements also bring significant improvements in efficiency. By automatically generating query statements, the BI system can quickly respond to user requests, reduce waiting time, and improve overall processing efficiency.
[0078] GQL templates refer to general query structures generated based on the requirements of query tasks. They can contain placeholders and conditions for subsequent filling of specific query parameters. The design of GQL templates allows large models or systems to quickly generate appropriate query statements, customized based on user input and task requirements. Examples of common GQL query templates are as follows:
[0079] ①Query node template
[0080] MATCH(n:Label)
[0081] WHERE n.property=$value
[0082] RETURN
[0083] Function: Use the MATCH statement to query nodes with a specific label (Label), where the node's property (property) is equal to a specific value ($value).
[0084] Purpose: Used to query nodes under specific conditions. For example, Label can be an event, and property can be time. For example, query all events that occurred in 2023.
[0085] ②Query edge template
[0086] MATCH(n1:Label1)-[r:RELATION_TYPE]->(n2:Label2)
[0087] WHERE n1.property=$value1 AND n2.property=$value2
[0088] RETURN
[0089] Function: Use the MATCH statement to query the specific relationship between two nodes (Label1 and Label2) and meet specific attribute conditions.
[0090] Purpose: Used to query the relationship between two entities. For example, query the relationship between an event and a region, where Label1 is the event Event, Label2 is the region Region, and RELATION_TYPE is EVENT_REGION.
[0091] ③Aggregation query template
[0092] MATCH(n:Label)-[r:RELATION_TYPE]->(m:Label)
[0093] WHERE n.property=$value
[0094] RETURN COUNT(r)
[0095] Function: Calculate the number of specific relationships between a node and other nodes through the MATCH statement.
[0096] Purpose: Used to query the number of occurrences of a certain type of event in an area.
[0097] ④Path query template
[0098] MATCH p=(n1:Label1)-[*]->(n2:Label2)
[0099] WHERE n1.property=$value1 AND n2.property=$value2
[0100] RETURN p
[0101] Function: Use the MATCH statement to query the path from node n1 to node n2. The path length is variable.
[0102] Usage: For example, to query whether there is a path or association between a user and a specific target node.
[0103] In actual applications, the GQL template is not fixed, but dynamically generated. Based on the understanding of the knowledge graph enhanced big model and the complexity of user needs, the knowledge graph enhanced big model can generate appropriate GQL templates based on intent, context, and task requirements. For example, for a complex query request, the knowledge graph enhanced big model may need to generate a complex query template containing multiple MATCH, RETURN, and WHERE clauses.
[0104] Furthermore, after the graph query statement is generated, the graph query statement can be optimized to remove redundant queries, merge similar query conditions, and improve the execution efficiency of subsequent query processes. In addition, an index can be established in the graph database to improve the query speed through the index. After the graph query statement is optimized, the query process is executed to query the graph query statement in the graph database to retrieve relevant data. After the graph database returns the relevant data, the relevant data can be further processed and filtered to ensure that the data format meets the requirements of the answer text, and finally the answer text for the question text is obtained.
[0105] Figure 2 FIG. 4 shows a flow chart of determining the answer text according to the subtask set query. Figure 2 As shown in the figure, the subtask set contains three subtasks, namely Task 1, Task 2 and Task 3. After the subtask set is input into the knowledge graph enhanced large model, query statement 1 is generated according to Task 1, query statement optimization operation is performed, and then the graph database is called to execute the query. Query statement 2 is generated according to Task 2, query statement optimization operation is performed, and then the graph database is called to execute the query. Query statement 3 is generated according to Task 3, query statement optimization operation is performed, and then the graph database is called to execute the query. Finally, the query result, that is, the answer text, is output.
[0106] For example, the question text input by the user is "Comparison of event data in Region 1 and Region 2 in 2023". The subtask set is determined through the semantic analysis of the big model and the decomposition of the thinking chain, including subtask 1: obtaining the number of events in Region 1 in 2023; subtask 2: obtaining the number of events in Region 2 in 2023; subtask 3: comparing the number of events in Region 1 and Region 2 based on the results of subtasks 1 and 2.
[0107] After inputting the subtask set into the knowledge graph enhanced large model, the graph query statement 1 generated for subtask 1 is:
[0108] MATCH(e:Event{region:'region 1'})
[0109] WHERE e.date>=date('2023-01-01')ANDe.date<=date(2023-12-31')
[0110] RETURN count(e) total number of events in AS region 1;
[0111] The graph query statement 2 generated for subtask 2 is:
[0112] MATCH(e:Event{region:'region 2'})
[0113] WHERE e.date>=date(2023-01-01')ANDe.date<=date(2023-12-31')
[0114] RETURN count(e) total number of events in AS region 2;
[0115] The graph query statement 3 generated for subtask 3 is:
[0116] WITH $region1 total events AS region1 total events, $region2 total events AS region2 total events
[0117] RETURN Total number of events in region 1, total number of events in region 2, abs(total number of events in region 1 - total number of events in region 2) AS event quantity difference.
[0118] Execute queries in the graph database according to graph query statement 1, graph query statement 2, and graph query statement 3 respectively, and input the query results as answer text.
[0119] In some embodiments, the method further comprises:
[0120] In response to determining that the question text does not meet the preset condition, multiple rounds of dialogue are conducted with the user according to the question text, and the following operations are performed for each round of dialogue:
[0121] Determine and output prompt information based on the question text; receive reply information from the user in response to the prompt information, and determine whether the reply information meets preset conditions; if the reply information does not meet the preset conditions, determine prompt information for the next round of dialogue based on the reply information; or, if the reply information meets the preset conditions, exit the multiple rounds of dialogue and update the subtask set based on the reply information.
[0122] Specifically, if it is determined that the question text does not meet the preset conditions, it is necessary to conduct multiple rounds of dialogue with the user to clarify the information contained in the question text. Multiple rounds of dialogue are used for: ① Dynamic counter-questioning: When the user input information is unclear, the BI system can clarify the specific requirements (such as missing parameters, expected result range, etc.) through dynamic questioning. ② Context memory: The BI system keeps the memory of the dialogue context in multiple rounds of dialogue to ensure that the user does not have to repeat the information provided.
[0123] For each round of dialogue, the prompt information is determined based on the question text. If the question text lacks query parameters, such as the query time range, location and other necessary query parameters, the prompt information can be to prompt the user to enter the time range and location. If the question text contains unreasonable query parameters, such as the query parameters are inconsistent with the data in the data relationship knowledge graph, the prompt information can be to prompt the user to adjust the query parameters. If the question text contains ambiguous or ambiguous content, the prompt information can be to ask the user to confirm the specific intention.
[0124] The user will respond to the prompt information to generate a reply message, and the big model will determine whether the reply information meets the preset conditions, that is, whether the reply information is clear. If the reply information is clear, the multi-round dialogue will be stopped, and the subtask set will be updated according to the user's reply information. Then, based on the updated subtask set, the big model will be enhanced by the knowledge graph to generate a graph query statement and execute the query. If the reply information is unclear, a new prompt information can be generated based on the unclear content in the reply information, and the next round of dialogue will continue with the user until the reply information entered by the user is clear.
[0125] For example, the question text entered by the user is "Query events in a certain city in 2023", and the BI system analysis results include: the user wants to query the "event" information of a certain city in 2023, but did not provide the city name, nor did it specify whether the number, type or distribution of events needs to be queried. Therefore, the corresponding prompt information 1 generated is: "Which specific city do you want to query? And do you need to query the number of events, the distribution of event types, or other information?" The reply information 1 fed back by the user in response to prompt information 1 is "Beijing, number of events." The BI system confirms that the intention of reply information 1 is to query the number of events that occurred in Beijing in 2023.
[0126] To ensure the accuracy of the query, the BI system also refines the problem. The specific analysis results are as follows: ① Determine the statistical scope of events. Does it include all types of events? Or is it limited to certain event types? ② Determine the specificity of time. Does it need to be monthly, quarterly, or only the total number? ③ Determine the output format: return only the total number or provide a detailed distribution of event types?
[0127] According to the analysis process of the above system, the system gives prompt information 2 again: "Do you want to query the number of all events in Beijing in 2023? Are there any specific event types? In addition, do you want the results to be broken down by month or quarter?" The user's response information 2 based on prompt information 2 is "Only query major events, and count them by quarter." The system confirms the user's final query intention based on response information 2 and outputs "OK, you want to query the number of major events in Beijing in 2023, and count the results by quarter."
[0128] Through the method of this embodiment, when the user input information is unclear, the BI system will start a multi-round dialogue process. Through dynamic counter-questions and context memory functions, the system can gradually guide users to clarify specific needs and supplement or correct missing query parameters. In multiple rounds of dialogue, the system will update the query intent and query parameters based on the feedback provided by the user to determine whether the reply information is clear enough. In order to improve user experience and efficiency, the BI system will also take measures such as intelligent recommendation, user guidance and error handling. After confirming that the user information is clear and meets the query requirements, the BI system will update the query parameters and enter the knowledge graph enhanced large model to generate a graph query statement and execute the query. The entire process is designed to ensure that users can accurately express their needs and obtain satisfactory query results.
[0129] It should be noted that the embodiments of the present application can be further described in the following manner:
[0130] Figure 3 FIG. 2 shows another flowchart of a multi-round dialogue method based on a large model and a thought chain. Figure 3 As shown in the figure, the user inputs the question text, and the semantic understanding is performed through the big model and the task is decomposed through the thought chain mechanism to obtain the subtask set. The intention knowledge graph and the data relationship knowledge graph are used to determine whether the subtask set has clear information. If it is clear, the knowledge graph is used to enhance the big model to generate a graph query statement for each subtask and execute the query in the graph database, and finally output the result as the answer text. If it is not clear, multiple rounds of dialogue are conducted with the user based on the unclear content in the question text to obtain the reply information, and the question text entered by the user is updated based on the clear reply information.
[0131] In summary, this embodiment completes the intelligence of the generative BI system by introducing a large model, a knowledge graph, a thinking chain reasoning mechanism and a multi-round dialogue function. By using the thinking chain technology, complex problems or tasks can be broken down into a series of interrelated and logically clear subtasks or thinking steps. This method enables the system to solve these subtasks one by one in a more systematic and organized manner, thereby effectively responding to and solving complex problems. By introducing the data relationship knowledge graph and the intention knowledge graph, the clarity of the user input can be verified. In response to vague questions raised by users, multi-round dialogues and rhetorical clarification techniques are used to obtain the user's reply information to ensure that vague problems are effectively solved. The knowledge graph-enhanced large model can directly reference the facts and relationship information in the graph, and improve the accuracy of dialogue, reasoning and information extraction. The automatic generation of graph query statements lowers the user's usage threshold, and the output data can be happily understood through dialogue, thereby better promoting problem solving and decision making.
[0132] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0133] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0134] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a multi-round dialogue device based on a large model and a thinking chain.
[0135] refer to Figure 4 The multi-round dialogue device based on the large model and thought chain includes:
[0136] The receiving module 402 is configured to receive a question text input by a user;
[0137] A decomposition module 404 is configured to input the question text into a large model, and decompose the question text into a subtask set including a plurality of subtasks through the large model;
[0138] The determination module 406 is configured to verify the subtask set through a pre-built verification knowledge graph to determine whether the question text meets a preset condition; wherein the preset condition is used to determine whether the question text is clear and complete;
[0139] The query module 408 is configured to query a match in a database according to the subtask set in response to determining that the question text meets a preset condition, and determine an answer text corresponding to the question text.
[0140] In some embodiments, the decomposition module 404 is configured to perform semantic analysis on the question text through the large model to determine the core intent; based on the core intent, the question text is divided into tasks through a thinking chain mechanism to generate a subtask set containing multiple subtasks.
[0141] In some embodiments, the verification knowledge graph includes an intent knowledge graph and a data relationship knowledge graph; the determination module 406 is configured to perform integrity verification on the subtask set through the intent knowledge graph; perform consistency verification on the subtask set through the data relationship knowledge graph; in response to the subtask set passing the integrity verification and the consistency verification, determine that the problem text meets the preset conditions.
[0142] In some embodiments, the determination module 406 is configured to match the subtask set with the intent knowledge graph, determine the query intent, and determine the required query parameters based on the query intent; perform integrity verification on the subtask set based on the query parameters; and determine that the subtask set passes the integrity verification in response to the query parameters being included in the subtask set.
[0143] In some embodiments, the determination module 406 is configured to perform search and matching in the data relationship knowledge graph based on the query parameters to verify the consistency of the subtask set; in response to the presence of entities and attributes related to the query parameters in the data relationship knowledge graph, determine that the subtask set passes the consistency verification.
[0144] In some embodiments, the database includes a graph database; the query module 408 is configured to input the subtask set into the knowledge graph enhanced big model, and output a graph query statement through the knowledge graph enhanced big model; and perform a query in the graph database according to the graph query statement to obtain an answer text corresponding to the question text.
[0145] In some embodiments, it also includes a multi-round dialogue module, which is configured to, in response to determining that the question text does not meet the preset conditions, conduct multiple rounds of dialogues with the user based on the question text, and perform the following operations for each round of dialogue: determine and output prompt information based on the question text; receive reply information from the user to the prompt information, and determine whether the reply information meets the preset conditions; if the reply information does not meet the preset conditions, determine the prompt information for the next round of dialogue based on the reply information; or, if the reply information meets the preset conditions, exit the multiple rounds of dialogue and update the subtask set based on the reply information.
[0146] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0147] The device of the above embodiment is used to implement the corresponding multi-round dialogue method based on the big model and thinking chain in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0148] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the multi-round dialogue method based on the large model and thinking chain described in any of the above embodiments is implemented.
[0149] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0150] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0151] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0152] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0153] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0154] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0155] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0156] The electronic device of the above embodiment is used to implement the corresponding multi-round dialogue method based on the large model and thought chain in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0157] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the multi-round dialogue method based on the big model and thinking chain as described in any of the above embodiments.
[0158] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0159] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the multi-round dialogue method based on the big model and thinking chain as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0160] Based on the same concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the method described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.
[0161] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.
[0162] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0163] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to the electronic device providing personal information.
[0164] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0165] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0166] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0167] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0168] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A multi-round dialogue method based on a large model and thought chain, characterized in that: include: Receive question text entered by the user; Inputting the question text into the big model, and decomposing the question text into a subtask set including a plurality of subtasks through the big model; Verifying the subtask set through a pre-built verification knowledge graph to determine whether the question text meets a preset condition; wherein the preset condition is used to determine whether the question text is clear and complete; In response to determining that the question text meets a preset condition, a match is searched in a database according to the subtask set to determine an answer text corresponding to the question text.
2. The method according to claim 1, characterized in that The problem text is decomposed into a subtask set including multiple subtasks by using a large model, including: Perform semantic analysis on the question text through the large model to determine the core intent; Based on the core intention, the problem text is divided into tasks through a thought chain mechanism to generate a subtask set including multiple subtasks.
3. The method according to claim 1, characterized in that The verification knowledge graph includes an intention knowledge graph and a data relationship knowledge graph; the subtask set is verified by the pre-built verification knowledge graph to determine whether the question text meets the preset conditions, including: Verifying the integrity of the subtask set through the intention knowledge graph; Performing consistency verification on the subtask set through the data relationship knowledge graph; In response to the subtask set passing the integrity verification and passing the consistency verification, it is determined that the question text meets a preset condition.
4. The method according to claim 3, characterized in that The integrity verification of the subtask set by using the intention knowledge graph includes: Matching the subtask set with the intention knowledge graph to determine the query intention, and determining the required query parameters according to the query intention; and verifying the integrity of the subtask set according to the query parameters; The subtask set passes the integrity verification, including: In response to the subtask set including the query parameter, it is determined that the subtask set passes the integrity verification.
5. The method according to claim 4, characterized in that The consistency verification of the subtask set through the data relationship knowledge graph includes: Based on the query parameters, searching and matching is performed in the data relationship knowledge graph to verify the consistency of the subtask set; The subtask set passes the consistency verification, including: In response to the existence of entities and attributes related to the query parameters in the data relationship knowledge graph, it is determined that the subtask set passes the consistency verification.
6. The method according to claim 1, characterized in that The database includes a graph database; the querying and matching in the database according to the subtask set to determine the answer text corresponding to the question text includes: Input the subtask set into the knowledge graph enhanced large model, and output a graph query statement through the knowledge graph enhanced large model; A query is performed in the graph database according to the graph query statement to obtain an answer text corresponding to the question text.
7. The method according to claim 1, characterized in that The method further comprises: In response to determining that the question text does not meet the preset condition, multiple rounds of dialogue are conducted with the user according to the question text, and the following operations are performed for each round of dialogue: Determine and output prompt information according to the question text; Receive a reply from the user to the prompt information, and determine whether the reply meets a preset condition; If the reply information does not meet the preset condition, determining the prompt information for the next round of dialogue according to the reply information; or, If the reply information meets the preset condition, the multi-round dialogue is exited, and the subtask set is updated according to the reply information.
8. A multi-round dialogue device based on a large model and a thought chain, characterized in that: include: A receiving module is configured to receive a question text input by a user; A decomposition module is configured to input the question text into the large model, and decompose the question text into a subtask set including a plurality of subtasks through the large model; A determination module is configured to verify the subtask set through a pre-built verification knowledge graph to determine whether the question text meets a preset condition; wherein the preset condition is used to determine whether the question text is clear and complete; The query module is configured to query a match in a database according to the subtask set in response to determining that the question text meets a preset condition, and determine an answer text corresponding to the question text.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Automobile maintenance question and answer method and device, terminal equipment and storage medium
CN121210600A