Search

CN-121562835-B - Method, system and storage medium for deducing prompt words of agent

CN121562835BCN 121562835 BCN121562835 BCN 121562835BCN-121562835-B

Abstract

The application discloses a method, a system and a storage medium for deducing prompt words of an agent, which are used for the technical field of language processing. The method comprises the steps of carrying out intention analysis on user input information through a main model to obtain an initial task abstract, judging whether logic of the initial task abstract is complete through an auxiliary model, if not, carrying out revising on the initial task abstract through the main model to obtain a target task abstract, converting the target task abstract into a structured prompting word through the auxiliary model, carrying out evaluation optimization on the structured prompting word based on a domain knowledge database to obtain a preferred prompting word, carrying out compliance filtering on the preferred prompting word to obtain a compliance prompting word, evaluating complexity of the compliance prompting word through a lightweight evaluation model to obtain an evaluation result, if the evaluation result is simple, calling an expert model to generate text content according to the compliance prompting word, and if the evaluation result is complex, calling a large language model to generate text content according to the compliance prompting word.

Inventors

  • XIE HONGTAO
  • ZHI TING
  • TANG YUMEI
  • HAN GUOQUAN
  • CAI HUIMIN
  • ZHOU WEI
  • WU JUNQIAN

Assignees

  • 中电科大数据研究院有限公司

Dates

Publication Date
20260508
Application Date
20260122

Claims (8)

  1. 1. The deduction method of the prompt word of the agent is characterized by comprising the following steps: carrying out intention analysis on user input information through a main model to obtain an initial task abstract; judging whether the logic of the initial task abstract is complete or not through an auxiliary model; if not, the initial task abstract is revised again through the main model to obtain a target task abstract; Converting the target task abstract into a structured prompt word through the auxiliary model; Evaluating and optimizing the structured prompting words based on a domain knowledge database to obtain preferred prompting words; compliance filtering is carried out on the optimized prompting words to obtain compliance prompting words; The complexity of the compliance prompt word is evaluated through a lightweight evaluation model, and an evaluation result is obtained; if the evaluation result is simple, an expert model is called to generate text content according to the compliance prompt word; if the evaluation result is complex, calling a large language model to generate text content according to the compliance prompt word; The method for evaluating and optimizing the structured prompting words based on the domain knowledge database to obtain the optimized prompting words comprises the following steps: Generating an alternative prompting word set according to the structured prompting word retrieval field knowledge database; calculating the API call cost of each prompt word in the candidate prompt word set by a parallel test method, and acquiring a Token consumption data report of each prompt word; evaluating the expected effect of each prompt word according to the Token consumption data report, and obtaining an expected satisfaction score; carrying out normalized weighted calculation on the expected satisfaction score of each prompt word according to the satisfaction weight to obtain an effect dimension score; Performing inverse weighting calculation on the relative Token in the Token consumption data report of each prompt word according to the cost weight to obtain a cost dimension score; Adding the effect dimension score and the cost dimension score to obtain a comprehensive evaluation score; Sorting each prompting word in the candidate prompting words according to the comprehensive evaluation score to obtain a score sorting list; And taking the prompting word with the highest score in the score sorting list as the preferable prompting word.
  2. 2. The method for deducting an agent hint word according to claim 1, wherein the performing intent analysis on the user input information through the master model to obtain an initial task abstract includes: extracting key information from user input information to obtain structured key data; and carrying out semantic understanding on the structured key data through a main model to generate an initial task abstract with weight.
  3. 3. The agent hint word deduction method according to claim 1, wherein after the determining whether the logic of the initial task abstract is complete by an auxiliary model, the method further comprises: if yes, converting the initial task abstract into a structured prompt word through the auxiliary model.
  4. 4. The method for deriving an agent hint word according to claim 1, wherein generating the set of candidate hint words from the structured hint word search domain knowledge database includes: extracting keywords in the structured prompt words to obtain a keyword list; searching a domain knowledge base through the keyword list to obtain related domain knowledge data; and generating an alternative prompting word set according to the related field knowledge data.
  5. 5. The agent-cue word derivation method of any one of claims 1-4, further comprising, after the generating text content: Performing multi-dimensional evaluation detection on the text content, and judging whether a multi-dimensional evaluation report of the text content reaches a quality standard or not; if yes, storing the structured prompt word and the text content as examples into a domain knowledge database; If not, obtaining problem positioning according to the multi-dimensional evaluation report; If the problem is positioned to be out of standard in response delay, reducing the complexity of the auxiliary model for generating the structured prompting word; If the problem is positioned with accuracy or user satisfaction below a threshold, increasing the number of initial task digests generated by the master model.
  6. 6. An agent-hint word deduction system, the system comprising: The data analysis unit is used for carrying out intention analysis on the user input information through the main model to obtain an initial task abstract; the first judging unit is used for judging whether the logic of the initial task abstract is complete or not through an auxiliary model; The data correction unit is used for correcting the initial task abstract again through the main model to obtain a target task abstract when the first judgment unit determines that the logic of the initial task abstract is incomplete; The first data conversion unit is used for converting the target task abstract into a structured prompt word through the auxiliary model; The optimizing unit is used for evaluating and optimizing the structured prompting words based on the domain knowledge database to obtain preferable prompting words; the data filtering unit is used for carrying out compliance filtering on the optimized prompting words to obtain compliance prompting words; the second judging unit is used for evaluating the complexity of the compliance prompt word through a lightweight evaluation model to obtain an evaluation result; The first generation unit is used for calling an expert model to generate text content according to the compliance prompt word when the second judgment unit determines that the evaluation result is simple; The second generation unit is used for calling a large language model to generate text content according to the compliance prompt word when the second judgment unit determines that the evaluation result is complex; The optimizing unit is specifically configured to: Generating an alternative prompting word set according to the structured prompting word retrieval field knowledge database; calculating the API call cost of each prompt word in the candidate prompt word set by a parallel test method, and acquiring a Token consumption data report of each prompt word; evaluating the expected effect of each prompt word according to the Token consumption data report, and obtaining an expected satisfaction score; carrying out normalized weighted calculation on the expected satisfaction score of each prompt word according to the satisfaction weight to obtain an effect dimension score; Performing inverse weighting calculation on the relative Token in the Token consumption data report of each prompt word according to the cost weight to obtain a cost dimension score; Adding the effect dimension score and the cost dimension score to obtain a comprehensive evaluation score; Sorting each prompting word in the candidate prompting words according to the comprehensive evaluation score, and sorting a score sorting list; And taking the prompting word with the highest score in the score sorting list as the preferable prompting word.
  7. 7. An agent-hint word deduction system, the system comprising: a processor, a memory, an input-output unit, and a bus; The processor is connected with the memory, the input/output unit and the bus; The memory holds a program which the processor invokes to perform the method of any one of claims 1 to 5.
  8. 8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a program which, when executed on a computer, performs the method according to any of claims 1 to 5.

