Parameter verification method and device, equipment, storage medium and program product
By performing multi-level inspection and correction on the list of input parameters to be checked generated by the agent system, the problems of low efficiency and low accuracy of parameter verification in the existing technology are solved, and the automation of the agent system in complex scenarios is realized. Improvement of task processing capabilities and user experience.
Patent Information
- Application Number
- CN202411301737.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-18
AI Technical Summary
The existing parameter verification methods are inefficient and have low accuracy, making it difficult to support automated task processing of intelligent systems in complex scenarios.
By performing existence checks, data type checks, parameter format checks and authenticity checks on the input parameter list to be verified generated by the agent system, and corresponding corrections are made based on the inspection results, the revised target input parameter list is finally obtained.
It realizes accurate and efficient verification of parameters, ensures that the intelligent system can accurately call skills, supports automated task processing in complex scenarios, and improves user experience.
Smart Images

Figure CN119474474A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a parameter verification method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of artificial intelligence technology, especially the continuous advancement of natural language processing (NLP) technology and machine learning technology, intelligent agent systems (i.e., agent systems) have been widely used in many fields, including but not limited to customer service, smart home control, and virtual personal assistants.
[0003] The core function of the Agent system is to accurately understand the intention in the user's conversation text, generate the input parameters of the relevant skills according to the user's intention, and perform the corresponding skill operations according to the generated input parameters to complete specific tasks. In the process of skill execution, the validity and accuracy of the parameters are crucial. If there are errors in the relevant parameters generated by the Agent system, such as missing parameters, mismatched data types, incorrect formats, or parameters that are not generated based on the user's real conversation text, the skill execution of the Agent system may fail, or even produce unexpected results for the user.
[0004] In the prior art, most Agent systems rely on fixed rules or simple preset conditions to process and verify parameters. The verification method based on fixed rules can effectively ensure the correctness of parameters when processing simple parameters.
[0005] However, with the increasing complexity of Agent system application scenarios and the dynamic changes in user needs, the limitations of verification methods based on fixed rules have gradually become apparent: when faced with complex parameter configurations, existing verification methods are not flexible enough and are prone to errors; in addition, as the frequency of interaction between Agent systems and users continues to increase, the uncertainty of user dialogue texts also increases, resulting in more diverse and complex parameters generated by Agent systems, which increases the difficulty of parameter verification.
[0006] Therefore, existing parameter verification methods are inefficient and inaccurate, making it difficult to support automated task processing of intelligent systems in complex scenarios. Summary of the invention
[0007] The present invention provides a parameter verification method, device, equipment, storage medium and program product to solve the defects of the existing parameter verification method, which is low in efficiency and accuracy and difficult to support the automated task processing of intelligent system in complex scenarios.
[0008] The present invention provides a parameter verification method, which is applied to an intelligent system, comprising: obtaining a list of input parameters to be verified; the list of input parameters to be verified includes multiple input parameters to be verified, and the input parameters to be verified are generated by the intelligent system according to the user's dialogue text; performing an existence check on the list of input parameters to be verified to obtain an existence check result, and based on the existence check result, performing an existence correction on the list of input parameters to be verified to obtain a first intermediate parameter list; performing a data type check on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, performing a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list; performing a parameter format check on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, performing a parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list; performing an authenticity check on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, performing an authenticity correction on the third intermediate parameter list to obtain a target input parameter list.
[0009] According to a parameter verification method provided by the present invention, an existence check is performed on an input parameter list to be verified to obtain an existence check result, and based on the existence check result, an existence correction is performed on the input parameter list to be verified to obtain a first intermediate parameter list, including: obtaining an actually required input parameter list; the actually required input parameter list includes multiple actually required input parameters; each input parameter to be verified is compared with each actually required input parameter to obtain an existence check result; based on the existence check result, it is determined whether there are missing parameters or redundant parameters in the input parameter list to be verified; if there are missing parameters or redundant parameters in the input parameter list to be verified, the redundant parameters in the input parameter list to be verified are deleted, and based on the missing parameters and the parameter completion prompt word template, the existence correction is performed on the input parameter list to be verified to obtain the first intermediate parameter list.
[0010] According to a parameter verification method provided by the present invention, a data type check is performed on a first intermediate parameter list to obtain a data type check result, and based on the data type check result, a data type correction is performed on the first intermediate parameter list to obtain a second intermediate parameter list, including: performing a data type check on each parameter in the first intermediate parameter list to obtain a data type check result; based on the data type check result, determining whether there are parameters with incorrect data types in the first intermediate parameter list; if there are parameters with incorrect data types in the first intermediate parameter list, correcting the data types of the parameters with incorrect data types based on a data type conversion tool to obtain a second intermediate parameter list.
[0011] According to a parameter verification method provided by the present invention, a parameter format check is performed on a second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, the parameter format is corrected on the second intermediate parameter list to obtain a third intermediate parameter list, including: based on a format regular expression, a parameter format check is performed on each parameter in the second intermediate parameter list to obtain a parameter format check result; information is extracted from the second intermediate parameter list to obtain key information of each parameter in the second intermediate parameter list; based on the parameter format check result, it is determined whether there are format-error parameters in the second intermediate parameter list; if there are format-error parameters in the second intermediate parameter list, parameter format correction is performed on the format-error parameters based on the format regular expression and a format correction prompt word template to obtain a third intermediate parameter list.
[0012] According to a parameter verification method provided by the present invention, an authenticity check is performed on a third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, the third intermediate parameter list is authenticity corrected to obtain a target input parameter list, including: generating an authenticity regular expression based on key information of each parameter in the second intermediate parameter list; based on the authenticity regular expression, performing an authenticity check on each parameter in the third intermediate parameter list to obtain an authenticity check result; based on the authenticity check result, determining whether there are unmatched parameters in the third intermediate parameter list; if there are unmatched parameters in the third intermediate parameter list, performing authenticity correction on the unmatched parameters to obtain a target input parameter list.
[0013] According to a parameter verification method provided by the present invention, authenticity correction is performed on unmatched parameters to obtain a target input parameter list, including: generating clarification information based on the unmatched parameters and a clarification template; returning the clarification information to the user; receiving the user's correction text; and based on the correction text, performing authenticity correction on the unmatched parameters to obtain a target input parameter list.
[0014] The present invention also provides a parameter verification device, including: an acquisition module, used to obtain a list of input parameters to be verified; the list of input parameters to be verified includes multiple input parameters to be verified, and the input parameters to be verified are generated by the intelligent system according to the user's dialogue text; an existence check module, used to perform an existence check on the list of input parameters to be verified, obtain an existence check result, and based on the existence check result, perform an existence correction on the list of input parameters to be verified to obtain a first intermediate parameter list; a data type check module, used to perform a data type check on the first intermediate parameter list, obtain a data type check result, and based on the data type check result, perform a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list; a format check module, used to perform a parameter format check on the second intermediate parameter list, obtain a parameter format check result, and based on the parameter format check result, perform a parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list; an authenticity check module, used to perform an authenticity check on the third intermediate parameter list, obtain an authenticity check result, and based on the authenticity check result, perform an authenticity correction on the third intermediate parameter list to obtain a target input parameter list.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned parameter verification methods when executing the computer program.
[0016] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the parameter verification method described in any one of the above is implemented.
[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the parameter verification method described above is implemented.
[0018] The parameter verification method, device, equipment, storage medium and program product provided by the present invention perform existence check, data type check, parameter format check and authenticity check on the input parameter list to be verified generated by the intelligent system, and make corresponding corrections based on the inspection results, and finally obtain a corrected target input parameter list, which can accurately and efficiently verify the parameters, thereby ensuring that the intelligent system can accurately call skills, so as to support the automated task processing of the intelligent system in complex scenarios and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 This is one of the flow charts of the parameter verification method provided by the present invention.
[0021] Figure 2 This is the second flow chart of the parameter verification method provided by the present invention.
[0022] Figure 3 It is a structural schematic diagram of the parameter verification device provided by the present invention.
[0023] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] See also Figure 1 , Figure 1 This is one of the flow charts of the parameter verification method provided by the present invention. Figure 1 As shown, in this embodiment, the parameter verification method is applied to an intelligent agent system (ie, an Agent system), and the parameter verification method includes steps S110 to S150, and each step is specifically as follows: S110: Obtain a list of input parameters to be verified.
[0026] The list of input parameters to be verified includes multiple input parameters to be verified, and the input parameters to be verified are generated by the intelligent agent system according to the user's dialogue text.
[0027] Specifically, the Agent system can provide multiple skill calls, and the relevant information of each skill is stored in the skill list. The skill list stores the skill parameter information corresponding to each skill, including parameter name, data type, example, description, format expression, authenticity expression, etc.
[0028] When a user needs to call a certain skill, he or she can interact with the Agent system through a dialogue. The Agent system can generate input parameters to be verified corresponding to the skill based on the user's dialogue text. It can be understood that a skill may require multiple input parameters, so there are usually multiple input parameters to be verified. The Agent system can store the generated multiple input parameters to be verified into a list of input parameters to be verified based on the skill that the user needs to call.
[0029] S120: Perform an existence check on the input parameter list to be checked to obtain an existence check result, and based on the existence check result, perform an existence correction on the input parameter list to be checked to obtain a first intermediate parameter list.
[0030] In this embodiment, the parameter verification system includes a parameter existence check module, a parameter data type check module, a parameter format check module, a parameter authenticity check module, a parameter existence correction module, a parameter data type correction module, a parameter format correction module and a parameter authenticity correction module.
[0031] The parameter existence check module is used to perform an existence check on the input parameter list to be checked, that is, to determine whether the names and quantities of the multiple input parameters to be checked generated by the Agent system are consistent with the input parameters actually required by the corresponding skills, and generate an existence check result.
[0032] The parameter existence correction module can perform existence correction on the input parameter list to be checked based on the existence check result to obtain a first intermediate parameter list.
[0033] S130: Perform a data type check on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, perform a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list.
[0034] After completing the existence check, the parameter data type check module can perform a data type check on the first intermediate parameter list, that is, determine whether the data types of the multiple input parameters to be verified generated by the Agent system are consistent with the input parameters actually required by the corresponding skills, and obtain the data type check result.
[0035] The parameter data type correction module may correct the data type of the first intermediate parameter list based on the data type check result to obtain a second intermediate parameter list.
[0036] S140: Perform parameter format check on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, perform parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list.
[0037] After completing the data type check, the parameter format check module can create matching rules for each input parameter actually required for each skill in the skill list, and perform parameter format check on the second intermediate parameter list according to the matching rules, that is, determine whether the multiple input parameters to be verified generated by the Agent system meet the format requirements of the input parameters actually required for the corresponding skills, and obtain the parameter format check results.
[0038] The parameter format correction module may correct the parameter format of the second intermediate parameter list based on the parameter format check result to obtain a third intermediate parameter list.
[0039] S150: Perform an authenticity check on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, perform authenticity correction on the third intermediate parameter list to obtain a target input parameter list.
[0040] After completing the parameter format check, the parameter authenticity check module can perform an authenticity check on the third intermediate parameter list, that is, determine whether the multiple input parameters to be verified generated by the Agent system are generated based on the user's real dialogue text, and obtain an authenticity check result.
[0041] The parameter authenticity correction module may perform authenticity correction on the third intermediate parameter list based on the authenticity check result to obtain a target input parameter list.
[0042] The parameter verification method provided in this embodiment performs existence check, data type check, parameter format check and authenticity check on the input parameter list to be verified generated by the intelligent agent system, and makes corresponding corrections based on the check results, and finally obtains a corrected target input parameter list. The parameters can be verified accurately and efficiently, thereby ensuring that the intelligent agent system can accurately call skills, so as to support the automated task processing of the intelligent agent system in complex scenarios and improve the user experience.
[0043] In some embodiments, an existence check is performed on a list of input parameters to be checked to obtain an existence check result, and based on the existence check result, an existence correction is performed on the list of input parameters to be checked to obtain a first intermediate parameter list, including: obtaining a list of actually required input parameters; the list of actually required input parameters includes multiple actually required input parameters; each input parameter to be checked is compared with each actually required input parameter to obtain an existence check result; based on the existence check result, it is determined whether there are missing parameters or redundant parameters in the list of input parameters to be checked; if there are missing parameters or redundant parameters in the list of input parameters to be checked, the redundant parameters in the list of input parameters to be checked are deleted, and based on the missing parameters and parameter completion prompt word template, the list of input parameters to be checked is corrected for existence to obtain a first intermediate parameter list.
[0044] Specifically, when a user needs to call a skill, he or she can interact with the Agent system through a dialogue. The Agent system can generate multiple input parameters to be verified corresponding to the skill based on the user's dialogue text, and store the generated multiple input parameters to be verified in the input parameter list to be verified. .
[0045] Furthermore, the Agent system can obtain the actual required input parameter list of the corresponding skill , the actual required input parameter list Multiple actually required input parameters of the corresponding skills are stored in it.
[0046] Furthermore, each input parameter to be checked is compared with each actually required input parameter to obtain an existence check result.
[0047] Specifically, the parameter existence check module can perform an existence check on the input parameter list to be checked: Each input parameter to be verified in the list of actual required input parameters Each actually required input parameter in the is compared with each other to determine whether the names and quantities of the multiple input parameters to be verified generated by the Agent system are consistent with the input parameters actually required for the corresponding skill, and the existence check result is obtained.
[0048] The existence check result contains a list of input parameters to be verified And the actual required input parameter list There are differences between the actual input parameter list and the Compared with the list of input parameters to be verified Missing and / or extra parameters are present.
[0049] Among them, the actual required input parameter list Compared with the list of input parameters to be verified The missing parameters that exist The expression is as follows: ; and the actual required input parameter list Compared with the list of input parameters to be verified The presence of redundant parameters The expression is as follows: ; Where k represents a parameter in the parameter list.
[0050] Furthermore, the parameter existence correction module determines the list of input parameters to be verified based on the existence check result. Whether there are missing or extra parameters.
[0051] If the input parameter list to be verified There are missing parameters or extra parameters , then delete the list of input parameters to be verified Extra parameters in , and based on the missing parameters The pre-set parameter completion prompt template is used to check the input parameter list through the dialogue between the user and the Agent system. Perform existence correction and complete the list of input parameters to be verified Missing parameters in , get the first intermediate parameter list.
[0052] In some embodiments, a data type check is performed on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, a data type correction is performed on the first intermediate parameter list to obtain a second intermediate parameter list, including: performing a data type check on each parameter in the first intermediate parameter list to obtain a data type check result; based on the data type check result, determining whether there are parameters in the first intermediate parameter list with incorrect data types; if there are parameters in the first intermediate parameter list with incorrect data types, correcting the data types of the parameters with incorrect data types based on a data type conversion tool to obtain a second intermediate parameter list.
[0053] Specifically, after completing the existence check, the parameter data type check module can perform a data type check on the first intermediate parameter list, that is, determine whether the data types of the multiple input parameters to be verified generated by the Agent system are consistent with the input parameters actually required by the corresponding skills, and obtain the data type check result.
[0054] Furthermore, the parameter data type correction module may determine whether there are parameters with incorrect data types in the first intermediate parameter list based on the data type check result.
[0055] If there are parameters with wrong data types in the first intermediate parameter list, the parameter data type correction module can perform data type conversion and correction on the parameters with wrong data types based on a predefined data type conversion tool to obtain a second intermediate parameter list.
[0056] In some embodiments, a parameter format check is performed on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, the parameter format is corrected on the second intermediate parameter list to obtain a third intermediate parameter list, including: based on a format regular expression, performing a parameter format check on each parameter in the second intermediate parameter list to obtain a parameter format check result; performing information extraction on the second intermediate parameter list to obtain key information of each parameter in the second intermediate parameter list; based on the parameter format check result, determining whether there are format-error-corrected parameters in the second intermediate parameter list; if there are format-error-corrected parameters in the second intermediate parameter list, based on the format regular expression and a format correction prompt word template, performing parameter format correction on the format-error-corrected parameters to obtain a third intermediate parameter list.
[0057] Specifically, the parameter format checking module includes a rule formulation module and a matching extraction module.
[0058] The rule making module can make a format regular expression for format checking according to the description and examples of each actually required input parameter.
[0059] Optionally, the format regular expression may be automatically generated by a rule formulation module and verified manually.
[0060] Optionally, the format regular expression can be automatically generated by the rule-making module through the fine-tuning language model: first, create a matching dictionary containing commonly used parameter format types and corresponding format regular expressions; then use ChatGPT to generate several parameter example-expression pairs according to the matching dictionary, and further generate a data set for fine-tuning language model training; finally, train a fine-tuning language model through the data set, and the trained fine-tuning language model can be used to generate corresponding format regular expressions according to the parameters.
[0061] Optionally, the format regular expression can also be automatically generated through a large language model and prompt engineering: first, create a matching dictionary that contains commonly used parameter format types and corresponding format regular expressions; then use the matching dictionary as a few-shot (i.e., a small number of samples) and combine it with the prompt word template to directly input the large language model (such as ChatGPT-4), so that the large language model can output the corresponding format regular expression according to the parameter example and description.
[0062] Furthermore, the matching and extraction module may perform regular matching on each parameter in the second intermediate parameter list based on the regular expression corresponding to each parameter, thereby determining whether the parameter format of each parameter is correct and obtaining a parameter format check result.
[0063] The second intermediate parameter list includes a plurality of input parameters to be verified that have been generated by the Agent system and have undergone existence check and correction.
[0064] At the same time, the matching extraction module can also extract information from the second intermediate parameter list through precise capture groups to obtain key information of each parameter in the second intermediate parameter list. .
[0065] For example, for the date parameter "August 24, 2024", the key information is "2024", "8", and "24".
[0066] Furthermore, the parameter format correction module may determine whether there are parameters with incorrect formats in the second intermediate parameter list based on the parameter format check result.
[0067] If there are parameters with incorrect formats in the second intermediate parameter list, the parameter format correction module can fill the parameters with incorrect formats and format regular expressions into the format correction prompt word template to generate format correction instructions; the filled-in format correction prompt word template and format correction instructions are input into the large language model, and the large language model can correct the parameter format of the parameters with incorrect formats, return parameters with correct formats, and generate a third intermediate parameter list.
[0068] In some embodiments, an authenticity check is performed on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, the third intermediate parameter list is corrected for authenticity to obtain a target input parameter list, including: generating an authenticity regular expression based on key information of each parameter in the second intermediate parameter list; based on the authenticity regular expression, performing an authenticity check on each parameter in the third intermediate parameter list to obtain an authenticity check result; based on the authenticity check result, determining whether there are unmatched parameters in the third intermediate parameter list; if there are unmatched parameters in the third intermediate parameter list, performing authenticity correction on the unmatched parameters to obtain a target input parameter list.
[0069] Specifically, the parameter authenticity check module can check the key information of each parameter in the second intermediate parameter list extracted from the parameter format check module based on the key information of each parameter in the second intermediate parameter list extracted from the parameter format check module. , create a authenticity regular expression, which is used to detect key information Whether it appears in the user's conversation record is to determine whether the multiple parameters generated by the Agent system are generated based on the user's real conversation text, thereby obtaining the authenticity check result.
[0070] Optionally, the authenticity regular expression may be generated by combining a general template and a customized template.
[0071] Optionally, for texts with special formats such as dates, longitudes and latitudes, coordinates, etc., customized templates can be used to adapt to different text presentation forms.
[0072] For example, the text representation of a date may be "August 24, 2024", "20240824", "2024.08.24", etc. In this case, the regular expression "2024[year.]?0?8[month.]?24[day]?" can be used for regular matching; the specific value of the date can be obtained through key information Extract.
[0073] Optionally, for general parameters that do not have a special format, they can be matched through a general template, the expression of the general template is as follows: ; Among them, n is the key information The number of elements in , For key information The i-th element in .
[0074] Furthermore, the parameter authenticity correction module may determine whether there are any unmatched parameters in the third intermediate parameter list based on the authenticity check result.
[0075] If there are unmatched parameters in the third intermediate parameter list, authenticity correction is performed on the unmatched parameters to obtain a target input parameter list.
[0076] In some embodiments, authenticity correction is performed on unmatched parameters to obtain a target input parameter list, including: generating clarification information based on the unmatched parameters and a clarification template; returning the clarification information to the user; receiving the user's correction text; and based on the correction text, performing authenticity correction on the unmatched parameters to obtain a target input parameter list.
[0077] Specifically, the parameter authenticity correction module can generate clarification information (i.e., clarification words) based on the authenticity check result, unmatched parameters and the clarification template.
[0078] Furthermore, clarification information (i.e., clarification words) is returned to the user to guide the user to correctly fill in the specified unmatched parameter information, generate a correction text, and receive the user's correction text; based on the correction text, the unmatched parameters are corrected for authenticity to obtain a target input parameter list.
[0079] The parameter verification method provided in this embodiment adopts multi-level parameter detection, which can accurately discover possible problems in the parameters generated by the Agent system, and can effectively improve the correctness of the generation of the skill parameters of the Agent system through a multi-layer correction method of existence correction, data type correction, format correction, and authenticity correction, thereby ensuring the effectiveness of skill calling and enhancing the stability and robustness of the Agent system.
[0080] The present invention also provides a specific example of a parameter verification method. Figure 2 , Figure 2 This is the second flow chart of the parameter verification method provided by the present invention.
[0081] like Figure 2 As shown in the figure, when a user needs to call a certain skill, he can interact with the Agent system through a dialogue. The Agent system can generate multiple input parameters to be verified corresponding to the skill based on the user's dialogue text, and store the generated multiple input parameters to be verified in the input parameter list to be verified. .
[0082] Furthermore, the Agent system can load the skill list and extract the corresponding skill parameter information in the skill list, including parameter name, data type, example, description, format expression, authenticity expression, etc., to obtain the actual required input parameter list of the corresponding skill. , the actual required input parameter list Multiple actually required input parameters of the corresponding skills are stored in it.
[0083] In this embodiment, it is assumed that the list of input parameters to be verified is , the actual required input parameter list is .
[0084] Specifically, first check the input parameter list as follows: Perform an existence check and obtain an existence check result.
[0085] The existence check result contains a list of input parameters to be verified And the actual required input parameter list There are differences between them.
[0086] In this embodiment, the actual required input parameter list Compared with the list of input parameters to be verified The missing parameters that exist as follows: ; and the actual required input parameter list Compared with the list of input parameters to be verified The presence of redundant parameters as follows: .
[0087] Further, based on the existence check result, the input parameter list to be checked is corrected for existence to obtain a first intermediate parameter column.
[0088] Specifically, delete the list of input parameters to be verified. Extra parameters in , and based on the missing parameters , and the preset parameter completion prompt template, through the dialogue between the user and the Agent system, to check the input parameter list Perform existence correction and complete the list of input parameters to be verified Missing parameters in , get the first intermediate parameter list.
[0089] Among them, the first intermediate parameter list The expression is as follows: .
[0090] For example, the parameter completion prompt template is "The following is the parameter information required for the {skill name} skill: parameter name: {parameter name}; parameter type: {parameter type}; parameter description: {parameter description}; parameter example: {parameter example}. Please extract the parameter value based on the parameter information and the historical conversation content, and output it in the {key: value} format."
[0091] Further, for the first intermediate parameter list Check the data type, compare the corresponding skill parameter information in the skill list, and check the first intermediate parameter list in turn The data types of all parameters in the , and obtain the data type check results.
[0092] Assume that the extracted parameter has the wrong data type , then traverse The parameters in the table will be the data type of the actual parameter required. The data type of the generated parameters is input into the predefined python script tool to convert the data type and correct the first intermediate parameter list Parameters with incorrect data types in the second intermediate parameter list .
[0093] Furthermore, the format regular expression is produced: first, a matching dictionary is produced that contains commonly used parameter format types and corresponding format regular expressions; then the matching dictionary is used as a few-shot (i.e., a small number of samples) and combined with the prompt word template to directly input the large language model (such as ChatGPT-4), so that the large language model can output the corresponding format regular expression according to the parameter example and description, and ensure the validity of the format regular expression through manual verification, and update the skill list.
[0094] Furthermore, for the second intermediate parameter list Perform parameter format check and use the format regular expression to check the second intermediate parameter list All parameters in the are matched in format to obtain the parameter format check result.
[0095] At the same time, the matching extraction module can also extract information from the second intermediate parameter list through precise capture groups to obtain key information of each parameter in the second intermediate parameter list. .
[0096] Further, based on the parameter format check result, the parameter format of the second intermediate parameter list is corrected to obtain a third intermediate parameter list.
[0097] Assume that the second intermediate parameter list Malformed parameter in , the parameter format correction module can fill in the format correction prompt word template with the format error and the format regular expression to generate the format correction instruction; the filled format correction prompt word template and format correction instruction are input into the large language model, and the large language model can correct the format error of the parameter Correct the parameter format, return the parameters with the correct format, and generate the third intermediate parameter list .
[0098] Furthermore, authenticity regular expressions are produced: the production rules are produced by combining general templates and customized templates: for texts with special formats such as dates, longitudes and latitudes, coordinates, etc., customized templates can be used to adapt to different text expressions; for general parameters that do not have special formats, they can be matched through general templates, and the expression of the general template is as follows: ; Among them, n is the key information The number of elements in , For key information The i-th element in .
[0099] Furthermore, for the third intermediate parameter list Perform an authenticity check and obtain an authenticity check result; based on the authenticity check result, determine the third intermediate parameter list Whether there are unmatched parameters in .
[0100] Assume that the third intermediate parameter list There are unmatched parameters in , based on the authenticity check results, based on the unmatched parameters and the clarification template, clarification information (i.e. clarification words) is generated.
[0101] Furthermore, clarification information (i.e., clarification words) is returned to the user to guide the user to correctly fill in the specified unmatched parameter information, generate correction text, and receive the user's correction text; based on the correction text, the unmatched parameters are corrected for authenticity to obtain the target input parameter list .
[0102] For example, the clarification template is "The following is the parameter information required for the {skill name} skill: {parameter 1}: {parameter name: {parameter name}; parameter type: {parameter type}; parameter description: {parameter description}; parameter example: {parameter example}}; {parameter 2}: {parameter name: {parameter name}; parameter type: {parameter type}; parameter description: {parameter description}; parameter example: {parameter example}}. It is detected that these parameter values do not appear in the historical conversation. Please fill in the following parameter values: {parameter 1} and {parameter 2}".
[0103] The present invention also provides a parameter verification device. Figure 3 , Figure 3 3 is a schematic diagram of the structure of the parameter checking device provided by the present invention. In this embodiment, the parameter checking device includes an acquisition module 310 , an existence check module 320 , a data type check module 330 , a format check module 340 and an authenticity check module 350 .
[0104] The acquisition module 310 is used to acquire a list of input parameters to be verified.
[0105] The list of input parameters to be verified includes multiple input parameters to be verified, and the input parameters to be verified are generated by the intelligent agent system according to the user's dialogue text.
[0106] The existence check module 320 is used to perform an existence check on the input parameter list to be checked, obtain an existence check result, and based on the existence check result, perform an existence correction on the input parameter list to be checked to obtain a first intermediate parameter list.
[0107] The data type checking module 330 is used to perform a data type check on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, perform a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list.
[0108] The format checking module 340 is used to perform parameter format checking on the second intermediate parameter list to obtain a parameter format checking result, and based on the parameter format checking result, perform parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list.
[0109] The authenticity check module 350 is used to perform an authenticity check on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, perform authenticity correction on the third intermediate parameter list to obtain a target input parameter list.
[0110] In some embodiments, the existence check module 320 is used to obtain a list of actually required input parameters; the list of actually required input parameters includes multiple actually required input parameters; each input parameter to be checked is compared with each actually required input parameter to obtain an existence check result; based on the existence check result, it is determined whether there are missing parameters or redundant parameters in the input parameter list to be checked; if there are missing parameters or redundant parameters in the input parameter list to be checked, the redundant parameters in the input parameter list to be checked are deleted, and based on the missing parameters and parameter completion prompt word template, the input parameter list to be checked is corrected for existence to obtain a first intermediate parameter list.
[0111] In some embodiments, the data type checking module 330 is used to perform a data type check on each parameter in the first intermediate parameter list to obtain a data type checking result; based on the data type checking result, determine whether there are parameters with incorrect data types in the first intermediate parameter list; if there are parameters with incorrect data types in the first intermediate parameter list, correct the data types of the parameters with incorrect data types based on a data type conversion tool to obtain a second intermediate parameter list.
[0112] In some embodiments, the format checking module 340 is used to perform parameter format checking on each parameter in the second intermediate parameter list based on a format regular expression to obtain a parameter format checking result; perform information extraction on the second intermediate parameter list to obtain key information of each parameter in the second intermediate parameter list; based on the parameter format checking result, determine whether there are parameters with incorrect formats in the second intermediate parameter list; if there are parameters with incorrect formats in the second intermediate parameter list, perform parameter format correction on the parameters with incorrect formats based on the format regular expression and the format correction prompt word template to obtain a third intermediate parameter list.
[0113] In some embodiments, the authenticity check module 350 is used to generate an authenticity regular expression based on the key information of each parameter in the second intermediate parameter list; based on the authenticity regular expression, perform an authenticity check on each parameter in the third intermediate parameter list to obtain an authenticity check result; based on the authenticity check result, determine whether there are unmatched parameters in the third intermediate parameter list; if there are unmatched parameters in the third intermediate parameter list, perform authenticity correction on the unmatched parameters to obtain a target input parameter list.
[0114] In some embodiments, the authenticity check module 350 is used to generate clarification information based on unmatched parameters and a clarification template; return the clarification information to the user; receive the user's correction text; and perform authenticity correction on the unmatched parameters based on the correction text to obtain a target input parameter list.
[0115] The invention also provides an electronic device. Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor (processor) 410, a communication interface (CommunicationsInterface) 420, a memory (memory) 430 and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the parameter verification method.
[0116] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0117] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the parameter verification method provided by the above methods is implemented.
[0118] The present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the parameter verification methods provided by the above methods.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A parameter verification method, characterized in that: Applications to intelligent agent systems include: Obtaining a list of input parameters to be verified; the list of input parameters to be verified includes a plurality of input parameters to be verified, and the input parameters to be verified are generated by the agent system according to the user's dialogue text; Performing an existence check on the input parameter list to be checked to obtain an existence check result, and based on the existence check result, performing an existence correction on the input parameter list to be checked to obtain a first intermediate parameter list; Performing a data type check on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, performing a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list; Performing a parameter format check on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, performing a parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list; An authenticity check is performed on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, an authenticity correction is performed on the third intermediate parameter list to obtain a target input parameter list.
2. The parameter verification method according to claim 1, characterized in that: The step of performing an existence check on the input parameter list to be checked to obtain an existence check result, and performing an existence correction on the input parameter list to be checked based on the existence check result to obtain a first intermediate parameter list includes: Obtaining a list of actually required input parameters; the list of actually required input parameters includes a plurality of actually required input parameters; Compare each of the input parameters to be checked with each of the actually required input parameters to obtain the existence check result; Based on the existence check result, determine whether there are missing parameters or redundant parameters in the input parameter list to be checked; If there are missing parameters or redundant parameters in the input parameter list to be verified, the redundant parameters in the input parameter list to be verified are deleted, and based on the missing parameters and the parameter completion prompt word template, the input parameter list to be verified is corrected for existence to obtain a first intermediate parameter list.
3. The parameter verification method according to claim 2, characterized in that: The performing a data type check on the first intermediate parameter list to obtain a data type check result, and based on the data type check result, performing a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list includes: Performing a data type check on each parameter in the first intermediate parameter list to obtain a data type check result; Based on the data type check result, determining whether there is a parameter in the first intermediate parameter list with an incorrect data type; If there are parameters with wrong data types in the first intermediate parameter list, the data types of the parameters with wrong data types are corrected based on a data type conversion tool to obtain a second intermediate parameter list.
4. The parameter verification method according to claim 2, characterized in that: The performing a parameter format check on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, performing a parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list, includes: Based on the format regular expression, perform parameter format check on each parameter in the second intermediate parameter list respectively to obtain a parameter format check result; Extracting information from the second intermediate parameter list to obtain key information of each parameter in the second intermediate parameter list; Based on the parameter format check result, determining whether there is a parameter with an incorrect format in the second intermediate parameter list; If there are parameters with incorrect formats in the second intermediate parameter list, the parameter formats of the parameters with incorrect formats are corrected based on the format regular expression and the format correction prompt word template to obtain a third intermediate parameter list.
5. The parameter verification method according to claim 4, characterized in that: The performing an authenticity check on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, performing an authenticity correction on the third intermediate parameter list to obtain a target input parameter list, includes: Generate an authenticity regular expression based on key information of each parameter in the second intermediate parameter list; Based on the authenticity regular expression, perform an authenticity check on each parameter in the third intermediate parameter list to obtain an authenticity check result; Based on the authenticity check result, determining whether there are unmatched parameters in the third intermediate parameter list; If there are unmatched parameters in the third intermediate parameter list, authenticity correction is performed on the unmatched parameters to obtain a target input parameter list.
6. The parameter verification method according to claim 5, characterized in that: The performing authenticity correction on the unmatched parameters to obtain a target input parameter list includes: generating clarification information based on the unmatched parameters and the clarification template; returning the clarification information to the user; receiving a revised text from the user; Based on the correction text, the unmatched parameters are corrected for authenticity to obtain a target input parameter list.
7. A parameter verification device, characterized in that: include: An acquisition module, used to acquire a list of input parameters to be verified; the list of input parameters to be verified includes multiple input parameters to be verified, and the input parameters to be verified are generated by the agent system according to the user's dialogue text; an existence check module, configured to perform an existence check on the input parameter list to be checked, obtain an existence check result, and perform an existence correction on the input parameter list to be checked based on the existence check result to obtain a first intermediate parameter list; a data type checking module, configured to perform a data type check on the first intermediate parameter list to obtain a data type checking result, and based on the data type checking result, perform a data type correction on the first intermediate parameter list to obtain a second intermediate parameter list; a format checking module, configured to perform a parameter format check on the second intermediate parameter list to obtain a parameter format check result, and based on the parameter format check result, perform a parameter format correction on the second intermediate parameter list to obtain a third intermediate parameter list; The authenticity check module is used to perform an authenticity check on the third intermediate parameter list to obtain an authenticity check result, and based on the authenticity check result, perform authenticity correction on the third intermediate parameter list to obtain a target input parameter list.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the parameter verification method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the parameter verification method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the parameter verification method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Parameter verification method and device, computer storage medium and embedded equipment
CN109597816A
Base station OAM parameter verification method, device and system
CN116801290A
Large model plug-in calling method and device, equipment and medium
CN117112064A
Large model plug-in calling method and device, equipment and medium
CN117112065A
Parameter verification method and device, equipment and storage medium
CN117369866A