Training method of parameter prediction model, parameter prediction method and device

CN116975635BActive Publication Date: 2026-08-07特赞(上海)信息科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
特赞(上海)信息科技有限公司
Filing Date
2023-07-25
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]然而,采用现有预测方式,参数预测准确性不高

Benefits of technology

[0026]The parameter prediction model training method provided in this application embodiment involves: acquiring first target data, which includes parameter data of historical API requests and attribute data corresponding to the parameter data of historical API requests. The attribute data describes the parameter declarations of the parameter data of historical API requests, and the parameter declarations include parameter name definitions and parameter values. Based on the first target data, a pre-trained model is determined, which is used to perform initial parameter prediction on API requests. Then, second target data is acquired, which describes question-and-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API requests and the attribute data of the API request parameters. Based on the second target data and the pre-trained model, a parameter prediction model is determined, which describes an optimized model obtained after adjusting the pre-trained model, for the final parameter prediction of API requests. Thus, in the model pre-training stage, the knowledge of parameter declarations is solidified in the pre-trained model. In the final model training stage, a large language model with reasoning capabilities is used to construct question-and-answer data pairs from logs as fine-tuning training data, training a parameter prediction model with parameter reasoning capabilities, facilitating accurate API parameter prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116975635B_ABST
    Figure CN116975635B_ABST
Patent Text Reader

Abstract

The present disclosure provides a parameter prediction model training method, a parameter prediction method and device, comprising: obtaining first target data, the first target data comprising: historical application program interface (API) request parameter data and attribute data corresponding to the historical API request parameter data, the attribute data being used to describe parameter declaration of the historical API request parameter data, the parameter declaration comprising: parameter name definition and parameter value; determining a pre-training model based on the first target data, the pre-training model being used to perform first parameter prediction on an API request; obtaining second target data, the second target data being used to describe question and answer data pairs corresponding to a plurality of user questions, each user question being derived from the API request parameter data and the attribute data of the API request parameter data; and determining a parameter prediction model based on the second target data and the pre-training model. Thus, API parameter prediction is accurately performed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this disclosure relate to the field of computer technology, and more specifically, to a training method, parameter prediction method, and apparatus suitable for a parameter prediction model. Background Technology

[0002] An API (Application Programming Interface) is a calling interface provided by the operating system for applications. Applications can invoke the operating system's API to instruct the operating system to execute commands. When a user interacts with the operating system, the operating system needs to predict the parameters of the API requests based on the user's behavior to effectively understand the user's needs.

[0003] However, the accuracy of parameter prediction using existing methods is not high. Summary of the Invention

[0004] The embodiments described herein provide a method for training a parameter prediction model, a parameter prediction method, and an apparatus that overcome the aforementioned problems.

[0005] Firstly, based on the content of this disclosure, a method for training a parameter prediction model is provided, including:

[0006] Obtain first target data, which includes: parameter data of historical application interface API requests and attribute data corresponding to the parameter data of the historical API requests. The attribute data is used to describe the parameter declaration of the parameter data of the historical API requests. The parameter declaration includes: parameter name definition and parameter value.

[0007] Based on the first target data, a pre-trained model is determined, which is used to perform initial parameter prediction on the API request;

[0008] Obtain second target data, which is used to describe question-answer data pairs corresponding to multiple user questions, each of which is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request;

[0009] Based on the second target data and the pre-trained model, a parameter prediction model is determined. The parameter prediction model is used to describe the optimized model obtained after adjusting the pre-trained model, so as to perform final parameter prediction for the API request.

[0010] Secondly, based on the content of this disclosure, a parameter prediction method is provided, including:

[0011] Obtain user input text, wherein the user input text is the text corresponding to the language interaction scenario;

[0012] In the user input text input parameter prediction model, the target API parameter corresponding to the user input text is determined based on the output of the parameter prediction model;

[0013] Alternatively, the user input text is input into a pre-trained model, and the first API parameter corresponding to the user input text is determined based on the output of the pre-trained model. The user input text is input into a parameter prediction model, and the second API parameter corresponding to the user input text is determined based on the output of the parameter prediction model. The first API parameter and the second API parameter are then fused to obtain the target API parameter corresponding to the user input text.

