Processing method and device of intelligent agent, equipment and storage medium

By fine-tuning the intelligent agent and utilizing target sample questions and interface feature data, it is equipped with API call capabilities, which solves the difficulty of the intelligent agent in understanding and generating API call code, and improves task processing capabilities and user experience.

CN119808940BActive Publication Date: 2025-10-10BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411826138.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-10-10
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

Existing intelligent agents have difficulty understanding and generating API call code, especially for complex APIs or APIs that require specific parameters. They also have security and reliability issues and are difficult to adapt to different tasks and environments.

Method used

By obtaining multiple target sample questions of the target intent category and interface feature data of the target interface, the preset intelligent agent is fine-tuned to enable it to have the ability to call the target interface, generate an interface calling program, and improve the task processing capability of the intelligent agent.

Benefits of technology

It improves the agent's ability to understand and process tasks, avoids problems such as environmental incompatibility and API unreliability, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808940B_ABST
    Figure CN119808940B_ABST
Patent Text Reader

Abstract

The present disclosure provides a processing method and device of an agent, equipment and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical field of deep learning, large model and the like. The specific implementation scheme is as follows: a plurality of target sample questions belonging to a target intent category are acquired; interface feature data of a target interface required to be called to answer a question belonging to the target intent category is acquired; based on the plurality of target sample questions and the interface feature data of the target interface, at least part of adjustable parameters in a preset agent are fine-tuned to obtain a target agent capable of calling the target interface to answer the question belonging to the target intent category.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of deep learning, large models, etc. BACKGROUND

[0002] Large language models (LLM) have made significant progress in the field of natural language processing, exhibiting strong learning and generation capabilities.

[0003] In existing solutions, in order to meet different reasoning needs of users, agent technology emerges as the times require. For example, in practical applications, large models with different reasoning capabilities (or different functions) can be packaged into different agents and presented to terminal users in the form of agents to improve user experience. Although existing agents can perform user tasks to some extent, there are still challenges. SUMMARY

[0004] The present disclosure provides a processing method, device, and equipment of an agent and a storage medium.

[0005] According to an aspect of the present disclosure, a processing method of an agent is provided, comprising:

[0006] obtaining a plurality of target sample questions belonging to a target intent category;

[0007] obtaining interface feature data of a target interface required to be called to answer a question belonging to the target intent category;

[0008] based on the plurality of target sample questions and the interface feature data of the target interface, fine-tuning at least part of adjustable parameters in a preset agent to obtain a target agent capable of calling the target interface to answer a question belonging to the target intent category.

[0009] According to another aspect of the present disclosure, a processing device of an agent is provided, comprising:

[0010] a sample processing unit configured to obtain a plurality of target sample questions belonging to a target intent category, and obtain interface feature data of a target interface required to be called to answer a question belonging to the target intent category;

[0011] an agent training unit configured to fine-tune at least part of adjustable parameters in a preset agent based on the plurality of target sample questions and the interface feature data of the target interface, to obtain a target agent capable of calling the target interface to answer a question belonging to the target intent category.

[0012] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein

[0015] the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any of the embodiments of the present disclosure.

