A human-computer interactive query optimization method and system for incomplete queries

Through knowledge-enhanced large language models and heuristic planning algorithms, it solves the problem of incomplete user queries and API call complexity, achieves efficient and accurate query understanding and API combination, and improves user experience and task completion rate.

CN118643060BActive Publication Date: 2024-10-29SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411116642.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-10-29
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

It is difficult for the existing technology to accurately identify and process incomplete user queries, especially in agent-based interaction methods, it is difficult to accurately identify user intentions and fill slot information, and the interface specifications and call restrictions of different APIs are complex, leading to false recalls and Wrong result.

Method used

It uses a knowledge-enhanced large language model combined with an external knowledge base to optimize API calls through heuristic planning algorithms to guide users to clarify their needs. It also uses multi-round dialogue and reinforcement learning algorithms to optimize query understanding and dialogue management to achieve API combination search and result processing.

Benefits of technology

It improves the accurate understanding of query intentions and slots, supports flexible semantic analysis, improves task completion rate and user experience, optimizes API calling efficiency, and provides personalized and intelligent human-computer interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643060B_ABST
    Figure CN118643060B_ABST
Patent Text Reader

Abstract

The present invention proposes a human-computer interactive query optimization method and system for incomplete queries, which belongs to the field of artificial intelligence technology, including: obtaining user queries, using a knowledge-enhanced large language model to semantically understand the user queries, and extracting query intent and key information; judging whether the user query is missing necessary information through knowledge reasoning, and if necessary information is missing, initiating a clarification dialogue to guide the user to complete the information and obtain clear query intent information and parameters; compensating for the incompleteness of the query information through interactive questions and answers, thereby improving the task completion rate; using heuristic search to optimize the API call sequence, thereby improving the execution efficiency while satisfying the constraints; relying on multiple rounds of dialogues and natural language interpretation, greatly enhancing the user experience, and being able to provide strong support for personalized and intelligent human-computer interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a human-computer interactive query optimization method and system for incomplete queries. Background Art

[0002] Currently, large language models (LLM) represented by ChatGPT, GPT-4, ChatGLM, Qwen, etc. are leading the new trend of natural language processing technology. These large models use massive corpus and Transformer neural network architecture for pre-training, and have powerful natural language understanding and generation capabilities. Applying LLM to dialogue systems, intelligent assistants, knowledge retrieval and other scenarios is expected to significantly improve the naturalness and efficiency of human-computer interaction.

[0003] With the support of LLM, a new interaction paradigm is emerging, namely Agent-based interaction. Agent is an intelligent dialogue agent that can actively extract key information based on user requests, call appropriate backend APIs or tools, and process and integrate the returned results, and finally provide services to users in the form of natural language. This "LLM+API" combination makes it possible to build a general intelligent dialogue system.

[0004] However, there are still many technical challenges to achieve high-quality agent-based interaction. First, although LLM is good at natural language understanding, it is often difficult to accurately identify the query intent and fill in the slot information for incomplete user queries. For example, if a user asks "tickets from Beijing to Shanghai tomorrow", LLM may not be able to determine whether the user wants economy class or business class, what time period the flight wants, etc. Further interaction and guidance are needed to clarify user needs.

[0005] Mapping user intent to an API call sequence is a challenging task in itself. Different APIs have different interface specifications, parameter requirements, and call restrictions. How to choose the right API combination and set appropriate parameter values ​​requires comprehensive use of multiple information such as API metadata and call context, and the introduction of domain knowledge to constrain it. Simple API matching and calling are prone to false recalls and wrong results.

[0006] In addition, due to the flexibility and colloquial nature of natural language, users' expressions vary greatly. Even for the same intent, different users may ask questions in very different ways. How to map these differentiated queries to the unified semantic representation of the backend knowledge base and API is the key to achieving accurate query understanding. Traditional methods based on keyword matching or templates are difficult to effectively deal with the diversity of query methods. Summary of the invention

[0007] In view of the problems in the prior art, the present invention proposes an innovative agent interaction optimization method. The method uses knowledge-enhanced LLM as the core, and enhances semantic understanding and slot matching capabilities by combining external knowledge base with API metadata. For incomplete queries, the agent can actively initiate inquiries to guide users to clarify their needs. In terms of searching for API combinations, the present invention adopts a heuristic planning algorithm to quickly find the optimal call path. The entire interaction process is carried out in the form of multiple rounds of dialogue, and the agent can use natural language to provide personalized services to users.