[0014] Wherein, the parameter prediction model is the parameter prediction model trained by the method described in the first aspect, and the pre-trained model is the pre-trained model trained by the method described in the first aspect.

[0015] Thirdly, according to the present disclosure, a training apparatus for a parameter prediction model is provided, comprising:

[0016] The first acquisition module is used to acquire first target data, which includes: parameter data of historical application interface (API) requests and attribute data corresponding to the parameter data of the historical API requests. The attribute data is used to describe the parameter declaration of the parameter data of the historical API requests. The parameter declaration includes: parameter name definition and parameter value.

[0017] The first determining module is used to determine a pre-trained model based on the first target data, wherein the pre-trained model is used to perform initial parameter prediction for the API request;

[0018] The second acquisition module is used to acquire second target data, which describes question-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request.

[0019] The second determining module is used to determine a parameter prediction model based on the second target data and the pre-trained model. The parameter prediction model is used to describe the optimized model obtained after adjusting the pre-trained model, so as to perform final parameter prediction for the API request.

[0020] Fourthly, according to the present disclosure, a parameter prediction device is provided, comprising:

[0021] The third acquisition module is used to acquire user input text, which is the text corresponding to the language interaction scenario.

[0022] The third determining module is used to determine the target API parameter corresponding to the user input text in the user input text input parameter prediction model based on the output of the parameter prediction model; or, input the user input text into a pre-trained model and determine the first API parameter corresponding to the user input text based on the output of the pre-trained model, and input the user input text into the user input text input parameter prediction model and determine the second API parameter corresponding to the user input text based on the output of the parameter prediction model, and fuse the first API parameter and the second API parameter to obtain the target API parameter corresponding to the user input text;

[0023] Wherein, the parameter prediction model is the parameter prediction model trained by the method described in the first aspect, and the pre-trained model is the pre-trained model trained by the method described in the first aspect.

[0024] Fifthly, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the training method for the parameter prediction model as described in any of the above embodiments, or implements the steps of the parameter prediction method as described in any of the above embodiments.

[0025] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the steps of the training method for the parameter prediction model as described in any of the above embodiments, or implements the steps of the parameter prediction method as described in any of the above embodiments.

[0026] The parameter prediction model training method provided in this application embodiment involves: acquiring first target data, which includes parameter data of historical API requests and attribute data corresponding to the parameter data of historical API requests. The attribute data describes the parameter declarations of the parameter data of historical API requests, and the parameter declarations include parameter name definitions and parameter values. Based on the first target data, a pre-trained model is determined, which is used to perform initial parameter prediction on API requests. Then, second target data is acquired, which describes question-and-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API requests and the attribute data of the API request parameters. Based on the second target data and the pre-trained model, a parameter prediction model is determined, which describes an optimized model obtained after adjusting the pre-trained model, for the final parameter prediction of API requests. Thus, in the model pre-training stage, the knowledge of parameter declarations is solidified in the pre-trained model. In the final model training stage, a large language model with reasoning capabilities is used to construct question-and-answer data pairs from logs as fine-tuning training data, training a parameter prediction model with parameter reasoning capabilities, facilitating accurate API parameter prediction.

[0027] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein:

[0029] Figure 1 This is a flowchart illustrating a training method for a parameter prediction model provided in this disclosure.

[0030] Figure 2 This is a flowchart illustrating a parameter prediction method provided in this disclosure.

[0031] Figure 3 This is a schematic diagram of the structure of a training device for a parameter prediction model provided in this disclosure.

[0032] Figure 4 This is a schematic diagram of the structure of a parameter prediction device provided in this disclosure.

[0033] Figure 5 This is a schematic diagram of the structure of a computer device provided in this disclosure.

[0034] It should be noted that the elements in the attached diagram are schematic and not drawn to scale. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.

[0036] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, the statement of “connecting” or “coupling” two or more parts together shall mean that these parts are directly joined together or joined through one or more intermediate components.

[0037] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0038] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or part of a component) from another component (or another part of a component).

[0039] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).

[0040] Large Language Model (LLM) technology is one of the important breakthroughs in the field of natural language processing in recent years. LLM can enable models to have the ability to process and generate natural language through large-scale data training.