[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform the method according to any of the embodiments of the present disclosure.

[0017] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method according to any of the embodiments of the present disclosure.

[0018] In this way, the present solution can fine-tune the preset agent using the multiple target sample problems belonging to the target intent category and the interface feature data of the target interface, so that the target agent obtained after fine-tuning can have the calling ability of the target interface, in other words, can automatically generate an interface calling program that calls the target interface, thereby effectively improving the understanding ability of the agent for the task, and further improving the task processing ability of the agent, thereby further improving the user experience.

[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not limit the present disclosure. Among them:

[0021] Figure 1 is a schematic flow of the processing method of the agent according to an embodiment of the present application Figure One ;

[0022] Figure 2 is a schematic flow of the processing method of the agent according to an embodiment of the present application Figure Two ;

[0023] Figure 3 is a flowchart of the processing method of the agent according to an embodiment of the present application in a specific example;

[0024] Figure 4 is a structural schematic diagram of the processing device of the agent according to an embodiment of the present application;

[0025] Figure 5 is a block diagram of an electronic device for implementing a processing method of an agent of an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, in which various specific details are set forth to assist in a thorough understanding of the embodiments of the present disclosure. It will be understood by those of ordinary skill in the art that various changes in the details of the embodiments of the present disclosure can be made without departing from the scope of the present disclosure. Also, the description is made in the following order in the interest of clarity and conciseness.

[0027] The term "and / or" used herein is merely an association relationship between associated objects, and means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The term "at least one" used herein means any one of a plurality or any combination of at least two of a plurality, for example, at least one of A, B, and C includes any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" used herein mean to refer to a plurality of similar technical terms and to distinguish them, and do not mean to limit the order or mean to limit to only two, for example, the first feature and the second feature mean to refer to two types / two features, the first feature can be one or more, and the second feature can also be one or more.

[0028] In addition, in order to better illustrate the present disclosure, a large number of specific details are given in the following detailed description. Those skilled in the art should understand that the present disclosure can also be implemented without some specific details. In some examples, methods, means, elements and circuits that are well known to those skilled in the art are not described in detail, in order to highlight the main idea of the present disclosure.

[0029] The related technologies of the embodiments of the present disclosure are described below. The following related technologies can be combined with the technical solutions of the embodiments of the present disclosure in any way as optional schemes, and all belong to the protection scope of the embodiments of the present disclosure.

[0030] In order to perform the tasks required by users, LLM needs to interact with external tools or application programming interfaces (APIs) to combine external capabilities to complete the tasks required by users. For example, in the map's artificial intelligence (AI) wizard system, LLM may need to call the weather API to obtain weather information, or LLM may also call the point of interest (POI) query API to obtain information about places of interest to users.

[0031] Although LLM has made some progress in generating API call code and creating tools, some challenges still exist. For example, LLM still has difficulties in understanding and generating API call code, especially for complex APIs or APIs that require specific parameters. In addition, in order to enable LLM to adapt to different tasks and environments, LLM also needs more data in creating and customizing tools. In addition, LLM may also have security and reliability issues when generating API call code or creating tools.

[0032] Based on this, the disclosed solution proposes a method for processing an intelligent agent, which can use the data pair of "multiple sample questions belonging to the new intent category - interface feature data of the new API" to fine-tune the intelligent agent so that the adjusted intelligent agent has the ability to call the new API. In other words, when the fine-tuned intelligent agent needs to call the new API, it can define parameters based on the interface feature data of the new API and generate API call code, thereby borrowing external capabilities to complete the tasks required by the user. In this way, on the one hand, the task processing capability of the intelligent agent is improved, and on the other hand, the user experience is also improved.

[0033] Specifically, Figure 1 This is a schematic flow chart of a processing method for an intelligent agent according to an embodiment of the present application. Figure One The method may be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices.

[0034] Furthermore, the method includes at least part of the following contents. Figure 1 Shown, including:

[0035] Step S101: Acquire multiple target sample questions belonging to the target intent category.

[0036] Step S102: Obtain interface feature data of the target interface required to be called to answer questions belonging to the target intent category.

[0037] Here, the interface feature data of the target interface can specifically include interface parameter data of the target interface, such as including function function definition, function parameters, etc. of the target interface.

[0038] It should be noted that the "interface" (such as the target interface) described in the present disclosure can be an application programming interface (API) for providing a specified function service, such as a weather API for obtaining weather information, a POI query API for obtaining information of a place of interest, etc. Further, the present disclosure does not specifically limit the specific function service to be implemented by the target interface.

[0039] Step S103: Fine-tuning at least part of the adjustable parameters in the preset agent based on the plurality of target sample problems and the interface feature data of the target interface, to obtain a target agent capable of calling the target interface to answer problems belonging to the target intent category.

[0040] For example, in an example, after obtaining the target agent, the target agent can automatically generate interface parameter data of the target interface, such as generating function definition and function parameters, in a case where it is determined based on the user-input question and answer task that the target interface needs to be called, to automatically generate an interface calling program for calling the target interface by using the generated function definition and function parameters, and then call the target interface by using the generated interface calling program. In this way, the question and answer task is completed by using the calling capability of the called target interface, and then a target question and answer result is generated and output.

[0041] Here, the preset agent can be a virtual agent or a software agent, such as an intelligent system capable of reasoning based on a user-input specified task by using an embedded knowledge base and reasoning mechanism, and achieving a specific target.

[0042] Further, the preset agent can be encapsulated with a large model having a specified reasoning capability, where the large model can include a large language model (LLM), a generative model, etc., and the present disclosure does not limit the specific large model encapsulated by the preset agent. Further, the present disclosure does not limit the number of large models encapsulated by the preset agent, such as one or more large models encapsulated based on a specific function to be implemented.

[0043] In this way, the present disclosure can fine-tune the preset agent based on the plurality of target sample problems belonging to the target intent category and the interface feature data of the target interface, so that the target agent obtained after fine-tuning can have the calling capability of the target interface, in other words, can automatically generate an interface calling program for calling the target interface, thereby effectively improving the understanding capability of the agent for the task, and further improving the task processing capability of the agent, thereby further improving the user experience.

[0044] Further, since the new API discovery capability of the agent of the disclosed scheme is trained based on the data of "interface feature data of target interface of multiple target sample problems belonging to the target intent category", compared with the existing agent scheme of generating a new API calling program autonomously based on task understanding, the disclosed scheme effectively avoids the problems of environment inadaptation, unsafe and unreliable API calling caused by autonomous generation, and effectively avoids the problems of being unable to respond to user questions and answers or unreasonable answers caused by unreasonable API calling.

[0045] For example, in the map application business scenario, the disclosed scheme can fine-tune the online map business agent using the data of "interface feature data of target interface of multiple target sample problems belonging to the target intent category", thereby enabling the agent to have new API discovery capability. In this way, the intelligent level of map services can be significantly improved, thereby providing users with more rich and personalized map services, and effectively enhancing the adaptive ability of the map business agent, making it better applicable to various complex scenarios, thereby further improving the user experience.

[0046] In a specific example, the interface feature data of the target interface can be obtained in the following manner; specifically, the above-mentioned interface feature data of the target interface required to answer the question belonging to the target intent category (such as step S102) can specifically include: constructing a target prompt template (Prompt) based on multiple questions (query) belonging to the target intent category; the target prompt template can guide the large model to generate the interface feature data of the target interface required to answer the multiple questions (query) belonging to the target intent category; further, the target prompt template can also include prompt examples, such as examples of interface feature data of preset interfaces, so as to facilitate guiding the large model to generate the required data. Further, after obtaining the target prompt template, the interface feature data of the target interface required to answer the question belonging to the target intent category can be obtained using the large language model and the target prompt template.

[0047] For example, in an example, the target prompt template can be specifically:

[0048] Prompt:

[0049] I am a high-tech enterprise, an engineer and a scientific researcher of AI map business, our model can judge the intent according to the user's query, and call a reasonable API (function) to help the user

[0050] respond to the query.

[0051] We have two functions now: search_for_poi() and

[0052] search_for_navi(). search_for_poi() can search for a place by name, so that later

[0053] various queries or distance calculations can be made based on the place;

[0054] search_for_navi() is an API function for searching for a route, including driving, bus,

[0055] subway, cycling, and smart walking. However, as the number of queries increases, when a

[0056] new set of similar queries comes in, I may need new APIs (functions) to customize the

[0057] user's needs. Please give me suggestions based on the set of queries I provide: the new

[0058] functions I may need to construct, and what input information they need, and what output

[0059] information they may have.

[0060] Queries:

[0061] 1. A restaurant between subway station A1, subway station A2, and residential area B?

[0062] 2. A hotel with a rooftop pool that is very convenient for visiting attractions C1, C2, and C3?

[0063] 3. Find an attraction that is close to building D1, airport E1, and airport E2?

[0064] 4. My child and I are coming out of attraction C4, and my mother is coming from F1 after shopping. Find a restaurant where we can all meet?

[0065] 5. Which attraction is about the same distance from train station G1, commercial area H1, and train station G2?

[0066] 6. Please choose a place to eat between square I1 and commercial area H2?

[0067] The above target prompt word template is concise and can make the large model understand the current task background, generate thought chains, and give high-quality replies. For example, after inputting the above target prompt template into the large language model, the following output can be obtained:

[0068] It may be considered to develop a more general function to cover the needs of these queries, which can improve code reuse and simplify the structure of the API. I suggest developing a function named explore_poi(), which can flexibly handle multiple types of queries and adjust its functions and outputs according to different input parameters. The following is the possible design of this function:

[0069] Function name: explore_poi()

[0070] Input:

[0071] Type (poi_type): The type of interest points, such as intersections, tourist attractions, schools, cities, etc.

[0072] Attributes (attributes): Query specific attributes, such as suitable for the elderly, see flowers, summer, etc.

[0073] Quantity (quantity): Optional, the number of recommendations needed.

[0074] Season (season): Optional, season-related queries.

[0075] Target group (target_group): Optional, target user groups, such as the elderly, children, etc.

[0076] Output:

[0077] Location information (location_info): If it is a location-related query, output the detailed information of the location, such as location, nearby facilities, etc.

[0078] Recommendations (recommendations): If it is a recommendation-related query, output the recommendation list, including the name of the place, features, user reviews, etc.

[0079] Statistics (statistics): If the query involves statistical data, such as the population of a city, output the relevant statistical information.

[0080] Function description:

[0081] General query processing: According to the input poi_type and attributes, the function can flexibly adjust the processing of the query.

[0082] Dynamic output: dynamically generate output content according to the required information type (location, recommendation, statistical data).

[0083] Such a design can enable the function to handle various different types of queries without the need to develop a specific function for each query type. This will make the system more flexible and easier to maintain.

[0084] Further, in a specific example, the service performance of the target agent obtained after fine-tuning can also be evaluated by the problem solving rate, so as to provide data basis for further optimization of the target agent. Specifically, for any given time t i , let the problem request set be Q i , let the number of successfully solved problem requests be Q good , let the number of unsuccessfully solved problem requests be Q bad , and let the problem solving rate be ACC, then the problem solving rate (ACC) is:

[0085]

[0086] In this way, the service performance of the target agent can be obtained using the above formula.

[0087] Figure 2 is a schematic flow of the processing method of the agent according to an embodiment of the present application Figure Two . The method can be optionally applied in electronic devices such as personal computers, servers, server clusters, etc. It can be understood that the related content of the method shown above Figure 1 can also be applied in this example, and the associated content will not be described again.

[0088] Further, the method at least includes at least part of the following content. As shown in Figure 2 , it includes:

[0089] Step S201: obtaining the initial intent feature of each initial sample problem in a plurality of initial sample problems.

[0090] Step S202: determining a plurality of suspected sample problems belonging to a target intent category from the plurality of initial sample problems based on the initial intent feature.

[0091] Step S203: verifying the intent feature of each suspected sample problem using a target large model to remove suspected sample problems not belonging to the target intent category from the plurality of suspected sample problems, and obtaining a plurality of target sample problems belonging to the target intent category.

[0092] It should be noted that in this example, after obtaining the initial intent feature of each initial sample question, in order to improve the data quality of the plurality of target sample questions belonging to the target intent category, first, according to the initial intent feature, a plurality of sample questions suspected of not belonging to the target intent category (i.e., suspected sample questions) are determined from the plurality of initial sample questions; second, the powerful reasoning and discrimination ability of the target large model is used to test the intent feature of each suspected sample question; the suspected sample questions not belonging to the target intent category are removed to correct the plurality of suspected sample questions, so that a plurality of target sample questions belonging to the target intent category and having high quality are obtained, which provides data support for subsequent fine-tuning of at least part of the adjustable parameters of the preset agent.

[0093] Step S204: Obtain interface feature data of a target interface required to answer a question belonging to the target intent category.

[0094] It should be noted that the related content of the target interface can refer to the above example, which will not be described here.

[0095] Step S205: Fine-tune at least part of the adjustable parameters in the preset agent based on the plurality of target sample questions and the interface feature data of the target interface, to obtain a target agent capable of calling the target interface to answer a question belonging to the target intent category.

[0096] It should be noted that the related content of the agent can refer to the above example, which will not be described here.

[0097] In this way, the disclosed scheme can use the target large language model to perform secondary correction on each suspected sample question determined from the plurality of initial sample questions to obtain a plurality of target sample questions belonging to the target intent category and having high quality, in other words, high-quality training data, so as to provide data support for subsequent training to improve the intelligent degree of the agent. Moreover, the high-quality training sample can effectively ensure that the agent learns accurate and reliable information, thereby further improving the task processing capability of the agent, and further improving the user experience.

[0098] Further, in a specific example, the initial intent feature of each initial sample question can be obtained in the following manner; specifically, the above-mentioned obtaining of the initial intent feature of each initial sample question in the plurality of initial sample questions (such as step S201) can specifically include:

[0099] Using the pre-trained initial intent recognition model, the initial intent feature of each initial sample question in the plurality of initial sample questions is obtained.

[0100] For example, in one example, each initial sample question can be input into the pre-trained Intent Bidirectional Encoder Representations from Transformers (IntentBert) model to obtain the initial intent features of each initial sample question. In this way, a powerful intent recognition model can be used to preliminarily obtain the intent semantic features, laying the foundation for subsequently obtaining multiple target sample questions belonging to the target intent category.

[0101] Furthermore, in a specific example, after obtaining the initial intent features of each initial sample question using the above-mentioned initial intent recognition model, multiple suspected sample questions belonging to the target intent category can be determined in the following manner, thereby further improving the accuracy of the obtained suspected sample questions. Specifically, the above-mentioned determination of multiple suspected sample questions belonging to the target intent category from the multiple initial sample questions based on the initial intent features (for example, step S202) can be implemented by using one of the following clustering methods:

[0102] Method 1: Clustering method based on neighbor contrast learning

[0103] Step S202a-1: Based on the initial intention feature, determine the positive samples of the initial sample questions and the negative samples of the initial sample questions from multiple initial sample questions.

[0104] Here, both the positive sample and the negative sample are one of the multiple initial sample problems. In other words, in this step, the positive sample of a specified initial sample problem (for example, a randomly specified initial sample problem) and the negative sample of the specified initial sample problem can be determined from the multiple existing initial sample problems, thereby providing data support for the subsequent clustering process.

[0105] Furthermore, in a specific example, the positive samples and negative samples of the initial sample questions can be obtained in the following manner. Specifically, the above-described determination of the positive samples and negative samples of the initial sample questions from multiple initial sample questions based on the initial intent features (e.g., step S202a-1) can specifically include:

[0106] Step S202a-1-1: Based on the initial intent feature, determine the distance between different initial sample questions. For example, obtain the distance between different initial sample questions in the intent feature space.

[0107] Step S202a-1-2: Based on the distances between different initial sample problems, determine the positive samples of the initial sample problems and the negative samples of the initial sample problems.

[0108] For example, according to the initial intention feature, the distance between two different initial sample questions in the intention feature space is determined, and then the distance between any two initial sample questions is obtained. Further, for a specified initial sample question, the N (N is a preset value) initial sample questions closest to the specified initial sample question are determined as positive samples of the specified initial sample question, and the remaining initial sample questions are determined as negative samples of the specified initial sample question. Based on this, a set of training data can be obtained, which provides data support for subsequent training of the initial intention recognition model, and further lays a foundation for improving the intention understanding and recognition ability of the intention recognition model.

[0109] Here, the "distance" in this example can be specifically Euclidean distance, and the present scheme does not make specific limitations.

[0110] In this way, the present scheme provides a refinement scheme for obtaining positive samples and negative samples of initial sample questions. The scheme is simple and efficient, which provides strong support for subsequent optimization of the intention understanding and recognition ability of the initial intention recognition model using the positive samples and negative samples of the initial sample questions, and further obtains accurate suspected sample questions. At the same time, it also lays a foundation for further improving the task processing ability of the intelligent agent and further improving the user experience.

[0111] Step S202a-2: training the initial intention recognition model based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question, to obtain a target intention recognition model.

[0112] Step S202a-3: obtaining the target intention feature of each initial sample question in the plurality of initial sample questions using the target intention recognition model, to obtain a plurality of suspected sample questions belonging to the target intention category based on the target intention feature.

[0113] That is, in this example, the positive sample and the negative sample of the initial sample question can be obtained first, and then the determined positive sample and the negative sample of the initial sample question are used as training data to further train the initial intention recognition model, so as to optimize the initial intention recognition model, so that the intention understanding and recognition ability of the initial intention recognition model is further enhanced, and a target intention recognition model with more accurate output result is obtained. At this time, the target intention feature of each initial sample question obtained by using the optimized target intention recognition model is more accurate, which provides strong support for further improving the task processing ability of the intelligent agent and further improving the user experience.

[0114] Further, in a specific example, the initial intent recognition model can be trained in the following manner; specifically, the training (such as step S202a-2) of the initial intent recognition model based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question can specifically include:

[0115] Step S202a-2-1: based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question, determine the distance between the initial sample question and its positive sample, and the distance between the initial sample question and its negative sample.

[0116] Step S202a-2-2: contrastive learning is performed on the initial intent recognition model to reduce the distance between the initial sample question and its positive sample and / or to increase the distance between the initial sample question and its negative sample.

[0117] For example, in an example, the initial intent recognition model can be trained using the positive sample of the initial sample question and the negative sample of the initial sample question to reduce the distance between the initial sample question and the positive sample; or, in another example, the initial intent recognition model can be trained using the positive sample of the initial sample question and the negative sample of the initial sample question to increase the distance between the initial sample question and the negative sample; or, in yet another example, the initial intent recognition model can be trained using the positive sample of the initial sample question and the negative sample of the initial sample question to reduce the distance between the initial sample question and the positive sample and to increase the distance between the initial sample question and the negative sample. In this way, the anti-interference ability of the intent recognition model to noise is enhanced, the intent understanding and recognition ability of the intent recognition model is significantly improved, and further, strong support is provided for subsequent accurate identification and differentiation of different intents.

[0118] Method two: clustering method based on top K similarity

[0119] Step S202b-1: based on the initial intent feature, obtain the intent similarity between different initial sample questions.

[0120] Step S202b-2: based on the intent similarity, perform clustering processing on the plurality of initial sample questions to obtain a plurality of suspected sample questions belonging to the target intent category.

[0121] That is, in this example, first, the intent similarity between different initial sample problems is calculated according to the initial intent features; second, clustering is performed according to the intent similarity, so that multiple suspected sample problems belonging to the target intent category are obtained, for example, the K initial sample problems with the closest intent similarity are clustered into a cluster to obtain multiple clusters, and further, the intent classification of each cluster is determined, so that K initial sample data belonging to the target intent category can be obtained.

[0122] In this way, the disclosure provides a refinement scheme for clustering based on intent similarity to obtain multiple suspected sample problems belonging to the target intent category. This scheme is simple and efficient, and can quickly obtain multiple suspected sample problems belonging to the target intent category, thereby providing strong support for further improving the task processing capability of the agent and thus improving the user experience.

[0123] The disclosure will be further described in detail below in conjunction with specific examples. The disclosure provides a processing method of an agent. Specifically, first, in combination with an intent recognition model (corresponding to the initial intent recognition model described above), the initial problem request (corresponding to the initial sample problem described above) in the massive data set is subjected to intent recognition to obtain massive intent semantic features (corresponding to the initial sample problem described above), and a clustering manner is used to cluster the massive intent semantic features to obtain an initial clustering result, and then the powerful reasoning and discrimination capabilities of the large language model are used to correct the initial clustering result to obtain multiple target problem requests (corresponding to the target sample problem described above) belonging to a new intent category (corresponding to the target intent category described above); second, the powerful reasoning and discrimination capabilities of the large language model are used again to obtain the interface feature data of the target interface required to be called to solve the target problem request of the new intent category, for example, the function function definition and function parameters of the general API (i.e., new API) capable of solving the target problem request belonging to the new intent category are reasoned out, so as to obtain the accurate function range definition and parameter information of the general API for solving the target problem request belonging to the new intent category; finally, the target problem request belonging to the new intent category and the accurate function range definition of the general API for solving the target problem request belonging to the new intent category are used, and a self-instruction method is combined to generate a large amount of training data pairs (corresponding to the multiple target sample problems and the interface feature data of the target interface described above), and then the preset agent is trained, so that the preset agent quickly has the ability to use the new API, thereby improving the intelligent degree of the agent and improving the user experience.

[0124] As shown in Figure 3 The core steps of the disclosure include:

[0125] Step S301: Perform intent recognition on each initial question request in the massive intent dataset using a new intent recognition model (corresponding to the initial intent recognition model described above) to obtain the initial intent feature corresponding to each initial question request.

[0126] Here, the massive dataset can specifically refer to a massive online log dataset; the new intent recognition model can specifically be an IntentBert model, or can also be other intent recognition models, which are not specifically limited by the present disclosure.

[0127] Step S302: Cluster each initial question request according to the initial intent feature to obtain an initial clustering result containing multiple clusters, each cluster corresponding to an intent category, and determine multiple candidate question requests belonging to the new intent category (corresponding to the multiple suspected sample questions belonging to the target intent category described above) from the multiple clusters contained in the initial clustering result.

[0128] Here, the clustering method described above can be a clustering method based on adjacent contrast learning, or can also be a clustering method based on Top-K similarity ranking, which is not specifically limited by the present disclosure.

[0129] For example, in an example, after obtaining the initial intent feature of each initial question request using the IntentBert model, according to the division neighborhood method, the positive sample and the negative sample of the initial intent feature are obtained, and the positive sample adjacency matrix is constructed based on the initial intent feature and its positive sample, and the negative sample adjacency matrix is constructed based on the initial intent feature and its negative sample, and the constructed positive sample adjacency matrix and negative sample adjacency matrix are used to perform contrast learning training on the IntentBert model to obtain the trained IntentBert model; finally, the trained IntentBert model is used to perform intent recognition on each initial question request again to obtain the target intent feature of each initial question request, and then the initial clustering result is updated according to the target intent feature of each initial question request to obtain the multiple candidate question requests belonging to the new intent category.

[0130] Or, in another example, after obtaining the initial intent feature of each initial question request using the IntentBert model, the intent similarity between different initial question requests is obtained according to the initial intent feature, at this time, the first K initial question requests closest in intent similarity are determined as a cluster, in this way, the initial clustering result is obtained, and then the multiple candidate question requests belonging to the new intent category are obtained.

[0131] Step S303: Using a large language model (corresponding to the target large language model described above), the intent of each candidate question request belonging to the new intent category is verified to complete the intent correction of the multiple candidate question requests belonging to the new intent category, and multiple target question requests belonging to the new intent category are obtained (corresponding to the multiple target sample questions belonging to the target intent category described above).

[0132] For example, in an example, for a candidate question request belonging to the new intent category, the candidate question request is input into the large language model to utilize the powerful reasoning and discrimination capabilities of the large language model to identify and delete the candidate question requests not belonging to the new intent category from the multiple candidate question requests, and obtain multiple target question requests belonging to the new intent category. In this way, the data quality of the question requests belonging to the new intent category is ensured, and strong support is provided for subsequent improvement of the task processing capability of the agent.

[0133] Step S304: Using the large language model and according to the multiple target question requests belonging to the new intent category, the function function definition and function parameters of the new API (corresponding to the target interface described above) capable of answering the target question requests belonging to the new intent category are inferred to facilitate the generation of the calling code of the new API answering the target question requests of the new intent category.

[0134] Step S305: According to the multiple target question requests belonging to the new intent category and the interface feature data (such as function function definition and function parameters, etc.) of the target API answering the question requests of the new intent category, and using the self-instruction method, a large number of high-quality training sample pairs are constructed.

[0135] Here, the training sample pair can specifically include the new intent category and the interface feature data of the target API corresponding to the new intent category; or the training sample pair can specifically include the target question request belonging to the new intent category and the interface feature data of the target API required to be called to answer the target question request. In this way, data support is provided for subsequent parameter fine-tuning of the agent (also known as "new function enabling processing").

[0136] Step S306: Using the large number of constructed training sample pairs, at least part of the adjustable parameters in the agent are fine-tuned to enable the agent to call the new API.

[0137] Here, before fine-tuning the agent by using the constructed large number of training sample pairs, the constructed training sample pairs can also be screened to screen out training sample pairs meeting the training requirements, and the agent is fine-tuned by using the screened training sample pairs. In this way, the fine-tuned agent can have the ability to call new APIs, thereby laying a foundation for providing more accurate personalized services.

[0138] To sum up, the disclosed scheme has the following advantages, including:

[0139] First, efficient processing of massive data. The disclosed scheme provides a way of combining an enhanced new intent recognition model with a large model to obtain sample data for training an agent. For example, a powerful new intent recognition model can be used to obtain more accurate intent features, and then massive data can be preliminarily clustered according to the intent features to obtain clustering results. Finally, a powerful large language model is used to perform intent testing and screening on the clustering results. In this way, efficient processing of massive data is achieved, and the quality of the sample data obtained after the above processing is higher, and the cost is lower.

[0140] Second, the agent empowerment process is more flexible. The disclosed scheme combines a large language model to discover, define, and set parameters of a new API function according to a plurality of target sample problems belonging to a new intent category, so as to obtain calling code of the new API required by the new intent category. Further, a large number of training sample pairs are constructed according to the target sample problems of the new intent category and the interface feature data of the new API, so as to empower the agent by using the training sample pairs, so that the empowered agent has the ability to call the new API. This process maximizes the automation of the solution process of new requirements, minimizes the human cost, significantly improves the intelligence level of the agent, and improves the user experience.

[0141] Third, improve user experience. Since the disclosed scheme can empower the agent with new functions, making the agent more intelligent and thus being able to adapt to different tasks and environments, it can efficiently solve the user's requirements, provide more rich and personalized services for the user, and thus improve the user experience.

[0142] The disclosed scheme also provides a processing device of an agent, as shown in Figure 4 The processing device of the agent includes:

[0143] The sample processing unit 401 is configured to obtain a plurality of target sample problems belonging to a target intent category, and obtain interface feature data of a target interface called to solve a problem belonging to the target intent category.

[0144] The agent training unit 402 is configured to fine-tune at least part of adjustable parameters in a preset agent based on the plurality of target sample questions and the interface feature data of the target interface, to obtain a target agent capable of invoking the target interface to answer questions belonging to the target intent category.

[0145] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0146] obtain an initial intent feature of each initial sample question in the plurality of initial sample questions;

[0147] determine a plurality of suspected sample questions belonging to the target intent category from the plurality of initial sample questions based on the initial intent feature;

[0148] verify the intent feature of each suspected sample question using the target large model, to remove suspected sample questions not belonging to the target intent category from the plurality of suspected sample questions, to obtain a plurality of target sample questions belonging to the target intent category.

[0149] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0150] obtain an initial intent feature of each initial sample question in the plurality of initial sample questions using the pre-trained initial intent recognition model.

