Conversation processing method and device, equipment and storage medium

By introducing a knowledge base for processing object and domain knowledge in a multi-round dialogue system, using machine learning models to determine structured parameters and call APIs, the problem of inaccurate results in slot filling tasks is solved, and the accuracy of dialogue system is improved and User experience.

CN119476484APending Publication Date: 2025-02-18JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411534284.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the slot filling tasks of specific fields, the existing multi-round dialogue system has inaccurate or useless filling results, resulting in the language model's inaccurate understanding of complex problems, which affects the overall performance and user experience of the dialogue system.

Method used

By introducing a knowledge base that includes at least processing object and domain knowledge, a machine learning model is used to determine structured parameters based on user input and knowledge base, and the target API is called to generate replies.

Benefits of technology

It improves the accuracy of understanding and response to user input in specific fields, reduces misunderstandings and information loss in communication, and improves the accuracy of reply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476484A_ABST
    Figure CN119476484A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dialogue processing method and device, equipment and a storage medium. The method comprises the following steps: in response to a received first input of a user for a dialogue system, determining a knowledge base associated with the first input based on a user demand corresponding to the first input; determining a first parameter corresponding to the first input based on the first input and a knowledge base by utilizing a machine learning model; based on the first parameter, determining a structured parameter used for calling a target application programming interface API; and generating a reply for the first input based on a calling result of the target API by calling the target API using the determined structured parameter. Therefore, the accuracy of determining the target API parameters and the dialogue reply is remarkably improved by introducing the knowledge base and utilizing the knowledge in the related field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of information technology, and more particularly, to methods, devices, apparatuses, and computer-readable storage media for dialog processing. Background Art

[0002] In the field of natural language processing, especially in the design of multi-turn dialogue systems, it is necessary to accurately understand and process user input to meet different application scenarios, such as customer service, information query, and task execution.

[0003] In related technologies, methods based on rules, statistics, deep learning and pre-trained language models are usually used for multi-round dialogues. Although they perform well in language generation and context understanding, they often have problems with inaccurate or useless filling results in slot filling tasks in specific fields, resulting in the language model's inaccurate understanding of complex problems, affecting the overall performance of the dialogue system and user experience.

[0004] Therefore, a method for dialogue processing with higher accuracy and applicability is needed. Summary of the invention

[0005] In the first aspect of the present disclosure, a method for dialogue processing is provided. The method includes: in response to receiving a first input from a user to a dialogue system, based on the user demand corresponding to the first input, determining a knowledge base associated with the first input, the knowledge base at least including a processing object matching the user demand and domain knowledge associated with the user demand; using a machine learning model, based on the first input and the knowledge base, determining a first parameter corresponding to the first input, the first parameter being used to indicate a processing object determined by the machine learning model based on at least the first input; based on the first parameter, determining a structured parameter for calling a target application programming interface API; and calling the target API by using the determined structured parameter, generating a reply to the first input based on the call result of the target API.

[0006] In the second aspect of the present disclosure, a device for dialogue processing is provided. The device includes: a knowledge base determination module, configured to determine the knowledge base associated with the first input based on the user demand corresponding to the first input in response to receiving the first input of the user for the dialogue system, the knowledge base at least including the processing object matching the user demand and the domain knowledge associated with the user demand; a first parameter determination module, configured to determine the first parameter corresponding to the first input based on the first input and the knowledge base using a machine learning model, the first parameter being used to indicate the processing object determined by the machine learning model based on at least the first input; a structured parameter determination module, configured to determine the structured parameters for calling the target application programming interface API based on the first parameter; and a reply module, configured to call the target API by using the determined structured parameters, and generate a reply to the first input based on the call result of the target API.

[0007] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0009] In a fifth aspect of the present disclosure, a computer program product is provided, which is tangibly stored in a computer storage medium and includes computer executable instructions, which when executed by a device cause the device to perform the method according to the first aspect of the present disclosure.

[0010] It should be understood that the content described in this content section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0012] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0013] Figure 2A flowchart showing a dialog processing process according to some embodiments of the present disclosure is shown;

[0014] Figure 3A A schematic diagram showing a process of determining a knowledge base in some embodiments of the present disclosure;

[0015] Figure 3B A schematic diagram showing a process of determining a first parameter in some embodiments of the present disclosure;

[0016] Figure 3C A schematic diagram showing a process of determining structured parameters of a target API according to some embodiments of the present disclosure;

[0017] Figure 4 A block diagram showing an apparatus for conversation processing according to some embodiments of the present disclosure; and

[0018] Figure 5 A block diagram of an electronic device capable of implementing one or more embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0019] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0021] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0022] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0023] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.

[0026] As briefly mentioned above, in the field of natural language processing, especially in the design of multi-turn dialogue systems, it is necessary to accurately understand and process user input to meet different application scenarios, such as customer service, information query, and task execution.

[0027] In the related art, multi-turn dialogue refers to a process in which participants communicate and respond multiple times in a dialogue, and requires the system to have a deep understanding of the context. It is widely used in natural language processing and human-computer dialogue. The workflow of the multi-turn dialogue system is as follows: when the system receives the user's input, it first uses natural language processing technology to determine the user's needs or purposes. This step is to understand what the user wants to do, such as querying information, performing tasks, or getting help. After clarifying the user's needs, the system needs to extract key information from the user's input, such as time, place, object, etc., and fill this information into the corresponding "slots". These slots are the information required by the dialogue system to communicate with the business-related application programming interface (Application Programming Interface, API). Once the slots are filled, the system will call the corresponding business API based on this information to process the user's request. This step usually involves interacting with external services or databases to obtain or process data. Finally, the system generates appropriate response information based on the results returned by the API to answer the user's questions or execute their instructions.