[0041] With the development of LLM technology, more convenient application forms have emerged, namely Language User Interface (LUI), a natural language-based interaction method. Compared with the traditional Graphical User Interface (GUI), LUI provides a more direct and natural interaction method. Using LUI, users can interact in applications in a way that is more like everyday conversation, without the need for cumbersome clicks and selections, which greatly improves the user experience and generation efficiency.

[0042] In LUI (Local User Interface), after expressing the user's intent and needs using natural language, this language needs to be translated into API request parameters that machines can understand. The process of automatically constructing API parameters involves techniques for parsing, understanding, and translating natural language. These techniques include natural language processing, natural language understanding, semantic parsing, entity recognition, and intent recognition.

[0043] Furthermore, enterprise applications often generate a large number of user usage records during cumulative use, including important information such as API request parameters. These logs are often not well utilized.

[0044] This embodiment provides an automatic API parameter construction method. By training a parameter prediction model, it can utilize a large number of API interaction records and make LUI interactions more accurate and smooth.

[0045] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0046] Figure 1 This is a flowchart illustrating a training method for a parameter prediction model provided in an embodiment of this disclosure.

[0047] like Figure 1 As shown, the specific process of training the parameter prediction model includes:

[0048] S110, Obtain the first target data.

[0049] The first target data includes: parameter data of historical API requests and attribute data corresponding to the parameter data of historical API requests. The attribute data is used to describe the parameter declarations of the parameter data of historical API requests. The parameter declarations include: parameter name definition and parameter value.

[0050] The parameter name definition is the name of the parameter. Parameter values ​​include: range values ​​and rule values, such as the format of the parameter value and the parameter description.

[0051] In some embodiments, obtaining the first target data may include:

[0052] Retrieve parameter data from historical API request logs; retrieve attribute data corresponding to the parameter data from the parameter specification file corresponding to the API parameter logs, where the parameter values ​​in the parameter declarations are either range values ​​or rule values; divide the parameter data from historical API requests and the attribute data corresponding to the parameter data into multiple text segments according to a preset character length to obtain the first target data.

[0053] For example, the parameter data of historical API requests is represented as follows:

[0054]

[0055]

[0056] Extract the definition of each parameter name, as well as the range or rules of possible parameter values, from the Open API (API parameter definition specification document) of this API. For example:

[0057]

[0058] The above data can be divided into multiple text segments according to a preset character length, which can be up to a maximum of 1024 characters.

[0059] Each text segment corresponds to parameter data and attribute data. That is, one text segment includes parameter data, and another text segment includes attribute data. This attribute data corresponds to the parameter data.

[0060] Therefore, by obtaining the parameter data of historical API requests and the attribute data corresponding to the parameter data of historical API requests, and dividing the parameter data of historical API requests and the attribute data corresponding to the parameter data into multiple text segments according to the preset character length, training samples that conform to the text input of the pre-trained model can be effectively obtained.

[0061] Before dividing the parameter data of historical API requests and the attribute data corresponding to the parameter data into multiple text segments according to a preset character length, the method in this embodiment may further include:

[0062] Data cleaning is performed on the parameter data of historical API requests to remove empty or duplicate parameter data corresponding to the same historical API request; similarly, data cleaning is performed on the attribute data corresponding to the parameter data of historical API requests to remove empty or duplicate attribute data corresponding to the same parameter data. This filters out empty and duplicate data in both parameter and attribute data, ensuring the validity of the model training samples.

[0063] The cleaned data can be seen as follows:

[0064]

[0065] The method in this embodiment may further include:

[0066] If the parameter data of a historical API request is empty, the parameter data that best matches a historical API request is selected from the historical API parameter log and used as the parameter data corresponding to a historical API request. If the attribute data corresponding to the parameter data of a historical API request is empty, the attribute data that best matches a historical API request is selected from the parameter specification file corresponding to the historical API parameter log and used as the attribute data corresponding to the parameter data of a historical API request.

[0067] Therefore, for historical API requests without data, the parameter and attribute data of the historical API requests can be enriched by adding explanatory text, thereby increasing the number of training samples for the model and effectively improving the training accuracy of the pre-trained model.