Description

Method, system and storage medium for deducing prompt words of agent Technical Field The application relates to the technical field of language processing, in particular to an agent prompt word deduction method, an agent prompt word deduction system and a storage medium. Background Along with the continuous development of language processing technology, the prompt word is used as the core of user demand and system processing, and the quality of the prompt word directly determines the service adaptation effect. In order to improve the use effect of the prompt words in the prior art, a method for manually constructing the prompt words is adopted, a professional manually disassembles the user requirements, combines the business rules and a knowledge base, gradually optimizes the structure of the prompt words in a trial-and-error iteration mode, and finally forms an executable instruction template. However, in long-term application, the lack of automatic parsing and structuring capabilities of the user's original intent results in an inability to translate ambiguous and non-specialized natural language requirements into standardized instructions that are precisely understood and executed by the machine. Disclosure of Invention In order to solve the technical problems, the application provides an agent prompt word deduction method, an agent prompt word deduction system and a storage medium. The following describes the technical scheme provided in the present application: the first aspect of the application provides an agent prompt word deduction method, which comprises the following steps: carrying out intention analysis on user input information through a main model to obtain an initial task abstract; judging whether the logic of the initial task abstract is complete or not through an auxiliary model; if not, the initial task abstract is revised again through the main model to obtain a target task abstract; Converting the target task abstract into a structured prompt word through the auxiliary model; Evaluating and optimizing the structured prompting words based on a domain knowledge database to obtain preferred prompting words; compliance filtering is carried out on the optimized prompting words to obtain compliance prompting words; The complexity of the compliance prompt word is evaluated through a lightweight evaluation model, and an evaluation result is obtained; if the evaluation result is simple, an expert model is called to generate text content according to the compliance prompt word; and if the evaluation result is complex, calling a large language model to generate text content according to the compliance prompt word. Optionally, the performing intent analysis on the user input information through the main model to obtain an initial task abstract includes: extracting key information from user input information to obtain structured key data; and carrying out semantic understanding on the structured key data through a main model to generate an initial task abstract with weight. Optionally, after the determining, by the auxiliary model, whether the logic of the initial task summary is complete, the method further includes: if yes, converting the initial task abstract into a structured prompt word through the auxiliary model. Optionally, the evaluating and optimizing the structured prompting word based on the domain knowledge database to obtain a preferred prompting word includes: Generating an alternative prompting word set according to the structured prompting word retrieval field knowledge database; and carrying out cost benefit evaluation on the candidate prompt word set to obtain the preferred prompt word. Optionally, the generating the candidate prompt word set according to the structured prompt word retrieval domain knowledge database includes: extracting keywords in the structured prompt words to obtain a keyword list; searching a domain knowledge base through the keyword list to obtain related domain knowledge data; and generating an alternative prompting word set according to the related field knowledge data. Optionally, the performing cost-benefit evaluation on the candidate prompt word set to obtain a preferred prompt word includes: calculating the API call cost of each prompt word in the candidate prompt word set by a parallel test method, and acquiring a Token consumption data report of each prompt word; evaluating the expected effect of each prompt word according to the Token consumption data report, and obtaining an expected satisfaction score; And carrying out weighted calculation on the Token consumption data report and the expected satisfaction score to obtain a preferred prompt word. Optionally, after the generating the text content, the method further includes: Performing multi-dimensional evaluation detection on the text content, and judging whether a multi-dimensional evaluation report of the text content reaches a quality standard or not; if yes, storing the structured prompt word