[0008] In order to achieve the above purpose, the technical solution adopted in this application is:

[0009] In a first aspect, the present invention provides a human-computer interactive query optimization method for incomplete queries, comprising:

[0010] Obtain user queries, use the knowledge-enhanced large language model to understand the semantics of user queries, and extract query intent and key information;

[0011] Determine whether the user's query is missing necessary information through knowledge reasoning. If necessary information is missing, initiate a clarification dialogue to guide the user to complete the information and obtain clear query intention information and parameters;

[0012] Map explicit query intent information and parameters into an API combination optimization problem, and use a heuristic search algorithm to search for feasible API call solutions;

[0013] Select the solution with the highest comprehensive evaluation value from the feasible API call solutions to generate an API call sequence; use the planning execution engine to call the API in sequence, process the returned results, and generate the end-user query results;

[0014] The user query results are sent to the user, and the user receives the user query results and obtains feedback and evaluation. The feedback and evaluation are collected, and the reinforcement learning algorithm is used to continuously optimize the key strategies of query understanding, dialogue management, and API combination search.

[0015] Furthermore, the knowledge-enhanced large language model integrates the external knowledge base with the pre-trained language model, thereby enhancing the semantic understanding capability of incomplete queries.

[0016] Furthermore, the heuristic search algorithm comprehensively considers the input and output type matching, call cost, and data quality factors of the API to efficiently find the optimal API combination solution.

[0017] Furthermore, the planning execution engine adopts asynchronous non-blocking calling and automatic retry fault tolerance mechanism.

[0018] Furthermore, the reinforcement learning algorithm continuously optimizes the dialogue strategy and intent recognition key models based on the delayed feedback reward signal.

[0019] Furthermore, it also includes task complexity assessment, dynamic expert team formation, and collaborative reasoning mechanism to improve the performance of large language models in processing complex tasks.

[0020] In a second aspect, the present invention provides a human-computer interactive query optimization system for incomplete queries, comprising:

[0021] The query understanding module is configured to: obtain user queries, use the knowledge-enhanced large language model to perform semantic understanding on the user queries, and extract query intent and key information;

[0022] The dialogue management module is configured to: determine whether the user query is missing necessary information through knowledge reasoning, and if necessary information is missing, initiate a clarification dialogue to guide the user to complete the information and obtain clear query intention information and parameters;

[0023] The API combination search module is configured to: map explicit query intent information and parameters into an API combination optimization problem, and use a heuristic search algorithm to search for feasible API call solutions;

[0024] The execution engine is configured to: select the solution with the highest comprehensive evaluation value from the feasible API call solutions to generate an API call sequence; use the planning execution engine to call the API in sequence, process the returned results, and generate the final user query results;

[0025] The optimization module is configured to: send user query results to users, have users accept user query results and obtain feedback and evaluation, collect feedback and evaluation, and use reinforcement learning algorithms to continuously optimize query understanding, dialogue management, and API combination search key strategies.

[0026] In a third aspect, the present invention provides a computer-readable storage medium, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the human-computer interactive query optimization method for incomplete queries described in the first aspect.

[0027] In a fourth aspect, the present invention provides an electronic device comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the human-computer interactive query optimization method for incomplete queries described in the first aspect.

[0028] Compared with the prior art, the advantages and positive effects of the present invention are:

[0029] 1. The present invention integrates the knowledge base and the big model, realizes accurate understanding of query intent and slots, and supports flexible semantic parsing; compensates for the incompleteness of query information through interactive question and answer, and improves the task completion rate; uses heuristic search to optimize the API call sequence, and improves the execution efficiency while satisfying the constraints; relies on multiple rounds of dialogue and natural language interpretation, greatly enhances the user experience, and can provide strong support for personalized and intelligent human-computer interaction.

[0030] 2. The present invention can be widely used in the fields of intelligent customer service, virtual assistants, knowledge question answering, etc. With the increasing maturity of LLM technology and the booming development of API economy, building general-purpose intelligent agents will become a general trend. The present invention provides key technologies for achieving efficient, accurate and natural agent interaction, and has broad application prospects and significant economic value. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0032] Figure 1 The present invention is a flow chart of the architecture of a human-computer interactive query optimization method for incomplete queries. DETAILED DESCRIPTION

