Intelligent agent data processing method, intelligent agent training method and related equipment

Through the agent data processing method, the initial data sample is input to the preset data labeling verification model for annotation and verification, which solves the problem of time-consuming and labor-intensive and easy introduction of errors in the traditional annotation method, and realizes efficient acquisition of high-quality annotation data, improving the performance and reliability of the agent.

CN120124663APending Publication Date: 2025-06-10IFLYTEK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510004285.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

Traditional agent training methods rely on high-quality labeling data, but traditional labeling methods consume time and effort, easily introduce errors and noise, affecting the performance of agents.

Method used

A data processing method for agents is proposed. By obtaining initial data samples and inputting them into preset data annotation verification model, the data is annotated and verified, and high-quality target data samples are obtained for training agents.

Benefits of technology

It realizes efficient acquisition of high-quality labeling data, improves the performance and reliability of the agent, and reduces the cost and time of manual labeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124663A_ABST
    Figure CN120124663A_ABST
Patent Text Reader

Abstract

The invention discloses an agent data processing method, an agent training method and related equipment. The agent data processing method comprises the following steps: acquiring an initial data sample of an agent; the initial data sample is input into a preset data annotation verification model, the initial data sample is annotated and verified, a target data sample of the intelligent agent is obtained, and the target data sample is used for training the intelligent agent. According to the method, high-quality annotation data can be efficiently obtained, and the performance and reliability of the intelligent agent are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed in this application relate to the field of artificial intelligence technology, and more specifically, to an agent data processing method, an agent training method, and related devices. Background Art

[0002] With the rapid development of artificial intelligence and machine learning technologies, agents have become increasingly popular in various applications. However, the performance of agents highly depends on the quality of training data. High-quality labeled data is the key to training efficient agent models, but traditional labeling methods are usually time-consuming and laborious, and are prone to introducing errors and noises in large-scale data sets, which affects the overall performance of agents. Summary of the Invention

[0003] According to the embodiments of this application, this application proposes an agent data processing method, an agent training method, and related devices to solve the above problems.

[0004] The first aspect of this application discloses an agent data processing method, including: obtaining an initial data sample of an agent; inputting the initial data sample into a preset data annotation verification model to perform annotation and verification on the initial data sample, and obtaining a target data sample of the agent, where the target data sample is used to train the agent.

[0005] In some embodiments, the step of inputting the initial data sample into a preset data annotation verification model to perform annotation and verification on the initial data sample and obtaining the target data sample of the agent includes: analyzing the initial data sample to obtain an analysis result; correcting the initial data sample based on the analysis result to obtain a data correction sample; and scoring the data correction sample to obtain the target data sample.

[0006] In some embodiments, the step of analyzing the initial data sample to obtain an analysis result includes: performing a format check on the initial data sample to obtain a format check result; and / or performing a planning check on the initial data sample to obtain a planning check result; and / or performing a semantic check on the initial data sample to obtain a semantic check result; and / or performing a style check on the initial data sample to obtain a style check result.

[0007] In some embodiments, the format check includes determining whether the syntax format is correct and / or whether the content is complete; the planning check includes determining at least one of whether necessary tools are lacking, whether unnecessary tools are called, and whether tools are called incorrectly; the semantic check includes at least one of hallucination check, consistency check, and conflict check; the style check includes at least one of normativity check, integrity check, and politeness check.

[0008] In some embodiments, correcting the initial data sample based on the analysis result to obtain a data correction sample includes: obtaining corresponding first data from the initial data sample based on the format check result to correct the format of the first data; and / or obtaining corresponding second data from the initial data sample based on the planning check result to correct the planning of the second data; and / or obtaining corresponding third data from the initial data sample based on the semantic check result to correct the semantics of the third data; and / or obtaining corresponding fourth data from the initial data sample based on the style check result to correct the planning of the fourth data.

[0009] In some embodiments, the format correction includes format correction and / or content completion; the planning correction includes tool call and / or code correction; the semantic correction includes at least one of fantasy problem correction, consistency problem correction, and conflict problem correction; the style correction includes optimizing the response language.

[0010] In some embodiments, scoring the data correction sample to obtain the target data sample includes: scoring the data correction sample based on a preset data scoring specification to obtain a scoring result; and selecting the target data sample from the data correction sample based on the scoring result.

[0011] A second aspect of the present application discloses an agent training method, including: obtaining a data sample of the agent; training the agent using the data sample; wherein the data sample is obtained by the agent data processing method in the first aspect.