[0068] Additionally, when selecting the parameter data that best matches a historical API request from the historical API parameter log, if no matching parameter data can be selected, requests most relevant / similar to one or more historical API requests can be matched from the historical API parameter log. Then, using the parameter data corresponding to these most relevant / similar requests, a parameter data can be predicted / derived as the parameter data for that historical API request. This expands the parameter data corresponding to historical API requests.

[0069] When selecting the attribute data that best matches a historical API request from the parameter specification file corresponding to the historical API parameter logs, if no attribute data that best matches a historical API request can be selected, then requests that are most relevant / similar to one or more historical API requests can be matched from the parameter specification file. Using the attribute data / parameter data corresponding to one or more of these most relevant / similar historical API requests, an attribute data can be predicted / derived as the attribute data corresponding to this historical API request. This expands the attribute data corresponding to historical API requests.

[0070] S120. Based on the first target data, determine the pre-trained model.

[0071] The pre-trained model is used to perform initial parameter prediction for API requests.

[0072] Obtain historical API parameter logs and clean the data. This data can be used as training data in the LLM Pretrain stage. Using the cleaned historical API parameter logs as pretrain data can solidify the knowledge of parameter declarations into the pretrained model.

[0073] In some embodiments, determining a pre-trained model based on the first target data includes:

[0074] The first target data is used as a pre-training sample, and the first loss function is used to train the network model structure, which is used to describe the structure of the large language model. The training continues until the change in the first loss value corresponding to the trained model is less than a preset change threshold, and the pre-trained model is obtained. The first loss value is determined by the difference between the output result of the model trained on the network model structure and the reference result.

[0075] The network model structure can be an open-source generative model: the BLOOM (BigScience Large Open-science Open-access Multilingual Language Model) structure. The BLOOM structure is a generative model with a decoder, which can expand or translate the input text into new text.

[0076] The first loss function can be the cross-entropy loss. In the pre-training dataset, each data point is used as a complete input. During the pre-training phase, the model predicts the next text in each data point through regression until the original document is reconstructed. The supervised process evaluates the cross-entropy loss between the generated text and each token (word) of the real text in each step. The loss is then fed back to the model to use a weight optimization method to correct the model weights until the model's loss no longer decreases within N steps.

[0077] S130, Obtain the second target data.

[0078] The second target data can be used to describe question-and-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request.

[0079] In some embodiments, acquiring the second target data includes:

[0080] Obtain the parameter data and attribute data corresponding to each text segment; construct a user question based on the parameter data and attribute data of each text segment, with the user question corresponding to the API request of the text segment; input each user question into a large language model, and determine the corresponding answer information based on the output of the large language model. The answer information is used to predict the user behavior corresponding to the user question; determine each user question and its corresponding answer information as the second target data.

[0081] For example, for each API log data entry (i.e., a text fragment), the definitions of the API parameters involved are found in the Open API documentation. The API log data and parameter description text are then combined into a question according to a specific format. An analytical LLM (Limited Language Management) is then used to answer this question, primarily inferring the user's possible behaviors for that API, thereby constructing a question-and-answer data pair.

[0082] The following is an example of a problem to be constructed:

[0083]

[0084]

[0085] Here is an example of a thoughtful LLM response:

[0086]

[0087] The LLM response above represents the user's potential behavior, i.e., the "instructions" for fine-tuning the data. After construction, the complete instruction-based fine-tuning training data (i.e., the second target data) is represented as follows:

[0088]

[0089] Here, "instruction" and "input" are the inputs to the model to be fine-tuned during training, and "output" is the content that the model is expected to output.

[0090] S140. Based on the second target data and the pre-trained model, determine the parameter prediction model.

[0091] The parameter prediction model is used to describe the optimized model obtained by adjusting the pre-trained model, in order to make the final parameter prediction for API requests.

[0092] In some embodiments, a parameter prediction model is determined based on the second target data and the pre-trained model, including:

[0093] The second target data is used as a fine-tuning training sample, and the second loss function is used to train the pre-trained model until the change in the second loss value corresponding to the trained model is less than the preset change threshold. The parameter prediction model is then obtained. The second loss value is determined by the difference between the output result of the model obtained by training the pre-trained model and the reference result.