[0033] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.

[0035] Embodiment 1, as Figure 1 As shown, this embodiment provides a human-computer interactive query optimization method for incomplete queries. The method is based on a knowledge-enhanced large language model and a heuristic API combination search technology. Through multiple rounds of dialogue, the user is guided to clarify the query intention and generate an optimal API call solution, thereby efficiently and accurately providing the user with the required information. The present invention is described in detail from two aspects: system architecture and core modules.

[0036] 1. System architecture. The query optimization system of the present invention adopts a typical front-end and back-end separation architecture, which mainly includes the following parts:

[0037] 1. User interface: responsible for receiving the user's natural language query input and displaying the Agent's return results in the form of dialogue. The interface supports two interaction modes: voice and text.

[0038] 2. Query understanding module: After receiving user queries, the knowledge-enhanced large language model is used to perform semantic analysis on the query and extract key information such as intent, slots, and restrictions. This module presets multiple domain ontologies and intent recognition models.

[0039] 3. Dialogue management module: Based on the query understanding results, it determines whether multiple rounds of interaction are needed to clarify the user's needs. If the query information is incomplete, corresponding clarification questions will be generated and a dialogue will be conducted with the user through the user interface until the complete query parameters are obtained.

[0040] 4. API combination search module: maps explicit query intent and parameters into an API combination optimization problem, and uses a heuristic search algorithm to quickly find the optimal API call solution. This module maintains an API metadata database that records the input / output type, call restrictions, and other information of each API.

[0041] 5. Execution engine: responsible for calling the backend API step by step according to the optimal solution, processing, integrating, sorting and other processing of the API return results to generate the final user query results.

[0042] 6. Backend API: Provides actual data and service support, which can be database, knowledge base, search engine, third-party service, etc. Each API has a clear input / output interface definition.

[0043] 2. Core module description, user interface module, the user interface module is the front-end component for direct interaction between the system and the end user. It is mainly responsible for the following tasks:

[0044] Provide users with natural and friendly query input methods, including text input box, voice input, image upload, etc., to meet the human-computer interaction needs in different scenarios.

[0045] The query input by the user is sent to the backend module for processing in a standardized form, such as encapsulating the query parameters in JSON format.

[0046] Receive query results returned by the backend module and display them to users in a rich media format, including text, images, tables, charts, etc., to provide a good information browsing experience.

[0047] The present invention adopts Vue.js as the front-end development framework, and uses its MVVM mode to realize the componentization and responsive design of the interface. At the same time, the present invention follows the Material Design design specification, and the interface style is simple, generous and consistent. In addition, the present invention also realizes the adaptation of the mobile terminal and the PC terminal, and supports multiple screen sizes and interaction modes.

[0048] Query understanding module, this module is the key to achieve accurate query understanding. Its main point is to integrate the external knowledge base and pre-trained large model, and enhance the semantic representation and slot filling capabilities.

[0049] Specifically, the present invention uses the Qwen1.5-72B large language model as the basis, and pre-trains on large-scale general corpus to learn basic language knowledge such as vocabulary, phrases, and syntax. Then, on this basis, the present invention incorporates structured knowledge for specific fields, including domain concepts, attributes, relationships, etc. This knowledge can come from artificially constructed knowledge bases, such as ConceptNet, DBPedia, etc.; it can also be automatically mined from semi-structured data through methods such as knowledge graph embedding. By aligning text data with structured knowledge, the large model learns more accurate and fine-grained semantic representations.

[0050] When in use, given a user query, the present invention first uses the preprocessing module to perform word segmentation, named entity recognition, dependency analysis and other processing to extract syntactic and semantic features. Then, the query is encoded using the fine-tuned BERT to obtain its distributed semantic vector. Next, the present invention uses the attention mechanism to match the query vector with the entity and relationship vectors in the knowledge base to find the key concepts, attributes, and relationships involved in the query, thereby achieving domain adaption.

[0051] On this basis, the present invention designs an intent recognition method based on slot filling. The present invention predefines a series of query intent templates, each template contains a number of slots corresponding to the key parameters of the query. For example, the ticket booking intent can be defined as: [place of departure], [destination], [departure date], [number of passengers];