[0028] However, the language models included in the multi-turn dialogue systems in related technologies are usually trained on large-scale data that is general and covers a variety of topics and fields, so they may lack sufficient expertise when faced with specific fields or scenarios. This can cause the model to produce inaccurate or useless results in slot filling tasks. For example, for a specific indicator query task, the model may generate multiple slot filling results that seem reasonable but do not actually meet the requirements of the professional field.

[0029] Therefore, in order to solve the above problems, domain knowledge can be introduced into the large language model, and a processing object alignment and clarification mechanism can be established based on this knowledge. The generalization ability and accuracy of the dialogue system can be improved through the processing object alignment and clarification mechanism based on domain knowledge.

[0030] In an embodiment of the present disclosure, a scheme for dialogue processing is provided. According to an embodiment of the present disclosure, in response to receiving a first input from a user to a dialogue system, based on the user demand corresponding to the first input, a knowledge base associated with the first input is determined, the knowledge base at least including a processing object matching the user demand and domain knowledge associated with the user demand; using a machine learning model, based on the first input and the knowledge base, a first parameter corresponding to the first input is determined, the first parameter is used to indicate the processing object determined by the machine learning model based on at least the first input; based on the first parameter, a structured parameter for calling a target application programming interface API is determined; and by calling the target API using the determined structured parameter, a reply to the first input is generated based on the call result of the target API.

[0031] Therefore, by introducing a knowledge base that includes at least processing objects and domain knowledge, this solution can effectively solve the problem of the lack of domain expertise in general machine learning models, ensuring that the model can be processed in combination with knowledge in specific fields, thereby improving the accuracy of understanding and responding to user input in specific fields. In addition, by calculating the similarity between the processing object determined from the user input and the standard processing object in the knowledge base, and aligning and clarifying them, misunderstandings and information loss in communication are reduced, and the accuracy of responses is improved.

[0032] Figure 1A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In the environment 100, in response to receiving input to a dialog system (collectively or individually referred to as user input 120), the electronic device 110 determines a knowledge base 130 associated with the user input 120. The electronic device 110 can then use a machine learning model to determine a structured parameter 150 for calling an application programming interface API 140 based on the user input 120 and the knowledge base 130. By using the determined structured parameter 150 to call the target API 140, the electronic device 110 can generate a reply 160 to the user input 120 based on the call result of the target API 140.

[0033] In some embodiments, the electronic device 110 may have at least one round of dialogue with the user and receive at least one user input 120 (e.g., a first input 120-1, a second input 120-2, and a third input 120-3). It should be understood that the first input 120-1, the second input 120-2, and the third input 120-3 are merely exemplary illustrations of the user input 120 that the electronic device 110 may receive in multiple rounds of dialogue, and are not intended to limit the number and order of the user input 120 in the present disclosure in any form.

[0034] In some embodiments, the knowledge base 130 may include information resources used in the process of determining the structured parameters 150 for calling the application programming interface API 140. For example, the knowledge base 130 includes at least processing objects that match user needs and domain knowledge associated with user needs. Knowledge refers to information or data that has been organized, integrated, refined and verified, generally has a clear structure and meaning, and can be directly used to support the implementation of functions, such as query functions, statistical functions, or functions to perform other operations. In the knowledge base 130, knowledge can often be organized and refined through specific methods and tools (such as offline processing, online acquisition), and has a structured or semi-structured form, such as database records, knowledge graph nodes, etc., which together constitute the basis for the dialogue system to understand user input, determine the structured parameters of the target API, and generate dialogue replies.

[0035] In some embodiments, the electronic device 110 may also regularly update the knowledge base 130 based on real-time user needs or new research results, field dynamics, etc., to ensure the timeliness and accuracy of the knowledge.

[0036] In the environment 100, the electronic device 110 can be any type of device with computing capabilities, including a terminal device or a server device. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like.

[0037] It should be understood that the structure and functionality of environment 100 are described for exemplary purposes only and does not imply any limitation on the scope of the present disclosure.

[0038] Figure 2 1 is a flowchart of a process 200 of dialog processing according to some embodiments of the present disclosure. The process 200 may be implemented in the environment 100, for example, the process 200 may be implemented at the electronic device 110. In the following, for ease of discussion, reference will be made to Figure 1 The process 200 is described. The multi-round dialogue process involved in the embodiment of the present disclosure may be performed on at least one user input 120 of at least one user. For ease of understanding, the first input 120-1 is used as an example for explanation.

[0039] In block 210 , in response to receiving a first input 120 - 1 from a user to a dialog system, a knowledge base 130 associated with the first input 120 - 1 is determined based on a user requirement corresponding to the first input 120 - 1 .

[0040] In some embodiments, the first input 120-1 refers to information provided by the user to the multi-round dialogue system indicating the user's purpose or needs, such as asking a question, requesting a service, or requiring specific information. For example, the first input 120-1 can be a question, query, instruction, or command sent by the user in various forms such as text, voice, or pictures. After receiving the first input 120-1, the electronic device 110 performs at least one round of dialogue processing to generate an appropriate response and meet the user's needs.

[0041] As an example, the first input 120 - 1 may be the initial input provided by the user when starting a dialogue with the dialogue system, which usually includes the user's initial purpose or demand and is the starting point of the system dialogue.

[0042] As another example, the first input 120-1 may also be a further input provided by the user based on the response or request of the system during the conversation. The first input as a subsequent input of the conversation may be an answer to a system question, a supplement or clarification of the aforementioned information, or a new query or request. This input based on interaction appears at different stages of the conversation, helping the system to gradually clarify the user's intention and improve the content of the conversation.

[0043] In some embodiments, after receiving the user's first input 120-1, the electronic device 110 can identify the user's specific needs or questions through natural language processing technology. For example, the electronic device 110 identifies the user's need to query the data of a certain indicator through the first input 120-1 "query the number of transaction customers in the past seven days". Then, the electronic device 110 can determine the knowledge base 130 associated with the first input 120-1 based on the user's needs corresponding to the first input 120-1.