[0151] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0152] determine a positive sample of the initial sample question and a negative sample of the initial sample question from the plurality of initial sample questions based on the initial intent feature; wherein the positive sample and the negative sample are each one of the plurality of initial sample questions;

[0153] train the initial intent recognition model based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question, to obtain a target intent recognition model;

[0154] obtain a target intent feature of each initial sample question in the plurality of initial sample questions using the target intent recognition model, to obtain a plurality of suspected sample questions belonging to the target intent category based on the target intent feature.

[0155] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0156] determine distances between different initial sample questions based on the initial intent feature;

[0157] The positive sample of the initial sample question and the negative sample of the initial sample question are determined based on distances between different initial sample questions.

[0158] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0159] Distances between the initial sample question and the positive sample, and distances between the initial sample question and the negative sample are determined based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question.

[0160] The initial intent recognition model is subjected to contrast learning to reduce the distance between the initial sample question and the positive sample and / or to increase the distance between the initial sample question and the negative sample.

[0161] In a specific example of the present disclosure, the sample processing unit is specifically configured to:

[0162] An intent similarity between different initial sample questions is obtained based on the initial intent feature.

[0163] The multiple initial sample questions are subjected to clustering processing based on the intent similarity to obtain multiple suspected sample questions belonging to the target intent category.