[0012] A third aspect of the present application discloses an electronic device, including a memory and a processor coupled to each other, the processor is configured to execute program instructions stored in the memory to implement the agent data processing method in the first aspect, or to implement the agent training method in the second aspect.

[0013] A fourth aspect of the present application discloses a non-volatile computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the agent data processing method in the first aspect is implemented, or the agent training method in the second aspect is implemented.

[0014] The beneficial effects of this application are as follows: Obtain the initial data sample of the intelligent agent, input the initial data sample into the preset data annotation and verification model, perform annotation and verification on the initial data sample, and obtain the target data sample of the intelligent agent. The target data sample is used to train the intelligent agent. Among them, by performing annotation and verification on the initial data sample through the preset data annotation and verification model to obtain the target data sample, it realizes the efficient acquisition of high-quality annotated data, thereby improving the performance and reliability of the intelligent agent. Description of the Drawings

[0015] The following will further illustrate this application in conjunction with the drawings. In the drawings:

[0016] Figure 1 is a flowchart of the intelligent agent data processing method according to an embodiment of this application;

[0017] Figure 2 is a structural diagram of the preset data annotation and verification model according to an embodiment of this application;

[0018] Figure 3 is a flowchart of the intelligent agent training method according to an embodiment of this application;

[0019] Figure 4 is a structural diagram of the electronic device according to an embodiment of this application;

[0020] Figure 5 is a structural diagram of the non-volatile computer-readable storage medium according to an embodiment of this application. Detailed Embodiments

[0021] Referring to "embodiment" in this application means that the specific features, structures, or characteristics described in connection with the embodiment may be included in at least one embodiment of this application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0022] In this application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, in this text, the character " / " generally indicates that the associated objects before and after are in an "or" relationship. Furthermore, the term "multiple" in this text means two or more than two. Additionally, the term "at least one" in this text means any one of multiple or any combination of at least two of multiple. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set composed of A, B, and C. Additionally, the terms "first", "second", and "third" in this application are only for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features.

[0023] Currently, for agent training, manual annotation is the most commonly used method to obtain high-quality data. Professional annotators annotate the original data according to predefined criteria to generate the intermediate process of high-quality large model planning, decision-making, and interactive dialogue. The annotation platform integrates a crowdsourcing system to mobilize a large number of ordinary users for data annotation, facilitating the efficiency of providing high-quality data; however, manual annotation, especially high-quality manual annotation, is costly and time-consuming. When generating agent data in complex fields, professional knowledge is required, further increasing the difficulty and cost of annotation. Alternatively, high-quality data can be obtained by synthetic data, that is, generating a virtual data set through a large model, which is used to quickly construct data types with a small amount or difficult to obtain in the real scenario. However, most of the data generated by the large model has problems such as insufficient domain knowledge and uncontrollable quality, and there is still a gap from high-quality data. A large amount of manual intervention is still required to perform error checking, correction, and quality control work, and the understanding differences and subjectivity of different annotators will also lead to inconsistent data quality, introducing noise and incorrect data problems.

[0024] To this end, this application provides an agent data processing method, an agent training method, an electronic device, and a storage medium.

[0025] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions of this application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0026] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the agent data processing method according to an embodiment of this application. The execution subject of this method can be an electronic device with computing functions, such as a microcomputer, a server, and mobile devices such as a laptop computer and a tablet computer, etc.

[0027] It should be noted that if there are substantially the same results, the method of this application does not depend onFigure 1 It is limited to the process sequence shown.

[0028] In some possible implementation manners, this method can be implemented by a processor calling computer-readable instructions stored in a memory, such as Figure 1 shown, this method may include the following steps:

[0029] S11: Obtain the initial data sample of the agent.

[0030] Obtain the initial data sample of the agent. The initial data sample includes multiple initial data examples. Among them, a single initial data example may include content such as user questions, planning thoughts (Thought), and actions taken during the process of the agent executing tasks.

[0031] S12: Input the initial data sample into a preset data annotation and verification model, perform annotation and verification on the initial data sample, and obtain the target data sample of the agent. The target data sample is used to train the agent.

[0032] Input the initial data sample into a preset data annotation and verification model, use the preset data annotation and verification model to perform annotation and verification on the initial data sample, and obtain the target data sample of the agent. Among them, the target data sample can be high-quality data with accuracy, integrity, reliability, and consistency, etc. For example, after performing annotation and verification on multiple initial data examples, select some from the multiple initial data examples as the target data sample; it can also be that after performing annotation and verification on a single initial data example, directly use it as the target data sample. Further, the target data sample can be used to train the agent to meet the needs of machine learning and artificial intelligence model training.