[0044] In some embodiments, the knowledge base 130 includes at least processing objects that match user requirements and domain knowledge associated with the user requirements.

[0045] In some embodiments, the processing object (also called entity) that matches the user's needs refers to an object or concept with a specific identity, attribute or relationship. In a dialogue system, an entity can be any specific or abstract thing mentioned by the user or other elements that need to be identified and processed, such as a person's name, place name, organization name, product name, time, date, quantity, etc.

[0046] In some embodiments, domain knowledge associated with user needs refers to expertise, rules, terminology, and concepts in a specific field. In a dialogue system, domain knowledge includes, but is not limited to, professional terminology, industry standards, rules and experience in specific scenarios, and solutions to common problems. Different fields have different knowledge systems and rules, so the dialogue system needs to have the corresponding domain knowledge to effectively interact with users. For example, in the medical field, domain knowledge may include disease diagnosis methods, drug instructions, surgical procedures, etc. In the e-commerce field, domain knowledge may include product classification, pricing strategies, promotional activity rules, etc.

[0047] In some embodiments, domain knowledge is used to supplement the deficiencies of machine learning models such as large language models in processing conversation content in specific fields, and to help the electronic device 110 process user input according to the rules and standards of specific scenarios. For example, in the financial field, domain knowledge can provide information on various indicator names and calculation cycles, thereby helping to identify user-specific financial terms and perform corresponding calculations or analyses.

[0048] In some embodiments, the process of determining the knowledge base 130 associated with the first input 120 - 1 is also referred to as recall, which refers to the process of quickly filtering out potentially relevant items from a data source for subsequent processing based on user needs or purposes.

[0049] Figure 3A A schematic diagram of a process of determining the knowledge base 130 according to some embodiments of the present disclosure is shown. The process 300A may be implemented at the electronic device 110 .

[0050] In block 311, the electronic device 110 determines whether the first input 120-1 is in a clarification state based on a user requirement. The clarification state indicates that the first input 120-1 is received in response to a historical conversation between the user and the dialog system.

[0051] In some embodiments, the clarification state refers to a state in which, during a historical conversation with the user, it is detected that the information or data required to currently determine the structured parameters of the target API is incomplete or unclear, and further more information needs to be obtained from the user to complete the information or data.

[0052] As an example, clarifying the status may include:

[0053] Clarification of missing or ambiguous information: When the information entered by the user is incomplete, unclear or ambiguous, the clarification state is entered. For example, if the user enters "query the number of people who activated product A" but does not specify a time range, the electronic device 110 can send a prompt to the user asking "Which time period do you want to query the number of people who activated product A?"

[0054] Entity alignment clarification: When the processing object identified by the electronic device 110 is not completely consistent with the processing object matching the user's needs in the knowledge base, the system may enter a clarification state. For example, the "number of users of product A" entered by the user may have multiple similar indicator names in the system, and the system may send a prompt to the user asking "Do you mean the number of people who have activated product A or the number of people who have used product A?"

[0055] Mismatched information clarification: When the information entered by the user does not match the expected format or content, enter the clarification state. For example, if the date format entered by the user is incorrect, you can send the user a prompt "Please enter the date in the format of YYYY-MM-DD."

[0056] In some embodiments, the electronic device 110 can determine whether the first input is in a clarification state through the historical conversation 131. The interaction data between the user and the dialogue system is saved in the historical conversation so that the electronic device 110 can better understand the user's needs and context. For example, the historical conversation may include: the content input by the user in the conversation, which may be user questions, instructions, clarification requests, etc.; the system's response to each user input, including information provision, request for clarification, confirmation, etc.; important contextual information during the conversation, such as identified user needs, filled slots, whether it is in a clarification state, etc.; the time of each dialogue interaction; the stage and order of the conversation, and other information.

[0057] In some embodiments, the electronic device 110 may query the historical conversation 131 between the user and the dialog system. If it is determined based on the user's needs that the first input 120-1 indicates a response to the historical interaction content in the historical conversation, the first input 120-1 is determined to be in a clarification state.

[0058] As an example, after the electronic device 110 identifies the user demand corresponding to the first input 120-1, it queries the historical conversations of the dialogue system based on the user demand, and determines that the first input 120-1 corresponds to a clarification request that has been initiated in the previous dialogue round, and then determines that the first input 120-1 is in a clarification state.

[0059] In the disclosed embodiment, by recording the historical conversation, the user's purpose and needs can be accurately determined based on the previous conversation content, making the conversation more coherent and avoiding breaks or unnecessary repetitions. In addition, by remembering and utilizing the information that the user has provided and determining whether the user input is in a clarification state, unnecessary repeated inquiries can be reduced, so that the user does not need to repeatedly provide the same information, thereby improving the user experience.

[0060] Continue to refer Figure 3A In block 312 , if the electronic device 110 determines that the first input 120 - 1 is not in a clarifying state, a knowledge base 130 corresponding to the user requirement is determined from a predetermined database.

[0061] In some embodiments, the electronic device 110 determines that the first input 120-1 is not in a clarification state, which generally means that the dialogue system does not currently need to obtain more information through additional user interaction to complete a task. For example, the first input 120-1 is the first task request made by the user to the electronic device 110 in the dialogue. The electronic device 110 needs to understand and process this task request from scratch without referring to the previous dialogue content. Or the first input 120-1 is in the middle turn of the dialogue, but it is not related to the content discussed before, and the electronic device 110 can regard it as a new question. This situation is also considered to be not in a clarification state because the electronic device 110 does not need to refer to the previous dialogue to answer this question.