[0052] The present invention inputs the BERT semantic vector and knowledge matching results into a multi-layer perceptron to predict which intent the query belongs to and the specific value corresponding to each slot. This semantic representation of fused knowledge can effectively improve the accuracy of intent recognition, especially for complex queries and small sample scenarios.

[0053] In addition, the present invention also proposes an end-to-end query understanding method that does not require an intent template. The present invention regards intent and slot recognition as a sequence labeling problem, and predicts intent labels and slot labels for each word in the query. The present invention connects a CRF layer after BERT, uses Bi-LSTM to encode the BERT output vector, and then uses CRF to simultaneously predict the intent label and slot label of each word. This end-to-end modeling method does not require manual definition of templates, can discover new intent categories, and is very suitable for open domain scenarios.

[0054] The dialogue management module is responsible for controlling the multi-round dialogues in the entire query process and guiding the user to provide necessary supplementary information. Its core is a dialogue state tracker and a dialogue strategy selector.

[0055] The dialogue state tracker determines whether the current query contains all the parameters required to complete the task based on the query understanding results. If some key parameters are missing, the status is set to "incomplete information". At the same time, the tracker records the dialogue history, including the user's initial query, the agent's questions, the user's replies, etc., to facilitate understanding of the context of the current dialogue. The present invention uses a transformer-based dialogue state representation model to encode all historical utterances into a fixed-length vector, which is concatenated with the current query vector and input into the state discriminator to predict whether the dialogue is completed and whether further inquiries are needed.

[0056] The transformer-based dialogue state representation model used in this paper adopts advanced natural language processing technology. The core of the model is a 12-layer transformer encoder structure, each layer contains 12 attention heads, and the hidden layer dimension is 768. In order to capture the position information in the sequence, the model uses position encoding implemented by sine cosine function. The word embedding dimension is consistent with the hidden layer dimension, both of which are 768, which helps to maintain the consistency of information and make full use of the model capacity.

[0057] The dialogue strategy selector selects the best dialogue behavior from a predefined set of strategies based on the current dialogue state. Common dialogue behaviors include: Clarification: Generate a clarification question for missing key parameters, asking the user to provide specific information. For example, "Which day do you want to book a flight?"

[0058] Confirmation: Provide clear confirmation of the information provided by the user. For example, "You need to book a flight from Beijing to Shanghai on January 3, right?"

[0059] Error correction: If the information provided by the user is wrong or inconsistent, point out the error and provide correct guidance. For example, "Sorry, there is no 1-hour direct flight from Beijing to New York. Do you need a transfer solution?"

[0060] Ask: Proactively ask the user if they need other related services. For example, "The ticket booking is successful. Do you want to book a hotel or airport transfer service at the same time?"

[0061] The present invention adopts a hierarchical dialogue strategy selection model. First, a rule-based decision tree is used to select one or more candidate strategies according to the current dialogue state. For example, if the current state is "incomplete information", the "clarification" strategy is given priority; if the state is "task completed", the "inquiry" strategy is selected. Then, the present invention uses a transformer-based strategy scoring model to calculate the score of each candidate strategy. The model takes the dialogue state vector as input and outputs the score value of each strategy. The present invention selects the strategy with the highest score as the current optimal strategy. The scoring function of the model can be optimized by reinforcement learning to maximize the long-term dialogue benefits and improve the task completion rate and user satisfaction.

[0062] API combination search module, this module is responsible for searching feasible API call solutions based on clear query intent and parameters, and selecting the optimal solution for execution. For large-scale API libraries and complex combination constraints, exhaustive search of all possible call solutions is too costly. Therefore, the present invention proposes a heuristic search algorithm, which significantly improves the search efficiency.

[0063] The present invention defines an API metadata description framework to standardize the input, output, preconditions, and post-effects of each API. These metadata can be written manually or automatically extracted from API documents through natural language processing technology. In addition, the present invention also introduces some API usage rules and patterns, such as "some APIs require paired calls, and intermediate results need to be passed". These metadata and rules constitute the domain knowledge of heuristic search.

[0064] Given a query, the present invention first uses a rule-based approach to quickly match a set of candidate APIs based on query intent and parameters. Then, the present invention uses heuristic functions to evaluate the matching degree of each API with the query, as well as the pros and cons of the combination of APIs. The present invention designs a variety of heuristic functions, including:

[0065] Parameter coverage: The degree of match between the API input parameters and query parameters. The more parameters covered, the better.

[0066] Combination length: The length of the API combination call. Generally, the shorter the better, reducing the number of intermediate processing steps.

[0067] IO type consistency: The output and input types of adjacent APIs must be consistent to avoid type mismatches.

[0068] Execution cost: Consider the API time, resource consumption, and call restrictions. Choose the solution with the lowest cost.

[0069] Data quality: The accuracy, timeliness, and completeness of the results returned by the API. High-quality data sources are given priority.

[0070] The present invention adopts a heuristic search algorithm based on best priority. Starting from the initial state (i.e., the query parameters), the API with the highest evaluation value is selected for expansion each time to obtain a new intermediate state. This process is repeated until a complete calling scheme is found, and the output result covers all the parameters of the query. During the search process, the present invention uses a priority queue to dynamically sort the intermediate states to be expanded, and always gives priority to exploring the most promising branches. In addition, the present invention also designs a pattern-based pruning strategy to filter out some unreasonable intermediate states in advance and reduce invalid searches.

[0071] The best-first heuristic search algorithm used in this invention is a variant of the A* algorithm, which is specially adjusted for the API combination optimization problem. The core idea of ​​the algorithm is to guide the search process through the evaluation function and give priority to exploring the most promising paths. The specific implementation is as follows:

[0072] Evaluation function definition: f(n) = g(n) + h(n) where:

[0073] f(n) is the total evaluation value of node n;

[0074] g(n) is the actual cost from the initial state to node n;

[0075] h(n) is the estimated cost from node n to the goal state (heuristic function);

[0076] Heuristic function design: h(n) = w1 * (1 - p_cover) + w2 * d_remain + w3 * c_est Where:

[0077] p_cover: the proportion of query parameters currently covered;

[0078] d_remain: the number of remaining unmet dependent APIs;

[0079] c_est: estimated remaining call cost;

[0080] w1, w2, w3: weight parameters, optimized by machine learning methods;

[0081] Case description: Assume we have a query "Book a flight from Beijing to Shanghai, departing on July 1, economy class". The system needs to call the following API to complete the task:

[0082] API1: Query flight information (departure, destination, date) → flight list;

[0083] API2: Query seat availability (flight number, class) → Available seats;

[0084] API3: Create Booking (flight number, seat number, passenger information) → Order Number;

[0085] The search process is as follows:

[0086] Initial state: S0 (parameters = {departure: Beijing, destination: Shanghai, date: July 1, cabin: economy class}) f(S0) = 0 + h(S0) = 3 (estimated to need to call 3 more APIs);

[0087] Expand S0 and call API1: S1(flight list = [CA1234, MU5678], parameter = {class: economy class}) g(S1) = 1, h(S1) = 2 f(S1) = 1 + 2 = 3;

[0088] Expand S1 and call API2 (taking CA1234 as an example): S2(available seats = [12A, 15B], parameters = {}) g(S2) = 2, h(S2) = 1 f(S2) = 2 + 1 = 3;

[0089] Expand S2 and call API3: S3(order number = ORDxxx456) g(S3) = 3, h(S3) = 0 f(S3) = 3+ 0 = 3;

[0090] S3 is the target state and the search ends.

[0091] The final API call sequence is: API1 → API2 → API3

[0092] In this way, the algorithm can effectively search and combine APIs while avoiding unnecessary API calls and improving efficiency. The algorithm selects the node with the lowest evaluation value to expand at each step, ensuring the efficiency of the search and the optimization of the results.

[0093] In addition, the present invention also implements some optimization strategies:

[0094] Pruning: If the f value of a node exceeds the preset threshold, the node is discarded directly to avoid the search space being too large.

[0095] Cache: For frequently occurring sub-problems, cache their solutions to avoid repeated calculations.

[0096] Parallel search: Utilize multi-threading technology to explore multiple promising branches simultaneously, further improving search efficiency.

[0097] If there are multiple feasible solutions, the present invention selects the solution with the highest comprehensive evaluation value as the optimal solution. The system will record the specific API call sequence, parameter binding, intermediate results and other information of each solution for execution engine scheduling.