[0033] In this embodiment, obtain the initial data sample of the agent, input the initial data sample into a preset data annotation and verification model, perform annotation and verification on the initial data sample, and obtain the target data sample of the agent. The target data sample is used to train the agent. Among them, by performing annotation and verification on the initial data sample through the preset data annotation and verification model to obtain the target data sample, it realizes the efficient acquisition of high-quality annotated data, thereby improving the performance and reliability of the agent.

[0034] In some embodiments, inputting the initial data sample into a preset data annotation and verification model, performing annotation and verification on the initial data sample, and obtaining the target data sample of the agent includes: analyzing the initial data sample to obtain an analysis result; correcting the initial data sample based on the analysis result to obtain a data correction sample; and scoring the data correction sample to obtain the target data sample.

[0035] In some examples, such as Figure 2 shownFigure 2 It is a schematic structural diagram of a preset data annotation verification model according to an embodiment of the present application. The preset data annotation verification model includes a reflection module, a correction module, and a scoring module. Among them, the reflection module, the correction module, and the scoring module may include multiple sub-modules, and each sub-module may be trained based on a dataset corresponding to a specific task, for example, trained using the Lora fine-tuning method. For example, the reflection module includes a format check sub-module, a planning check sub-module, a semantic check sub-module, a style check sub-module, etc.; the correction module includes a data extraction sub-module, a format correction sub-module, a planning correction sub-module, a semantic correction sub-module, a style correction sub-module, etc.; the scoring module may include a data quality scoring sub-module, etc. The modules and / or sub-modules can be built through workflow configuration to determine the framework of the preset data annotation verification model.

[0036] Among them, the reflection module can be used to analyze the initial data sample to obtain an analysis result. In practical applications, the reflection module can be used to generate personalized self-examinations for the agent data in various industries and scenarios. The correction module can be used to correct the initial data sample based on the analysis result of the reflection module to obtain a data correction sample. The scoring module can be used to score and classify the data correction sample to obtain a target data sample.

[0037] Analyze the initial data sample to obtain an analysis result. For example, the reflection module analyzes the initial data sample to evaluate the performance of the agent in different tasks or scenarios, identify potential problems or bottlenecks, and generate corresponding feedback and opinions on the data based on the defined user expectations and requirements for the agent. Correct the initial data sample based on the analysis result to obtain a data correction sample, that is, the initial data sample can be transformed and corrected based on the generated feedback and opinions, and then a data correction sample is obtained. Further, score the data correction sample to obtain a target data sample. For example, score and classify the obtained data correction sample to determine the data with good performance and high quality as the target data sample.

[0038] In some embodiments, analyzing the initial data sample to obtain an analysis result includes: performing a format check on the initial data sample to obtain a format check result; and / or performing a planning check on the initial data sample to obtain a planning check result; and / or performing a semantic check on the initial data sample to obtain a semantic check result; and / or performing a style check on the initial data sample to obtain a style check result.

[0039] Analyze the initial data sample. For example, in the reflection module, perform format checking, planning checking, semantic checking, and style checking on the initial data sample in sequence to obtain corresponding inspection results. Among them, performing format checking on the initial data sample can obtain a format checking result, performing planning checking on the initial data sample can obtain a planning checking result, performing semantic checking on the initial data sample can obtain a semantic checking result, and performing style checking on the initial data sample can obtain a style checking result.

[0040] In some embodiments, format checking includes determining whether the syntax format is correct and / or whether the content is complete; planning checking includes determining at least one of whether necessary tools are lacking, whether unnecessary tools are called, and whether tools are called incorrectly; semantic checking includes at least one of hallucination checking, consistency checking, and conflict checking; style checking includes at least one of normativity checking, integrity checking, and politeness checking.

[0041] In one example, performing format checking on the initial data sample obtains a format checking result, where format checking includes determining whether the syntax format is correct and / or whether the content is complete. For example, performing format checking on the initial data sample includes performing json syntax checking on tool calls and / or react format checking on the agent in the initial data sample. Among them, when performing format checking on the json syntax of tool calls, the content of format checking includes determining whether it conforms to the data structure defined by json and whether it can be read and written normally using json validator code. For example, checking the input parameters (action) and output parameters (observation) of the tools in the agent; when performing format checking on the react format of the agent, the content of format checking includes determining whether it conforms to the data structure of thought, action, action_parameter, observation, finish, and whether each field exists and the content is complete.