[0164] The specific functions and examples of the units of the apparatus of the embodiments of the present disclosure are described in the related description of the corresponding steps in the above method embodiments, which will not be described here.

[0165] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0166] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0167] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present disclosure described and / or claimed in this document.

[0168] As Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0169] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0170] The computing unit 501 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 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 that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the agent processing method. For example, in some embodiments, the agent processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the agent processing method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the agent processing method by any other appropriate means (e.g., by means of firmware).

[0171] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0172] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0173] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical conductors, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0174] To provide for interaction with a user, the systems and techniques described here 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, 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, speech, or tactile input.

[0175] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end 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), and the Internet.

[0176] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server is generally established by computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of a distributed system, or servers combined with a blockchain.

[0177] It should be understood that the various forms of flow shown above can be re-ordered, added to, or deleted from without departing from the scope of the present disclosure. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without departing from the desired results of the technology disclosed in the present disclosure, which are not limited herein.

[0178] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the principles of the disclosure. Accordingly, modifications, equivalent alternatives and improvements should be included within the scope of the disclosure.

Claims

1. A method for processing an intelligent agent, comprising: Obtain multiple target sample questions belonging to the target intent category; Obtaining interface feature data of the target interface required to answer questions belonging to the target intent category; Based on the multiple target sample questions and the interface characteristic data of the target interface, fine-tuning at least some adjustable parameters in the preset intelligent agent to obtain a target intelligent agent capable of calling the target interface to answer questions belonging to the target intent category; Among them, also include: Obtaining the initial intent features of each initial question request in the intent dataset; Clustering the initial question requests according to their initial intent features to obtain an initial clustering result containing multiple clusters, where each cluster corresponds to an intent category. Determine a new intent category from the multiple clusters included in the initial clustering results; the target intent category is the new intent category; Among them, also include: By using the target large model and based on multiple target sample questions belonging to the new intent category, interface feature data of a new interface that can answer the target sample questions belonging to the new intent category is inferred; the target interface is the new interface.