[0062] In some embodiments, the electronic device 110 retrieves the processing object that matches the user's needs from the predefined entity database 130-1 according to the user's intention corresponding to the first input 120-1, and retrieves the relevant domain knowledge from the predefined domain knowledge database 130-2. The entity database 130-1 usually contains all possible processing objects (entities) and their attributes in the domain. The domain knowledge database 130-2 may include background information, rules and expertise related to a specific domain, such as documents, databases, knowledge graphs, etc. For example, specific calculation methods, term definitions, etc. in the financial field.

[0063] In some embodiments, the knowledge base 130 may also include example knowledge, which indicates sample user input and corresponding sample replies. The electronic device 110 may also retrieve example knowledge related to user needs from a predefined example knowledge database 130-3. Example knowledge may refer to a specific example used to illustrate or demonstrate a concept, method, or situation. Example knowledge can help the electronic device 110 better understand the user's needs, especially when the user input is unclear or ambiguous, the electronic device 110 can guide the user to give a more accurate answer through example knowledge.

[0064] In some embodiments, the electronic device 110 may also perform relevance calculations, such as keyword matching, semantic similarity calculations, context relevance calculations, etc., for the processing objects, domain knowledge, and / or example knowledge in the knowledge base 130. The processing objects, domain knowledge, and / or example knowledge that match the user's needs are sorted according to the scores of the relevance calculations, and a candidate list is generated based on the sorting results for subsequent dialog processing.

[0065] Continue to refer Figure 3A In box 313, if the electronic device 110 determines that the first input 120-1 is in a clarifying state, the knowledge base 130 corresponding to the user's needs is determined based on at least the historical conversation 131 for the user.

[0066] In some embodiments, if the first input 120-1 is in a clarifying state, the electronic device 110 can directly determine the knowledge base 130 corresponding to the user's needs based on the historical conversation 131 for the user. Because this information has been obtained from a predetermined database in the previous conversation round, the electronic device 110 can obtain the information in the knowledge base 130 in the historical conversation and continue to interact with the user based on this information.

[0067] In the disclosed embodiment, by determining whether the user input is in a clarifying state, the system can ensure that when the user input is unclear or the information is insufficient, the system proactively asks the user for additional information and only requests more information from the user when necessary. This helps avoid misunderstandings and incorrect API calls and improves the accuracy of the system's response.

[0068] In some embodiments, the knowledge base 130 also includes interface information. The interface information includes at least one of the following: interface name, interface data type, interface parameter format. In other embodiments, the interface information may also include more, less or different other information.

[0069] In some embodiments, the electronic device 110 may determine, based on user requirements, interface information of a target API corresponding to the first input from an application programming interface library.

[0070] In some embodiments, after the electronic device 110 identifies the user demand corresponding to the user input, it can query in a predetermined API library. This API library contains the definition and interface information of each API supported by the system, such as the function, interface name, interface data type, interface parameter format, return value type and other information of each API. The electronic device 110 can match the identified user demand with the API function in the API library to determine the target API. This process may involve calculating the semantic similarity between the API function description and the user demand to ensure that the selected API can accurately meet the user's needs.

[0071] In the disclosed embodiments, by accurately matching user needs with API functions, it is possible to ensure that the called API is highly relevant to the actual needs of the user, thereby improving the accuracy of the system's response to user requests. Moreover, by clarifying the interface information, it is possible to clearly know the parameters of the interface that need to be filled in, as well as the specific meanings and format requirements of these parameters. This helps to reduce the cases where API calls fail or invalid results are returned due to parameter mismatches or format errors, thereby improving the accuracy and stability of the dialogue system.