[0094] For example, in the instruction fine-tuning training dataset, the "instruction" and "input" of each data point are concatenated into a text string as input. The model continues to write the subsequent text of the input text until the API parameter is answered. The supervision process evaluates the cross-entropy loss between the output generated by the model in each step and the true complete output for each token (word). The loss is fed back to the model to use a weight optimization method to correct the model weights until the loss of the model no longer decreases within N steps. Training stops then. After the model is trained, a model that can automatically build API parameters is obtained.

[0095] Therefore, by leveraging Natural Language Processing (NLP) technology, the user's intent and needs expressed in natural language are transformed into machine-understandable API request parameters. This involves technologies such as semantic parsing, entity recognition, and intent recognition, enabling accurate API parameter construction within LUI. Enterprise applications generate a large amount of user usage records during operation, containing crucial information such as API request parameters. This implementation fully utilizes this log information to train a model that can automatically construct API parameters based solely on natural language text.

[0096] Traditional methods are suitable for scenarios with few parameters and easy reasoning, but they cannot handle the lengthy and complex parameters of enterprise-level API requests. The method proposed in this embodiment overcomes the limitations of LLM on the length of text input and output by combining historical API parameter logs, thus solving the problem of complex parameter construction. At the same time, by improving the accuracy and fluency of API parameter construction, better LUI interaction is achieved. Users can express their needs more naturally, and the system can accurately understand and generate appropriate API parameters and values, further improving the effect of LUI interaction and user satisfaction.

[0097] This embodiment can utilize natural language to construct API parameters, leverage historical API parameter logs, and solve the problem of automatically constructing complex parameters, making accurate and smooth LUI interactions possible. This allows for the construction of more intuitive and natural application interaction methods, improving user experience and work efficiency. Furthermore, by automatically constructing API parameters, the accuracy and smoothness of LUI interactions are further optimized.

[0098] In this embodiment, first target data is acquired, including parameter data of historical API requests and attribute data corresponding to the parameter data of historical API requests. The attribute data describes the parameter declarations of the parameter data of historical API requests, including parameter name definitions and parameter values. Based on the first target data, a pre-trained model is determined, which is used to perform initial parameter prediction for API requests. Second target data is acquired, describing question-and-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API requests and the attribute data of the parameter data of the API requests. Based on the second target data and the pre-trained model, a parameter prediction model is determined, which describes the optimized model obtained after adjusting the pre-trained model, for the final parameter prediction of API requests. Thus, in the model pre-training stage, the knowledge of parameter declarations is solidified in the pre-trained model. In the model final training stage, a large language model with thinking ability is used to construct question-and-answer data pairs from logs as fine-tuning training data to train a parameter prediction model with parameter reasoning ability, which facilitates accurate API parameter prediction.

[0099] Figure 2 This is a flowchart illustrating a parameter prediction method provided in this embodiment. Figure 2 As shown, parameter prediction methods may include:

[0100] S210. Obtain user input text.

[0101] The user-input text is the text corresponding to the language interaction scenario.

[0102] For example, user-input text can be text information entered by the user in the operating system through touch screen, voice, keypad, etc.

[0103] S220. In the user input text input parameter prediction model, determine the target API parameters corresponding to the user input text based on the output of the parameter prediction model.

[0104] When a user inputs text related to the interaction, the model, fine-tuned by the instructions, will directly output the API parameters. An example of the generated result is shown below:

[0105]

[0106]

[0107] You can use regular expression tools to parse the JSON block output by the model and use it as parameter data for API requests.

[0108] Alternatively, the user input text can be fed into a pre-trained model, and the first API parameter corresponding to the user input text can be determined based on the output of the pre-trained model. Then, the user input text can be fed into a parameter prediction model, and the second API parameter corresponding to the user input text can be determined based on the output of the parameter prediction model. The first and second API parameters can be fused to obtain the target API parameter corresponding to the user input text. This further improves the accuracy of parameter prediction.

[0109] The parameter prediction model is the parameter prediction model trained by the method in the above embodiments, and the pre-trained model is the pre-trained model trained by the method in the above embodiments.