[0098] Execution engine module, the execution engine is the system's task scheduling and runtime environment. It is responsible for converting the optimal execution plan obtained by API combination search into an actual API call sequence, and controlling the execution process, exception handling, result collection, etc. of these calls. The main features of the execution engine include:

[0099] Universal scheduling: Automatically generate corresponding calling codes based on the input API metadata, shield the interface differences of different APIs, and decouple the scheduling logic from the API implementation.

[0100] Asynchronous execution: Adopt asynchronous non-blocking execution mode to make full use of system resources and improve throughput and concurrency performance.

[0101] Fault-tolerant mechanism: Perform error handling and timeout control on each API call to ensure the robustness and stability of the system.

[0102] Data fusion: Clean, normalize, and remove duplicates of atomic results returned by multiple APIs to generate comprehensive query results.

[0103] Cache optimization: cache repeated calls and hot data to reduce unnecessary API requests and improve response speed.

[0104] The present invention uses Python as the development language of the execution engine. Its rich data processing and concurrent programming libraries, such as Pandas, Numpy, asyncio, etc., are used to achieve efficient data processing and scheduling control. In addition, the present invention also provides a plug-in API adapter mechanism to facilitate the integration of different types of back-end services and has good scalability.

[0105] Backend API modules are not internal components of the query optimization system, but a collection of external services that provide data and computing power support for the system. They are usually developed and maintained by third-party providers or other internal teams, provide standardized REST or RPC interfaces, and have independent performance guarantees and service agreements. The query optimization system interacts with these backend services through API adapters to obtain data, calculation results, knowledge, etc., and is an important dependent resource of the system.

[0106] Common back-end APIs include: Structured databases: provide storage and retrieval services for business entity data such as products, orders, and customers, such as MySQL, Redis, etc.

[0107] Unstructured database: provides storage and retrieval services for multimedia data such as text, images, and videos, such as MongoDB and ElasticSearch.

[0108] Knowledge graph: provides storage and query services for knowledge entities, attributes, and relationships, and supports complex semantic reasoning, such as Neo4j, JanusGraph, etc.

[0109] Machine learning services: Provide intelligent algorithm services such as online learning, prediction, and recommendation, such as TensorFlowServing, PyTorch Serve, etc.

[0110] Third-party services: provide general business function services such as authentication, authorization, and payment, such as OAuth, WeChat Pay, etc.

[0111] The present invention designs and implements the backend API based on the microservice architecture, follows the principles of high cohesion, low coupling, and statelessness, and has good scalability and fault tolerance. At the same time, the present invention formulates a unified API specification and development process, including Swagger documents, unit testing, CI / CD, etc., to ensure the consistency and maintainability of the service. The backend API is decoupled from the query optimization system and can evolve and expand independently.

[0112] In summary, the above six modules constitute a complete query optimization system, covering the entire life cycle from user interaction, semantic understanding, query optimization to task execution, effect evaluation, and continuous optimization. Through the coordinated cooperation of various modules, the semantic understanding ability of the large language model and knowledge base is brought into play, and the reasoning and decision-making ability of heuristic search and automatic planning is utilized. Strategy self-optimization is also achieved through machine learning methods such as reinforcement learning, and finally a human-machine collaborative intelligent system is built that can flexibly, efficiently, and accurately meet the personalized query needs of users.

[0113] An application case of the query optimization system based on the present invention in the field of intelligent customer service.

[0114] User A bought a refrigerator on an e-commerce platform. After receiving the product, he found that the refrigerator door had slight scratches and wanted to consult the after-sales service. He entered the following query in the customer service chat window:

[0115] "There is a problem with the refrigerator I just bought. There are scratches on the door. Can I exchange it?"

[0116] 1. Query understanding: The system first performs intent recognition and slot filling on the query, and obtains the following results:

[0117] Intent: Exchange; Product: Refrigerator; Problem: There are scratches on the door; Due to the lack of necessary order number information, the exchange operation cannot be performed directly.

[0118] 2. Dialogue management: The system finds that the "Order Number" slot is empty and determines it as "Incomplete Information". Select the "Clarify" strategy and generate a reply asking for the order number:

[0119] "We are very sorry that the refrigerator you received has quality problems. In order to exchange it for you as soon as possible, please provide the order number corresponding to the refrigerator."