[0072] Return to reference Figure 2In box 220, the electronic device 110 uses the machine learning model to determine the first parameter corresponding to the first input 120-1 based on the first input 120-1 and the knowledge base 130. The first parameter is at least used to indicate the processing object determined by the machine learning model based on at least the first input. The machine learning model can also determine the corresponding processing object (i.e., a parameter object related to the user's intention, used to call the target API or perform a specific task) based on the first input and / or all user inputs received previously.

[0073] Figure 3B A schematic diagram of a process of determining a first parameter according to some embodiments of the present disclosure is shown. The process 300B may be implemented at the electronic device 110 .

[0074] In box 321, the electronic device 110 can use a predetermined template 133 to determine the first prompt word information based on at least one of the following: the first input 120-1, the processing object corresponding to the user needs included in the knowledge base 130, the domain knowledge associated with the user needs, example knowledge and historical conversations 131 for the user, and the interface information 132 of the target API.

[0075] In some embodiments, the electronic device 110 includes a predetermined prompt template 133, which can generate prompt information based on user input, combined with the processing object corresponding to the user demand in the knowledge base, example knowledge, domain knowledge and interface information, historical conversations and other information, so as to provide a complete context for the machine learning model. This comprehensive information input can help the machine learning model understand the user demand more accurately and generate corresponding parameters.

[0076] In some embodiments, the prompt word information refers to the starting text or instructions provided in the generative language model to guide and direct the model to generate specific output text.

[0077] In box 322, the electronic device 110 uses a machine learning model to determine a first parameter corresponding to the first input 120-1 based on the first prompt word information.

[0078] In some embodiments, after the electronic device 110 sends the constructed prompt word information into a machine learning model (such as a large language model), the model determines the first parameter corresponding to the first input 120-1 based on this information, that is, generates parameters that match user requirements and API parameters, which are used to fill in the various slots of the structured parameters of the target API as slot values ​​after verifying these parameters.

[0079] In some embodiments, the machine learning model used to determine the first parameter corresponding to the first input 120-1 based on the first prompt word information is a large language model (LLM). The large language model has a strong natural language understanding capability, and the electronic device 110 can use the large language model to understand the prompt words dynamically generated by combining entities, examples, domain knowledge and context information, so as to understand the purpose and needs of the user input.

[0080] In the disclosed embodiment, by comprehensively considering the processing object corresponding to the user demand, the domain knowledge associated with the user demand, the example knowledge, the historical conversation, the interface of the target API and other information, the dynamic prompt word information can be generated to help the large language model understand the user demand more accurately. And by introducing domain knowledge and context information, the occurrence of model hallucination can be effectively reduced, and the reliability of the dialogue system can be improved.

[0081] Return to reference Figure 2 In block 230 , the electronic device 110 determines structured parameters for calling a target application programming interface API based on the first parameter.

[0082] In some embodiments, although the first parameter used to construct the structured parameter is determined using a machine learning model, the processing object indicated by the first parameter may not be completely consistent with the processing object in the knowledge base that matches the user's needs. For example, the processing object indicated by the first parameter based on the user's input is "the number of people who have activated product A", while the standard processing object that matches the user's needs in the knowledge base is "the number of users who have activated product A". By calculating the similarity between the processing object indicated by the first parameter and the processing object that matches the user's needs in the knowledge base, those processing objects that need further alignment or clarification can be identified, thereby ensuring that the generated reply or the performed operation can accurately reflect the user's needs and conform to the relevant domain knowledge.

[0083] In some embodiments, the electronic device 110 may determine the structured parameters for calling the target application programming interface API based on the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base.

[0084] Figure 3C A schematic diagram of a process 300C for determining structural parameters of a target API according to some embodiments of the present disclosure is shown. The process 300C may be implemented at the electronic device 110 .

[0085] In block 331 , the electronic device 110 determines the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user requirement.

[0086] In some embodiments, the electronic device 110 determines the vector representation of the processing object indicated by the first parameter and the processing object corresponding to the user demand. Then, the electronic device 110 uses the embedding model to determine the similarity between the processing object indicated by the first parameter and the processing object matching the user demand in the knowledge base based on the vector representation.

[0087] In some embodiments, the electronic device 110 can use an embedding model to place the processing object indicated by the first parameter and the processing object corresponding to the user demand into a high-dimensional space, and obtain the similarity between the processing object indicated by the first parameter and the processing object matching the user demand in the knowledge base by calculating the distance or angle between the vectors to measure their semantic similarity.

[0088] In some embodiments, the electronic device 110 may also check whether the processing object indicated by the first parameter and the processing object corresponding to the user demand directly match according to the set business rules. These rules may be formulated based on domain knowledge, data specifications or business logic, and are used to quickly determine whether the processing object indicated by the first parameter and the processing object corresponding to the user demand can be directly identified as the same concept.

[0089] In some embodiments, the electronic device 110 may also use a text similarity algorithm to determine the text similarity between the processing object indicated by the first parameter and the processing object corresponding to the user demand. For example, a contextual query rewriting algorithm (CQR) and a contextual term relationship algorithm (CTR). These algorithms are usually calculated based on the similarity at the character, vocabulary or grammatical level, and can quantify the similarity between texts.

[0090] In some embodiments, the electronic device 110 can also combine the results of business rule matching, text similarity algorithm and similarity calculation based on embedded model to form an overall similarity score as the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user's needs.

[0091] In the disclosed embodiment, by calculating the similarity between the processing object indicated by the first parameter and the processing object corresponding to the user's needs, parameters that need further alignment or clarification can be identified, thereby ensuring that the generated reply or the executed operation can accurately reflect the user's needs. This helps to improve the accuracy and reliability of the dialogue system and enhance user satisfaction and trust.

[0092] Continue to refer Figure 3CIn box 332, the electronic device 110 determines whether the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base is greater than a predetermined threshold.

[0093] If it is determined that the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base is greater than a predetermined threshold, block 333 is executed. In block 333, the electronic device 110 determines the first parameter as the first slot value corresponding to the first input.

[0094] In some embodiments, when the similarity calculation result indicates that the processing object indicated by the first parameter obtained by the user input is sufficiently similar to an entity (processing object) in the knowledge base (exceeding a preset threshold), the electronic device 110 can identify the two as the same object. This means that the processing object indicated by the first parameter and the processing object in the knowledge base are regarded as the same entity. This process can also be called entity alignment. Entity alignment is the process of associating and matching the same or related entities in a knowledge graph or multiple data sources. Its core purpose is to associate user input with existing knowledge in the system to achieve more accurate and relevant responses.

[0095] In block 334, the electronic device 110 updates the dialog state tracking component based on the first slot value. The dialog state tracking component is used to store dialog information interacting with the user, and the dialog information at least includes the slot value used to determine the structural parameter.

[0096] In some embodiments, the Dialog State Tracking (DST) component is a key component in the dialog system, which is used to track and maintain the dialog state between the user and the system in real time. It records various dialog information during the dialog process so that the system can understand the user's needs and respond accordingly.

[0097] In some embodiments, the conversation information stored in DST includes slots and slot values ​​for determining structured parameters. A slot is a semantic role in natural language processing, which indicates the location or attribute of specific information and is used to fill in information related to user needs identified from the user's input, such as the first parameter. For example, in a conversation scenario of time query, the slots may include "start time" and "end time".

[0098] In some embodiments, a slot value is specific information or data associated with a specific slot, indicating a specific value provided by a user in a conversation or interaction. When the electronic device 110 calculates the similarity and regards the processing object indicated by the first parameter and the processing object in the knowledge base as the same entity, the first parameter can be filled into the corresponding slot as the slot value.

[0099] In some embodiments, the electronic device 110 determines structured parameters for calling the target API based on the various slot values ​​stored in the dialog state tracking component.

[0100] Continue to refer Figure 3C In block 335 , the electronic device 110 determines whether the slot value of each slot in the dialog state tracking component has been determined. If the slot value of each slot in the dialog state tracking component has been determined, block 336 is executed.

[0101] In block 336 , the electronic device 110 determines structured parameters for calling the target API based on the slot values ​​of the slots in the dialog state tracking component.

[0102] In some embodiments, the electronic device 110 can update the dialog state tracking component according to the result of slot filling, and determine whether the slots defined by the API in the dialog state tracking component have been filled. If the slot values ​​of each slot have been determined, the electronic device 110 can construct structured parameters for calling the target API based on these slot values.

[0103] In the disclosed embodiment, by filling and updating each slot in the dialogue state tracking, the accuracy and real-time nature of the system dialogue state can be ensured, misunderstandings and errors can be reduced, and the accuracy of the response can be improved. In addition, through this mechanism of automatically updating and filling slots, users do not need to provide information repeatedly. The system can respond promptly and accurately based on understanding the user's needs and purposes.

[0104] Continue to refer Figure 3C If the electronic device 110 determines that there is an undetermined slot, the electronic device 110 may execute box 337.

[0105] In block 337 , the electronic device 110 sends an instruction message to the user for entity clarification to obtain more input information.

[0106] In some embodiments, if it is determined that there are undetermined slot values ​​in each slot in the dialog state tracking component, the electronic device 110 sends a first indication message to the user, where the first indication message indicates obtaining the user's second input 120 - 2 .

[0107] As an example, if there are undetermined time slots in the DST, the electronic device 110 may generate a first indication message (eg, "please indicate a specific time range") and send it to the user through the user interface. The electronic device 110 may receive a second input 120-2 provided by the user according to the first indication message.

[0108] In some embodiments, the electronic device 110 determines the second slot value corresponding to the second input 120-2 based on the second input 120-2. Based on the second slot value and the slot value determined in the dialog state tracking component, the electronic device 110 determines the structured parameters for calling the target API.

[0109] In some embodiments, the electronic device 110 receives a second input 120-2 from the user, determines a second slot value by performing the same or similar processing steps as the first input 120-1 on the second input 120-2, and combines the second slot value with the determined slot value to finally form a complete structured parameter.

[0110] As an example, the electronic device 110 can check whether the slot values ​​corresponding to each slot have been filled after each slot value in the dialogue state tracking component (DST) is determined. If it is found that some slots are not filled or the information is incomplete. The electronic device 110 can generate a clarification request related to the unfilled slots and ask the user for the missing information. By receiving and processing the user's response, the slot value in the DST is updated. For example, in response to the user's flight booking needs, the electronic device 110 determines the slot values ​​such as "booked flight", "departure A", and "destination B" after several rounds of dialogue with the user, but detects that the user has not specified the slot for the departure date. The electronic device 110 can send a prompt message to the user "When do you want to leave?", and after updating the slot information of the departure date based on the user's response, determine the structured parameters that meet the API definition (such as parameters in the format of "JSON" or "CSV"). Through the structured parameters, the electronic device 110 calls the corresponding API to continue the flight booking process.

[0111] In the disclosed embodiment, by prompting the user to supplement the information, it is possible to ensure that the system obtains all necessary information, avoiding processing errors or request failures due to missing data. In addition, by asking the user for more details, it is possible to help the dialogue system understand the user's needs and purposes more accurately, thereby providing more accurate and relevant services or information.

[0112] Return to reference Figure 3C In box 332, the electronic device 110 determines whether the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base is greater than a predetermined threshold.

[0113] If it is determined that the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base is less than a predetermined threshold, box 337 is executed. In box 337, the electronic device 110 sends an instruction message to the user for entity clarification to obtain more input information.

[0114] In some embodiments, if it is determined that the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user's needs is less than a predetermined threshold, this means that the similarity between the processing object indicated by the first parameter obtained by the user input and an entity (processing object) in the knowledge base is not enough to consider them to be the same or highly related, and the user's input cannot be directly aligned with an entity in the knowledge base. When the similarity is lower than the threshold, the electronic device 110 usually performs an entity clarification process to improve the accuracy of understanding and response.

[0115] In some embodiments, the electronic device 110 sends second indication information to the user, where the second indication information indicates obtaining a third input 120 - 3 from the user.

[0116] As an example, if the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user's needs is less than a predetermined threshold, the electronic device 110 can generate a second indication information (such as "Please confirm whether your query target is A or B") and send it to the user through the user interface to receive a third input 120-3 provided by the user based on the second indication information.

[0117] In some embodiments, the electronic device 110 determines a third slot value corresponding to the third input 120 - 3 based on the third input 120 - 3 . Based on the third slot value and the slot value determined in the dialog state tracking component, the electronic device 110 determines structured parameters for calling the target API.

[0118] In some embodiments, the electronic device 110 receives a third input 120-3 from the user, determines a third slot value by performing the same or similar processing as the first input 120-1 and / or the second input 120-2 on the third input 120-3, and combines the third slot value with the determined value to finally form a complete structured parameter.

[0119] As an example, the user inputs "Query the number of users of product A in the past week." The electronic device 110 calculates the similarity and finds that the similarity between the processing object "number of users of product A" and multiple standard processing objects in the knowledge base that match the user's needs (such as "number of activated users of product A" and "number of users using product A") is lower than the set threshold. At this time, the electronic device 110 can generate a second prompt message "Do you mean 'number of activated users of product A' or 'number of users using product A'?", and after determining the slot information of the processing object corresponding to the user's needs based on the user's response update, determine the structured parameters that comply with the API definition (for example, parameters in formats such as "JSON" or "CSV"). Through the structured parameters, the electronic device 110 calls the corresponding API to continue the query process.

[0120] In some embodiments, if there are multiple candidate processing objects corresponding to the user's needs in the knowledge base 130, the electronic device 110 can calculate the similarity between each candidate processing object and the processing object indicated by the first parameter, and then filter the content of the second prompt information according to the calculation result. For example, a recommendation threshold is set. If the similarity between a candidate processing object in the knowledge base 130 and the processing object indicated by the first parameter exceeds the recommendation threshold, the candidate processing object is regarded as a recommended candidate and recommended to the user for confirmation through the second prompt message.

[0121] In the disclosed embodiment, by triggering the entity clarification process when the similarity is lower than a predetermined threshold, when the understanding of the user input is not clear enough, further interaction and clarification are performed to more accurately understand the user's needs, so as to ensure that the final response is accurate, relevant and meets the user's needs. In this way, the system can not only improve its own accuracy and reliability, but also provide a better user experience.

[0122] Return to reference Figure 2 In block 240 , the electronic device 110 calls the target API by using the determined structured parameters, and generates a reply to the first input based on the calling result of the target API.

[0123] In some embodiments, the electronic device 110 fills the slots of the dialogue state tracking component (DST) through the user's input to determine the structured parameters of the target API. After determining the structured parameters of the target API, the electronic device 110 can use these structured parameters to call the corresponding target API. When the API returns the results, the electronic device 110 will generate a reply to the user based on these results. This process can be directly feeding back data, interpreting data, or performing further processing based on the data to give suggestions or conclusions.

[0124] In the disclosed embodiment, by introducing a knowledge base, the understanding and response capabilities of the machine learning model in a specific field can be enhanced. This approach not only improves the adaptability of the model to complex field problems, but also ensures accurate answers to user-specific needs. Moreover, by performing similarity calculations, the system can more accurately align the processing object indicated by the user input with the standard processing object in the system. And by generating prompt information, the system can clarify in a timely manner to ensure that the final aligned entity meets the user's real needs.

[0125] Figure 4 A block diagram of an apparatus 400 for conversation processing according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented as or include the electronic device 110.

[0126] The device 400 includes a knowledge base determination module 410, which is configured to determine, in response to receiving a first input from a user to a dialogue system, a knowledge base associated with the first input based on a user demand corresponding to the first input, the knowledge base including at least a processing object matching the user demand and domain knowledge associated with the user demand; a first parameter determination module 420, which is configured to determine, using a machine learning model, a first parameter corresponding to the first input based on the first input and the knowledge base, the first parameter being used to indicate the processing object determined by the machine learning model based on at least the first input; a structured parameter determination module 430, which is configured to determine, based on the first parameter, a structured parameter for calling a target application programming interface API; and a reply module 440, which is configured to call the target API by using the determined structured parameter, and generate a reply to the first input based on the call result of the target API.

[0127] In some embodiments, the structured parameter determination module 430 is further configured to determine the structured parameters for calling the target application programming interface API based on the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base.

[0128] In some embodiments, the knowledge base determination module 410 is further configured to determine whether the first input is in a clarification state based on user needs, the clarification state indicating that the first input is received in response to a historical conversation between the user and the dialogue system; if it is determined that the first input is in a clarification state, determine the knowledge base corresponding to the user needs based at least on the historical conversation with the user; and if it is determined that the first input is not in a clarification state, determine the knowledge base corresponding to the user needs from a predetermined database.

[0129] In some embodiments, the knowledge base determination module 410 is further configured to query historical conversations between the user and the dialogue system; if it is determined based on user needs that the first input indicates a response to historical interaction content in the historical conversation, then the first input is determined to be in a clarification state.

[0130] In some embodiments, the knowledge base determination module 410 is further configured to determine interface information of the target API corresponding to the first input from the application programming interface library based on user needs, and the interface information includes at least one of the following: interface name, interface data type, and interface parameter format.

[0131] In some embodiments, the knowledge base also includes example knowledge, which indicates sample user inputs and corresponding sample replies.

[0132] In some embodiments, the first parameter determination module 420 is further configured to use a predetermined template to determine the first prompt word information based on at least one of the following: a first input, a processing object corresponding to the user needs included in the knowledge base, domain knowledge associated with the user needs, example knowledge, interface information of the target API, and historical sessions for the user; and to use a machine learning model to determine the first parameter corresponding to the first input based on the first prompt word information.

[0133] In some embodiments, the machine learning model is a large language model.

[0134] In some embodiments, the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user demand is determined in the following manner: determining the vector representation of the processing object indicated by the first parameter and the processing object corresponding to the user demand; using the embedding model, based on the vector representation, determining the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user demand.

[0135] In some embodiments, the structured parameter determination module 430 is further configured to determine the first parameter as the first slot value corresponding to the first input if the similarity between the processing object indicated by the first parameter and the processing object matching the user's needs in the knowledge base is greater than a predetermined threshold; based on the first slot value, update the dialog state tracking component, the dialog state tracking component is used to store dialog information for interacting with the user, and the dialog information at least includes the slot value for determining the structured parameter; based on the slot values ​​stored in the dialog state tracking component, determine the structured parameters for calling the target API.

[0136] In some embodiments, the structured parameter determination module 430 is further configured to determine whether the slot values ​​of each slot in the dialog state tracking component have been determined; if the slot values ​​of each slot in the dialog state tracking component have been determined, the structured parameters for calling the target API are determined based on the slot values ​​of each slot in the dialog state tracking component.

[0137] In some embodiments, if it is determined that there are undetermined slot values ​​in each slot in the dialog state tracking component, the structured parameter determination module 430 is further configured to send a first indication message to the user, the first indication message indicating obtaining the user's second input; based on the second input, determining the second slot value corresponding to the second input; and based on the second slot value and the determined slot value in the dialog state tracking component, determining the structured parameters for calling the target API.

[0138] In some embodiments, the structured parameter determination module 430 is further configured to send a second indication message to the user if it is determined that the similarity between the processing object indicated by the first parameter and the processing object matching the user's needs in the knowledge base is less than a predetermined threshold, and the second indication message indicates obtaining the user's third input; based on the third input, determine the third slot value corresponding to the third input; based on the third slot value and the slot value determined in the dialog state tracking component, determine the structured parameters for calling the target API.

[0139] The modules included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0140] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein.