[0042] In one example, performing planning checking on the initial data sample obtains a planning checking result, where planning checking includes determining whether necessary tools are lacking, whether unnecessary tools are called, and whether tools are called incorrectly. For example, performing planning checking on the initial data sample includes checking whether there are situations such as lacking necessary tools, calling unnecessary tools, and calling tools incorrectly in the initial data sample.

[0043] Among them, checking for the lack of necessary tools includes: when asking for explanations of business terms, the knowledge base query tool must be called; when querying whether a business has expired, the calendar query tool must be called to compare with the current time; when performing mathematical statistical tasks, the calculator tool must be called; determining whether there is a lack of intermediate tool reasoning based on the definitions and descriptions of other reference tools, etc. Checking for the invocation of unnecessary tools includes: repeatedly calling the same tool, such as repeatedly calling the recharge record query tool, resulting in waste of resources; redundant invocation, such as the tool called being irrelevant to the user's question; redundant reasoning process, repeatedly calling the tool to return the same result, etc. Checking for incorrect tool invocation includes: completely extracting the slots in the user's semantics according to the protocol of the reference tool; for numerical comparison situations, the drawing tool needs to be called, using a bar chart for multi-month comparison and a pie chart for single-month multi-item comparison; correctly calling the corresponding tool according to the reference tool invocation instructions, etc.

[0044] In one example, semantic checking is performed on the initial data sample to obtain a semantic checking result. Among them, semantic checking includes at least one of fantasy checking, consistency checking, and conflict checking. For example, performing semantic checking on the initial data sample includes checking whether there are fantasy problems, consistency problems, and conflict problems in the initial data sample, etc. Among them, fantasy checking includes checking whether there is counterfactual content in the reasoning process and the response language, etc.; consistency checking includes checking whether the reasoning process and the response language follow the given tool results to give a consistent response, etc.; conflict checking includes checking whether there are loopholes or front-back conflict problems in the reasoning process and the response language, etc.

[0045] In one example, style checking is performed on the initial data sample to obtain a style checking result. Among them, style checking includes at least one of normative checking, integrity checking, and courtesy checking. For example, performing style checking on the initial data sample includes checking whether there are normative problems, integrity problems, and courtesy problems in the initial data sample, etc. Among them, normative checking includes checking whether relevant laws and regulations (such as data protection law, consumer rights protection law, etc.), privacy policies, and confidentiality agreements are complied with. Integrity checking includes checking whether the content of the response language is incomplete or lacks necessary key point information, whether a positive and effective response language to the user's question is clear, accurate, and unambiguous, etc. Courtesy checking includes checking whether polite and diverse customer service closing remarks are used, whether customer dissatisfaction and complaints can be properly handled, etc.

[0046] To facilitate the understanding of the above analysis of the initial data sample to obtain the analysis result, an example is given below. For example. The initial data sample of the intelligent agent includes Example 1, and Example 1 is analyzed as follows:

[0047] Input Example 1:

[0048] "How much was the total amount of money I recharged last Monday? <end> <bot>;

[0049] Thought: To answer the user's question, it is necessary to call the date query tool to obtain the specific date of last Monday, and then call the recharge record query tool to determine each recharge record of the user last week. First, call the date query tool to obtain the date of last Monday. <ret>;

[0050] Action: calendar_api <ret>Action_Parameter:{"date":"Last Monday"} <ret> <end>Observation: {'result': {'date': '2024-08-05 14:01:46', 'weekday': 'Monday'},'recommandProducts': None} <end>;

[0051] Thought: It has been obtained that last Monday was August 5, 2024. Next, it is necessary to call the recharge record query interface to query the latest recharge records. <ret>;