[0120] 3. Multi-round interaction: The user replied with the order number "2023xxxx0001", and the system updated the order number slot. At the same time, the multi-round dialogue content is integrated into a complete query: Intent: exchange; Product: refrigerator; Problem: scratches on the door; Order number: 2023xxxx0001

[0121] 4. API combination search: Based on clear query intent and parameters, the system searches for the following exchange solutions:

[0122] Solution 1: (order number + product SKU → identification qualification) + (order number + product SKU + problem description → generate return order) + (return order number → track logistics status) + (tracking order number → notify user); score: 0.95.

[0123] Solution 2: (order number + product SKU → identification qualification) + (order number + product SKU → generate exchange order) + (exchange order number → wait for the customer to send back the product) + (exchange order number + customer sends back the product → send new product) + (logistics order number → notify the user); Score: 0.90.

[0124] Option 3: Process omitted; score: 0.85.

[0125] The system selects solution 1 with the highest comprehensive score as the optimal solution.

[0126] 5. Execution engine: Call the return identification, return order generation, logistics tracking, user notification and other APIs in solution 1 in sequence to obtain the return order number "R2023xxxx0001" and the logistics tracking number "T2023xxxx0001".

[0127] 6. Result return: The system sends the return result and subsequent operation steps to the user:

[0128] "Hello, your refrigerator return application has been accepted. The return order number is R2023xxxx0001. The courier is expected to pick up the item tomorrow. Please keep all the refrigerator accessories complete and properly packed. The courier order number is T2023xxxx0001, which is convenient for you to track the return progress in real time. If you have any questions, please feel free to contact me at any time."

[0129] The above cases demonstrate the application effect of the present invention in actual customer service scenarios. Through key technologies such as knowledge base-enhanced query understanding, multi-round interactive dialogue management, heuristic API combination search, asynchronous and reliable task execution, the system ultimately provides users with personalized and highly interpretable return and exchange services, greatly improving service quality and user satisfaction. Since most common queries can be automatically processed, the workload of manual customer service is greatly reduced and service efficiency is improved.

[0130] Embodiment 2, the present invention provides a human-computer interactive query optimization system for incomplete queries, comprising:

[0131] The query understanding module is configured to: obtain user queries, use the knowledge-enhanced large language model to perform semantic understanding on the user queries, and extract query intent and key information;

[0132] The dialogue management module is configured to: determine whether the user query is missing necessary information through knowledge reasoning, and if necessary information is missing, initiate a clarification dialogue to guide the user to complete the information and obtain clear query intention information and parameters;

[0133] The API combination search module is configured to: map explicit query intent information and parameters into an API combination optimization problem, and use a heuristic search algorithm to search for feasible API call solutions;

[0134] The execution engine is configured to: select the solution with the highest comprehensive evaluation value from the feasible API call solutions to generate an API call sequence; use the planning execution engine to call the API in sequence, process the returned results, and generate the final user query results;

[0135] The optimization module is configured to: send user query results to users, have users accept user query results and obtain feedback and evaluation, collect feedback and evaluation, and use reinforcement learning algorithms to continuously optimize query understanding, dialogue management, and API combination search key strategies.

[0136] Embodiment 3, the present invention provides a computer-readable storage medium, the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the human-computer interactive query optimization method for incomplete queries described in Embodiment 1.

[0137] Embodiment 4, the present invention provides an electronic device, comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the human-computer interactive query optimization method for incomplete queries described in Embodiment 1

[0138] The electronic device may include: a processor, a memory and a communication unit. These components communicate via one or more buses. Those skilled in the art will appreciate that the structure of the electronic device does not limit the embodiments of the present invention, and it may be a bus structure or a star structure, or a combination of certain components, or different component arrangements.

[0139] The communication unit is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.

[0140] The processor is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0141] The memory is used to store the execution instructions of the processor. The memory can be implemented by any type of volatile or non-volatile storage device or a combination of them, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0142] When the execution instructions in the memory are executed by the processor, the electronic device is enabled to execute part or all of the steps of Embodiment 1.