[0141] like Figure 5 As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.

[0142] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any available media accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.

[0143] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0144] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0145] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0146] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0147] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0148] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0149] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0150] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0151] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.

Claims

1. A method for dialog processing, comprising: In response to receiving a first input from a user to the dialogue system, based on a user requirement corresponding to the first input, determining a knowledge base associated with the first input, the knowledge base including at least a processing object matching the user requirement and domain knowledge associated with the user requirement; Determine, using a machine learning model, a first parameter corresponding to the first input based on the first input and the knowledge base, the first parameter being used to indicate a processing object determined by the machine learning model based on at least the first input; Determine structured parameters for calling a target application programming interface API based on the first parameters; as well as The target API is called by using the determined structured parameters, and a reply to the first input is generated based on a result of calling the target API.

2. The method according to claim 1, wherein determining the structured parameters for calling the target API based on the first parameters comprises: Based on the similarity between the first parameter and the processing object in the knowledge base that matches the user requirement, a structured parameter for calling a target application programming interface API is determined.

3. The method according to claim 1, wherein based on the user requirement, determining a knowledge base associated with the first input comprises: Based on the user demand, determining whether the first input is in a clarification state, the clarification state indicating that the first input is received in response to a historical conversation between the user and the dialog system; If it is determined that the first input is in the clarification state, determining a knowledge base corresponding to the user demand based at least on a historical conversation with the user; as well as If it is determined that the first input is not in the clarification state, a knowledge base corresponding to the user demand is determined from a predetermined database.