[0110] When fusing the first API parameter and the second API parameter, different fusion weighting coefficients can be assigned to them respectively. By fusing the first API parameter, the second API parameter, the fusion weighting coefficient corresponding to the first API parameter, and the fusion weighting coefficient corresponding to the second API parameter, the first API parameter and the second API parameter can be fused to obtain the target API parameter corresponding to the user input text.

[0111] It should be noted that since the first API parameter is obtained through a pre-trained model and the second API parameter is obtained through a parameter prediction model, and since the parameter prediction model is an optimized version of the pre-trained model, the fusion weighting coefficient corresponding to the second API parameter can be set to be greater than the fusion weighting coefficient corresponding to the first API parameter to ensure the accuracy of the target API parameter.

[0112] Figure 3 This is a schematic diagram of a training device for a parameter prediction model provided in this embodiment. The training device for the parameter prediction model may include: a first acquisition module 310, a first determination module 320, a second acquisition module 330, and a second determination module 340. Wherein:

[0113] The first acquisition module 310 is used to acquire first target data, which includes: parameter data of historical application interface (API) requests and attribute data corresponding to the parameter data of the historical API requests. The attribute data is used to describe the parameter declaration of the parameter data of the historical API requests, and the parameter declaration includes: parameter name definition and parameter value.

[0114] The first determining module 320 is used to determine a pre-trained model based on the first target data, wherein the pre-trained model is used to perform initial parameter prediction for the API request.

[0115] The second acquisition module 330 is used to acquire second target data, which describes question-and-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request.

[0116] The second determining module 340 is used to determine a parameter prediction model based on the second target data and the pre-trained model. The parameter prediction model is used to describe the optimized model obtained after adjusting the pre-trained model, so as to perform final parameter prediction for the API request.

[0117] In this embodiment, optionally, the first acquisition module 310 is specifically used for:

[0118] Obtain parameter data of historical API requests from historical API parameter logs; obtain attribute data corresponding to the parameter data of historical API requests from the parameter specification file corresponding to the API parameter logs, wherein the parameter values ​​in the parameter declaration are range values ​​or rule values; divide the parameter data of historical API requests and the attribute data corresponding to the parameter data into multiple text segments according to a preset character length to obtain the first target data, wherein each text segment corresponds to parameter data and attribute data.

[0119] In this embodiment, optionally, a cleaning module is also included.

[0120] The cleaning module is used to clean the parameter data of the historical API requests, removing empty or duplicate parameter data corresponding to the same historical API request; and to clean the attribute data corresponding to the parameter data of the historical API requests, removing empty or duplicate attribute data corresponding to the same parameter data.

[0121] In this embodiment, the selection module is optional.

[0122] The selection module is used to select the parameter data that best matches the historical API request from the historical API parameter log if the parameter data of a historical API request is empty, and to use it as the parameter data corresponding to the historical API request; if the attribute data corresponding to the parameter data of a historical API request is empty, it selects the attribute data that best matches the historical API request from the parameter specification file corresponding to the historical API parameter log, and to use it as the attribute data corresponding to the parameter data of the historical API request.

[0123] In this embodiment, optionally, the second acquisition module 330 is specifically used for:

[0124] Obtain parameter data and attribute data corresponding to each text segment; construct a user question based on the parameter data and attribute data of each text segment, wherein the user question corresponds to the API request corresponding to the text segment; input each user question into a large language model, determine the response information corresponding to the user question based on the output of the large language model, wherein the response information is used to predict the user behavior corresponding to the user question; and determine each user question and the response information corresponding to each user question as the second target data.

[0125] In this embodiment, optionally, the first determining module 320 is specifically used for:

[0126] The first target data is used as a pre-training sample, and a first loss function is used to train the network model structure, which is used to describe the structure of the large language model; until the change in the first loss value corresponding to the trained model is less than a preset change threshold, the pre-trained model is obtained, and the first loss value is determined by the difference between the output result of the model obtained by training the network model structure and the reference result.

[0127] In this embodiment, optionally, the second determining module 340 is specifically used for:

[0128] The second target data is used as a fine-tuning training sample, and the second loss function is used to train the pre-trained model until the change in the second loss value corresponding to the trained model is less than a preset change threshold, thus obtaining the parameter prediction model. The second loss value is determined by the difference between the output result of the model obtained by training the pre-trained model and the reference result.

[0129] The training apparatus for the parameter prediction model provided in this disclosure can execute the above-described method embodiments. For the specific implementation principle and technical effects, please refer to the above-described method embodiments. This disclosure will not repeat them here.

[0130] Figure 4 This is a schematic diagram of a parameter prediction device provided in this embodiment. The parameter prediction device may include: a third acquisition module 410 and a third determination module 420. Wherein:

[0131] The third acquisition module 410 is used to acquire user input text, wherein the user input text is the text corresponding to the language interaction scenario.

[0132] The third determining module 420 is used to determine the target API parameter corresponding to the user input text in the user input text input parameter prediction model based on the output of the parameter prediction model; or, input the user input text into a pre-trained model and determine the first API parameter corresponding to the user input text based on the output of the pre-trained model, and input the user input text into the user input text input parameter prediction model and determine the second API parameter corresponding to the user input text based on the output of the parameter prediction model, and fuse the first API parameter and the second API parameter to obtain the target API parameter corresponding to the user input text.

[0133] Wherein, the parameter prediction model is the parameter prediction model trained by the method described in the above embodiments, and the pre-trained model is the pre-trained model trained by the method described in the above embodiments.

[0134] The parameter prediction device provided in this disclosure can execute the above method embodiments. Its specific implementation principle and technical effects can be found in the above method embodiments, and will not be repeated here.

[0135] This application also provides a computer device. Please refer to the following for details. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.

[0136] The computer device includes a memory 510 and a processor 520 that are interconnected via a system bus. It should be noted that only a computer device with components 510-520 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0137] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0138] The memory 510 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of a computer device, such as the hard disk or RAM of the computer device. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or FlashCard. Of course, the memory 510 may include both internal and external storage units of the computer device. In this embodiment, the memory 510 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the methods described above. Furthermore, the memory 510 may also be used to temporarily store various types of data that have been output or will be output.

[0139] The processor 520 is typically used to perform the overall operation of a computer device. In this embodiment, the memory 510 is used to store program code or instructions, including computer operation instructions. The processor 520 is used to execute the program code or instructions stored in the memory 510 or to process data, such as program code that runs the methods described above.

[0140] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0141] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.

[0142] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.

[0143] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.

[0144] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0145] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0146] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0147] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.

[0148] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A training method for a parameter prediction model, characterized in that, include: Obtain first target data, which includes: parameter data of historical application interface API requests and attribute data corresponding to the parameter data of the historical API requests. The attribute data is used to describe the parameter declaration of the parameter data of the historical API requests. The parameter declaration includes: parameter name definition and parameter value. Based on the first target data, a pre-trained model is determined, which is used to perform initial parameter prediction on the API request; Obtain second target data, which is used to describe question-answer data pairs corresponding to multiple user questions, each of which is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request; Based on the second target data and the pre-trained model, a parameter prediction model is determined. The parameter prediction model is used to describe the optimized model obtained after adjusting the pre-trained model, so as to perform final parameter prediction for the API request.

2. The method according to claim 1, characterized in that, The acquisition of the first target data includes: Retrieve parameter data from historical API request logs; Obtain the attribute data corresponding to the parameter data of the historical API request from the parameter specification file corresponding to the API parameter log. The parameter value in the parameter declaration is a range value or a rule value. The parameter data of the historical API request and the attribute data corresponding to the parameter data are divided into multiple text segments according to a preset character length to obtain the first target data. Each text segment corresponds to parameter data and attribute data.

3. The method according to claim 2, characterized in that, Also includes: Data cleaning is performed on the parameter data of the historical API requests to remove empty / duplicate parameter data corresponding to the same historical API request; Data cleaning is performed on the attribute data corresponding to the parameter data of the historical API requests to remove empty or duplicate attribute data corresponding to the same parameter data.