[0143] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A human-computer interactive query optimization method for incomplete queries, characterized in that: include: Obtain user queries, use the knowledge-enhanced large language model to understand the semantics of user queries, and extract query intent and key information; The knowledge-enhanced large language model integrates the external knowledge base with the pre-trained language model to enhance the semantic understanding capability of incomplete queries; Determine whether the user's query is missing necessary information through knowledge reasoning. If necessary information is missing, initiate a clarification dialogue to guide the user to complete the information and obtain clear query intent information and parameters; Map explicit query intent information and parameters into an API combination optimization problem, and use a heuristic search algorithm to search for feasible API call solutions; The specific implementation of the heuristic search algorithm is as follows: Evaluation function definition: f(n)=g(n)+h(n) where: f(n) is the total evaluation value of node n; g(n) is the actual cost from the initial state to node n; h(n) is the estimated cost from node n to the target state; heuristic function design: h(n)=w1*(1-p_cover)+w2*d_remain+w3*c_est, where: p_cover: the proportion of query parameters currently covered; d_remain: the number of remaining unmet dependent APIs; c_est: the estimated remaining call cost; w1, w2, w3: weight parameters, optimized by machine learning methods; Select the solution with the highest comprehensive evaluation value from the feasible API call solutions to generate an API call sequence; use the planning execution engine to call the API in sequence, process the returned results, and generate the end-user query results; Send user query results to users, and users receive feedback and evaluations from the user query results. Collect feedback and evaluations, and use reinforcement learning algorithms to continuously optimize query understanding, dialogue management, and API combination search key strategies.

2. The method for optimizing incomplete queries based on human-computer interactive query according to claim 1, characterized in that: The heuristic search algorithm comprehensively considers the input and output type matching, call cost, and data quality factors of the API to efficiently find the optimal API combination solution.

3. The method for human-computer interactive query optimization for incomplete queries according to claim 1, characterized in that: The planning execution engine adopts asynchronous non-blocking calling and automatic retry fault tolerance mechanism.

4. The method for human-computer interactive query optimization for incomplete queries according to claim 1, characterized in that: The reinforcement learning algorithm continuously optimizes the dialogue strategy and intent recognition key models based on the delayed feedback reward signal.

5. The human-computer interactive query optimization method for incomplete queries according to claim 1, characterized in that: It also includes task complexity assessment, dynamic expert team formation, and collaborative reasoning mechanisms to improve the performance of large language models in processing complex tasks.

6. A human-computer interactive query optimization system for incomplete queries, characterized in that: include: The query understanding module is configured to: obtain user queries, use the knowledge-enhanced large language model to perform semantic understanding on the user queries, and extract query intent and key information; the knowledge-enhanced large language model integrates the external knowledge base with the pre-trained language model to enhance the semantic understanding ability of incomplete queries; The dialogue management module is configured to: determine whether the user query is missing necessary information through knowledge reasoning, and if necessary information is missing, initiate a clarification dialogue to guide the user to complete the information and obtain clear query intention information and parameters; The API combination search module is configured to: map explicit query intent information and parameters into an API combination optimization problem, and use a heuristic search algorithm to search for feasible API call solutions; The specific implementation of the heuristic search algorithm is as follows: Evaluation function definition: f(n)=g(n)+h(n) where: f(n) is the total evaluation value of node n; g(n) is the actual cost from the initial state to node n; h(n) is the estimated cost from node n to the target state; heuristic function design: h(n)=w1*(1-p_cover)+w2*d_remain+w3*c_est, where: p_cover: the proportion of query parameters currently covered; d_remain: the number of remaining unmet dependent APIs; c_est: the estimated remaining call cost; w1, w2, w3: weight parameters, optimized by machine learning methods; The execution engine is configured to: select the solution with the highest comprehensive evaluation value from the feasible API call solutions to generate an API call sequence; use the planning execution engine to call the API in sequence, process the returned results, and generate the final user query results; The optimization module is configured to: send user query results to users, have users accept user query results and obtain feedback and evaluation, collect feedback and evaluation, and use reinforcement learning algorithms to continuously optimize query understanding, dialogue management, and API combination search key strategies.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the human-computer interactive query optimization method for incomplete queries as described in any one of claims 1-5.

8. An electronic device, characterized in that: It comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, an electronic device is triggered to execute the human-computer interactive query optimization method for incomplete queries as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Intention recognition method based on deep learning network

    CN110232439A

  • SQL (Structured Query Language) generation method and device based on background knowledge enhancement, equipment and medium

    CN117312372A