4. The method according to claim 3, wherein determining whether the first input is in a clarifying state based on the user demand comprises: Querying historical conversations between the user and the dialogue system; If it is determined based on the user demand that the first input indicates a response to the historical interaction content in the historical conversation, then it is determined that the first input is in the clarification state.

5. The method of claim 1, wherein the knowledge base further comprises interface information, wherein determining the knowledge base associated with the first input further comprises: Based on the user demand, interface information of a target API corresponding to the first input is determined from an application programming interface library, where the interface information includes at least one of the following: an interface name, an interface data type, and an interface parameter format.

6. The method according to claim 1, wherein the knowledge base further includes example knowledge, the example knowledge indicating sample user input and corresponding sample replies, wherein using a machine learning model, based on the first input and / or the knowledge base, determining the first parameter corresponding to the first input comprises: Determining the first prompt word information by using a predetermined template based on at least one of the following: the first input, the processing object corresponding to the user demand included in the knowledge base, the domain knowledge associated with the user demand, the example knowledge, the interface information of the target API, and the historical conversation for the user; as well as A machine learning model is used to determine a first parameter corresponding to the first input based on the first prompt word information.

7. The method of claim 6, wherein the machine learning model is a large language model.

8. The method according to claim 2, wherein the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user requirement is determined by: Determine a vector representation of a processing object indicated by the first parameter and a processing object corresponding to the user demand; The embedding model is used to determine the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user requirement based on the vector representation.