4. The method according to claim 3, characterized in that, Also includes: If the parameter data of a historical API request is empty, then the parameter data that best matches the historical API request is selected from the historical API parameter log and used as the parameter data corresponding to the historical API request. If the attribute data corresponding to the parameter data of a historical API request is empty, then the attribute data that best matches the historical API request is selected from the parameter specification file corresponding to the historical API parameter log, and used as the attribute data corresponding to the parameter data of the historical API request.

5. The method according to claim 2, characterized in that, The acquisition of the second target data includes: Obtain the parameter data and attribute data corresponding to each text segment; Based on the parameter data and attribute data corresponding to each text fragment, a user question is constructed, and the user question corresponds to the API request corresponding to the text fragment. Each user question is input into a large language model, and the response information corresponding to the user question is determined based on the output of the large language model. The response information is used to predict the user behavior corresponding to the user question. Each user question and the corresponding response information are identified as the second target data.

6. The method according to claim 1, characterized in that, The step of determining the pre-trained model based on the first target data includes: The first target data is used as a pre-training sample, and the first loss function is used to train the network model structure, which is used to describe the structure of the large language model. The pre-trained model is obtained when the change in the first loss value corresponding to the trained model is less than a preset change threshold. The first loss value is determined by the difference between the output result of the model obtained by training the network model structure and the reference result.

7. The method according to claim 1, characterized in that, The step of determining the parameter prediction model based on the second target data and the pre-trained model includes: The second target data is used as a fine-tuning training sample, and the pre-trained model is trained using the second loss function; The parameter prediction model is obtained when the change in the second loss value corresponding to the trained model is less than a preset change threshold. The second loss value is determined by the difference between the output result of the model obtained by training the pre-trained model and the reference result.

8. A parameter prediction method, characterized in that, include: Obtain user input text, wherein the user input text is the text corresponding to the language interaction scenario; In the user input text input parameter prediction model, the target API parameter corresponding to the user input text is determined based on the output of the parameter prediction model; Alternatively, the user input text is input into a pre-trained model, and the first API parameter corresponding to the user input text is determined based on the output of the pre-trained model. The user input text is input into a parameter prediction model, and the second API parameter corresponding to the user input text is determined based on the output of the parameter prediction model. The first API parameter and the second API parameter are then fused to obtain the target API parameter corresponding to the user input text. Wherein, the parameter prediction model is the parameter prediction model trained by the method of any one of claims 1-7, and the pre-trained model is the pre-trained model trained by the method of any one of claims 1-7.

9. A training device for a parameter prediction model, characterized in that, include: The first acquisition module is used to acquire first target data, which includes: parameter data of historical application interface (API) requests and attribute data corresponding to the parameter data of the historical API requests. The attribute data is used to describe the parameter declaration of the parameter data of the historical API requests. The parameter declaration includes: parameter name definition and parameter value. The first determining module is used to determine a pre-trained model based on the first target data, wherein the pre-trained model is used to perform initial parameter prediction for the API request; The second acquisition module is used to acquire second target data, which describes question-answer data pairs corresponding to multiple user questions. Each user question is constructed from the parameter data of the API request and the attribute data of the parameter data of the API request. The second determining module is used to determine a parameter prediction model based on the second target data and the pre-trained model. The parameter prediction model is used to describe the optimized model obtained after adjusting the pre-trained model, so as to perform final parameter prediction for the API request.

10. A parameter prediction device, characterized in that, include: The third acquisition module is used to acquire user input text, which is the text corresponding to the language interaction scenario. The third determining module is used to determine the target API parameter corresponding to the user input text in the user input text input parameter prediction model based on the output of the parameter prediction model; or, input the user input text into a pre-trained model and determine the first API parameter corresponding to the user input text based on the output of the pre-trained model, and input the user input text into the user input text input parameter prediction model and determine the second API parameter corresponding to the user input text based on the output of the parameter prediction model, and fuse the first API parameter and the second API parameter to obtain the target API parameter corresponding to the user input text; Wherein, the parameter prediction model is the parameter prediction model trained by the method of any one of claims 1-7, and the pre-trained model is the pre-trained model trained by the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Question and answer prediction model training method and device and question and answer prediction method and device

    CN111078854A

  • Parameter prediction model training method and device and parameter prediction method and device

    CN113194320A

  • Prediction system and method based on retail store and restaurant data

    CN113627992A