2. The method according to claim 1, wherein The problem of obtaining multiple target sample problems belonging to the target intent category includes: obtaining an initial intention feature of each of the multiple initial sample questions; Based on the initial intent features of the initial sample questions, determining a plurality of suspected sample questions belonging to the target intent category from the plurality of initial sample questions; The target large model is used to verify the intention feature of each suspected sample question, so as to remove the suspected sample questions that do not belong to the target intention category from the multiple suspected sample questions and obtain multiple target sample questions that belong to the target intention category.

3. The method according to claim 2, wherein: The obtaining of the initial intention feature of each of the multiple initial sample questions includes: The pre-trained initial intent recognition model is used to obtain the initial intent features of each of the multiple initial sample questions.

4. The method according to claim 3, wherein: The determining of a plurality of suspected sample questions belonging to a target intent category from the plurality of initial sample questions based on the initial intent features of the initial sample questions includes: Based on the initial intention features of the initial sample questions, determining a positive sample of the initial sample questions and a negative sample of the initial sample questions from the multiple initial sample questions; wherein the positive sample and the negative sample are each one of the multiple initial sample questions; Based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question, the initial intent recognition model is trained to obtain a target intent recognition model; A target intent recognition model is used to obtain a target intent feature of each of the multiple initial sample questions, so as to obtain multiple suspected sample questions belonging to the target intent category based on the target intent feature.