9. The method according to claim 2, wherein determining the structured parameters for calling the target API based on the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base comprises: If it is determined that the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user requirement is greater than a predetermined threshold, the first parameter is determined as the first slot value corresponding to the first input; Based on the first slot value, updating a dialog state tracking component, the dialog state tracking component is used to store dialog information interacting with the user, the dialog information at least including the slot value used to determine the structural parameter; Based on the slot values ​​stored in the dialog state tracking component, structured parameters for calling a target API are determined.

10. The method according to claim 9, wherein determining structured parameters for calling a target API based on the slot values ​​stored in the dialog state tracking component comprises: Determining whether the slot value of each slot in the dialog state tracking component has been determined; If the slot value of each slot in the dialog state tracking component has been determined, the structured parameters for calling the target API are determined based on the slot value of each slot in the dialog state tracking component.

11. The method according to claim 10, wherein determining the structural parameters of the target API further comprises: If it is determined that there are undetermined slot values ​​in each slot in the dialog state tracking component, first indication information is sent to the user, where the first indication information indicates obtaining a second input from the user; Based on the second input, determining a second slot value corresponding to the second input; as well as Based on the second slot value and the slot value determined in the dialog state tracking component, structured parameters for calling a target API are determined.

12. The method according to claim 9, wherein determining the structural parameters for calling the target application programming interface API based on the similarity between the processing object indicated by the first parameter and the processing object matching the user requirement in the knowledge base further comprises: If it is determined that the similarity between the processing object indicated by the first parameter and the processing object in the knowledge base that matches the user requirement is less than a predetermined threshold, sending second indication information to the user, wherein the second indication information indicates obtaining a third input from the user; Based on the third input, determining a third slot value corresponding to the third input; Based on the third slot value and the slot value determined in the dialog state tracking component, structured parameters for calling a target API are determined.

13. A device for dialogue processing, comprising: a knowledge base determination module configured to, in response to receiving a first input from a user to the dialogue system, determine a knowledge base associated with the first input based on a user demand corresponding to the first input, wherein the knowledge base includes at least a processing object matching the user demand and domain knowledge associated with the user demand; A first parameter determination module is configured to determine a first parameter corresponding to the first input based on the first input and the knowledge base using a machine learning model, wherein the first parameter is used to indicate a processing object determined by the machine learning model based on at least the first input; A structured parameter determination module, configured to determine a structured parameter for calling a target application programming interface API based on the first parameter; as well as The reply module is configured to call the target API by using the determined structured parameters, and generate a reply for the first input based on a call result of the target API.

14. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 12 when executed by the at least one processing unit.

15. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 12.

16. A computer program product tangibly stored in a computer storage medium and comprising computer executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 12.

Citation Information

Cited By

  • Method and device for calling API (Application Program Interface) in question answering system, computer equipment and medium

    CN120653747A