Query answering method and device, and electronic device
By extracting business metadata from the intelligent question-answering system and using intent flow graphs and multi-dimensional intent vector matching technology to dynamically generate execution paths, the problem of existing technologies being unable to identify complex query text intents is solved, resulting in more accurate responses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2026-05-19
- Publication Date
- 2026-06-16
AI Technical Summary
Existing intelligent question-answering systems cannot accurately identify the user's specific business scenario when processing query texts containing multiple intents, resulting in low accuracy of the response text.
By extracting business metadata from the query text, enhanced text is generated. Then, using intent flow graphs and multidimensional intent vector matching technology, execution paths are dynamically generated. By combining historical enhanced text and response text, multiple business intents are identified, and accurate response text is generated.
It enables accurate responses to complex business scenarios, improves the accuracy of generated response text, and avoids intent omissions caused by triggering a single keyword.
Smart Images

Figure CN122220482A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to query response methods, apparatus and electronic devices. Background Technology
[0002] In practical applications, intelligent question answering systems often adopt a response method based on fixed rule templates. That is, they trigger a preset execution process based on keywords (such as "query" or "analysis") in the user's query text. For example, when the word "analysis" appears in the query text, a fixed risk analysis process is triggered.
[0003] However, when the user's query text contains multiple keywords, this response method will only trigger the execution process of one keyword (such as the first keyword identified). At the same time, the execution process corresponding to each keyword is also fixed, and it cannot identify the specific business scenario (such as project type, amount range, etc.) corresponding to the user's query text. This will result in low accuracy of the generated response text. Summary of the Invention
[0004] In view of this, this application provides a query response method, apparatus, and electronic device to improve the accuracy of generating response text.
[0005] The technical solution provided in this application is as follows: According to an embodiment of the first aspect of this application, a query response method is provided, the method comprising: The business metadata of the current query text is placed in the specified position of the current query text to generate the current enhanced text; the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1; Obtain historical enhanced texts associated with the current enhanced text, as well as historical response texts corresponding to the historical enhanced texts; wherein, the historical enhanced texts are generated based on historical query texts, the business metadata in the historical enhanced texts includes metadata of the business involved in the historical query texts under the N indicator dimensions, and the historical response texts are replies to the historical query texts; A multidimensional intent vector is generated based on the current enhanced text, historical enhanced text, and the historical response text. A target business node that matches the multidimensional intent vector is found in the existing intent flow graph. The intent flow graph includes the dependencies between multiple business nodes. Each business node has a corresponding feature vector and a corresponding response method. The multidimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirement. Based on the dependency relationship between each business node in the intent flow graph and the target business node, a business execution path containing the target business node is generated, so as to generate the response text of the current query text using the response method corresponding to each business node in the business execution path.
[0006] According to an embodiment of a second aspect of this application, a query response apparatus is provided, the apparatus comprising: The first generation unit is used to place the business metadata of the current query text into a specified position of the current query text to generate the current enhanced text; the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1; The obtaining unit is used to obtain historical enhanced text associated with the current enhanced text and historical response text corresponding to the historical enhanced text; wherein, the historical enhanced text is generated based on historical query text, the business metadata in the historical enhanced text includes metadata of the business involved in the historical query text under the N indicator dimensions, and the historical response text is a reply to the historical query text; The search unit is used to generate a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and the historical response text, and to find a target business node that matches the multi-dimensional intent vector in an existing intent flow graph; the intent flow graph includes the dependencies between multiple business nodes; each business node has a corresponding feature vector and a corresponding response method, and the multi-dimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirement; The second generation unit is used to generate a business execution path containing the target business node based on the dependency relationship between each business node in the intent flow graph and the target business node, so as to generate the response text of the current query text using the response method corresponding to each business node in the business execution path.
[0007] According to an embodiment of a third aspect of this application, an electronic device is provided, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor being configured to execute the machine-executable instructions to perform the method as described in the first aspect.
[0008] As can be seen from the above technical solutions, the proposed solution, upon receiving a user query text, obtains historical enhanced text and historical answer text related to the business context of the query text through metrics used to represent the business. This enables accurate perception and understanding of the specific business scenario involved in the user query. By generating a multi-dimensional intent vector representing the user's intent and matching it in the intent flow graph, multiple business intents included in the query text can be identified and processed simultaneously, avoiding intent omissions caused by triggering based on a single keyword. Furthermore, execution paths are dynamically generated based on the dependencies between nodes in the intent flow graph, replacing rigid fixed processes and achieving accurate responses adapted to complex business scenarios, thus improving the accuracy of the generated response text. Attached Figure Description
[0009] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the principles of this application.
[0010] Figure 1 A flowchart illustrating the method provided in this application embodiment; Figure 2 This is a diagram illustrating the overall architecture of the model provided in the embodiments of this application. Figure 3 A schematic diagram of a long-term memory layer provided for an embodiment of this application; Figure 4 A schematic diagram of the path planning layer provided in an embodiment of this application; Figure 5 This is a structural diagram of the device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0011] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0012] In intelligent question-answering systems within related technologies, a common response method is a fixed-process response method based on keyword matching.
[0013] In this method, the system searches for predefined keywords in the user's query text. For example, in professional business scenarios such as bidding and financial analysis, "query," "analysis," and "comparison" are used as predefined keywords. When a keyword is matched, a pre-defined fixed operation process corresponding to that keyword is triggered.
[0014] For example, when a user asks "to find the tenderer of project A", the system recognizes the keyword "search" and will automatically execute the fixed operation process of "searching for the project number in the project database and returning the result".
[0015] It is evident that this response method relies entirely on keywords and pre-defined operational procedures, failing to grasp the specific business context behind the question. For instance, regarding the query text "Query the tendering party for project A," the solutions in the relevant technologies cannot distinguish whether the user is querying an "EPC (Engineering, Procurement and Construction) project" or a "software development project," and therefore may be unable to accurately filter information.
[0016] Furthermore, when the query text contains multiple intents (such as multiple keywords), taking the query text "Analyze the risks of Project B and predict the probability of winning the bid" as an example, the system often can only capture one intent, such as triggering the fixed operation process corresponding to the first identified keyword "analysis", while ignoring the user's other intents. This results in a more one-sided and incomplete response that is difficult to meet the complex actual business consultation needs.
[0017] Based on this, this application proposes a query response method to improve the accuracy of the generated response text.
[0018] Please refer to Figure 1 , Figure 1 A flowchart illustrating the method provided in this application embodiment.
[0019] like Figure 1 As shown, the method may include the following steps: Step 101: Place the business metadata of the current query text into the specified location of the current query text to generate the current enhanced text.
[0020] Among them, the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1.
[0021] In this embodiment, the current query text can be text information manually entered by the user, or text information obtained by speech recognition of the user's voice query information. This application does not impose any restrictions on this.
[0022] In order to clearly identify the business that the query text targets, business metadata can be extracted from the user's query text. This business metadata includes metadata of the business involved in the query text across N indicator dimensions.
[0023] In bidding scenarios, common indicator dimensions may include "project type", "amount range", "time interval", etc., and this application does not impose any restrictions on these.
[0024] As an example, the business metadata of the current query text can be obtained according to the following method: Determine if a business identifier exists in the current query text; the business identifier can be a project number, project name, or other identifier used to uniquely identify the target business.
[0025] For example, for the query text "User inquiry: Bidding time of project ZH-2024-038", the business identifier "ZH-2024-038" can be directly extracted using regular expressions or Named Entity Recognition (NER) technology.
[0026] If a business identifier exists in the current query text, the business identifier is extracted from the query text, and a query is performed based on the business identifier to check whether there is a business in the preset business knowledge base (such as a project information database) that matches the business identifier.
[0027] In this embodiment, the knowledge base can be a structured database that records complete information corresponding to each business identifier. Each record can be stored in a key-value format, for example, with the business identifier as the key and the parameters of the business caused by that business identifier under various indicator dimensions as the value.
[0028] For example, records stored in a knowledge base can be in the following forms:
[0029] If a business matching the business identifier is found, the original information of that business under the N preset indicator dimensions is retrieved from the business knowledge base.
[0030] In this embodiment, the knowledge base can be queried to see if there is a record matching the project number, using "ZH-2024-038" as the key.
[0031] If a record is successfully matched, the values of fields such as "Project Type," "Amount," and "Project Initiation Date" are directly read from that record as the original information of the business metadata of the query text. For example, the original information obtained is: {Project Type: EPC, Amount: 323 million yuan, Time: 2026-02-08}.
[0032] If no matching business identifier is found, or if no business identifier exists in the current query text, feature extraction is performed directly on the current query text to determine the original information under the N indicator dimensions of the current query text.
[0033] For example, if the query text is "Analyze the risks of EPC projects worth approximately 300 million yuan initiated last quarter", the original information under N indicator dimensions of the query text can be extracted through methods such as large language models, and the original information can be obtained as follows: {Project type: EPC, Amount: 300 million yuan, Time: Last quarter}.
[0034] After obtaining the original information, the original information is mapped to predefined category labels, and the business metadata of the current query text is determined based on the category labels.
[0035] In this embodiment, regardless of which method is used to obtain the original information, it will be further mapped to a predefined category label according to preset rules.
[0036] For example, for the dimension of "amount", the original information obtained is a specific value, such as 300 million mentioned above. Here, a series of non-overlapping amount ranges can be predefined, and the original information belonging to the amount range can be classified into the category label corresponding to the amount range.
[0037] For example, if the amount is less than 100 million yuan, the category label can be: less than 100 million yuan; if the amount is between 100 million yuan and 500 million yuan, the category label can be: 100 million to 500 million yuan; if the amount is between 500 million yuan and 1 billion yuan, the category label can be: 500 million to 1 billion yuan; if the amount is ≥ 1 billion yuan, the category label can be: more than 1 billion yuan.
[0038] After obtaining the original information, the original information (e.g., 300 million) can be compared with various amount ranges to determine the amount range (100 million to 500 million) to which the original information belongs. Then, the category label corresponding to the original information can be determined as 100 million to 500 million. At this time, the metadata of this dimension can be standardized as [amount = 100 million to 500 million].
[0039] For example, for the dimension of "project initiation date", the raw information obtained can also be a specific date, such as 2026-02-08 mentioned above. Here, the date range can be divided according to fixed quarters, and the raw information belonging to the date range can be classified into the category label corresponding to the date range.
[0040] For example, the category label for January to March could be Q1; the category label for April to June could be Q2; the category label for July to September could be Q3; and the category label for October to December could be Q4.
[0041] After obtaining the original information, the original information (e.g., 2026-02-08) can be compared with each date range to determine the amount range (Q1) to which the original information belongs, and then the category label corresponding to the original information can be determined as 2026Q1. At this time, the metadata of this dimension can be standardized as [Project Initiation Date = 2026Q1].
[0042] It should be noted that for some vague descriptions of dates, such as "last quarter", we can estimate them by combining them with the current date. For example, if the current date is February 2026, then "last quarter" is the fourth quarter of 2025. That is, we can determine that the category label corresponding to the original information is 2025Q4. At this time, the metadata of this dimension can be standardized as [project initiation date = 2025Q4].
[0043] For example, regarding the "project type" dimension, the original information may be abbreviations, acronyms, full names, etc. For instance, EPC and engineering general contracting actually represent the same business. Therefore, a standard list of business types and their equivalent name mappings can be maintained, for example: {Category label: "EPC", equivalent name: "engineering general contracting"}.
[0044] After obtaining the original information, it can be matched with the category labels and equivalent names in the standard business type list so that the equivalent names representing the same business are mapped to the same category label.
[0045] The following is a general example to describe the format of business metadata: Assuming the current query text is: "User inquiry: Bidding time of project ZH-2024-038", querying the knowledge base reveals that the project type is EPC, the amount is 300 million, and the bidding time is May 2024. Then, according to the preset rules, it is mapped to the predefined category label, and the final business metadata is: [Project type=EPC][Amount=100 million~500 million][Time=2024Q2].
[0046] In this embodiment, after obtaining the business metadata of the current query text, the business metadata can be placed in a specified position of the current query text to generate the current enhanced text.
[0047] As an example, business metadata in a specified format can be appended to the beginning of the current query text to obtain the current enhanced text.
[0048] For example, taking the above example, the final enhanced text is: "[Project Type=EPC][Amount=100 million~500 million][Time=2024Q2] User inquiry: Bidding time for project ZH-2024-038".
[0049] This is merely an exemplary description. In this embodiment, business metadata can also be appended to other positions in the current query text, such as appending it to the end of the current query text. This application does not impose any limitations on this.
[0050] This concludes the description of step 101. We will now proceed to step 102.
[0051] Step 102: Obtain the historical enhanced text associated with the current enhanced text, and the historical response text corresponding to the historical enhanced text.
[0052] Among them, the historical enhanced text is generated based on the historical query text. The business metadata in the historical enhanced text includes the metadata of the business involved in the historical query text under N indicator dimensions, and the historical response text is the reply to the historical query text.
[0053] In related technologies, intelligent question-answering systems typically respond solely based on the literal content of the current query text. Their workflow involves analyzing keywords in the current question, triggering a pre-defined execution process, and directly generating the answer based on that process. This process does not effectively utilize the contextual information from past dialogues.
[0054] In this embodiment, after obtaining the current enhanced text through step 101, the metadata carried in the current enhanced text can be further utilized to obtain the historical enhanced text associated with the current enhanced text, and the historical response text corresponding to the historical enhanced text can be further obtained. The historical enhanced text and the historical response text are used as the associated context information of the current enhanced text.
[0055] As one example, a specific method for obtaining historical enhanced text associated with the current enhanced text may include: Based on the metadata of the N indicator dimensions contained in the current enhanced text, determine the target business scenario corresponding to the current enhanced text; In the vector database, query the target storage area corresponding to the target business scenario; the vector database is pre-configured with multiple business scenarios, each business scenario is defined by a combination of specific metadata values under N indicator dimensions; the historical enhanced text vectors corresponding to the historical enhanced text belonging to the same business scenario are stored in the same physical storage area; Based on the similarity between the current text vector corresponding to the current enhanced text and the historical enhanced text vectors in the target storage area, the historical enhanced texts associated with the current enhanced text are determined.
[0056] In this embodiment, the target business scenario to which the current query text belongs can be determined based on the structured business metadata concatenated from the header of the current enhanced text.
[0057] For example, a business scenario can be uniquely defined by a combination of specific metadata values across N metric dimensions. In the bidding and tendering field, a business scenario can be uniquely identified by a triple (project type, amount range, time interval).
[0058] In this embodiment, a vector database is pre-maintained to store the historical enhanced text vectors corresponding to the historical enhanced text. The vector database is pre-configured to be sharded according to business scenarios. During initialization, the vector database will pre-create multiple logically independent collections or partitions based on all preset business scenarios. Each collection can be named according to the metadata combination of the corresponding business scenario (for example, the collection name is Collection_EPC_1-500 million_2024Q2), and a direct mapping from the business scenario to the physical storage area is established.
[0059] In this embodiment, all historical enhanced text vectors belonging to the same business scenario (e.g., [Project Type = EPC] [Amount = 100 million to 500 million] [Time = 2024Q2]) can be stored in the same physical storage area, such as in contiguous or adjacent blocks on a physical disk, and logically belong to a named set or partition to achieve efficient retrieval during querying.
[0060] After obtaining the current enhanced text, the target business scenario corresponding to the business metadata of the current enhanced text can be determined based on the business metadata of the current enhanced text. The target business scenario can be directly determined by the business metadata. For example, the business metadata [Project Type=EPC][Amount Range=100 Million~500 Million][Time Interval=2024Q2] can be directly combined to form the target business scenario "EPC_100 Million-500 Million_2024Q2".
[0061] Furthermore, based on the target business scenario, the target storage area corresponding to the target business scenario can be queried from the vector database. After successfully locating the target storage area, a fine-grained similarity search can be performed within that area.
[0062] Specifically, the same semantic encoding model used when storing historical augmented text can be used to convert the current augmented text into a current augmented text vector.
[0063] Within the target storage area, calculate the similarity between the current enhanced text vector and all historical enhanced text vectors (e.g., calculate cosine similarity), and based on a preset similarity threshold or a maximum number of returned results (e.g., return the 5 results with the highest similarity), obtain at least one historical enhanced text vector corresponding to a historical enhanced text associated with the current enhanced text.
[0064] In this embodiment, the vector database can also store the IDs corresponding to each historical augmented text vector. After determining the historical augmented text vector corresponding to the historical augmented text associated with the current augmented text, the database can query the historical augmented text corresponding to the ID and the historical response text corresponding to the historical augmented text from the structured database used to store complete text data, based on the ID of the historical augmented text vector.
[0065] The process of obtaining historical enhanced text associated with the current enhanced text and historical response text corresponding to the historical enhanced text is described below through a specific embodiment.
[0066] Assuming the current enhanced text is: [Project Type=EPC][Amount Range=100 Million~500 Million][Time Interval=2024Q2] Analyze the bidding risks of project ZH-2024-038.
[0067] Then, the business metadata of the current enhanced text can be parsed to obtain the target business scenario (EPC, 100 million to 500 million, 2024Q2). Based on the target business scenario, the business scenario set named Collection_EPC_1-500 million_2024Q2 can be located in the vector database.
[0068] The current enhanced text is converted into a vector, and similarity detection is performed on each historical enhanced text vector included in the physical storage space corresponding to the Collection_EPC_1-500 million_2024Q2 set. Assume the historical vector ID with the highest recall similarity is vec_123. Furthermore, based on this historical vector ID, the complete historical enhanced text and the corresponding historical response text corresponding to that ID can be retrieved from a relational database. For example, the corresponding historical enhanced text is: [Project Type=EPC][Amount Range=100 Million~500 Million][Time Interval=2024Q1] What are the technical risks of the ZH-2024-037 project? The historical response text is: The main technical risk of project ZH-2024-037 lies in the high complexity of the design scheme, and it is recommended to conduct expert review.
[0069] Thus, we have successfully obtained the historical enhanced texts associated with the current enhanced text and their corresponding historical response texts.
[0070] In this embodiment, after obtaining the current enhanced text, the method may further include: Based on the target business scenario corresponding to the current enhanced text, the current enhanced text vector corresponding to the current enhanced text is stored in the storage area allocated to the business scenario corresponding to the target business scenario in the vector database.
[0071] In this embodiment, in order to record the current enhanced text for use as the historical enhanced text corresponding to subsequent query text, after obtaining the current enhanced text, the current enhanced text can be vectorized and stored in the corresponding storage area of the business scenario in the value vector database.
[0072] This concludes the description of step 102. We will now proceed to step 103.
[0073] Step 103: Generate a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and historical response text, and find the target business node that matches the multi-dimensional intent vector in the existing intent flow graph.
[0074] The intent flow graph includes the dependencies between multiple business nodes; each business node has a corresponding feature vector and a corresponding response method, and the multidimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirements.
[0075] As an example, a specific method for generating a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and historical response text includes: The current enhanced text, historical enhanced text, and historical response text are input into the pre-trained language model to obtain a high-dimensional semantic feature vector used to represent the semantic features of the context. The high-dimensional semantic feature vector is mapped to the low-dimensional intent space through a projection layer to generate a multi-dimensional intent vector. Each dimension of the multi-dimensional intent vector corresponds to a business intent, which represents the specific analysis task to be performed in a business scenario defined by a specific combination of metadata values under N indicator dimensions.
[0076] Specifically, after obtaining the current enhanced text, historical enhanced text, and historical response text through step 102, these three parts of text information can be concatenated to form a comprehensive input text sequence containing rich historical context.
[0077] Furthermore, the input text sequence is fed into a pre-trained language model (such as a model based on the BERT architecture). This model understands the contextual semantics of the entire input sequence through a deep Transformer encoder and outputs a fixed-length, high-dimensional (such as 768-dimensional) semantic feature vector, which is a deep semantic representation of the entire input text.
[0078] In this embodiment, although the high-dimensional semantic feature vector contains rich semantic information, its high dimensionality and indirect meaning necessitate mapping it to a low-dimensional intent space specifically tailored for the business logic.
[0079] Specifically, a high-dimensional vector (e.g., 768-dimensional) can be linearly transformed into a low-dimensional space (e.g., 32-dimensional) through a trainable projection layer (such as a fully connected neural network layer), and the output is a multi-dimensional intent vector.
[0080] Each or more dimensions of this low-dimensional vector correspond to a predefined, specific business intent. For example: dimensions 0-7: bidding analysis intent; dimensions 8-15: qualification review intent; dimensions 16-32: risk prediction intent, etc. The value of the vector in each dimension (usually between 0 and 1) represents the strength or probability that the current query belongs to the corresponding business intent.
[0081] As an example, the generated multidimensional intent vector might be: [Bidding Analysis: 0.15, Qualification Review: 0.08, Risk Prediction: 0.76]. This indicates that the system judges that the user's current query text has a strong risk prediction intent.
[0082] After obtaining the multidimensional intent vector, the target business node that matches the multidimensional intent vector can be found in the existing intent flow graph.
[0083] Specifically, target service nodes include primary path nodes and secondary path nodes; target service nodes that match the multidimensional intent vector are found in the existing intent flow graph, including: For each business node in the intent flow graph, determine the similarity between the multidimensional intent vector and the feature vector corresponding to that business node; If the similarity falls within the first similarity threshold range, then the business node is determined to be a primary path node. If the similarity falls within the second similarity threshold range, the business node is determined to be a secondary path node; wherein, the maximum similarity value in the second similarity threshold range is less than the minimum similarity value in the first similarity threshold range.
[0084] In this embodiment, each business node in the intent flow graph generates a node feature vector through graph neural network and other technologies. This vector represents the business intent that the node can process.
[0085] After obtaining the multidimensional intent vector, the similarity between the multidimensional intent vector and the feature vector of each business node in the IFG can be calculated to obtain a similarity list.
[0086] In this embodiment, nodes can be classified according to a preset similarity threshold range to determine their execution priority and strategy. Assume the thresholds are set as follows: the lower limit for the primary path is 0.70, and the lower limit for the secondary path is 0.55.
[0087] Furthermore, if the similarity between the multidimensional intent vector and a node is found to be greater than 0.70, the node can be identified as a primary path node; if the similarity between the multidimensional intent vector and a node is found to be between 0.55 and 0.70, the node can be identified as a secondary path node.
[0088] In this embodiment, in addition to identifying primary and secondary path nodes, auxiliary path nodes can also be identified based on a lower similarity threshold.
[0089] Specifically, after determining the similarity between the multidimensional intent vector and the feature vector corresponding to each service node in the intent flow graph, the method further includes: If the similarity falls within the third similarity threshold range, then the business node is determined to be an auxiliary path node; wherein, the maximum similarity value in the third similarity threshold range is less than the minimum similarity value in the second similarity threshold range; For auxiliary path nodes, based on the weight of the connection paths between each business node, a path search is performed in the intent flow graph to generate at least one auxiliary path from the preset starting node in the intent flow graph to the auxiliary path node. The auxiliary path is cached so that, under specified conditions, auxiliary response text can be generated using the response methods corresponding to each business node in the auxiliary path.
[0090] In this embodiment, a third similarity threshold interval can be set, the upper limit of which is lower than the lower limit of the second similarity threshold interval (secondary path). For example, if the lower limit of the primary path threshold is 0.70, that is, the primary path threshold interval is (0.70, 1], and the secondary path threshold interval is (0.55, 0.70], then the third threshold interval (auxiliary path threshold interval) can be set to (0.40, 0.55).
[0091] In this embodiment, the three types of nodes not only represent the strength of the matching degree, but also determine the fundamental differences in system resource scheduling and response generation strategies.
[0092] The primary path node represents the core intent of the current user's query and is a task that must be completed when responding. Its execution result directly determines the basic content of the response, and the system must ensure the execution of the paths to which the primary path node belongs. When resources are limited, the execution of the primary path will be prioritized, and its execution result will serve as the core content of the response.
[0093] Secondary path nodes represent supplementary or supporting intents that are strongly related to the core intent. Executing these nodes can significantly improve the completeness and depth of the response.
[0094] When resources permit, paths belonging to primary path nodes can be executed simultaneously with paths belonging to secondary path nodes, but their execution priority and resource guarantee level are lower than those of paths belonging to primary path nodes. When system resources are scarce, their order may be adjusted, or even sacrificed, to ensure the completion of the primary path. The execution results of paths belonging to secondary path nodes can be used as supplementary information in the response.
[0095] Secondary path nodes represent intentions that are less relevant to the current query but still have potential value. For example, secondary path nodes may point to areas of expansion that the user may not have explicitly stated but could be of interest to, or to in-depth analyses that require high computational costs and should not be triggered immediately.
[0096] The system will pre-plan the complete auxiliary path from the starting node to the auxiliary path node based on the connection weight of the intent flow graph, and store its metadata (such as the path node sequence and the estimated required resources) in the cache. It will only be activated and executed when specific conditions are met.
[0097] The specific conditions here may include: The user's follow-up questions indicate that they are interested in the content of the auxiliary path (for example, after reading the risk analysis, the user continued to ask about the probability of winning the bid).
[0098] If system resources are still available after the primary and secondary paths have been completed, auxiliary paths will be executed automatically to generate more comprehensive supplementary information.
[0099] During periods of low system load, high-value auxiliary paths can be proactively executed to pre-store the results and accelerate potential future related queries.
[0100] The auxiliary response text generated after the auxiliary path is executed can be provided to the user as incremental information in the interaction after the initial response.
[0101] This concludes the description of step 103. We will now proceed to step 104.
[0102] Step 104: Based on the dependency relationship between each business node and the target business node in the intent flow diagram, generate a business execution path containing the target business node, and use the response method corresponding to each business node in the business execution path to generate the response text of the current query text.
[0103] After the target business node is determined through step 103, an executable business execution path can be generated, which defines the business nodes that need to be called to answer the current query.
[0104] In this embodiment, the intent flow graph records the weights of the connection paths between each service node, and the weights are used to characterize the dependencies between each service node; based on the dependencies between each service node and the target service node in the intent flow graph, a service execution path containing the target service node is generated, including: If the target business node is the main path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one main execution path from the preset starting node in the intent flow graph to the main path node; the execution result of the main execution path is the core content of the response text. If the target business node is a secondary path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one secondary execution path from the preset starting node in the intent flow graph to the secondary path node; the secondary execution path is allowed to be executed in parallel with the primary execution path, and the execution result of the secondary execution path is supplementary content of the response text. The business execution path is generated based on the primary and secondary execution paths.
[0105] Specifically, the intention flow graph is a weighted directed graph G = (V, E, W), where: V represents a set of business nodes (such as "data query node" or "risk analysis node").
[0106] E represents the set of directed edges connecting nodes, representing the allowed flow of business logic.
[0107] W represents the set of weights for directed edges. The weight value w (usually 0 ≤ w ≤ 1) characterizes the historical success rate or reliability of the connection path. The higher the weight, the more successful the path has been in its historical execution.
[0108] In this embodiment, for each activated target service node (whether it is a primary path node or a secondary path node), a weighted path search can be performed on the intent flow graph, with a preset starting node as the source and the target service node as the destination.
[0109] Weighted path search here refers to finding a path with the optimal overall weight. For example, finding a path that maximizes the weights of all edges after a specified operation (such as averaging), and then selecting the business nodes with the highest historical success rate to form the execution path.
[0110] In this embodiment, the final business execution path can be a set of the primary execution path and all secondary execution paths. By utilizing the weights in the intent flow graph for optimal path search, it is ensured that the correct business execution path with the best historical performance can be planned, thereby significantly improving the reliability of decision execution and the quality of responses.
[0111] It should be noted that, as described above, when resources permit, the paths belonging to the primary path node can be executed simultaneously with those belonging to the secondary path node, but their execution priority and resource guarantee level are lower than those of the primary path node. When system resources are scarce, their order may be adjusted, or even sacrificed, to ensure the completion of the primary path. The execution results of the paths belonging to the secondary path nodes can be used as supplementary information in the response.
[0112] At the same time, the system can also pre-plan the complete auxiliary path from the starting node to the auxiliary path node, and store its metadata (such as the path node sequence and the estimated required resources) in the cache, and execute the auxiliary path when specific conditions are met.
[0113] As one example, after generating the response text for the current query text, the method further includes: Get feedback information on the response text; Based on the feedback information, determine the success rate of the business execution path; Based on the execution success rate, the weights of each connection path that constitutes the business execution path are updated so that the updated weights are positively correlated with the execution success rate.
[0114] In this embodiment, after the system executes the business execution path and generates the response text, it will proactively obtain the user's feedback information regarding the response.
[0115] The feedback here can be provided by the user clicking buttons such as "Helpful" or "Useless," or by the system monitoring the user's behavior after the current response. For example, if the user naturally ends the conversation or asks a new question related to the current topic, it indicates that the response has met their needs. If the user immediately asks "Why?", clicks "Regenerate," or moves to another topic after a long period of inactivity, it indicates that the response was inaccurate or incomplete.
[0116] Furthermore, the above feedback information can be quantified into a specific, calculable success rate (S), which is usually a value between 0 and 1.
[0117] Based on the calculated success rate of this execution, the weights of each connection path in the intent flow graph traversed by the business execution path are updated. The updated weights are positively correlated with the execution success rate.
[0118] The intent flow graph in this application can update the weights from the actual interactions, enabling the intent flow graph to dynamically reflect the execution path with a higher success rate.
[0119] This concludes the discussion on... Figure 1 The description.
[0120] The proposed solution, upon receiving a user query text, obtains historical enhanced text and historical answer texts related to the business context of the query text through metrics used to characterize the business. This enables precise perception and understanding of the specific business scenario involved in the user query. By generating a multi-dimensional intent vector representing the user's intent, matching it in the intent flow graph simultaneously identifies and processes multiple business intents included in the query text, avoiding intent omissions caused by triggering based on a single keyword. Furthermore, it dynamically generates execution paths based on the dependencies between nodes in the intent flow graph, replacing rigid fixed processes and achieving accurate responses adapted to complex business scenarios, thus improving the accuracy of the generated response text.
[0121] The following is through Figures 2 to 4 The method proposed in this application is described in its entirety.
[0122] Please refer to Figure 2 , Figure 2 This is a diagram illustrating the overall architecture of the model provided in this application embodiment.
[0123] like Figure 2 As shown, the model consists of two core modules: a long-term memory layer and a path planning layer.
[0124] The long-term memory layer manages historical dialogue information that is highly relevant to the current query scenario. By adding business metadata to the query text, the system can recall historical dialogue contexts that are truly relevant to the current business background when responding, rather than just semantically similar dialogue fragments, thus providing input information rich in business semantics for the response.
[0125] The path planning layer is used to parse the complex intent of a user query into an executable execution path. By calculating the similarity between the user intent and the business nodes in the predefined intent flow graph, it dynamically plans multi-priority execution paths. This allows the system to flexibly combine business nodes to cope with complex and ever-changing queries, rather than mechanically executing fixed processes, thereby generating more accurate responses.
[0126] Please refer to Figure 3 , Figure 3 A schematic diagram of a long-term memory layer provided for an embodiment of this application.
[0127] like Figure 3 As shown, the input to the long-term memory layer is the user query text. Through business metadata extraction, the query is bound to a specific business scenario (such as project type and amount) to form the current enhanced text. Further, this current enhanced text is transformed into a current enhanced text vector, and this vector is used to query historical enhanced texts and their corresponding historical responses.
[0128] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the path planning layer provided in an embodiment of this application.
[0129] like Figure 4 As shown, the input to the path planning layer is the output of the long-term memory layer, namely the current enhanced text, historical enhanced text, and historical response text. Based on the above input, a multi-dimensional intent vector is generated to quantify the user's multiple intents (e.g., 70% for risk analysis and 30% for cost comparison). Further, the target business node matching the multi-dimensional intent vector is determined in the intent flow graph, and the business node that needs to be invoked (e.g., risk analysis model, cost database) is found. An execution path is generated based on the target business node, and a response text is generated based on the execution path.
[0130] The above process is described below through a specific embodiment.
[0131] Suppose in a bidding analysis system, a user asks: "Analyze the risks of the EPC project ZH-2024-038." After receiving the user's query text, the long-term memory layer extracts business metadata: The system identifies the business tags: Project Type = EPC, Project Number = ZH-2024-038.
[0132] Generate the current enhanced text [Project Type=EPC] to analyze the risks of project ZH-2024-038, and convert it into the current enhanced text vector.
[0133] By using pre-enhanced text vectors, historical risk discussion records and responses regarding similar EPC projects (such as ZH-2023-029) can be retrieved from the “EPC Project” storage area of the vector database to gain historical risk analysis experience.
[0134] In the path planning layer, the input is the current enhanced text and the recalled historical risk dialogue records (including historical enhanced text and the historical response text corresponding to the historical enhanced text).
[0135] By comprehensively analyzing the current enhanced text and historical risk dialogue records, a multi-dimensional intent vector is generated, for example: {Risk analysis: 0.85, Cost assessment: 0.20}.
[0136] In the intent flow graph, the vector is highly matched with the "Risk Assessment Model" node (e.g., similarity 0.85) and slightly matched with the "Cost Query" node (e.g., similarity 0.60).
[0137] Based on the two types of business nodes mentioned above, a primary execution path including the "risk assessment model" node and a secondary execution path including the "cost query" node are integrated. The primary and secondary execution paths are then combined to generate a response.
[0138] This concludes the discussion on... Figures 2 to 4 The description.
[0139] Please refer to Figure 5 , Figure 5 This is the apparatus proposed in the embodiments of this application. For example... Figure 5 As shown, the device may include a first generation unit 501, an acquisition unit 502, a search unit 503, and a second generation unit 504. Specifically, the device includes: The first generation unit 501 is used to put the business metadata of the current query text into the specified position of the current query text to generate the current enhanced text; the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1; The obtaining unit 502 is used to obtain the historical enhanced text associated with the current enhanced text and the historical response text corresponding to the historical enhanced text; wherein, the historical enhanced text is generated based on the historical query text, the business metadata in the historical enhanced text includes the metadata of the business involved in the historical query text under N indicator dimensions, and the historical response text is the reply to the historical query text; The search unit 503 is used to generate a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and historical response text, and to find the target business node that matches the multi-dimensional intent vector in the existing intent flow graph. The intent flow graph includes the dependencies between multiple business nodes. Each business node has a corresponding feature vector and a corresponding response method. The multi-dimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirements. The second generation unit 504 is used to generate a business execution path containing the target business node based on the dependency relationship between each business node and the target business node in the intent flow diagram, so as to generate the response text of the current query text by using the response method corresponding to each business node in the business execution path.
[0140] Optionally, the first generating unit 501 is specifically used for: The specified format of business metadata is appended to the beginning of the current query text to obtain the current enhanced text.
[0141] Optionally, obtaining unit 502 is specifically used for: Based on the metadata of the N indicator dimensions contained in the current enhanced text, determine the target business scenario corresponding to the current enhanced text; In the vector database, query the target storage area corresponding to the target business scenario; the vector database is pre-configured with multiple business scenarios, each business scenario is defined by a combination of specific metadata values under N indicator dimensions; the historical enhanced text vectors corresponding to the historical enhanced text belonging to the same business scenario are stored in the same physical storage area; Based on the similarity between the current text vector corresponding to the current enhanced text and the historical enhanced text vectors in the target storage area, the historical enhanced texts associated with the current enhanced text are determined.
[0142] Optionally, the lookup unit 503 is specifically used for: The current enhanced text, historical enhanced text, and historical response text are input into the pre-trained language model to obtain a high-dimensional semantic feature vector used to represent the semantic features of the context. The high-dimensional semantic feature vector is mapped to the low-dimensional intent space through a projection layer to generate a multi-dimensional intent vector. Each dimension of the multi-dimensional intent vector corresponds to a business intent, which represents the specific analysis task to be performed in a business scenario defined by a specific combination of metadata values under N indicator dimensions.
[0143] Optionally, the target business node includes primary path nodes and secondary path nodes; the lookup unit 503 is specifically used for: For each business node in the intent flow graph, determine the similarity between the multidimensional intent vector and the feature vector corresponding to that business node; If the similarity falls within the first similarity threshold range, then the business node is determined to be a primary path node. If the similarity falls within the second similarity threshold range, the business node is determined to be a secondary path node; wherein, the maximum similarity value in the second similarity threshold range is less than the minimum similarity value in the first similarity threshold range.
[0144] Optionally, the intent flow graph records the weights of the connection paths between each business node, and the weights are used to characterize the dependencies between each business node; the second generation unit is specifically used for: If the target business node is the main path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one main execution path from the preset starting node in the intent flow graph to the main path node; the execution result of the main execution path is the core content of the response text. If the target business node is a secondary path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one secondary execution path from the preset starting node in the intent flow graph to the secondary path node; the secondary execution path is allowed to be executed in parallel with the primary execution path, and the execution result of the secondary execution path is supplementary content of the response text. The business execution path is generated based on the primary and secondary execution paths.
[0145] Optionally, after determining the similarity between the multidimensional intent vector and the feature vector corresponding to each service node in the intent flow graph, the search unit is further used to: If the similarity falls within the third similarity threshold range, then the business node is determined to be an auxiliary path node; wherein, the maximum similarity value in the third similarity threshold range is less than the minimum similarity value in the second similarity threshold range; For auxiliary path nodes, based on the weight of the connection paths between each business node, a path search is performed in the intent flow graph to generate at least one auxiliary path from the preset starting node in the intent flow graph to the auxiliary path node. The auxiliary path is cached so that, under specified conditions, auxiliary response text can be generated using the response methods corresponding to each business node in the auxiliary path.
[0146] Optionally, the intent flow graph records the weights of the connection paths between each business node, and the weights are used to characterize the dependencies between each business node; after generating the response text for the current query text, the second generation unit is also used to: Get feedback information on the response text; Based on the feedback information, determine the success rate of the business execution path; Based on the execution success rate, the weights of each connection path that constitutes the business execution path are updated so that the updated weights are positively correlated with the execution success rate.
[0147] This concludes the process. Figure 5 Description of the device.
[0148] This application also provides embodiments that... Figure 5 Hardware structure description of the illustrated device. This hardware structure is... Figure 6 The structure in the illustrated electronic device. Please refer to [link / reference]. Figure 6 , Figure 6 This is a structural diagram of an electronic device provided in an embodiment of this application. Figure 6 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0149] Based on the same concept as the above method, this application also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the method disclosed in the above examples of this application.
[0150] For example, the aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For instance, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0151] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A query-response method, characterized in that, The method includes: The business metadata of the current query text is placed in the specified position of the current query text to generate the current enhanced text; the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1; Obtain historical enhanced texts associated with the current enhanced text, as well as historical response texts corresponding to the historical enhanced texts; wherein, the historical enhanced texts are generated based on historical query texts, the business metadata in the historical enhanced texts includes metadata of the business involved in the historical query texts under the N indicator dimensions, and the historical response texts are replies to the historical query texts; A multidimensional intent vector is generated based on the current enhanced text, historical enhanced text, and the historical response text. A target business node that matches the multidimensional intent vector is found in the existing intent flow graph. The intent flow graph includes the dependencies between multiple business nodes. Each business node has a corresponding feature vector and a corresponding response method. The multidimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirement. Based on the dependency relationship between each business node in the intent flow graph and the target business node, a business execution path containing the target business node is generated, so as to generate the response text of the current query text using the response method corresponding to each business node in the business execution path.
2. The method according to claim 1, characterized in that, The step of placing the business metadata of the current query text into a specified location of the current query text to generate the current enhanced text includes: The specified format of business metadata is appended to the beginning of the current query text to obtain the current enhanced text.
3. The method according to claim 1, characterized in that, Obtaining the historical enhanced text associated with the current enhanced text includes: Based on the metadata under the N indicator dimensions contained in the current enhanced text, determine the target business scenario corresponding to the current enhanced text; In the vector database, the target storage area corresponding to the target business scenario is queried; wherein, the vector database is pre-configured with multiple business scenarios, each business scenario is defined by a combination of specific metadata values under the N indicator dimensions; the historical enhanced text vectors corresponding to the historical enhanced text belonging to the same business scenario are stored in the same physical storage area; Based on the similarity between the current text vector corresponding to the current enhanced text and the historical enhanced text vectors in the target storage area, the historical enhanced texts associated with the current enhanced text are determined.
4. The method according to claim 1, characterized in that, The generation of a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and historical response text includes: The current enhanced text, the historical enhanced text, and the historical response text are input into a pre-trained language model to obtain a high-dimensional semantic feature vector for representing contextual semantic features. The high-dimensional semantic feature vector is mapped to a low-dimensional intent space through a projection layer to generate the multi-dimensional intent vector; wherein each dimension of the multi-dimensional intent vector corresponds to a business intent, which represents the specific analysis task to be performed in a business scenario defined by a specific combination of metadata values under the N indicator dimensions.
5. The method according to claim 1, characterized in that, The target service node includes primary path nodes and secondary path nodes; finding the target service node that matches the multidimensional intent vector in the existing intent flow graph includes: For each service node in the intent flow graph, determine the similarity between the multidimensional intent vector and the feature vector corresponding to that service node; If the similarity falls within the first similarity threshold range, then the business node is determined to be a primary path node. If the similarity falls within the second similarity threshold range, then the business node is determined to be a secondary path node; wherein the maximum similarity value in the second similarity threshold range is less than the minimum similarity value in the first similarity threshold range.
6. The method according to claim 5, characterized in that, The intent flow graph records the weights of the connection paths between each business node, and these weights are used to characterize the dependencies between each business node. The step of generating a business execution path containing the target business node based on the dependency relationships between each business node in the intent flow graph and the target business node includes: If the target business node is the main path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one main execution path from the preset starting node in the intent flow graph to the main path node; the execution result of the main execution path is the core content of the response text. If the target business node is the secondary path node, then based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one secondary execution path from the preset starting node in the intent flow graph to the secondary path node; the secondary execution path is allowed to be executed in parallel with the primary execution path, and the execution result of the secondary execution path is supplementary content to the response text. The business execution path is generated based on the primary execution path and the secondary execution path.
7. The method according to claim 5, characterized in that, After determining the similarity between the multidimensional intent vector and the feature vector corresponding to the service node for each service node in the intent flow graph, the method further includes: If the similarity falls within the third similarity threshold interval, then the business node is determined to be an auxiliary path node; wherein, the maximum similarity value of the third similarity threshold interval is less than the minimum similarity value of the second similarity threshold interval; For the auxiliary path node, based on the weight of the connection path between each business node, a path search is performed in the intent flow graph to generate at least one auxiliary path from the preset starting node in the intent flow graph to the auxiliary path node. The auxiliary path is cached so that, under specified conditions, auxiliary response text can be generated using the response methods corresponding to each business node in the auxiliary path.
8. The method according to claim 1, characterized in that, The intent flow graph records the weights of the connection paths between each business node, and these weights are used to characterize the dependencies between each business node. After generating the response text to the current query text, the method further includes: Obtain feedback information regarding the response text; Based on the feedback information, determine the success rate of the business execution path; Based on the execution success rate, the weights of each connection path constituting the business execution path are updated so that the updated weights are positively correlated with the execution success rate.
9. A query-response device, characterized in that, The device includes: The first generation unit is used to place the business metadata of the current query text into a specified position of the current query text to generate the current enhanced text; the business metadata of the query text refers to the metadata of the business involved in the query text under N indicator dimensions; N is greater than or equal to 1; The obtaining unit is used to obtain historical enhanced text associated with the current enhanced text and historical response text corresponding to the historical enhanced text; wherein, the historical enhanced text is generated based on historical query text, the business metadata in the historical enhanced text includes metadata of the business involved in the historical query text under the N indicator dimensions, and the historical response text is a reply to the historical query text; The search unit is used to generate a multi-dimensional intent vector based on the current enhanced text, historical enhanced text, and the historical response text, and to find a target business node that matches the multi-dimensional intent vector in an existing intent flow graph; the intent flow graph includes the dependencies between multiple business nodes; each business node has a corresponding feature vector and a corresponding response method, and the multi-dimensional intent vector and the feature vector corresponding to the target business node meet the similarity requirement; The second generation unit is used to generate a business execution path containing the target business node based on the dependency relationship between each business node in the intent flow graph and the target business node, so as to generate the response text of the current query text using the response method corresponding to each business node in the business execution path.
10. An electronic device, characterized in that, include: A processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; The processor is configured to execute machine-executable instructions to perform the method as described in any one of claims 1 to 8.