Information generation method and device, electronic equipment and storage medium
By calling the agent on the server side of the intelligent customer service to determine the target intention and tasks to be executed, the problem of intelligent customer service being unable to use experience to deal with similar problems is solved, and the efficiency and user experience of dealing with user problems are improved.
Patent Information
- Application Number
- CN202411754172.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
When dealing with user problems, smart customer service cannot use experience to deal with similar problems that have occurred before due to insufficient platform rules and knowledge base knowledge, resulting in inefficiency and poor user experience.
By calling the first agent on the server to determine the target intention based on user problems and information, and calling the second agent to determine the task to be executed corresponding to the target intention, the target information is generated as reply information to be sent to the client. The first agent is responsible for confirming intentions, the second agent is responsible for task planning, and the agent has the ability to learn to cope with environmental changes.
It improves the efficiency of dealing with user problems, improves the user experience, and can determine the target intention and tasks to be executed based on the user's problems and previous experiences of similar problems.
Smart Images

Figure CN119670863A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to an information generation method, device, electronic device and storage medium. Background Art
[0002] When answering user questions, intelligent customer service usually obtains information from the customer service knowledge base and other aspects based on the pre-set task rules in the platform, and then answers the questions raised by the user based on the information obtained.
[0003] However, due to the platform's rules and insufficient knowledge in the customer service knowledge base, and the inability of intelligent customer service to use experience to deal with similar problems that have occurred before, intelligent customer service is less efficient in handling user issues and users have a poor experience. Summary of the invention
[0004] To overcome the problems existing in the related art, the embodiments of the present application provide an information generation method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present application, there is provided an information generation method, which is applied to a server, and the method includes:
[0006] In response to obtaining the question and the user information, calling the first agent to determine the target intent based on the question and the user information;
[0007] Invoke a second agent to determine a task to be performed corresponding to the target intent, wherein the task to be performed includes an execution plan for obtaining reply information corresponding to the target intent;
[0008] The second agent is called to execute the task to be executed to generate target information, and the target information is sent to the client as reply information of the target intention.
[0009] According to a second aspect of an embodiment of the present application, there is provided an information generating device, which is applied to a server, and the device includes:
[0010] An intention determination module, configured to, in response to obtaining the question and the user information, call the first agent to determine the target intention based on the question and the user information;
[0011] A task determination module is used to call a second agent to determine a task to be performed corresponding to the target intention, wherein the task to be performed includes an execution plan for obtaining reply information corresponding to the target intention;
[0012] A reply information generating module is used to call the second agent to execute the task to be executed to generate target information, and send the target information as reply information of the target intention to the client.
[0013] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is executed by the processor to enable the electronic device to execute the method described in the first aspect.
[0014] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement the method described in the first aspect.
[0015] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising instructions, which, when executed on a computer, cause the computer to execute the method according to the first aspect.
[0016] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0017] In an embodiment of the present application, in response to obtaining a question and user information, a first agent is called to determine a target intent based on the question and the user information; a second agent is called to determine a task to be performed corresponding to the target intent, and the second agent is called to perform the task to be performed to generate target information, and the target information is sent to the client as a reply information of the target intent. The first agent and the second agent are responsible for intent confirmation and task planning, respectively. The agents have learning capabilities and can take corresponding actions based on changes in the environment. Therefore, the target intent can be determined based on the user's question and the experience of similar problems that have occurred before, and then the task to be performed can be determined, which ultimately improves the efficiency of handling user problems and enhances user experience.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments of the present application. It should be understood that for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0020] Figure 1 A schematic diagram of a scenario corresponding to the information generation method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of an overall scenario of the information generation method provided in an embodiment of the present application;
[0022] Figure 3A schematic diagram of an exemplary method flow of the information generation method provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a specific example of the information generation method provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of an information generating device provided in an embodiment of the present application;
[0025] Figure 6 An exemplary structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solution of the embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.
[0027] The terms used in the following embodiments of the present application are for the purpose of describing specific embodiments, and are not intended to be used as limitations on the technical solutions of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "above", "the" and "this" are intended to include plural expressions as well, unless there is a clear indication to the contrary in the context.
[0028] It should also be understood that although the terms first, second, etc. may be used to describe a certain type of object in the following embodiments, the object should not be limited to these terms. These terms are used to distinguish the specific implementation objects of this type of object.
[0029] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] With the popularity of various types of platforms and the increase in user data on the corresponding platforms, the transaction volume and consultation volume of the tasks corresponding to the platforms have also increased. Taking the food delivery platform as an example, the store faces complex problems from ordering users, riders, orders, product management, marketing activities, account security and other aspects. When facing ordering users, it is necessary to respond to the questions raised by the ordering users; at the same time, after entering the platform, the store also needs to ask questions to the platform about setting up the corresponding activity rules for the store, food management, etc., in order to solve the above problems.
[0031] For example, a newly settled store encountered difficulties when trying to set the store's business hours, and asked the platform's intelligent customer service how to do it. However, due to the lack of specific guidance for the latest interface changes in the knowledge base, the answers given by the intelligent customer service were unclear and could not directly solve the problem. The store had to try repeatedly or seek help from manual customer service, resulting in increased time costs. During peak periods, the number of questions from stores regarding order cancellations increased, and these questions were highly similar in content and context. However, due to the lack of experience accumulated in handling similar problems, the intelligent customer service could not automatically identify and apply previous solutions, but instead went through the same query and response process each time, resulting in inefficient processing.
[0032] In view of this, an embodiment of the present application proposes an information generation method to solve the problem that traditional customers do not have enough knowledge when answering user questions and cannot use experience to deal with similar problems that have occurred before.
[0033] The information generation method provided in the embodiment of the present application can be run on the server corresponding to the intelligent customer service. Figure 1 The application scenario diagram used in the embodiment of the present application is shown, including a client 101 and a server 102. The client is used to run an application program that carries intelligent customer service, specifically, a mobile application (APP), a web version of a customer service chat window, a desktop application, or a chat plug-in integrated in other platforms (such as an e-commerce platform, a social platform). Users can communicate with intelligent customer service through text, voice or video through a browser or a specific application on a device such as a smartphone, tablet computer, personal computer, etc., to ask questions, query information or obtain services.
[0034] The server is used to process requests from the client, including receiving information input by the user (such as text messages, voice commands, etc.), calling the knowledge base, algorithm model and other resources in the intelligent customer service system for intelligent analysis, processing and reply, and finally sending the generated response information to the client. The server can be deployed on a cloud server, using the high availability and scalability of cloud computing resources to ensure the stable operation and rapid response of the intelligent customer service system. The server can also integrate natural language processing, machine learning and other technologies to achieve functions such as natural language understanding, intent recognition, sentiment analysis, and intelligent recommendations.
[0035] Specifically, Figure 2 As shown, the process of the intelligent customer service corresponding to the information processing method of the present application in the dialogue with the user is an outer loop, and the reply information generated for replying to the user in each dialogue is the output result of the corresponding task to be executed. The intelligent customer service on the server side confirms the intention internally, determines the task to be executed according to the target intention, and corrects and adjusts the task to be executed, which is an inner loop.
[0036] The client and the server are connected by wireless communication, and data can be transmitted using protocols such as Hypertext Transfer Protocol (HTTP), Hypertext Transfer Protocol Secure (HTTPS) or WebSocket. The user enters questions through the client, and the client encapsulates this information into a data packet in HTTP request or other protocol format and sends it to the server. After receiving the request, the server recognizes the intent of the question entered by the user and classifies it into a preset intent category, such as order inquiry, product consultation, complaint feedback, etc. Intent recognition is the core of the outer loop and determines the type of task to be performed later. According to the recognized intent, the intelligent customer service obtains the output results of the corresponding task to be performed from the inner loop. The output results are converted into natural language replies that are easy for users to understand, including text, voice or graphical interface. The reply content not only contains direct answers, but may also contain suggestions or links to further guide user operations. The server encapsulates the generated reply content into a response data packet and sends it back to the client through the Internet. After receiving the response, the client parses the data packet and displays it to the user, such as displaying it in the chat window in text form or playing it to the user in voice form.
[0037] On the basis of the above content, we can also collect feedback from users on their satisfaction with the reply information, whether the problem has been solved, whether there are further inquiries, etc. Feedback data can be used to optimize the model and algorithm of intelligent customer service and improve user experience.
[0038] In the inner loop, the intelligent customer service system further confirms the identified user intent to ensure accuracy. Based on the confirmed target intent, the intelligent customer service system assigns the corresponding tasks to be executed to the corresponding modules or systems, such as the order query module, product recommendation system, etc. To execute the assigned tasks, relevant information can be retrieved from the database, the application programming interface (API) can be called, and complex calculations or logical reasoning can be performed. Tasks are dynamically adjusted or optimized according to actual conditions. Preliminary evaluation is performed on the task execution results to check whether they meet expectations and whether there are errors or omissions. Based on the evaluation results, necessary corrections and adjustments are made to the task execution logic, data retrieval strategy, etc. in the inner loop to improve the accuracy and relevance of the results. The corrected task execution results are encapsulated into a format that is convenient for use in the outer loop. The encapsulated results are output to the outer loop to generate the final reply information.
[0039] The internal and external loops are linked through data exchange and state synchronization to promote the smooth progress of the dialogue process. The intelligent customer service system continuously optimizes and adaptively adjusts the models and algorithms in the internal and external loops by continuously collecting user feedback and dialogue data, thereby improving the user experience.
[0040] Under the above operating environment, the embodiment of the present application provides the following Figure 3 Please refer to the information generation method shown in Figure 3 , the information generation method comprises the following steps:
[0041] In step S301, in response to obtaining a question and user information, a first agent is called to determine a target intention based on the question and user information.
[0042] Exemplarily, an agent is a software program that can observe and act autonomously to achieve a specific goal or task. The agent formed by the software program can operate in different environments and can infer the next action by perceiving changes in the environment (user feedback, whether the results are correct, etc.), so that the environmental changes after the action are close to the desired results. For example, an agent can act as a non-player character (NPC) or a player assistant in an electronic game or simulation environment, and complete tasks or challenges by learning and adapting to the game mechanism; an agent can be embedded in a robot, so that the robot can autonomously perceive the environment, plan paths, and perform tasks (such as carrying goods, exploring unknown areas, and autonomously planning paths according to the surrounding environment); an agent can interact with users in natural language as a chatbot, answer questions, provide information, assist in decision-making, or communicate emotionally. The next action can be inferred by machine learning, rule engines, and planning algorithms, etc., and different algorithms can be selected according to the scenario in which the agent is applied.
[0043] After the user inputs a question through the intelligent customer service, the first agent is called to determine the target intent corresponding to the question based on the corresponding user information combined with the historical question and answer information. The first agent can select a matching algorithm based on the user information and the question and combine the historical question and answer information to determine the question intent.
[0044] Specifically, user information can be an identity document (ID), and the corresponding question and answer records can be found in the historical question and answer information database based on the identity document. After obtaining the relevant question and answer records, the initial intent can be obtained through large language model (LLM) analysis. Next, the question and the initial intent can be input into the pre-trained machine learning model to predict the target intent.
[0045] In step S302, the second agent is called to determine the task to be executed corresponding to the target intention, and the task to be executed includes an execution plan for obtaining the reply information corresponding to the target intention.
[0046] For example, after determining the target intent, it is necessary to determine the reply information of the reply user, wherein the reply information is obtained by executing necessary tasks. The second agent is called to generate a task to be executed to obtain the reply information according to the target intent. The task to be executed here is the action and plan corresponding to the target intent by the second agent. The second agent is different from the first agent. The second agent is used to plan the task to be executed, while the first agent is used to determine the target intent of the user.
[0047] For example, the target intent is input into the second agent for task planning, and each node in the execution process of the task to be executed and the target execution result are obtained. For another example, the corresponding task to be executed can be matched in the preset task library according to the target intent. Specifically, the target intent is to inquire about the estimated delivery time of the order. The second agent needs to query the order and predict the delivery time based on the actual situation of the queried order at the current moment. The corresponding task to be executed is to query the order and predict the delivery time.
[0048] In step S303, the second agent is called to execute the task to be executed to generate target information, and the target information is sent to the client as reply information of the target intention.
[0049] Exemplarily, the task to be executed is the action and plan of the second agent, so after determining the task to be executed, the second agent executes the corresponding action and plan, thereby generating target information. Specifically, the second agent executes the query order by calling the interface / program / model of the task to be executed, and predicts the delivery time to obtain the reply information corresponding to the user information, and sends the reply information to the client.
[0050] Different agents are used to process different parts of the information generation method, which improves the efficiency of information generation, avoids the shortage of computing resources of a single agent, and realizes the effective utilization of resources and load balancing. The corresponding agents can be assigned different tasks according to their expertise and advantages, thereby improving the professionalism and accuracy of task processing. The task allocation can also be dynamically adjusted according to the actual needs of the task and the state of the agent to adapt to the complex and changing environment. Agents can share information, resources and experience through communication and collaboration mechanisms, thereby improving the performance and efficiency of the overall system. Multiple agents can work together to complete complex tasks and solve problems that are difficult for a single agent to solve through cooperation. Each agent can be regarded as an independent decision-making entity, and its behavior and decision-making process can be recorded and explained, thereby improving the interpretability and transparency of the system. When problems arise, it is easier to trace the specific agent and its decision-making process, so as to analyze the problem.
[0051] It can be seen that, by adopting the embodiment of the present application, in response to obtaining a question and user information, the first agent is called to determine the target intent based on the question and user information; the second agent is called to determine the task to be executed corresponding to the target intent, the second agent is called to execute the task to be executed to generate target information, and the target information is sent to the client as reply information of the target intent. The first agent and the second agent are responsible for intention confirmation and task planning respectively. The agents have learning capabilities and can take corresponding actions based on changes in the environment. Therefore, the target intent can be determined based on the user's question and the experience of similar problems that have occurred before, and then the task to be executed can be determined, which ultimately improves the efficiency of handling user problems and enhances user experience.
[0052] In some embodiments, the question input by the user may have been asked in previous historical question and answer information. Therefore, when the user asks a similar question again, the experience of previously handling the question can be used to handle the question currently asked by the user. At the same time, the true intention of the current question can be further inferred based on the user's historical question and answer information.
[0053] Therefore, when calling the first agent to determine the target intent, the historical question information corresponding to the user information can be first filtered in the user library. The historical question and answer information here can be other question and answer information before the current question. After that, the first agent can call the preset large language model to identify the keywords in the question and match the identified keywords in the historical question and answer information. If there is a match with the corresponding historical question and answer information, the intent corresponding to the matched historical question and answer information can be used as the target intent. If there is no match with the corresponding historical question and answer information, it is necessary to combine according to the keywords to obtain the target intent.
[0054] Specifically, historical question and answer information matching the user information is screened in the user database; a preset large language model is called to identify keywords corresponding to the question, wherein the keywords are words used to represent the intention expressed by the question; if the intention corresponding to the keywords is matched in the historical question and answer information, the intention is used as the target intention; if the intention corresponding to the keywords is not matched in the historical question and answer information, the keywords are combined to generate the target intention.
[0055] Exemplarily, the user library stores historical question and answer information corresponding to each user, including questions, answers, intent tags and other information, and the historical question and answer information corresponds to the user information. Before identifying the keywords corresponding to the question, the question can be text cleaned (such as removing punctuation, stop words, converting to lowercase, etc.) and word segmented to improve the accuracy of intent recognition. Use a pre-trained language model to identify keywords and intents in the question, input the question text into a preset large language model, and obtain the intent classification or keyword list output by the model, and extract keywords that can represent the intent of the question. Traverse the historical question and answer information to check whether there is an intent tag that matches the current question keyword. The matching algorithm can be a string match or a semantic similarity calculation. If an intent that matches the current question keyword is found in the historical question and answer information, the intent is used as the target intent.
[0056] If no matching intent is found, a new intent can be generated using the extracted keyword combination. This can be achieved through string concatenation or rules / templates.
[0057] Combining keywords through rules / templates can be achieved in the following manner. Specifically, the defined rules / templates can define the combination of keywords according to the word class, semantic relationship, etc. of the keywords. For example, for a question about the weather, the following templates can be defined: "Query [weather type] at [location]" or "Forecast for [weather type] at [location]", and rules are defined to identify the location and weather type keywords in the question.
[0058] In actual applications, the combination process can be: A. First, keywords need to be extracted from the question text through natural language processing technology, such as word segmentation, part-of-speech tagging, named entity recognition, etc. These keywords may include place names, time words, action verbs, and related nouns. B. Match the extracted keywords with predefined rules to determine which keywords are applicable to the current question, and filter and sort them. For example, in weather query questions, it is necessary to filter out location and weather type as key information. C. Based on the filtered keywords and predefined templates, the keywords are combined into new sentences or query statements that conform to grammatical and semantic rules through string replacement or formatting operations. For example, if the question is "What is the weather like in area X today?", and the extracted keywords are "area X" and "today's weather", the template "query [weather type] of [location]" can be applied to combine the keywords into "query today's weather in area X".
[0059] It should be noted that the target intent obtained by combining the questions input by the user according to the keywords may be the user's corresponding "rejection intent", "appeal intent" and "rhetorical question intent". When a "rejection intent" is received, the second agent may reply with the reply information corresponding to the "rejection intent", specifically, the reply sentence template corresponding to the rejection intent, to complete the relevant information of the user's question; when a "rhetorical question intent" is received, the second agent directly replies to the question sentence of the user; when a "appeal intent" is received, the second agent plans the tasks to be executed according to the "appeal intent".
[0060] The purpose of the task to be executed corresponding to the "rhetorical question intention" is to further confirm the user's true intention. After the reply information corresponding to the rhetorical question intention is sent to the client, the user sends the question or confirmation information again according to the reply information to determine the user's true intention.
[0061] Next, the second intelligent agent is called to determine the tasks to be executed corresponding to the target intent. In order to further improve the response efficiency of the intelligent customer service, the second intelligent agent can also filter out tasks that match the target intent in the stored task library, and then use the filtered tasks as tasks to be executed, reducing the steps of regenerating tasks to be executed according to the target intent and improving the response efficiency of the intelligent customer service.
[0062] Specifically, the task library can be a structure that is easy to query and match. Each task in the task library should have an identifier and metadata describing the task's function, parameters, input and output, etc. This information should be indexed or tagged for quick retrieval.
[0063] According to the target intent, one or more matching algorithms can be used to filter out matching tasks from the task library. These algorithms are text similarity, keyword matching, rule matching, or machine learning models. Among them, text similarity uses natural language processing (NLP) technology to calculate the text similarity between the target intent and the task description in the task library, and selects the task with the highest similarity as the matching result; keyword matching extracts keywords from the target intent and then searches for these keywords in the task description of the task library. If a match is found, other metadata of the task are further evaluated to determine whether it is a true match; rule matching, corresponding rules can be defined, which map the target intent to specific tasks. When a target intent is received, these rules are traversed, matching rules are found, and the corresponding tasks are returned; machine learning model, train a machine learning model (such as a classifier), which can receive the target intent as input and output one or more matching tasks. This method requires a large amount of labeled data to train the model.
[0064] If multiple possible tasks are returned according to the matching algorithm, and if all of the multiple possible tasks can obtain reply information corresponding to the target intent, the tasks that meet the corresponding conditions among the multiple tasks can be determined as the tasks to be executed based on the scores of the corresponding user feedback results in the historical question and answer information of the multiple tasks.
[0065] If multiple tasks are mutually coordinated, and thus reply information corresponding to the target intent is obtained, then each sub-agent included in the second agent is called to execute each task respectively to obtain reply information of the target intent. Specifically, in actual applications, if the matched task to be executed includes multiple sub-tasks, and the second agent includes multiple first sub-agents and multiple second sub-agents, calling the second agent to execute the task to be executed to generate target information includes:
[0066] Find the first sub-agent and the second sub-agent corresponding to the multiple sub-tasks one by one; call the corresponding first sub-agent to execute the corresponding sub-tasks in the execution order satisfied by the multiple sub-tasks, and call the second sub-agent to verify the output information of the corresponding first sub-agent; when the output information of the multiple sub-tasks are all verified, the output information of the last sub-task among the multiple sub-tasks is used as the target information.
[0067] Specifically, after calling the i-th first sub-agent to perform the corresponding subtask and obtain output information, the i-th second sub-agent is called to verify the output information, where i is not equal to N; if the verification passes, the output information is input to the i+1-th first sub-agent, and the i+1-th first sub-agent is called to perform the corresponding subtask; if the verification fails, the i-th second sub-agent is called to adjust the i-th subtask, and the i-th first sub-agent is called to perform the adjusted i-th subtask.
[0068] Exemplarily, a mapping relationship is pre-established between each subtask and the corresponding first sub-agent (executor) and second sub-agent (verifier). This can be established through a configuration file, a database, or a data structure in memory. The sub-agent corresponding to each subtask is found based on the mapping relationship.
[0069] When executing each subtask, the subtasks can be arranged into a queue according to the execution order they meet. Take out the subtasks one by one according to the order in the task queue. For each subtask, call the corresponding first sub-agent to execute the task and obtain its output information. Subsequently, call the corresponding second sub-agent and use the output information of the first sub-agent as input for verification. If the verification passes, continue to call the first sub-agent corresponding to the next subtask to process the subtask. If the verification fails, according to the task requirements, you can choose to re-execute the current subtask (you may need to modify the input or parameters, and re-plan the current subtask), or terminate the entire process and return an error message.
[0070] After all subtasks are executed and their output information is verified, the output information of the last subtask is used as the target information. The target information is returned to the requester or stored in a specified location for subsequent use.
[0071] It should be noted that, when the result type of the failure to verify the current subtask is that the value of the output information is not within the preset range, the i-th second sub-agent is called to adjust the parameters corresponding to the i-th subtask until the output result of the i-th subtask is verified to pass, and the adjusted i-th subtask is obtained; if the result type of the failure to verify is that the type of the output information is not the preset type, the i-th second sub-agent is called to regenerate the i-th subtask, and the adjusted i-th subtask is obtained.
[0072] For example, if the output information is not within the preset range, for example, the predicted estimated delivery time exceeds the specified delivery time period, it means that the output information is wrong. In this case, the prediction model parameters can be adjusted and the prediction can be repeated until data within the specified delivery time period is obtained.
[0073] If the type of the output information is not the preset type, that is, the preset type is the delivery time period, which can be a specific time point, and the output result is deliverable, this means that the current subtask cannot obtain the expected output information, then it is necessary to re-match the corresponding subtask in the task library to correct the above problem.
[0074] In addition, if no task matching the target intent is found in the task library, a corresponding task to be executed can be generated according to the target intent, and the generated task to be executed can be stored in the task library so that the next time a problem with the same intent is encountered, it can be filtered out in the task library.
[0075] Among them, the corresponding tasks to be executed are generated according to the target intent, which can be obtained specifically in the following ways: matching the reference reply information corresponding to the target intent in the preset reply rules; obtaining at least one subtask matching the reference reply information and the execution order of at least one subtask from the preset subtask set; and determining at least one subtask executed in the execution order as the task to be executed.
[0076] Exemplarily, one or more reply rules are predefined, and the reply rules map the target intent to specific reference reply information. This can be implemented through a database table or a dedicated rule engine. When the target intent is received, the reference reply information matching it is found according to the preset reply rules. The reference reply information can be a reply template corresponding to the target intent, and at least one matching subtask is obtained from the preset subtask set according to the information required in the reply template.
[0077] A pre-set subtask collection contains multiple subtasks, each of which has a unique identifier, description, possible input / output parameters, and data or conditions required to execute the task.
[0078] In the subtask set, one or more matching subtasks are associated according to the data that needs to be added in each reference reply information (reply template). Specifically, the subtasks can be selected according to the amount of data that needs to be added. For example, if an estimated delivery time needs to be added, the delivery time is the data that needs to be added, and the subtask of predicting the delivery time is one of the subtasks corresponding to the reference reply information. Furthermore, when replying to the delivery time, the corresponding user and order need to be clarified, so before the subtask of predicting the delivery time, the subtask corresponding to the order needs to be queried.
[0079] In the actual execution process, this can be achieved by adding a "reference reply ID" or similar field to each subtask in the subtask collection, which corresponds to the unique identifier in the reference reply information. For each subtask collection matched by the reference reply information, the execution order of these subtasks also needs to be defined. This can be achieved by adding an "execution order" field to the subtask collection, or by establishing clear dependencies between subtasks. Once a subtask collection matching the reference reply information is found, these subtasks are retrieved according to the execution order (or dependency). At least one subtask arranged in execution order is combined into a list of tasks to be executed. According to the requirements of each subtask, prepare the necessary input data or conditions for subsequent execution.
[0080] Next, the above information generation method is described with a specific example. Figure 4 The figure shows a schematic diagram of an information generation method suitable for intelligent customer service. After obtaining the question and user information, the first agent determines the historical question and answer information according to the user information. If the target intention cannot be determined by combining the historical question and answer information and the question, the intention clarification is performed, wherein the intention clarification can be to generate a rhetorical question or interrogative statement related to the question, which is used to determine the target intention to the user. After determining the target intention, if the target intention can be determined by combining the historical question and answer information and the question, the second agent determines the task to be performed according to the task library and the target intention. If the task to be performed is not directly screened in the task library, the task to be performed is stored in the task library so that it can be directly obtained from the task library when encountering the same intention problem later, thereby improving the efficiency of information generation. After generating the task to be performed, the second agent performs the corresponding task to be performed to obtain the output result, further verifies the output result, and uses the output result as the reply information if the verification passes. If the verification fails, the task to be performed needs to be further adjusted so that the output result of the adjusted task to be performed can pass the verification.
[0081] It can be seen that the embodiment of the present application proposes an information generation method, which responds to obtaining a question and user information, calls the first agent to determine the target intent based on the question and user information; calls the second agent to determine the task to be performed corresponding to the target intent, calls the second agent to perform the task to be performed to generate target information, and sends the target information to the client as reply information of the target intent. The first agent and the second agent are responsible for intention confirmation and task planning respectively. The agents have learning capabilities and can take corresponding actions based on changes in the environment. Therefore, the target intent can be determined based on the user's question and the experience of similar problems that have occurred before, and then the task to be performed can be determined, which ultimately improves the efficiency of handling user problems and enhances user experience.
[0082] The above implementation steps can also implement corresponding functions through software modules. Corresponding to the above information generation method, the embodiment of the present application can also provide an information generation device.
[0083] like Figure 5 As shown, an information generating device is provided, which may include an intention determining module 51, a task determining module 52, and a reply information generating module 53. The information generating device may be used to perform the above Figure 2 operation of part or all of the electronic equipment in the
[0084] For example: an intention determination module 51 is used to, in response to obtaining a question and user information, call the first agent to determine the target intent based on the question and the user information; a task determination module 52 is used to call the second agent to determine the task to be performed corresponding to the target intent, and the task to be performed includes an execution plan for obtaining the reply information corresponding to the target intent; a reply information generation module 53 is used to call the second agent to perform the task to be performed to generate target information, and send the target information to the client as the reply information of the target intent.
[0085] Optionally, the reply information generation module 53 is used to: filter out tasks that match the target intent from the stored task library; if a task that matches the target intent is filtered out from the stored task library, determine the filtered out task as the task to be executed; if a task that matches the target intent is not filtered out from the preconfigured task library, generate a task according to the target intent, the task is the task to be executed, and store the task in the task library.
[0086] Optionally, the reply information generation module 53 is also used to: match reference reply information corresponding to the target intent in a preset reply rule; obtain at least one subtask matching the reference reply information and the execution order of the at least one subtask from a preset subtask set; and determine the at least one subtask executed in the execution order as the task to be executed.
[0087] Optionally, the task to be executed includes multiple sub-tasks, the second agent includes multiple first sub-agents and multiple second sub-agents, and the module 53 for generating reply information is further used to: search for first sub-agents and second sub-agents corresponding one-to-one to the multiple sub-tasks; respectively call the corresponding first sub-agents to execute the corresponding sub-tasks in the execution order satisfied by the multiple sub-tasks, and respectively call the second sub-agents to verify the output information of the corresponding first sub-agents; when the output information of the multiple sub-tasks are all verified, the output information of the last sub-task among the multiple sub-tasks is used as the target information.
[0088] Optionally, the total number of the multiple subtasks is N, and the reply information generation module 53 is also used to: after calling the i-th first sub-agent to perform the corresponding subtask and obtain output information, call the i-th second sub-agent to verify the output information, where i is not equal to N; if the verification passes, input the output information to the i+1-th first sub-agent, and call the i+1-th first sub-agent to perform the corresponding subtask; if the verification fails, call the i-th second sub-agent to adjust the i-th subtask, and call the i-th first sub-agent to perform the adjusted i-th subtask.
[0089] Optionally, the calling of the i-th second sub-agent to adjust the i-th subtask includes at least one of the following: if the result type of the verification failure is that the value of the output information is not within a preset range, calling the i-th second sub-agent to adjust the parameters corresponding to the i-th subtask until the output result of the i-th subtask is verified to pass, thereby obtaining the adjusted i-th subtask; if the result type of the verification failure is that the type of the output information is not a preset type, calling the i-th second sub-agent to regenerate the i-th subtask, thereby obtaining the adjusted i-th subtask.
[0090] Optionally, the intention determination module 51 is also used to: filter historical question and answer information that matches the user information in the user library; call a preset large language model to identify keywords corresponding to the question, and the keywords are used to represent the words of the intention expressed by the question; if the intention corresponding to the keyword is matched in the historical question and answer information, then the intention is used as the target intention; if the intention corresponding to the keyword is not matched in the historical question and answer information, then the keywords are combined to generate the target intention.
[0091] It can be seen that in the intention determination module 51, in response to obtaining the question and the user information, the first agent is called to determine the target intent based on the question and the user information; the task determination module 52 calls the second agent to determine the task to be performed corresponding to the target intent, and the reply information generation module 53 calls the second agent to perform the task to be performed to generate target information, and sends the target information to the client as the reply information of the target intent. The first agent and the second agent are responsible for intention confirmation and task planning respectively. The agents have learning capabilities and can take corresponding actions based on changes in the environment. Therefore, the target intent can be determined based on the user's question and the experience of similar problems that have occurred before, and then the task to be performed can be determined, which ultimately improves the efficiency of handling user problems and enhances user experience.
[0092] Understandably, Figure 5The division of each module is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into the hardware entity of the electronic device for implementation.
[0093] Please refer to Figure 6 , Figure 6 An electronic device is provided. The embodiment of the present disclosure also provides an electronic device for executing the above-mentioned information generation method. Figure 6 , which shows a schematic diagram of an electronic device provided by some embodiments of the present disclosure. Figure 6 As shown, the electronic device includes: a processor 600, a memory 601, a bus 602 and a communication interface 603, wherein the processor 600, the communication interface 603 and the memory 601 are connected via the bus 602; the memory 601 stores a computer program that can be run on the processor 600, and the processor 600 executes the aforementioned Figure 3 The information generation method provided by any of the illustrated embodiments.
[0094] The memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0095] The bus 602 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 601 is used to store programs. After receiving the execution instruction, the processor 600 executes the program. Figure 3 The information generation method disclosed in any of the illustrated embodiments may be applied to the processor 600 or implemented by the processor 600 .
[0096] The processor 600 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 600. The above processor 600 can be a general-purpose processor, including a processor (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 600 reads the information in the memory 601 and completes the steps of the above method in combination with its hardware.
[0097] The electronic device provided by the embodiment of the present disclosure and the information generation method provided by the embodiment of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented by them.
[0098] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores instructions for generating information. When the instructions are executed on a computer, the computer executes part or all of the steps in the method described in the above-mentioned embodiment.
[0099] The embodiment of the present application also provides a computer program product including instructions for generating information, which, when executed on a computer, enables the computer to execute part or all of the steps in the method described in the above-mentioned embodiment.
[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a smart phone or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0105] Although the optional embodiments of the present application have been described, those skilled in the art, once informed of the basic creative concept, may make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications falling within the scope of the present application.
[0106] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present invention.
Claims
1. A method for generating information, characterized in that: Applied to the server, the method includes: In response to obtaining the question and the user information, calling the first agent to determine the target intent based on the question and the user information; Invoke a second agent to determine a task to be performed corresponding to the target intent, wherein the task to be performed includes an execution plan for obtaining reply information corresponding to the target intent; The second agent is called to execute the task to be executed to generate target information, and the target information is sent to the client as reply information of the target intention.
2. The method according to claim 1, characterized in that The calling of the second agent to determine the task to be performed corresponding to the target intention includes: Filtering tasks matching the target intent from a stored task library; If a task matching the target intention is screened out from the stored task library, the screened task is determined as the task to be executed; If no task matching the target intent is screened out from the preconfigured task library, a task is generated according to the target intent, the task is the task to be executed, and the task is stored in the task library.
3. The method according to claim 2, characterized in that The generating of a task according to the target intention comprises: Matching the reference reply information corresponding to the target intent in the preset reply rules; Acquire at least one subtask matching the reference reply information from a preset subtask set, and an execution order of the at least one subtask; The at least one subtask executed in the execution order is determined as the task to be executed.
4. The method according to claim 1, characterized in that: The task to be executed includes a plurality of subtasks, the second agent includes a plurality of first subagents and a plurality of second subagents, and the calling of the second agent to execute the task to be executed to generate target information includes: Finding the first sub-agent and the second sub-agent corresponding to the plurality of sub-tasks one by one; In accordance with the execution order satisfied by the plurality of subtasks, the corresponding first sub-agents are respectively called to execute the corresponding subtasks, and the second sub-agents are respectively called to verify the output information of the corresponding first sub-agents; When the output information of the plurality of subtasks are all verified, the output information of the last subtask among the plurality of subtasks is used as the target information.
5. The method according to claim 4, characterized in that The total number of the plurality of subtasks is N, and the respectively calling the second sub-agent to verify the output information of the corresponding first sub-agent includes: After calling the i-th first sub-agent to perform the corresponding sub-task and obtain output information, calling the i-th second sub-agent to verify the output information, where i is not equal to N; If the verification is successful, the output information is input to the i+1th first sub-agent, and the i+1th first sub-agent is called to perform the corresponding subtask; If the verification fails, the i-th second sub-agent is called to adjust the i-th sub-task, and the i-th first sub-agent is called to execute the adjusted i-th sub-task.
6. The method according to claim 5, characterized in that The calling of the i-th second sub-agent to adjust the i-th subtask includes at least one of the following: If the result type of the verification failure is that the value of the output information is not within the preset range, the i-th second sub-agent is called to adjust the parameters corresponding to the i-th subtask until the output result of the i-th subtask is verified to pass, thereby obtaining the adjusted i-th subtask; If the result type of the verification failure is that the type of the output information is not a preset type, the i-th second sub-agent is called to regenerate the i-th subtask to obtain an adjusted i-th subtask.
7. The method according to claim 1, characterized in that The calling of the first agent to determine the target intention based on the question and the user information includes: Filtering historical question and answer information matching the user information in the user database; Calling a preset large language model to identify keywords corresponding to the question, where the keywords are used to represent the intent expressed by the question; If an intent corresponding to the keyword is matched in the historical question and answer information, the intent is used as the target intent; If no intent corresponding to the keyword is matched in the historical question and answer information, the keywords are combined to generate a target intent.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The computer program is executed by the processor to enable the electronic device to perform the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Task planning reasoning device, method and equipment of intelligent agent, medium and product
CN120146202A
Video generation method and device based on multi-agent cooperation and agents
CN120151560A
Information interaction method, system and device, electronic equipment and storage medium
CN120315798A
Information interaction method, system, device, electronic device and storage medium
CN120315798B
Payment system, method and device based on large model, medium and equipment
CN120634542A