5. The method according to claim 4, wherein The determining of positive samples of the initial sample questions and negative samples of the initial sample questions from the multiple initial sample questions based on the initial intention features of the initial sample questions includes: Based on the initial intention characteristics of the initial sample questions, the distance between different initial sample questions is determined; Based on the distances between different initial sample problems, positive samples of the initial sample problems and negative samples of the initial sample problems are determined.

6. The method according to claim 4 or 5, wherein: The training of the initial intent recognition model based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question includes: Based on the initial sample problem, the positive sample of the initial sample problem, and the negative sample of the initial sample problem, determining the distance between the initial sample problem and the positive sample, and the distance between the initial sample problem and the negative sample; The initial intent recognition model is subjected to comparative learning to reduce the distance between the initial sample problem and the positive sample and / or to increase the distance between the initial sample problem and the negative sample.

7. The method according to claim 3, wherein: The determining of a plurality of suspected sample questions belonging to a target intent category from the plurality of initial sample questions based on the initial intent features of the initial sample questions includes: Based on the initial intention features of the initial sample questions, the intention similarity between different initial sample questions is obtained; Based on the intent similarity, the multiple initial sample questions are clustered to obtain multiple suspected sample questions belonging to the target intent category.

8. A processing device for an intelligent agent, comprising: a sample processing unit, configured to obtain a plurality of target sample questions belonging to a target intent category; and obtaining interface feature data of a target interface required to be called to answer questions belonging to the target intent category; It is also used to obtain the initial intent features of each initial question request in the intent dataset; Clustering the initial question requests based on their initial intent features to obtain an initial clustering result containing multiple clusters, each cluster corresponding to an intent category; and determining a new intent category from the multiple clusters contained in the initial clustering result. The target intention category is a new intention category; It is also used to utilize the target large model and, based on multiple target sample questions belonging to the new intent category, infer interface feature data of a new interface that can answer the target sample questions belonging to the new intent category; The target interface is the new interface; An agent training unit is used to fine-tune at least some of the adjustable parameters in the preset agent based on the multiple target sample questions and the interface feature data of the target interface, so as to obtain a target agent that can call the target interface to answer questions belonging to the target intention category.

