Intelligent interaction method and device and interaction system based on intelligent agent
By evaluating user intent clarity by utilizing knowledge base and positive and negative sample statements and configuring multi-agent collaboration, the problem of low efficiency and poor accuracy of task execution caused by fuzzy user intent is solved, and more efficient and reliable intelligent interaction is achieved.
Patent Information
- Application Number
- CN202411320403.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-17
AI Technical Summary
The existing multi-agent collaboration framework based on large language models deals with complex problems, blurred user intentions lead to reduced task execution efficiency, poor answer accuracy, and lack of effective solutions to ensure that user needs are fully understood and accurately executed.
By evaluating the clarity of user intentions using knowledge base and positive and negative sample statements, actively ask users for related questions when the clarity does not meet the requirements, until the user intention is clarified, and multiple agents are configured to interact and collaborate, using messages Queues save interactive records to improve the ability to handle complex problems.
Improve the accuracy and reliability of intelligent interactions, avoid cognitive confusion, and optimize the accuracy of user experience and task execution.
Smart Images

Figure CN119149701A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of artificial intelligence technologies such as natural language processing, large language models, and deep learning, and specifically to an intelligent interaction method, device, and an interaction system based on an intelligent agent. Background Art
[0002] In recent years, autonomous agent technology (AutoAgent) based on large language models (LLM) has demonstrated excellent complex problem-solving capabilities in many application fields, including planning, reasoning, decision-making, and the use of external tools. The LLM-based multi-agent collaboration framework decomposes the problem by collaborating multiple LLM-based agents, forming multi-perspective thinking to improve the accuracy and stability of the solution. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] To this end, the purpose of the present disclosure is to propose an intelligent interaction method, device and agent-based interaction system, so as to determine the clarity of user intention by utilizing a knowledge base and positive and negative sample sentences, and actively ask users relevant questions based on query sentences with unclear intentions, so as to clarify user intentions and improve the accuracy of intelligent interaction.
[0005] According to a first aspect of the present disclosure, there is provided an intelligent interaction method, comprising:
[0006] Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system;
[0007] Based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, performing intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent;
[0008] When the clarity of the first intention is less than a first threshold, outputting an intention query sentence;
[0009] Acquire a second input sentence, and return to execute the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained;
[0010] Based on the target intention, a reply sentence corresponding to the first input sentence is output.
[0011] According to a second aspect of the present disclosure, there is provided an intelligent interaction device, comprising:
[0012] A first determination module is used to determine the knowledge base, positive sample reference sentences and negative sample reference sentences currently associated with the dialogue system;
[0013] A second determination module is used to perform intent recognition on the current first input sentence based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, and determine the first intent of the first input sentence and the clarity of the first intent;
[0014] A first generating module, configured to output an intention query statement when the clarity of the first intention is less than a first threshold;
[0015] A first acquisition module is used to acquire a second input sentence, and return to execute the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained;
[0016] The second acquisition module is used to output a response sentence corresponding to the first input sentence based on the target intention.
[0017] According to a third aspect of the present disclosure, there is provided an agent-based interactive system, comprising:
[0018] Input component, used to obtain input sentences;
[0019] A processing component is used to call the first agent to perform intent recognition on the input sentence based on the currently associated knowledge base, the positive sample reference sentence and the negative sample reference sentence, and when the clarity of the intent of the input sentence is less than a first threshold, call the second agent to generate an intent query sentence, until a target intent with a clarity greater than the first threshold is obtained, and then call the third agent to obtain a reply sentence corresponding to the input sentence;
[0020] An output component is used to output an intended inquiry statement and a reply statement. According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:
[0021] at least one processor; and
[0022] a memory communicatively connected to the at least one processor; wherein,
[0023] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent interaction method as described in the first aspect.
[0024] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the intelligent interaction method as described in the first aspect.
[0025] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the intelligent interaction method as described in the first aspect.
[0026] The intelligent interaction method, device and agent-based interaction system provided by the present disclosure have the following beneficial effects:
[0027] By utilizing the knowledge base and positive and negative sample sentences, we evaluate the clarity of the user's intent in the query sentence. When the clarity does not meet the requirements, we actively ask relevant questions to clarify the user's intent, ensure that the user's needs can be fully understood and accurately executed, and avoid cognitive confusion when generating reply sentences. This improves the accuracy and reliability of the reply sentences, thereby improving the performance of intelligent interaction and optimizing the user experience.
[0028] It should be understood that the content described in this section is not intended to identify the key 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
[0029] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, which are used to better understand the present solution and do not constitute a limitation of the present disclosure, wherein:
[0030] Figure 1 is a flowchart of an intelligent interaction method proposed according to an embodiment of the present disclosure;
[0031] Figure 2 is a judgment logic diagram of a clarifier module provided by the present disclosure;
[0032] Figure 3 is a flowchart of an intelligent interaction method proposed according to another embodiment of the present disclosure;
[0033] Figure 4 is a flowchart of an intelligent interaction method proposed according to another embodiment of the present disclosure;
[0034] Figure 5 is a flowchart of an intelligent interaction method proposed according to another embodiment of the present disclosure;
[0035] Figure 6 It is a schematic diagram of a multi-agent collaboration framework of a dialogue system provided by the present invention.
[0036] Figure 7 is a schematic diagram of the structure of an intelligent interaction device proposed according to an embodiment of the present disclosure;
[0037] Figure 8This is a schematic diagram of the structure of an agent-based interactive system provided by an embodiment of the present disclosure:
[0038] Fig. 9 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0039] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0040] The embodiments of the present disclosure relate to artificial intelligence technology fields such as natural language processing, large models, and deep learning.
[0041] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
[0042] Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between humans and computers using natural language. It is a discipline that uses computer technology to analyze, understand and process natural language, that is, it uses computers as a powerful tool for language research, conducts quantitative research on language information with the support of computers, and provides language descriptions that can be used by humans and computers.
[0043] Large Language Model (LLM) refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question answering, and dialogue, and are an important path to artificial intelligence.
[0044] Deep learning is the process of learning the inherent laws and representation levels of sample data. The information obtained in the learning process is of great help in interpreting data such as text, images, and sounds. The ultimate goal of deep learning is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as text, images, and sounds.
[0045] An agent is an agent that can perceive the environment and take actions to achieve specific goals. It can be software, hardware or a system with autonomy, adaptability and interaction. The agent perceives changes in the environment (such as through sensors or data input), makes judgments and decisions based on the knowledge and algorithms it has learned, and then performs actions to affect the environment or achieve predetermined goals.
[0046] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0047] The following describes the intelligent interaction method, device and agent-based interaction system of the embodiments of the present disclosure with reference to the accompanying drawings.
[0048] The existing LLM-based multi-agent collaboration framework technology usually only supports interaction and collaboration between two types of agents. As the difficulty of user questions increases, the probability of agents receiving mixed instructions will greatly increase, which will affect the efficiency of task execution, make errors more likely, and usually get less and less accurate answers. It is necessary for agents with more roles to participate in interaction and collaboration to achieve the decomposition and planning of complex problems.
[0049] On the other hand, the user's instructions or demands may have ambiguous intentions. Therefore, during interaction, it is necessary to ensure that the user's input requests can be fully understood and refined, so as to ensure that the interactive system can accurately distribute the requests to the corresponding agents for execution. However, the existing multi-agent collaboration framework does not provide an effective solution to this problem.
[0050] Therefore, in the scheme disclosed in the present invention, the clarity of the intention in the user query statement is evaluated by using the knowledge base and positive and negative sample statements. When the clarity does not meet the requirements, the user intention is clarified by actively asking relevant questions to ensure that the user's needs can be fully understood and accurately executed, avoiding the problem of cognitive confusion in LLM. It is also possible to configure intelligent agents with multiple roles to achieve interaction and collaboration among multiple agents, including the refinement and planning of user needs and the assignment of corresponding instructions to different agents, and to use message queues to save interaction records, which can improve the ability of intelligent interaction to handle complex problems and improve the accuracy and reliability of reply statements.
[0051] It should be noted that the executor of the intelligent interaction method of this embodiment is an intelligent interaction device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, which may include but is not limited to a terminal, a server, etc.
[0052] Figure 1It is a flowchart of an intelligent interaction method proposed according to an embodiment of the present disclosure.
[0053] like Figure 1 As shown, the intelligent interaction method includes:
[0054] S101: Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system.
[0055] In the disclosed embodiment, the dialogue system can configure different knowledge bases in different application scenarios to provide background knowledge and professional domain knowledge for the dialogue system to generate reply statements. For example, if the application scenario set by the dialogue system is related to stocks, then the currently associated knowledge base contains stock-related knowledge; and if the application scenario is navigation, the currently associated knowledge base contains traffic rules and other navigation-related knowledge.
[0056] Among them, the positive sample reference sentence refers to the sample data that is marked as containing clear intentions. The negative sample reference sentence refers to the sample data that is marked as containing unclear intentions. Both positive samples and negative samples correspond to the content in the knowledge base. The same reference sentence may be a positive sample for one knowledge base and a negative sample for another knowledge base.
[0057] It should be noted that in some possible implementation forms, the dialogue system may be applied to multiple different scenarios, or may not be limited to a specific application scenario. In this case, the knowledge base, positive sample reference sentences, and negative sample reference sentences may also be determined based on the services that the dialogue system can provide to users.
[0058] Optionally, the service type currently selected in the dialogue system may be determined first, and then a knowledge base, positive sample reference sentences, and negative sample reference sentences associated with the selected service type may be obtained.
[0059] The currently selected service type may be any one of all services that the dialogue system can provide to the user, may be selected by the user in the dialogue system according to current needs, or may be a default service type of the dialogue system.
[0060] It is understandable that, since the business logic and rules of different service types may differ, the associated knowledge base, positive sample reference statements and negative sample reference statements can be configured for different service types. Then, when a service type is selected, its associated knowledge base and reference statements are called, which improves the reliability of the data used for intent recognition and ensures the accuracy of the intent recognition results.
[0061] S102: Based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, perform intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent.
[0062] The first input sentence refers to a request sent by a user to the dialogue system, which describes the user's intention.
[0063] Clarity refers to the reliability of the dialog system's recognition of the user's intent. If the first intent identified is ambiguous, it is not possible to clearly determine a clear intent, and the expression is vague, it can be determined that the clarity of the first intent is relatively low.
[0064] In the disclosed embodiment, the dialogue system is established based on a multi-agent collaboration framework. By introducing a dynamic role allocator, one of the agents can be identified as a requirement refinement (Specifier) agent. The requirement refinement agent can perform in-depth recognition and analysis of the intent contained in the first input sentence to obtain the first intent. In addition, the clarifier module can be used to compare with the data in the knowledge base, as well as the positive sample reference sentences and the negative sample reference sentences to evaluate whether the first input sentence contains ambiguous, vague or content that needs to be clarified, so that the clarity of the first intent can be determined based on the data of these contents. The more ambiguous, vague and content that needs to be clarified, the lower the clarity of the first intent.
[0065] It should be noted that a large language model may also be used to perform intent recognition to obtain a first intent and clarity evaluation result of a first input sentence output by the model.
[0066] Optionally, based on a first prompt template associated with intent recognition, the knowledge base, positive sample reference sentences, negative sample reference sentences and the first input sentence can be input into a large language model to obtain the first intent of the first input sentence and the clarity of the first intent.
[0067] Among them, the first prompt information is used to instruct the model to recognize the intent of the input sentence, and refer to the knowledge base, positive sample reference sentences and negative sample reference sentences to evaluate the reliability of the recognition result.
[0068] In the embodiments of the present disclosure, by utilizing a large language model in combination with a knowledge base and positive and negative sample reference sentences, the intent information contained in the user input sentence is determined, and the clarity of the intent information is evaluated based on whether the intent information is ambiguous or unclear, thereby improving the efficiency of intent recognition and ensuring the accuracy of the intent recognition results.
[0069] S103: When the clarity of the first intention is less than a first threshold, output an intention inquiry sentence.
[0070] Among them, the first threshold refers to the minimum value of the intent clarity that can ensure that the generated reply statement meets the user's needs. It can be dynamically set according to the actual accuracy requirements, and the present disclosure does not limit this.
[0071] The intent inquiry statement is a statement that further asks questions about the uncertain and ambiguous content in the first intent to inquire about the user's accurate intent. For example, the format of the inquiry statement can be similar to "Do you mean...?" and so on.
[0072] In the embodiment of the present disclosure, when the clarity of the first intention is less than the first threshold, it can be determined that there is ambiguity in the first input sentence and the intention expression is unclear. At this time, directly using the first intention to generate a reply sentence may result in low accuracy of the reply sentence, which does not meet the user's needs. Therefore, it is necessary to generate a corresponding intention query sentence for the uncertain content in the first query sentence, output it in the interactive interface and ask the user questions to obtain the user's clarification information on the uncertain content.
[0073] It should be noted that the clarifier module used in the above step S102 can be composed of three key parts, namely, a demand classifier, a situation-aware self-reflection mechanism, and an active inquiry mechanism. The judgment logic diagram of the clarifier module can be as follows: Figure 2 shown.
[0074] Depend on Figure 2 It can be seen that the demand classifier is used to analyze the first input statement and verify the demand in the first input statement through uncertainty estimation. If it is found that there is uncertainty in the first input statement or the intention is ambiguous, the first input statement can be forwarded to the scenario-aware self-reflection module for processing. The scenario-aware self-reflection module can understand the context of the first input statement and query the knowledge base for feasibility verification to determine whether the first input statement exceeds the capabilities of the current dialogue system. If it does not exceed the capabilities, the active inquiry mechanism is triggered, and questions are generated using the back-end LLM based on the first input statement and the capabilities of the dialogue system, and the customer is actively asked about the uncertain content in the user input in the previous round of conversation.
[0075] It is understandable that the dialogue system obtains a reply statement by screening the knowledge in the knowledge base configured therein, integrating and reasoning the screened knowledge, so the scope of knowledge contained in the knowledge base can determine the scope of the dialogue system's capabilities. In the case where the first input statement exceeds the capabilities of the current dialogue system, the dialogue system cannot generate a relevant reply statement and can send the user content that cannot answer the first input statement.
[0076] S104: Obtain a second input sentence, and return to the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained.
[0077] The second input sentence refers to the user's response to the intended inquiry sentence output by the dialogue system.
[0078] In the disclosed embodiment, after sending the query statement to the user, the content of the user's reply to the query statement can be received, thereby obtaining a second input statement. Then, the second input statement can be used to return to the step of performing intent recognition on the first input statement to clarify the content in the intent recognition result of the first input statement to obtain a clearer and more specific first intent. If the clarity of the updated first intent is still less than the first threshold, query statements can continue to be generated to obtain user answers to gradually correct unclear and ambiguous content in the intent recognition result until the target intent with a clarity greater than the first threshold is obtained.
[0079] S105: Based on the target intention, output a reply sentence corresponding to the first input sentence.
[0080] In the disclosed embodiment, a large language model can be used to obtain data related to the first input sentence in the knowledge base according to the target intent, and then the relevant data is analyzed to obtain a reply sentence corresponding to the first input sentence, and the reply sentence is output to the interactive interface of the dialogue system and returned to the user to complete the interaction.
[0081] It should be noted that in some embodiments, the target intent may be relatively complex. In order to ensure the reliability of the reply statement, the target intent can be split into multiple sub-intentions, and then the multiple sub-intentions are assigned to different agents to obtain corresponding reply statements respectively, and then they are fused to obtain the reply statement corresponding to the first input statement, so as to avoid cognitive confusion caused by mixed instructions.
[0082] In this embodiment, the knowledge base, positive sample reference sentences and negative sample reference sentences currently associated with the dialogue system are first determined, and then, based on the knowledge base, positive sample reference sentences and negative sample reference sentences, the intent of the current first input sentence is identified to determine the first intent of the first input sentence and the clarity of the first intent. After that, if the clarity of the first intent is less than the first threshold, the intention query sentence is output. Then, the second input sentence related to the query sentence is obtained, and the step of performing intent identification on the first input sentence is returned based on the second input sentence until the target intent with a clarity greater than the first threshold is obtained. Finally, based on the target intent, the reply sentence corresponding to the first input sentence is output. Thus, by using the knowledge base and positive and negative sample sentences, the clarity of the intent in the user query sentence is evaluated. When the clarity does not meet the requirements, the user intent is clarified by actively asking relevant questions, ensuring that the user needs can be fully understood and accurately executed, avoiding cognitive confusion when generating reply sentences, improving the accuracy and reliability of reply sentences, and thus improving the performance of intelligent interaction and optimizing user experience.
[0083] Figure 3 It is a flowchart of an intelligent interaction method proposed in another embodiment of the present disclosure.
[0084] like Figure 3 As shown, the intelligent interaction method includes:
[0085] S301: Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system.
[0086] S302: Based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, perform intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent.
[0087] The description of S301 and S302 can be specifically referred to the above embodiment, which will not be repeated here.
[0088] S303: When the clarity of the first intention is less than a first threshold, determine the score of the first intention in each evaluation dimension.
[0089] In the disclosed embodiment, after determining that the clarity of the first intention is less than the first threshold, the clarity of the first intention may be obtained by different evaluation dimensions. Therefore, the focus of the first intention that needs to be clarified and corrected can be determined based on the score on each evaluation dimension, so as to generate a query statement that needs to be answered by the user in a targeted manner, improve the quality of the query statement, and improve the efficiency of intent clarification. Therefore, the first input statement can be analyzed according to the scoring requirements of each evaluation dimension to determine the score of the first intention of the first input statement in each evaluation dimension.
[0090] It should be noted that, in the present disclosure, the evaluation dimensions of clarity may include at least one of the following: comprehensibility, consistency, completeness, and clarity, etc.
[0091] Among them, comprehensibility is used to evaluate whether the input sentence is easy to be understood by the dialogue system. Consistency is used to check whether the information in the input sentence is self-contradictory or ambiguous. Completeness is used to evaluate whether the input sentence provides enough information to clarify the intention. Clarity is used to judge whether the intention of the input sentence is direct and clear without too much inference.
[0092] S304: When the score of any first-type evaluation dimension is less than a second threshold, obtain a second prompt template associated with any first-type evaluation dimension.
[0093] The second prompt template is used to instruct the large language model to generate an associated query statement for the corresponding evaluation dimension.
[0094] It should be noted that the first type of evaluation dimension may include any of the following: completeness, consistency, and clarity. Assessing the clarity of intent through any of completeness, consistency, and clarity helps ensure the completeness of the intended information, reduce the possibility of misunderstanding and ambiguity, and improve the efficiency of generating response statements.
[0095] The second threshold is the minimum value for which the score of the evaluation dimension meets the user's requirements. Different evaluation dimensions may correspond to different second thresholds or to the same second threshold.
[0096] In the disclosed embodiment, after determining the score of the first intention in each evaluation dimension, the score of each first-type evaluation dimension can be compared with its corresponding second threshold. When the score of any first-type evaluation dimension is less than the second threshold, it can be determined that the problem reflected by the first-type evaluation dimension has a greater impact on the clarity of the first intention. In this case, it is necessary to inquire the user about the problem reflected by the first-type evaluation dimension. The second prompt template associated with any first-type evaluation dimension can be obtained first.
[0097] It should be noted that different first-type evaluation dimensions reflect different problems, and therefore the associated second prompt templates may also be different.
[0098] It should be noted that, in the disclosed embodiment, before comparing the size relationship between the score of the first type of evaluation dimension and the second threshold, it can be determined that the clarity of the first intention is less than the first threshold, not because the first input sentence is not within the capabilities of the current dialogue system. This is because, when the first input sentence is not within the capabilities of the current dialogue system, no matter how the first intention of the first input sentence is clarified and improved, when generating a reply sentence, it is impossible to generate a relevant reply sentence based on the knowledge base associated with the dialogue system.
[0099] S305: Based on the second prompt template, any first type evaluation dimension, the knowledge base, the positive sample reference sentence, the negative sample reference sentence and the first input sentence are input into the large language model to obtain the intended query sentence.
[0100] In the disclosed embodiment, after obtaining the second prompt template for the first type evaluation dimension with a score less than the second threshold, any first type evaluation dimension, knowledge base, positive sample reference sentence, negative sample reference sentence and first input sentence can be filled into the corresponding position in the second prompt template, and the filled-in second prompt information can be input into the large language model. The large language model can determine the problem in the first input sentence based on any first type evaluation dimension, knowledge base, positive sample reference sentence and negative sample reference sentence, generate an inquiry sentence corresponding to the problem, and return it to the user who sent the first input sentence.
[0101] It should be noted that, in the embodiment of the present disclosure, when the scores of two or more first-type evaluation dimensions are all less than the second threshold, the second prompt information associated therewith can be used respectively to obtain the query sentences output by the large language model in sequence.
[0102] S306: Outputting the intention query statement.
[0103] In the disclosed embodiment, after obtaining the intended query statement, the intended query statement can be output in the interactive interface to ask questions to the user and obtain clarification information of the user on the uncertain content.
[0104] S307: Obtain a second input sentence, and return to the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained.
[0105] S308: Based on the target intention, obtain and return a reply sentence corresponding to the first input sentence.
[0106] The description of S307 and S308 can also be specifically referred to the above embodiment, which will not be repeated here.
[0107] In this embodiment, when the clarity of the first intention is less than the first threshold, the score of the first intention in each evaluation dimension is first determined. Then, when the score of any first-type evaluation dimension is less than the second threshold, the second prompt template associated with any first-type evaluation dimension is obtained, and based on the second prompt template, any first-type evaluation dimension, the knowledge base, the positive sample reference sentence, the negative sample reference sentence and the first input sentence are input into the large language model to obtain the intention query sentence, and then the intention query sentence is output. Therefore, by determining the score of the intention of the first input sentence under different evaluation dimensions, and using the prompt templates corresponding to some evaluation dimensions whose scores do not meet the conditions, instructing the large language model to generate a query sentence, the generated query sentence can be made more consistent with the question in the input sentence, thereby improving the quality of the query sentence.
[0108] Figure 4 It is a flowchart of an intelligent interaction method proposed in another embodiment of the present disclosure.
[0109] like Figure 4 As shown, the intelligent interaction method includes:
[0110] S401: Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system.
[0111] S402: Based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, perform intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent.
[0112] S403: When the clarity of the first intention is less than a first threshold, determine the score of the first intention in each evaluation dimension.
[0113] The description of S401 to S403 above can be specifically referred to the above embodiment, which will not be repeated here.
[0114] S404: When the score of the second type evaluation dimension is less than a third threshold, output a preset reply statement.
[0115] The second type of evaluation dimension is used to evaluate whether the sentence can be understood by the dialogue system, that is, whether it is within the processable range of the currently associated knowledge base. The second type of evaluation dimension may be comprehensibility.
[0116] Among them, the third threshold is used to measure whether the first intention is within the capability of the knowledge base. When the score of the second type of evaluation dimension is lower than the third threshold, it can be determined that the first intention exceeds the processing capability of the dialogue system.
[0117] In the embodiment of the present disclosure, when the score of the second type evaluation dimension is less than the third threshold, the first intention exceeds the processing capability of the dialogue system, and a preset reply statement for prompting the system that the first input statement cannot be processed can be output to the user who sent the first input statement. The preset reply statement can be similar to "cannot answer the current question" or "the current service cannot answer the question, it is recommended to select a service... to answer" and the like.
[0118] It should be noted that in some possible embodiments, when the intention of the first input statement is not within the capabilities of the knowledge base currently associated with the dialogue system, it may be that the service type currently selected by the dialogue system is inaccurate, and the user may be prompted to change the service type.
[0119] Optionally, when the score of the second type evaluation dimension is less than the third threshold, the first input statement may be matched with keywords associated with each candidate service to obtain a matching degree corresponding to each candidate service.
[0120] Keywords are words or phrases used to describe the service features, functions, advantages or target audience of each candidate service.
[0121] Then, based on a candidate service with the greatest matching degree with the first input sentence and a preset reply sentence template, a reply sentence is generated and output.
[0122] Among them, the preset reply sentence template may be a text similar to "The current service cannot answer this question, it is recommended to select a service... for an answer" and the like.
[0123] In the disclosed embodiment, a candidate service with the greatest matching degree with the first input sentence can be filled in the corresponding position in the reply sentence template to obtain a reply sentence, and then the reply sentence is output to the user, and the user is recommended to use other candidate services to obtain specific reply content. This can improve the performance of intelligent interaction and improve user satisfaction.
[0124] In this embodiment, by first determining the scores of the first intention in each evaluation dimension when the clarity of the first intention is less than the first threshold, and then returning the preset reply statement when the score of the second type of evaluation dimension is less than the third threshold, it is possible to avoid generating invalid reply statements and wasting computing resources, promptly reminding the user that the current demand does not meet the system processing range, enhancing the interaction between the user and the dialogue system, and improving the user experience.
[0125] Figure 5 It is a flowchart of an intelligent interaction method proposed in another embodiment of the present disclosure.
[0126] like Figure 5 As shown, the intelligent interaction method includes:
[0127] S501: Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system.
[0128] S502: Based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, perform intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent.
[0129] S503: When the clarity of the first intention is less than a first threshold, generate and return a query statement.
[0130] S504: Obtain a second input sentence, and return to the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained.
[0131] The description of S501 to S505 can be specifically referred to the above embodiment, which will not be repeated here.
[0132] S505: Analyze the target intent to obtain a command sequence.
[0133] In the disclosed embodiment, the target intent may be relatively complex. In order to ensure the reliability of the reply statement, the target intent may be parsed and split, and each sub-intent obtained after the split may be taken as a command to obtain a command sequence.
[0134] S506: Execute each command in the command sequence in sequence to obtain a reply statement.
[0135] Combine the following Figure 6 Explain how to analyze and execute target intentions based on collaboration among multiple agents. Figure 6 It is a schematic diagram of a multi-agent collaboration framework provided by the present invention.
[0136] like Figure 6 As shown in the figure, the multi-agent collaboration framework of the dialogue system can include agents playing the role of user, agents playing the role of assistant, and agents playing the role of router. Among them, the user role includes the demand refinement agent and the planner agent, while the assistant role can include any number of agents, called executor agents, and multiple executor agents can be called simultaneously to execute corresponding commands respectively. In addition, there is a router agent between the user and the assistant to facilitate the interaction between the planner agent and the executor agent.
[0137] In the present disclosure, after the demand refinement agent determines the specific intention of the customer based on the first input statement, the planner agent (hereinafter referred to as planner) can collaborate with multiple agents of the assistant role as a user role to execute the customer's request. In the process of collaborating with the executor group of the assistant role, the planner can disassemble the specific intention, formulate an execution plan in a chain-of-thought manner, and obtain a command sequence. Then, the commands in the command sequence are sent to the assistant role in sequence to guide the assistant role to complete the specific commands.
[0138] It should be noted that the multiple executor agents (hereinafter referred to as executors) contained in the assistant role can be distinguished according to certain specific standards, such as the capabilities of the agent (such as the size of the backend model) and the functions of the agent (different areas of expertise, etc.).
[0139] In addition, the interaction between the executor and the planner needs to be coordinated by the router agent (hereinafter referred to as the router), that is, the router can dynamically distribute the specific commands issued by the planner to a specific executor for execution. In this way, the planner does not need to know how many different executors there are. Within the planner's cognitive scope, it only knows that there are user and assistant roles. On the other hand, the executors do not need to know each other's existence. Therefore, the prompt design of the user role and the assistant role will be simplified. At the same time, different agents of the user role and the assistant role can flexibly adopt different LLMs for support during the specific implementation process, which improves the scalability of the multi-agent system.
[0140] It should be noted that since the target requirements are usually broken down into multiple steps by the planner, multiple rounds of interactions will be carried out between the user role and the assistant role. In order to ensure the consistency and integrity of multiple rounds of conversations, a shared memory mechanism can be introduced. In other words, the interaction records between the planner and the executor will be recorded as historical conversations and shared between the planner and multiple executors. In the present disclosure, the interaction records between multiple agents can be maintained by using a message queue or an external memory storage unit.
[0141] Optionally, when the command sequence includes multiple commands, a message queue corresponding to the command sequence may be generated first, the first command in the command sequence may be placed in the message queue, and a third prompt template for obtaining a first response corresponding to the first command may be determined.
[0142] The message queue is used to store historically executed command information and command execution results, etc. Each historical record maintained in the message queue corresponds to each command in the command sequence.
[0143] Among them, the third prompt template is a prompt template corresponding to the executor agent for executing the first command, which can instruct the agent to call the large language model and generate a corresponding response according to the command information.
[0144] Then, after determining the third prompt template, the first command can be input into the large model based on the third prompt template to obtain a first response.
[0145] Afterwards, the first response and the second command in the command sequence can be placed in the message queue in sequence, and a fourth prompt template for obtaining a second response corresponding to the second command can be determined. Based on the fourth prompt template, the second command and the current message queue are input into the large model to obtain the second response. If there are no unexecuted commands in the command sequence, a reply statement can be generated based on the first response and the second response.
[0146] It can be understood that when there are still unexecuted commands in the command sequence, the next command in the command sequence can be obtained, and the second response and the next command can be returned to be placed in the message queue to determine the steps of the prompt template until there are no unexecuted commands in the command sequence. At this time, all responses in the message queue can be spliced together to generate a reply statement.
[0147] In the embodiment of the present disclosure, by utilizing a message queue, the response to each command in the command sequence is obtained in turn, and then a reply statement is generated based on the responses to all commands, thereby ensuring the consistency and integrity of the intelligent interaction.
[0148] S507: Output a reply statement.
[0149] In this embodiment, by parsing the target intent to obtain a command sequence, executing each command in the command sequence in turn, obtaining a reply statement and outputting it, the decomposed execution of the user's intent can be achieved, so that multiple agents can be called at the same time to execute commands and obtain response information, avoiding cognitive confusion caused by complex commands when a single agent executes commands, improving the accuracy and reliability of the reply statement, and optimizing the user experience.
[0150] Figure 7It is a structural diagram of an intelligent interaction device proposed in one embodiment of the present disclosure.
[0151] like Figure 7 As shown, the intelligent interaction device 70 includes:
[0152] The first determination module 701 is used to determine the knowledge base, positive sample reference sentences and negative sample reference sentences currently associated with the dialogue system;
[0153] A second determination module 702 is used to perform intent recognition on the current first input sentence based on the knowledge base, the positive sample reference sentence and the negative sample reference sentence, and determine the first intent of the first input sentence and the clarity of the first intent;
[0154] A first generating module 703, configured to output an intention query statement when the clarity of the first intention is less than a first threshold;
[0155] A first acquisition module 704 is used to acquire a second input sentence, and return to perform the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained;
[0156] The second acquisition module 705 is used to output a reply sentence corresponding to the first input sentence based on the target intention.
[0157] Optionally, the first determining module 701 may be specifically configured to:
[0158] Determine the type of service currently selected in the dialogue system;
[0159] A knowledge base, positive sample reference sentences, and negative sample reference sentences associated with the selected service type are obtained.
[0160] Optionally, the second determining module 702 may be specifically configured to:
[0161] Based on the first prompt template associated with intent recognition, the knowledge base, the positive sample reference sentence, the negative sample reference sentence and the first input sentence are input into the large language model to obtain the first intent of the first input sentence and the clarity of the first intent.
[0162] Optionally, the generating module 703 may be specifically used for:
[0163] When the clarity of the first intention is less than the first threshold, determining the score of the first intention in each evaluation dimension;
[0164] When the score of any first-type evaluation dimension is less than a second threshold, obtaining a second prompt template associated with any first-type evaluation dimension;
[0165] Based on the second prompt template, any first type evaluation dimension, the knowledge base, the positive sample reference sentence, the negative sample reference sentence and the first input sentence are input into the large language model to obtain the intended query sentence;
[0166] Output the query statement.
[0167] Optionally, the first type of evaluation dimensions includes any of the following: completeness, consistency, and clarity.
[0168] Optionally, the intelligent interaction device 70 may further include:
[0169] A third determination module, configured to determine the score of the first intention in each evaluation dimension when the clarity of the first intention is less than a first threshold;
[0170] The first output module is used to output a preset reply statement when the score of the second type evaluation dimension is less than a third threshold.
[0171] Optionally, the intelligent interaction device 70 may further include:
[0172] a matching module, configured to match the first input sentence with a keyword associated with each candidate service if the score of the second type evaluation dimension is less than a third threshold;
[0173] A second generation module, configured to generate a reply statement based on a candidate service having the greatest matching degree with the first input statement and a preset reply statement template;
[0174] The second output module is used to output the reply statement.
[0175] Optionally, the second acquisition module 705 may be specifically used to:
[0176] Parse the target intention and obtain the command sequence;
[0177] Execute each command in the command sequence in turn and get a reply statement;
[0178] Output the reply sentence.
[0179] Optionally, the second acquisition module 705 may be specifically used to:
[0180] When the command sequence contains multiple commands, a message queue corresponding to the command sequence is generated;
[0181] Putting a first command in the command sequence into a message queue, and determining a third prompt template for obtaining a first response corresponding to the first command;
[0182] Based on the third prompt template, the first command is input into the large model to obtain a first response;
[0183] placing the first response and the second command in the command sequence into a message queue in sequence, and determining a fourth prompt template for obtaining a second response corresponding to the second command;
[0184] Based on the fourth prompt template, the second command and the current message queue are input into the large model to obtain a second response;
[0185] When there are no unexecuted commands in the command sequence, a reply sentence is generated based on the first response and the second response.
[0186] It should be noted that the aforementioned explanation of the intelligent interaction method is also applicable to the intelligent interaction device of this embodiment and will not be repeated here.
[0187] In this embodiment, the knowledge base and positive and negative sample sentences are used to evaluate the clarity of the intention in the user's query sentence. When the clarity does not meet the requirements, the user's intention is clarified by actively asking relevant questions, ensuring that the user's needs can be fully understood and accurately executed, avoiding cognitive confusion when generating reply sentences, improving the accuracy and reliability of the reply sentences, and thereby improving the performance of intelligent interaction and optimizing the user experience.
[0188] Figure 8 It is a structural diagram of an agent-based interactive system proposed in one embodiment of the present disclosure.
[0189] like Figure 8 As shown, the agent-based interactive system 80 includes:
[0190] Input component 801, used to obtain input sentences;
[0191] Processing component 802 is used to call the first agent to identify the intent of the input sentence based on the currently associated knowledge base, the positive sample reference sentence and the negative sample reference sentence, and when the clarity of the intent of the input sentence is less than the first threshold, call the second agent to generate an intent query sentence, until the target intent with a clarity greater than the first threshold is obtained, and then call the third agent to obtain a reply sentence corresponding to the input sentence;
[0192] The output component 803 is used to output the intended inquiry statement and the reply statement.
[0193] It should be noted that an agent is a computer system or entity that can act autonomously, perceive the environment, make decisions, and interact with the environment. It usually uses a large language model as the core decision-making and processing unit, and has the ability to think independently and call tools to gradually complete a given goal.
[0194] The first agent can use the model to identify the intent of the input sentence, the second agent can use the model to generate a query sentence for the unclear part of the intent, and the third agent can use the model to generate a reply sentence corresponding to the input sentence in combination with the user's intent. The models in the first agent, the second agent, and the third agent may be the same or different.
[0195] In the embodiment of the present disclosure, the agent-based interactive system can implement the intelligent interactive method described in the above embodiment of the present disclosure by using the input component 801, the processing component 802 and the output component 803 to complete the dialogue interaction with the user. The specific description of the interaction can refer to the above embodiment of the present disclosure, which will not be repeated here. In addition, in the processing component 802, by configuring the first agent, the second agent and the third agent, the data processing of different links can be realized by different roles, which can improve the orderliness of data processing and thus improve the quality of interaction.
[0196] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0197] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0198] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0199] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0200] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the intelligent interaction method. For example, in some embodiments, the intelligent interaction method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the intelligent interaction method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the intelligent interaction method in any other appropriate manner (e.g., by means of firmware).
[0201] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0202] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0203] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0204] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0205] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0206] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0207] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0208] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the description of the present disclosure, the words "if" and "if" used can be interpreted as "at the time of" or "when" or "in response to determination" or "under the circumstances of".
[0209] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An intelligent interaction method, comprising: Determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system; Based on the knowledge base, the positive sample reference sentences and the negative sample reference sentences, performing intent recognition on the current first input sentence to determine the first intent of the first input sentence and the clarity of the first intent; When the clarity of the first intention is less than a first threshold, outputting an intention query statement; Obtaining a second input sentence, and returning to the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained; Based on the target intention, a reply statement corresponding to the first input statement is output.
2. The method according to claim 1, wherein The step of determining the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system includes: Determining a service type currently selected in the dialogue system; A knowledge base, positive sample reference sentences, and negative sample reference sentences associated with the selected service type are obtained.
3. The method according to claim 1, wherein The performing intent recognition on the current first input sentence based on the knowledge base, the positive sample reference sentence, and the negative sample reference sentence, and determining the first intent of the first input sentence and the clarity of the first intent, includes: Based on the first prompt template associated with intent recognition, the knowledge base, positive sample reference sentences, negative sample reference sentences and the first input sentence are input into a large language model to obtain the first intent of the first input sentence and the clarity of the first intent.
4. The method according to claim 1, wherein The step of outputting an intention query statement when the clarity of the first intention is less than a first threshold includes: When the clarity of the first intention is less than a first threshold, determining a score of the first intention in each evaluation dimension; When the score of any first-type evaluation dimension is less than a second threshold, obtaining a second prompt template associated with any first-type evaluation dimension; Based on the second prompt template, inputting any one of the first type evaluation dimensions, the knowledge base, the positive sample reference sentence, the negative sample reference sentence, and the first input sentence into a large language model to obtain the intended query sentence; Output the intended query sentence.
5. The method according to claim 4, wherein: The first type of evaluation dimensions includes any of the following: completeness, consistency and clarity.
6. The method of claim 1, wherein: The method further comprises: When the clarity of the first intention is less than a first threshold, determining a score of the first intention in each evaluation dimension; When the score of the second type evaluation dimension is less than the third threshold, a preset reply sentence is output.
7. The method according to claim 6, wherein: The method further comprises: When the score of the second type evaluation dimension is less than a third threshold, matching the first input sentence with keywords associated with each candidate service; Generate a reply statement based on a candidate service with the greatest matching degree with the first input statement and a preset reply statement template; The reply sentence is output.
8. The method according to any one of claims 1 to 7, wherein: The step of outputting a response sentence corresponding to the first input sentence based on the target intention includes: Parsing the target intention to obtain a command sequence; Executing each command in the command sequence in sequence to obtain the reply statement; The reply sentence is output.
9. The method of claim 8, wherein: The step of sequentially executing each command in the command sequence to obtain the reply statement includes: When the command sequence includes multiple commands, generating a message queue corresponding to the command sequence; Putting a first command in the command sequence into the message queue, and determining a third prompt template for obtaining a first response corresponding to the first command; Based on the third prompt template, the first command is input into the large model to obtain a first response; placing the first response and the second command in the command sequence into the message queue in sequence, and determining a fourth prompt template for obtaining a second response corresponding to the second command; Based on the fourth prompt template, input the second command and the current message queue into the large model to obtain a second response; When there are no unexecuted commands in the command sequence, the reply sentence is generated based on the first response and the second response.
10. An intelligent interactive device, comprising: A first determination module is used to determine the knowledge base, positive sample reference sentences, and negative sample reference sentences currently associated with the dialogue system; a second determination module, configured to perform intent recognition on a current first input sentence based on the knowledge base, the positive sample reference sentence, and the negative sample reference sentence, and determine a first intent of the first input sentence and the clarity of the first intent; A first generating module, configured to output an intention query statement when the clarity of the first intention is less than a first threshold; a first acquisition module, configured to acquire a second input sentence, and return to executing the step of performing intent recognition on the first input sentence based on the second input sentence until a target intent with a clarity greater than a first threshold is obtained; The second acquisition module is used to output a response sentence corresponding to the first input sentence based on the target intention.
11. The device according to claim 10, wherein The first determining module is specifically configured to: Determining a service type currently selected in the dialogue system; A knowledge base, positive sample reference sentences, and negative sample reference sentences associated with the selected service type are obtained.
12. The device of claim 10, wherein: The second determining module is specifically configured to: Based on the first prompt template associated with intent recognition, the knowledge base, positive sample reference sentences, negative sample reference sentences and the first input sentence are input into a large language model to obtain the first intent of the first input sentence and the clarity of the first intent.
13. The device according to claim 10, wherein The generation module is specifically used to: When the clarity of the first intention is less than a first threshold, determining a score of the first intention in each evaluation dimension; When the score of any first-type evaluation dimension is less than a second threshold, obtaining a second prompt template associated with any first-type evaluation dimension; Based on the second prompt template, inputting any one of the first type evaluation dimensions, the knowledge base, the positive sample reference sentence, the negative sample reference sentence, and the first input sentence into a large language model to obtain the intended query sentence; Output the intended query sentence.
14. The method of claim 15, wherein: The first type of evaluation dimensions includes any of the following: completeness, consistency and clarity.
15. The apparatus of claim 10, wherein: The device further comprises: a third determining module, configured to determine a score of the first intention in each evaluation dimension when the clarity of the first intention is less than a first threshold; The first output module is used to output a preset reply statement when the score of the second type evaluation dimension is less than a third threshold.
16. The method of claim 15, wherein: The device further comprises: a matching module, configured to match the first input sentence with keywords associated with each candidate service if the score of the second type evaluation dimension is less than a third threshold; A second generating module is configured to generate a reply statement based on a candidate service having the greatest matching degree with the first input statement and a preset reply statement template; The second output module is used to output the reply statement.
17. The device according to any one of claims 10 to 16, wherein: The second acquisition module is specifically configured to: Parsing the target intention to obtain a command sequence; Executing each command in the command sequence in sequence to obtain the reply statement; The reply sentence is output.
18. The apparatus of claim 17, wherein: The second acquisition module is specifically configured to: When the command sequence includes multiple commands, generating a message queue corresponding to the command sequence; Putting a first command in the command sequence into the message queue, and determining a third prompt template for obtaining a first response corresponding to the first command; Based on the third prompt template, the first command is input into the large model to obtain a first response; placing the first response and the second command in the command sequence into the message queue in sequence, and determining a fourth prompt template for obtaining a second response corresponding to the second command; Based on the fourth prompt template, input the second command and the current message queue into the large model to obtain a second response; When there are no unexecuted commands in the command sequence, the reply sentence is generated based on the first response and the second response.
19. An agent-based interactive system comprising: Input component, used to obtain input sentences; a processing component for invoking a first agent to perform intent recognition on an input sentence based on a currently associated knowledge base, a positive sample reference sentence, and a negative sample reference sentence; and, if the clarity of the intent of the input sentence is less than a first threshold, invoking a second agent to generate an intent query sentence; and, after obtaining a target intent with a clarity greater than the first threshold, invoking a third agent to obtain a response sentence corresponding to the input sentence; Output component, used to output intent query statements and response statements.
20. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the intelligent interaction method according to any one of claims 1 to 9.
21. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to enable the computer to execute the intelligent interaction method according to any one of claims 1 to 9.
22. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the intelligent interaction method according to any one of claims 1 to 9 when being executed by a processor.
Citation Information
Patent Citations
Dialogue model interaction method and device based on multiple tenants and storage medium
CN116881429A
Medication scheme generation method based on large language model and related equipment
CN117194630A
Multi-round question and answer intention recognition method and device based on knowledge base
CN117743556A
Task-based dialogue method based on vector retrieval and large language model
CN117829295A
Question and answer method based on intention determination logic and server
CN118093848A
Cited By
Large model training and evaluation method
CN119357678A
Integrated customer service method and system based on multiple agents
CN119359316A
Interactive teaching assisting method and device based on controllable intelligent agent
CN120104279A
Multi-agent collaborative graph database natural language interaction method and system
CN121092755A
Research learning agent interaction system based on generative pre-training large model
CN121279429A