[0052] Action: get_pay_history_api <ret>Action_Parameter:{} <ret> <end>Observation: {'result': [{{'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-06-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-06-01'}, {'amount': '50.00', 'payType': 'Transfer', 'payDate': '2024-06-11'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-06-17'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-07-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-07-01'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-08-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-08-01'}],'recommandProducts': None} <end>;

[0053] Thought: The user's historical recharge records have been queried. From the results, there was 1 recharge last week, which was a recharge of 38 yuan on August 1, 2024. At this time, the user's question can already be answered, and there is no need to call other tools anymore;

[0054] Finish: Your recharge records have been found. There were a total of two recharges last week, namely a recharge of 38 yuan through other means on August 1 and a recharge of 100 yuan through transfer. So, you recharged a total of 138 yuan last week. <end>”

[0055] Accordingly, the reflection module analyzes Example 1 and obtains the analysis results as follows:

[0056] "1. Thought fantasy problem: Last Monday was August 5th, and there was no recharge record on August 5th in the user recharge record. Therefore, it was wrong to have made a total of one recharge last week in Thought;

[0057] 2. Finish fantasy problem: Last Monday was August 5th, and there was no recharge record on August 5th in the user recharge record. Therefore, it was wrong to have made a total of two recharges last week in Finish;

[0058] 3. Politeness check: The closing statement did not use polite and diverse customer service statement closings."

[0059] In some embodiments, the initial data sample is corrected based on the analysis results to obtain a data correction sample, including: obtaining corresponding first data from the initial data sample based on the format check result to correct the format of the first data; and / or obtaining corresponding second data from the initial data sample based on the planning check result to correct the planning of the second data; and / or obtaining corresponding third data from the initial data sample based on the semantic check result to correct the semantics of the third data; and / or obtaining corresponding fourth data from the initial data sample based on the style check result to correct the planning of the fourth data.

[0060] The initial data sample is corrected based on the analysis results. For example, the correction module obtains corresponding data based on the analysis results for modification, and the modified data is used as the data correction sample. Among them, the first data can be the data segment corresponding to the format check result extracted from the initial data sample, the second data can be the data segment corresponding to the planning check result extracted from the initial data sample, the third data can be the data segment corresponding to the semantic check result extracted from the initial data sample, and the fourth data can be the data segment corresponding to the style check result extracted from the initial data sample.

[0061] In some embodiments, format correction includes format correction and / or content completion; planning correction includes tool call and / or code correction; semantic correction includes at least one of fantasy problem correction, consistency problem correction, and conflict problem correction; style correction includes optimizing the reply statement.

[0062] In one example, based on the format check result, the corresponding first data is obtained from the initial data sample to correct the format of the first data, where the format correction includes format correction and / or content completion. For example, the format check result includes json syntax problems and react format problems. For json syntax problems, the json code part can be read from the initial data sample, and then json format correction can be performed. For react format problems, the react code part can be read from the initial data sample, and then content completion of json fields can be performed, etc.

[0063] For example, the initial data sample of the agent includes Example Two, and there are json syntax problems in Example Two. The process of extracting and correcting its corresponding data is as follows:

[0064] Input Example Two:

[0065] "{'result':[{{'amount':'100.00','payType':'transfer','payDate':'2024-06-01'},{'amount':'38.00','payType':'other','payDate':'2024-06-01'},{'amount':'50.00','payType':'transfer','payDate':'2024-06-11'”;

[0066] The reflection module analyzes Example Two to obtain the analysis result:

[0067] "The format of Json is illegal and not a correct json format”.

[0068] The correction module obtains the corresponding data based on the analysis result for correction to obtain the corrected data:

[0069] "{'result':[{{'amount':'100.00','payType':'transfer','payDate':'2024-06-01'},{'amount':'38.00','payType':'other','payDate':'2024-06-01'},{'amount':'50.00','payType':'transfer','payDate':'2024-06-11'}}]}”.

[0070] In one example, based on the planning check result, the corresponding second data is obtained from the initial data sample to perform planning correction on the second data, where the planning correction includes tool invocation and / or code correction. For example, the planning check result includes the lack of necessary tools, invocation of unnecessary tools, and incorrect tool invocation. For the lack of necessary tools or incorrect tool invocation, the correction module can output the correct large model tool invocation interface and / or integrate the external plugin platform to invoke and generate tool results to complete the correction of tool planning; for the invocation of unnecessary tools, the correction module can execute code deletion and then output the correct tool invocation interface to complete the correction of tool planning.

[0071] For example, the initial data sample of the agent includes Sample Three, and there is a problem of incorrect tool invocation in Sample Three. The process of extracting its corresponding data for correction is as follows:

[0072] Input Sample Three:

[0073] "User question: I want to know how much I have spent in total for my last ten recharges;

[0074] Planning thinking: To answer the user's question, it is necessary to invoke the recharge record query tool to determine each recharge record of the user in the last ten times, and then use the calculator tool to calculate the total recharge amount. First, invoke the recharge record query tool;

[0075] Tool invocation: Action:get_pay_history_api <ret>Action_Parameter:{};

[0076] Call result: {'result': [{'amount': '20.00', 'payType': 'Transfer', 'payDate': '2024-02-28'}... {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-06-17'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-07-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-07-01'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-08-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-08-01'};

[0077] Planning consideration: The historical recharge records of the user have been queried. Next, it is necessary to call the calculator tool to calculate the total amount;

[0078] Tool call: Action: calculator_api <ret>Action_Parameter:{"expression":100+38+50+100+38+50+100+38+50+100+38+50+100+38+50+100"};

[0079] Call result: {'result': 1040};

[0080] Planning and thinking: The calculation result has been obtained, and the user's question can be answered;

[0081] Reply: "Hello, the total of the last 10 recharges queried for you is 1040 yuan."

[0082] The reflection module analyzes Example 3 and obtains the analysis result:

[0083] "1. The calculator planning is incorrect, and the extraction formula for the last 10 recharges queried by the user is wrong";

[0084] The correction module obtains the corresponding data based on the analysis result for correction and obtains the correction data:

[0085] "Planning and thinking: The user's historical recharge records have been queried. It is necessary to find the last 10 recharges and use a calculator to calculate the total amount;

[0086] Tool call: Action: calculator_api <ret>Action_Parameter:{"expression":100+38+50+100+38+50+100+38+50+100"};

[0087] Call result: {'result': 664}”.

[0088] In one example, based on the semantic check result, the corresponding third data is obtained from the initial data sample to perform semantic correction on the third data, where the semantic correction includes at least one of fantasy problem correction, consistency problem correction, and conflict problem correction. Fantasy problem correction, for example, modifies the counterfactual content in the reasoning process and the reply. Consistency problem correction, for example, modifies the content that does not give a consistent reply following the given tool result in the reasoning process and the reply. Conflict problem correction, for example, modifies the content with loopholes or conflicts in the reasoning process and the reply.

[0089] In one example, based on the style check result, the corresponding fourth data is obtained from the initial data sample to perform planning correction on the fourth data, where the style correction includes optimizing the reply. For example, modify the content that does not comply with relevant laws and regulations, or supplement the content of the reply that is incomplete or lacks necessary key point information, or modify the content that does not give a positive and effective reply to the user's question, or modify the content that does not use a polite customer service closing statement, etc.

[0090] For example, the initial data sample of the agent includes Sample 4, which has semantic problems and style problems. The process of extracting the corresponding data for correction is as follows:

[0091] Input Sample 4:

[0092] "User question: I want to know how much I have spent in total for my last ten recharges?

[0093] Planning and thinking: To answer the user's question, it is necessary to call the recharge record query tool to determine each recharge record of the user in the last ten times, and then use the calculator tool to calculate the total recharge amount. First, call the recharge record query tool.

[0094] Tool call: Action: get_pay_history_api <ret>Action_Parameter:{};

[0095] Call result: {'result': [{'amount': '20.00', 'payType': 'Transfer', 'payDate': '2024-02-28'}……{'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-06-17'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-07-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-07-01'}, {'amount': '100.00', 'payType': 'Transfer', 'payDate': '2024-08-01'}, {'amount': '38.00', 'payType': 'Other', 'payDate': '2024-08-01'};

[0096] Planning consideration: The historical recharge records of the user have been queried. Next, it is necessary to call the calculator tool to calculate the total amount;

[0097] Tool call: Action: calculator_api <ret>Action_Parameter:{"expression":100+38+50+100+38+50+100+38+50+100"};

[0098] Call result: {'result': 664};

[0099] Planning and thinking: The calculation result has been obtained and the user's question can be answered;

[0100] Reply: "Hello, it is found that the total recharge in the recent 10 times is 1040 yuan for you."

[0101] The reflection module performs semantic check on Example 4 and obtains the semantic check result:

[0102] "1. There is an inconsistency problem between the reply and the calculator tool result;"

[0103] The correction module obtains the corresponding data based on the semantic check result for semantic correction and obtains the initial correction data:

[0104] "1. Reply: "Hello, it is found that the total recharge in the recent 10 times is 664 yuan for you."

[0105] The reflection module performs style check on the initial correction data and obtains the style check result:

[0106] "2. The expression of the reply is relatively single and no polite terms are added;"

[0107] The correction module obtains the corresponding data based on the style check result for style correction and obtains the target correction data:

[0108] "2. Reply: "Hello, according to the recharge records I checked, the total recharge in your recent 10 times is 664 yuan. If you have any other questions, you are welcome to continue consulting."

[0109] In some embodiments, the data correction sample is scored to obtain the target data sample, including: scoring the data correction sample based on the preset data scoring specification to obtain the scoring result; selecting the target data sample from the data correction sample based on the scoring result.

[0110] In some examples, such as Figure 2 As shown, the scoring module is used to score the data correction samples to obtain the target data samples. For example, after the initial data samples are input into the reflection module, the correction module corrects the initial data samples based on the analysis results output by the reflection module to obtain the initial corrected data samples, and determines whether to end the current analysis and correction task. If it is determined that the task has not ended, the initial corrected data samples are continuously analyzed and corrected to perform n rounds of planning iterations, where n ≥ 1 and n can be determined based on the number of tools called in the data samples. For example, if n tool ports are called in the initial data samples, at this time, the initial data samples can be analyzed and corrected n times, that is, the quality of the agent data samples can be improved through multiple rounds of iteration.

[0111] Among them, the scoring module scores the data correction samples based on the preset data scoring specification to obtain the scoring results. The preset data scoring specification includes the corresponding scoring examples, and the scoring results can be used to characterize the accuracy, standardization, integrity, interactivity, etc. of the data samples. Based on the scoring results, the target data samples are selected from the data correction samples. For example, the data that meets the requirements of accuracy, standardization, integrity, and interactivity in the data correction samples is used as the target data samples.

[0112] In some examples, the preset data scoring specification is as follows:

[0113] Large model scoring module Data scoring specification 1 point The information involved in the reply is inaccurate, example: …… 2 points There are offensive terms in the reply, example…… 3 points The reply content is not perfect and lacks some key information, example…… 4 points Some of the corpus expressions in the reply are not precise enough, example…… 5 points Meet the requirements of accuracy, standardization, completeness, and interactivity, example……

[0114] For example, in the data samples, if the information involved in the reply is inaccurate, the scoring result is 1 point, that is, the accuracy of the data samples does not meet the requirements; if there are illegal terms in the reply, the scoring result is 2 points, that is, the standardization of the data samples does not meet the requirements; if the reply content is not perfect and lacks some key point information, the scoring result is 3 points, that is, the integrity of the data samples does not meet the requirements; if the expression of some corpus in the reply is not precise enough, the scoring result is 4 points, that is, the interactivity of the data samples does not meet the requirements; if it meets the requirements of accuracy, standardization, integrity, and interactivity, the scoring result is 5 points, that is, the accuracy, standardization, integrity, and interactivity of the data samples all meet the requirements.

[0115] Please refer to Figure 3 , Figure 3 is a schematic flowchart of the agent training method according to an embodiment of the present application. This method can be applied to an electronic device with functions such as computing. It should be noted that if there are substantially the same results, the method of the present application is not limited to Figure 3 the shown process sequence.

[0116] In some possible implementation manners, this method can be implemented by a processor calling computer-readable instructions stored in a memory. As Figure 3 shown, this method may include the following steps:

[0117] S31: Obtain the data samples of the agent.

[0118] Obtain the data samples of the agent. The data samples include multiple data examples. Among them, a single data example may include user questions, planning thoughts (Thought), actions (Action), etc. that occur during the agent's task processing. Among them, the data samples are obtained through the above-mentioned agent data processing method, that is, high-quality labeled data.

[0119] S32: Use the data samples to train the agent.

[0120] Using the obtained data samples to train the agent can meet the needs of machine learning and artificial intelligence model training.

[0121] In this embodiment, the data samples obtained by annotating and verifying the initial data samples through a preset data annotation verification model are used for the training of the agent, improving the performance and reliability of the agent.

[0122] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation to the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0123] Please refer to Figure 4 , Figure 4 is a schematic structural diagram of the electronic device according to the embodiment of the present application. The electronic device 40 includes a memory 41 and a processor 42 that are coupled to each other. The processor 42 is configured to execute program instructions stored in the memory 41 to implement the steps of the above-mentioned agent data processing method embodiment, or to implement the steps of the above-mentioned agent training method embodiment. In a specific implementation scenario, the electronic device 40 may include, but is not limited to: a microcomputer, a server, which is not limited herein.

[0124] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps of the above-mentioned embodiment of the agent data processing method, or to implement the steps of the above-mentioned embodiment of the agent training method. The processor 42 can also be referred to as a CPU (Central Processing Unit), and the processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Additionally, the processor 42 can be implemented jointly by integrated circuit chips.

[0125] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of the non-volatile computer-readable storage medium according to an embodiment of the present application. The non-volatile computer-readable storage medium 50 is used to store a computer program 501. When the computer program 501 is executed by a processor, for example, when executed by the processor 42 in the above Figure 4 embodiment, it is used to implement the steps of the above-mentioned embodiment of the agent data processing method, or to implement the steps of the above-mentioned embodiment of the agent training method.

[0126] The descriptions of the above embodiments tend to emphasize the differences between the embodiments. Their similarities or similarities can be referred to each other. For the sake of brevity, they will not be elaborated herein.

[0127] In several embodiments provided by the present application, it should be understood that the disclosed methods and related devices can be implemented in other ways. For example, the above-described implementation manners of related devices are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication disconnections between each other can be through some interfaces. The indirect couplings or communication disconnections of devices or units can be in electrical, mechanical or other forms.

[0128] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, can exist physically alone for each unit, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0129] 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 such an understanding, the technical solution of the present application, in essence, 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. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0130] Those skilled in the art will readily appreciate that many modifications and variations can be made to the apparatus and methods while maintaining the teachings of the present application. Therefore, the above disclosure should be considered to be limited only by the scope of the appended claims.< / ret> < / ret> < / ret> < / ret> < / ret> < / end> < / end> < / end> < / ret> < / ret> < / ret> < / end> < / end> < / ret> < / ret> < / ret> < / bot> < / end>

Claims

1. An agent data processing method, characterized in that: include: Get the initial data sample of the agent; The initial data sample is input into a preset data labeling and verification model, the initial data sample is labeled and verified, and the target data sample of the intelligent agent is obtained, and the target data sample is used to train the intelligent agent.

2. The method according to claim 1, characterized in that The step of inputting the initial data sample into a preset data annotation and verification model, annotating and verifying the initial data sample, and obtaining the target data sample of the agent includes: Analyze the initial data sample to obtain an analysis result; Correcting the initial data sample based on the analysis result to obtain a data corrected sample; The data correction sample is scored to obtain the target data sample.

3. The method according to claim 2, characterized in that The analyzing the initial data sample to obtain an analysis result includes: Performing a format check on the initial data sample to obtain a format check result; and / or Performing a planning check on the initial data sample to obtain a planning check result; and / or Performing a semantic check on the initial data sample to obtain a semantic check result; and / or Performing a style check on the initial data sample to obtain a style check result.

4. The method according to claim 3, characterized in that The format check includes determining whether the grammatical format is correct and / or whether the content is complete; The planning check includes determining at least one of whether a necessary tool is lacking, whether an unnecessary tool is called, and whether a tool is called incorrectly; The semantic check includes at least one of a fantasy check, a consistency check, and a conflict check; The style check includes at least one of a standardization check, a completeness check, and a politeness check.

5. The method according to claim 2, characterized in that: The step of correcting the initial data sample based on the analysis result to obtain a data corrected sample includes: Based on the format check result, obtaining corresponding first data from the initial data sample to perform format correction on the first data; and / or Based on the planning check result, obtaining corresponding second data from the initial data sample to perform planning correction on the second data; and / or Based on the semantic check result, obtaining corresponding third data from the initial data sample to perform semantic correction on the third data; and / or Based on the style check result, corresponding fourth data is obtained from the initial data sample to perform planning correction on the fourth data.

6. The method according to claim 5, characterized in that The format correction includes format correction and / or content completion; The plan modification includes tool calling and / or code modification; The semantic correction includes at least one of a fantasy problem correction, a consistency problem correction, and a conflict problem correction; The style correction includes optimizing the reply language.

7. The method according to claim 2, characterized in that The step of scoring the data correction sample to obtain the target data sample includes: Scoring the data correction sample based on a preset data scoring specification to obtain a scoring result; Based on the scoring result, the target data sample is selected from the data correction sample.

8. A method for training an intelligent agent, characterized in that: include: Get data samples of the agent; Using the data sample to train the agent; Wherein, the data sample is obtained by the intelligent agent data processing method described in any one of claims 1 to 7.

9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the intelligent agent data processing method described in any one of claims 1 to 7, or to implement the intelligent agent training method described in claim 8.

10. A non-volatile computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by the processor, the intelligent agent data processing method described in any one of claims 1 to 7 is implemented, or the intelligent agent training method described in claim 8 is implemented.

Citation Information

Cited By

  • Fault removal agent training method and device and electronic equipment

    CN122241242A