9. The device according to claim 8, wherein The sample processing unit is specifically used to: obtaining an initial intention feature of each of the multiple initial sample questions; Based on the initial intent features of the initial sample questions, determining a plurality of suspected sample questions belonging to the target intent category from the plurality of initial sample questions; The target large model is used to verify the intention feature of each suspected sample question, so as to remove the suspected sample questions that do not belong to the target intention category from the multiple suspected sample questions and obtain multiple target sample questions that belong to the target intention category.

10. The device according to claim 9, wherein The sample processing unit is specifically used to: The pre-trained initial intent recognition model is used to obtain the initial intent features of each of the multiple initial sample questions.

11. The device according to claim 10, wherein The sample processing unit is specifically used to: Based on the initial intention features of the initial sample questions, determining a positive sample of the initial sample questions and a negative sample of the initial sample questions from the multiple initial sample questions; wherein the positive sample and the negative sample are each one of the multiple initial sample questions; Based on the initial sample question, the positive sample of the initial sample question, and the negative sample of the initial sample question, the initial intent recognition model is trained to obtain a target intent recognition model; A target intent recognition model is used to obtain a target intent feature of each of the multiple initial sample questions, so as to obtain multiple suspected sample questions belonging to the target intent category based on the target intent feature.

12. The device according to claim 11, wherein The sample processing unit is specifically used to: Based on the initial intention characteristics of the initial sample questions, the distance between different initial sample questions is determined; Based on the distances between different initial sample problems, positive samples of the initial sample problems and negative samples of the initial sample problems are determined.

13. The device according to claim 11 or 12, wherein: The sample processing unit is specifically used to: Based on the initial sample problem, the positive sample of the initial sample problem, and the negative sample of the initial sample problem, determining the distance between the initial sample problem and the positive sample, and the distance between the initial sample problem and the negative sample; The initial intent recognition model is subjected to comparative learning to reduce the distance between the initial sample problem and the positive sample and / or to increase the distance between the initial sample problem and the negative sample.

14. The device according to claim 10, wherein The sample processing unit is specifically used to: Based on the initial intention features of the initial sample questions, the intention similarity between different initial sample questions is obtained; Based on the intent similarity, the multiple initial sample questions are clustered to obtain multiple suspected sample questions belonging to the target intent category.

15. 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 perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Information processing method and device, equipment and storage medium

    CN117194620A

  • Intelligent domain matching method and system based on intention large model

    CN117708286A