Model training method and device, model application method and device, electronic equipment and medium

By personalizing the training parameters in the base model, a target model that meets the specific application scenarios of users is generated, which solves the problem that existing models are difficult to meet personalized needs and achieves efficient and personalized model generation.

CN119692428APending Publication Date: 2025-03-25CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411741958.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing artificial intelligence models are difficult to meet the personalized needs of users. Due to the lack of professional technical knowledge and computing resources, ordinary users find it difficult to train models that meet personalized needs on their own.

Method used

A model training method is proposed. By obtaining multiple training tasks, training the training parameters in the pedestal model based on the training data in each training task, and obtaining the target model. The method includes obtaining training parameters, receiving uploaded data for sample construction, obtaining training data from the sample library, and training and storing parameters in the base model.

Benefits of technology

It realizes efficiently generating a target model that is more suitable for user-specific application scenarios, meets user personalized needs, and reduces the requirements for professional technical knowledge and computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692428A_ABST
    Figure CN119692428A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model training method and device, a model application method and device, electronic equipment and a medium. The model training method comprises the steps that a plurality of training tasks are acquired, each training task comprises training parameters and a plurality of training data, the training data comprise first data and second data, the first data are used for being input to a base model, the second data are true values of data output by the base model under the condition that the first data are input to the base model, and the first data are input to the base model; the training parameters are parameters related to personalized demands of the user in the base model; and according to each training task, executing the following processing: training training parameters belonging to the training task in the base model through training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameters of the training task. According to the embodiment of the invention, the parameters related to the personalized demands of the user in the base model can be trained, so that the model meeting the personalized demands of the user is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a model training method, a model application method, a device, an electronic device and a medium. Background Art

[0002] In the current technological environment, the training of AI models usually requires professional technical knowledge and expensive computing resources. Although there are many pre-trained models on the market, these models can meet the general needs of users to a certain extent, but they often cannot accurately adapt to the personalized needs of specific users. Ordinary users find it difficult to train models that meet personalized needs due to their lack of professional machine learning background and sufficient computing resources. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a model training method, a model application method, a device, an electronic device and a medium, aiming to solve the problem that existing models are difficult to meet the personalized needs of users.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a model training method, which is applied to a first electronic device, and the method includes:

[0005] Acquire multiple training tasks, each of which includes training parameters and multiple training data, the training data includes first data and second data, the first data is used to be input into the base model, the second data is the true value of the data output by the base model when the first data is input into the base model, and the training parameters are parameters in the base model related to the personalized needs of the user;

[0006] For each training task, the following processing is performed:

[0007] The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

[0008] In some implementations, obtaining a plurality of training tasks includes:

[0009] For each of the training tasks, perform the following processing:

[0010] Get training parameters;

[0011] Receiving uploaded data, and performing sample construction on the uploaded data to obtain a plurality of training data;

[0012] and / or,

[0013] receiving a first input, wherein the first input is used to select a target scene from a plurality of preset scenes;

[0014] In response to the first input, a plurality of the training data corresponding to the target scene are acquired from a sample library, wherein the sample library includes the training data corresponding to each of the preset scenes.

[0015] In some implementations, obtaining training parameters includes:

[0016] Displaying multiple parameters of the base model, each of which is a parameter related to the personalized needs of the user;

[0017] receiving a second input for a plurality of said parameters;

[0018] In response to the second input, the parameters selected by the second input are used as the training parameters.

[0019] In some implementations, after training the training parameters in the base model belonging to the training task using the training data in the training task to obtain the target model corresponding to the training task and the first parameter value of the training parameter of the training task, the method further includes:

[0020] Storing the target model corresponding to the training task in the first database;

[0021] The identifier of the user who constructs the training task, the model identifier of the target model corresponding to the training task, and the first corresponding relationship between the training parameters in the training task are stored in the first database.

[0022] In a second aspect, an embodiment of the present application proposes a model application method, which is applied to a second electronic device, and the method includes:

[0023] Get the dialogue text and the first model identifier;

[0024] Matching the first model identifier with a model identifier in a pre-acquired second corresponding relationship to obtain a training parameter corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and a training parameter corresponding to each of the model identifiers;

[0025] Obtaining a first parameter value of a training parameter corresponding to the first model identifier, where the first parameter value is obtained by training using the model training method described in any embodiment of the first aspect;

[0026] Replacing the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model;

[0027] The dialogue text is input into the target model to obtain a reply text of the dialogue text.

[0028] In some implementations, obtaining a first parameter value of a training parameter corresponding to the first model identifier includes:

[0029] Obtain a first parameter value of a training parameter corresponding to the first model identifier from a first electronic device or a third electronic device, wherein the third electronic device is a device for performing online processing on a target model in the first electronic device; after completing the online processing of the target model, the third electronic device stores the first parameter value of the training parameter corresponding to the model identifier of the target model, and the model identifier of the target model that has completed the online processing and the training parameters corresponding to the model identifier are recorded in the second corresponding relationship.

[0030] In a third aspect, an embodiment of the present application proposes a model training device, the device comprising:

[0031] A task acquisition module, used to acquire multiple training tasks, each of which includes training parameters and multiple training data, the training data includes first data and second data, the first data is used to be input into the base model, the second data is the true value of the data output by the base model when the first data is input into the base model, and the training parameters are parameters in the base model related to the personalized needs of the user;

[0032] The parameter training module is used to perform the following processing according to each training task:

[0033] The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

[0034] In some implementations, obtaining a plurality of training tasks includes:

[0035] For each of the training tasks, perform the following processing:

[0036] Get training parameters;

[0037] Receiving uploaded data, and performing sample construction on the uploaded data to obtain a plurality of training data;

[0038] and / or,

[0039] receiving a first input, wherein the first input is used to select a target scene from a plurality of preset scenes;

[0040] In response to the first input, a plurality of the training data corresponding to the target scene are acquired from a sample library, wherein the sample library includes the training data corresponding to each of the preset scenes.

[0041] In some implementations, obtaining training parameters includes:

[0042] Displaying multiple parameters of the base model, each of which is a parameter related to the personalized needs of the user;

[0043] receiving a second input for a plurality of said parameters;

[0044] In response to the second input, the parameters selected by the second input are used as the training parameters.

[0045] In some embodiments, after training the training parameters belonging to the training task in the base model using the training data in the training task to obtain the target model corresponding to the training task and the first parameter value of the training parameter of the training task, the apparatus is further used to:

[0046] Storing the target model corresponding to the training task in the first database;

[0047] The identifier of the user who constructs the training task, the model identifier of the target model corresponding to the training task, and the first corresponding relationship between the training parameters in the training task are stored in the first database.

[0048] In a fourth aspect, an embodiment of the present application provides a model application device, the device comprising:

[0049] A data acquisition module, used to acquire the conversation text and the first model identifier;

[0050] a parameter matching module, configured to match the first model identifier with a model identifier in a pre-acquired second corresponding relationship to obtain a training parameter corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and a training parameter corresponding to each of the model identifiers;

[0051] A parameter acquisition module, used to acquire a first parameter value of a training parameter corresponding to the first model identifier, wherein the first parameter value is obtained by training using the model training method described in any embodiment of the first aspect;

[0052] A parameter replacement module, used to replace the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model;

[0053] The text reply module is used to input the dialogue text into the target model to obtain a reply text of the dialogue text.

[0054] In some implementations, obtaining a first parameter value of a training parameter corresponding to the first model identifier includes:

[0055] Obtain a first parameter value of a training parameter corresponding to the first model identifier from a first electronic device or a third electronic device, wherein the third electronic device is a device for performing online processing on a target model in the first electronic device; after completing the online processing of the target model, the third electronic device stores the first parameter value of the training parameter corresponding to the model identifier of the target model, and the model identifier of the target model that has completed the online processing and the training parameters corresponding to the model identifier are recorded in the second corresponding relationship.

[0056] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the model training method described in the first aspect when executing the computer program.

[0057] To achieve the above-mentioned purpose, the sixth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the model training method described in the first aspect above.

[0058] The model training method, model application method, device, electronic device and medium proposed in the present application obtain multiple training tasks, and train the training parameters in the base model according to the training data in each training task to obtain a target model. The training parameters are parameters related to the personalized needs of the user. By training the training parameters, the training parameters corresponding to each training task, i.e., the first parameter value, are obtained; that is, the data related to the personalized needs of the user in the base model are trained to efficiently generate a target model that is more suitable for the user's specific application scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a flowchart of the model training method provided in the embodiment of the present application;

[0060] Figure 2 yes Figure 1 A schematic flow chart of step S101 in FIG.

[0061] Figure 3 It is a flow chart of the model application method provided in the embodiment of the present application;

[0062] Figure 4 It is a structural schematic diagram of a model training device provided in an embodiment of the present application;

[0063] Figure 5It is a structural schematic diagram of a model application device provided in an embodiment of the present application;

[0064] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0066] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0068] First, some nouns involved in this application are analyzed:

[0069] Base Model: refers to a pre-trained model in deep learning and machine learning. These models are usually trained on large-scale data sets and have strong feature extraction capabilities. The base model can be used as the basis for building more complex models. Through transfer learning technology, the knowledge of the base model can be transferred to specific tasks, thereby improving the performance and training efficiency of the model. Common base models include natural language processing (NLP) models, such as the BERT model, GPT model, etc., and also include computer vision models, such as the ResNet model, ViT model, etc.

[0070] Training Task: In the field of machine learning and artificial intelligence, it refers to the process of using a data set to train a model so that it can perform a specific task. A training task usually includes a training data set, a validation data set, model parameters, etc. In the embodiment of the present application, the first data is used as the training data set, the second data is used as the validation data set, and the training parameters are used as the model parameters.

[0071] In the current technical environment, the training of artificial intelligence models usually requires professional technical knowledge to build training tasks that meet the requirements, and because the training data of some models is large, a large amount of computing resources are required to train the models. Although there are many pre-trained models on the market, such as base models, these models can meet the general needs of users to a certain extent, but they often cannot accurately adapt to the personalized needs of specific users. Ordinary users find it difficult to train models that meet personalized needs by themselves due to the lack of professional machine learning background and sufficient computing resources.

[0072] Based on this, the embodiments of the present application provide a model training method, a model application method, an apparatus, an electronic device and a medium, aiming to solve the problem that the existing models are difficult to meet the personalized needs of users.

[0073] The model training method, model application method, device, electronic device and medium provided in the embodiments of the present application are specifically illustrated by the following embodiments. First, the model training method in the embodiments of the present application is described.

[0074] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0075] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0076] The model training method provided in the embodiment of the present application relates to the field of artificial intelligence. The model training method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms; the software can be an application that implements the model training method, etc., but is not limited to the above forms.

[0077] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0078] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0079] The embodiment of the present application provides a model training method, which can be executed by a first electronic device, and the first electronic device can be implemented as a server or a terminal. Figure 1 This is a flow chart of the model training method provided in the embodiment of the present application, please refer to Figure 1 The model training method provided in the embodiment of the present application may include but is not limited to steps S101 to S102.

[0080] Step S101, obtaining multiple training tasks, each of the training tasks including training parameters and multiple training data, the training data including first data and second data, the first data being used to be input into a base model, the second data being the true value of the data output by the base model when the first data is input into the base model, and the training parameters being parameters in the base model related to the user's personalized needs.

[0081] In this step, users can select training tasks that meet their own needs in the training task database according to their needs, or they can upload corresponding training tasks to train the base model. There is no limitation here. The training task includes training parameters and multiple training data. The training parameters can be default training parameters or training parameters selected by the user. The training data includes data input into the base model, i.e., first data, and also includes the true value of the data output by the base model, i.e., second data. The first data is used as the input of the base model, the training parameters in the base model are trained, and the predicted value of the base model is supervised and adjusted through the second data to obtain the target model.

[0082] Exemplarily, the training samples include inquiry texts in a preset scenario and reply texts corresponding to the inquiry texts; the default training parameters in the base model are trained using a plurality of training samples to obtain a target model.

[0083] Step S102: According to each training task, perform the following processing:

[0084] The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

[0085] In this step, the training data includes first data (input data) and second data (true value data). The first data is used to input into the base model, and the second data is the output that the base model should generate when receiving the first data. Parameters in the base model related to the user's personalized needs are selected for targeted training.

[0086] Specifically, the first data is taken as input, forward propagated through the base model, the output of the base model is compared with the second data, the loss function is calculated, and then the training parameters belonging to the training task in the base model are updated through the back-propagation algorithm to reduce the value of the loss function, and the above training process is repeated. The training parameters are optimized through multiple iterations until the preset standards are reached to obtain the target model, which includes a first parameter and a second parameter. The first parameter is the training parameter value in the base model after training with the training sample, and the second parameter is the shared parameter value in the base model.

[0087] In another implementation, during the process of training the base model using a plurality of the training samples, if a first parameter of the base model is trained, the first parameter is used as a parameter in the base model related to the personalized needs of the user; after the base model training is completed, a target model is obtained, and a second parameter of the target model adopts a preset shared parameter value, and the second parameter is a parameter included in the base model except the first parameter.

[0088] Through the above steps S101 to S102, the first electronic device obtains multiple training tasks, and according to the training data in each training task, trains the training parameters in the base model to obtain a target model, wherein the training parameters are parameters related to the personalized needs of the user. By training the training parameters, the training parameters corresponding to each training task, i.e., the first parameter value, are obtained; that is, the data related to the personalized needs of the user in the base model is trained to efficiently generate a target model that is more suitable for the user's specific application scenario.

[0089] In some implementations, obtaining multiple training tasks in step S101 may include, but is not limited to, the following:

[0090] For each of the training tasks, perform the following processing:

[0091] Get training parameters;

[0092] Receiving uploaded data, and performing sample construction on the uploaded data to obtain a plurality of training data;

[0093] and / or,

[0094] receiving a first input, wherein the first input is used to select a target scene from a plurality of preset scenes;

[0095] In response to the first input, a plurality of the training data corresponding to the target scene are acquired from a sample library, wherein the sample library includes the training data corresponding to each of the preset scenes.

[0096] In this implementation, a set of initial training parameters is determined for each training task. The initial training parameters can be default training parameters or training parameters selected by the user, which are not limited here. The training data can be uploaded by the user himself, or the user can select the target scene and then match the target scene from the sample library according to the target scene.

[0097] If the training data is uploaded by the user himself, the original data uploaded by the user, such as text data, image data or video data, is received, and the original data uploaded by the user is preprocessed to generate sample data suitable for training.

[0098] Specifically, the original data uploaded by the user is cleaned to remove invalid or erroneous data, the data is standardized and normalized to make it meet the input requirements of the base model, and the data is labeled to obtain sample data. The sample data is divided into training set, validation set and test set to complete the sample construction and obtain multiple training data.

[0099] In some implementations, a scene selection instruction from the user, i.e., a first input, is accepted, and a target scene is selected from a plurality of preset scenes. The preset scenes are a plurality of application scenes corresponding to the training data in a sample library. The sample library is a plurality of training data collected in advance. The sample library stores a collection of training data pre-built and stored for each preset scene.

[0100] In this embodiment, when the user has high personalized requirements, sufficient professional knowledge or a large amount of training data, he or she can choose to upload the training data to train the base model to obtain a target model that meets the user's personalized needs. If the user's professional knowledge is insufficient or the training data is small, the user can select a target application scenario that meets his or her needs from the sample library. The sample library contains the training data corresponding to the target application scenario. The above method allows users to quickly and conveniently generate a target model that meets their requirements.

[0101] In some embodiments, Figure 2 As shown, obtaining multiple training tasks in step S101 may include but is not limited to steps S1011 to S1013.

[0102] Step S1011: display multiple parameters of the base model, each of which is related to the user's personalized needs.

[0103] Step S1012: Receive a second input for the plurality of parameters.

[0104] Step S1013: In response to the second input, use the parameters selected by the second input as the training parameters.

[0105] In this implementation, all parameters related to the user's personalized needs are extracted from the base model. A parameter list can be generated based on the extracted parameters and displayed to the user; or the extracted parameters can be directly displayed to the user. The form of expression of the parameters is not limited here. The user issues a selection instruction, which is the second input. The second input indicates the parameters selected by the user that are related to his or her personalized needs, and the parameters selected by the user are used as training parameters.

[0106] Exemplarily, the parameters in the base model related to the user's personalized needs are parameters A, B, and C. Parameters A, B, and C are displayed to the user. When the user selects parameter A, parameter A is used as the training parameter of the base model. Parameter A is trained according to the training data previously selected by the user to obtain a target detection model.

[0107] In this implementation, the user can select the parameters that need to be trained in the base model, so as to perform targeted training on the parameters in the base model and generate parameters that meet the user's personalized needs.

[0108] In some implementations, after training the training parameters in the base model belonging to the training task using the training data in the training task in step S102 to obtain the target model corresponding to the training task and the first parameter value of the training parameter of the training task, the method may further include, but is not limited to, the following contents:

[0109] Storing the target model corresponding to the training task in the first database;

[0110] The identifier of the user who constructs the training task, the model identifier of the target model corresponding to the training task, and the first corresponding relationship between the training parameters in the training task are stored in a first database. The first database can be a relational database or a NoSQL database, which is not limited here.

[0111] In this implementation, the structure and parameters of the target model are serialized, and the serialized model is stored in the first database. For each training task, the user identifier of the user who selects the training task is identified, and the user identifier includes but is not limited to the user name, user ID or other unique identifier. A unique identifier is assigned to the target model generated for each training task to distinguish different models, and the parameters in the target model related to the user's personalized needs, i.e., the first parameter value, are recorded.

[0112] Construct a correspondence between the user identifier, the model identifier, and the first parameter value. The correspondence can be expressed in a data table or a dictionary, which is not limited here. The correspondence between the user identifier, the model identifier, and the first parameter value is also stored in the first database to ensure association with the records of the target model.

[0113] In this implementation, by maintaining the correspondence between the user identifier, the model identifier, and the first parameter value in the first database, it is helpful to quickly find the corresponding model according to the user identifier or the model identifier when the model is used subsequently.

[0114] To summarize, the model training method provided in the embodiment of the present application obtains multiple training tasks, and according to the training data in each training task, trains the training parameters in the base model to obtain a target model, wherein the training parameters are parameters related to the personalized needs of the user, and the training parameters corresponding to each training task, i.e., the first parameter value, are obtained by training the training parameters; that is, the data related to the personalized needs of the user in the base model is trained to efficiently generate a target model that is more in line with the user's specific application scenarios.

[0115] Based on the target model obtained through training, the embodiment of the present application provides a model application method, which can be executed by a second electronic device, which can be implemented as a server or a terminal. Figure 3 This is a flow chart of the model application method provided in the embodiment of the present application, please refer to Figure 3 The model application method provided in the embodiment of the present application may include but is not limited to steps S301 to S305.

[0116] Step S301, obtaining a dialogue text and a first model identifier.

[0117] In this step, the dialog text input by the user and the model identifier selected by the user, ie, the first model identifier, are received.

[0118] Exemplarily, the user inputs the dialogue text "Hello, I want to know about product xx", and specifies the model with the model identifier "model123" to answer.

[0119] Step S302, matching the first model identifier with the model identifier in the pre-acquired second corresponding relationship to obtain the training parameters corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and the training parameters corresponding to each of the model identifiers.

[0120] In this step, a correspondence between the model identifier and the training parameters of each target model in the first database, that is, the second correspondence, is pre-constructed. After obtaining the first model identifier, a match is performed based on the first model identification and the model identifier in the second correspondence to find out whether there are training parameters corresponding to the first model identifier. If so, it means that the model is a pre-trained target model. If not, it means that the model has not been pre-trained.

[0121] Step S303: Obtain a first parameter value of a training parameter corresponding to the first model identifier, wherein the first parameter value is obtained by training using the model training method described in any embodiment of the first aspect.

[0122] In this step, the first parameter value is a parameter value obtained by training using the model training method of the first aspect.

[0123] Step S304: Replace the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model.

[0124] In this step, the base model is a pre-trained model. The base model is usually trained on a large-scale data set and has a strong feature extraction capability. The base model can be used as the basis for building a more complex model. Through the transfer learning technology, the knowledge of the base model is transferred to a specific task, thereby improving the performance and training efficiency of the model. For example, the BERT model and GPT model belonging to the natural language processing model can be used as the base model, and the ResNet model and ViT model belonging to the computer vision model can also be used as the base model, which is not limited here; load the pre-trained base model, replace the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value, and use the base model with modified training parameters as the target model.

[0125] Step S305, inputting the dialogue text into the target model to obtain a reply text of the dialogue text.

[0126] In this step, the dialogue text is input into the target model, the target model generates a corresponding reply text for the dialogue text, and feeds the reply text back to the user.

[0127] Through the above steps S301 to S305, by obtaining the dialogue text and model identification, the user's input can be understood more accurately, and the response strategy can be adjusted according to different model identifications so that the output of the model is more in line with the user's expectations. By matching the model identification and the corresponding training parameters, it can be ensured that the model parameters most suitable for the current dialogue context are used, which helps to improve the quality and accuracy of the response to the user input. By replacing the parameter values ​​in the base model to generate the target model, the model update iteration can be quickly realized, which greatly saves time and computing resources.

[0128] In some implementations, obtaining the first parameter value of the training parameter corresponding to the first model identifier in step S303 may include, but is not limited to, the following contents:

[0129] Obtain a first parameter value of a training parameter corresponding to the first model identifier from a first electronic device or a third electronic device, wherein the third electronic device is a device for performing online processing on a target model in the first electronic device; after completing the online processing of the target model, the third electronic device stores the first parameter value of the training parameter corresponding to the model identifier of the target model, and the model identifier of the target model that has completed the online processing and the training parameters corresponding to the model identifier are recorded in the second corresponding relationship.

[0130] In this implementation, the first electronic device is a device for model training, which may be a server or workstation with powerful computing capabilities; the second electronic device is a device for users to use the model, which may be a server or a terminal; the third electronic device is a device for users to put the trained models online for processing. Because a large number of models are trained in the first electronic device, some of the models are put online for processing according to actual needs. For example, a target model with a higher frequency of use may be put online for processing, that is, the correspondence between the model identifier of the target model and the first parameter value of the corresponding training parameter data, that is, the second correspondence, is stored in the third electronic device, so that during use, the corresponding first parameter value can be quickly matched according to the model identifier, thereby improving the efficiency of generating the target model.

[0131] In summary, the model application method provided in the embodiment of the present application can more accurately understand the user's input by acquiring the conversation text and model identification, and adjust the response strategy according to different model identifications so that the output of the model is more in line with the user's expectations. By matching the model identification and the corresponding training parameters, it can ensure that the model parameters most suitable for the current conversation context are used, which helps to improve the quality and accuracy of the response to the user input. By replacing the parameter values ​​in the base model to generate the target model, the model can be updated and iterated quickly, which greatly saves time and computing resources.

[0132] Figure 4 This is a schematic diagram of the structure of the model training device provided in the embodiment of the present application. Figure 4 The embodiment of the present application further provides a model training device 400, which can implement the above-mentioned model training method. The model training device 400 includes:

[0133] A task acquisition module 401 is used to acquire a plurality of training tasks, each of which includes training parameters and a plurality of training data, wherein the training data includes first data and second data, wherein the first data is used to be input into a base model, and the second data is the true value of the data output by the base model when the first data is input into the base model, and the training parameters are parameters in the base model related to the personalized needs of the user;

[0134] The parameter training module 402 is used to perform the following processing according to each training task:

[0135] The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

[0136] In some implementations, the task acquisition module 401 is further configured to:

[0137] For each of the training tasks, perform the following processing:

[0138] Get training parameters;

[0139] Receiving uploaded data, and performing sample construction on the uploaded data to obtain a plurality of training data;

[0140] and / or,

[0141] receiving a first input, wherein the first input is used to select a target scene from a plurality of preset scenes;

[0142] In response to the first input, a plurality of the training data corresponding to the target scene are acquired from a sample library, wherein the sample library includes the training data corresponding to each of the preset scenes.

[0143] In some implementations, the task acquisition module 401 is further configured to:

[0144] Displaying multiple parameters of the base model, each of which is a parameter related to the personalized needs of the user;

[0145] receiving a second input for a plurality of said parameters;

[0146] In response to the second input, the parameters selected by the second input are used as the training parameters.

[0147] In some implementations, the parameter training module 402 is further configured to:

[0148] Storing the target model corresponding to the training task in the first database;

[0149] The identifier of the user who constructs the training task, the model identifier of the target model corresponding to the training task, and the first corresponding relationship between the training parameters in the training task are stored in the first database.

[0150] The specific implementation of the model training device 400 is basically the same as the specific implementation of the above-mentioned model training method, and will not be repeated here.

[0151] When the electronic device is started, the model training device 400 obtains multiple training tasks, and according to the training data in each training task, trains the training parameters in the base model to obtain a target model, wherein the training parameters are parameters related to the personalized needs of the user. By training the training parameters, the training parameters corresponding to each training task, i.e., the first parameter value, are obtained; that is, the data related to the personalized needs of the user in the base model is trained to efficiently generate a target model that is more in line with the user's specific application scenarios.

[0152] Figure 5This is a schematic diagram of the structure of the model application device provided in the embodiment of the present application. Figure 5 The embodiment of the present application further provides a model application device 500, which can implement the above-mentioned model application method. The model application device 500 includes:

[0153] A data acquisition module 501 is used to acquire a conversation text and a first model identifier;

[0154] A parameter matching module 502 is used to match the first model identifier with a model identifier in a pre-acquired second corresponding relationship to obtain a training parameter corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and a training parameter corresponding to each of the model identifiers;

[0155] A parameter acquisition module 503 is used to acquire a first parameter value of a training parameter corresponding to the first model identifier, where the first parameter value is obtained by training using the model training method described in any embodiment of the first aspect;

[0156] A parameter replacement module 504 is used to replace the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model;

[0157] The text reply module 505 is used to input the dialogue text into the target model to obtain a reply text of the dialogue text.

[0158] In some implementations, the parameter matching module 502 is further configured to:

[0159] Obtain a first parameter value of a training parameter corresponding to the first model identifier from a first electronic device or a third electronic device, wherein the third electronic device is a device for performing online processing on a target model in the first electronic device; after completing the online processing of the target model, the third electronic device stores the first parameter value of the training parameter corresponding to the model identifier of the target model, and the model identifier of the target model that has completed the online processing and the training parameters corresponding to the model identifier are recorded in the second corresponding relationship.

[0160] The specific implementation of the model application device 500 is basically the same as the specific implementation example of the above-mentioned model application method, and will not be repeated here.

[0161] When the electronic device is started, the model application device 500 can understand the user's input more accurately by obtaining the dialogue text and model identification, and adjust the response strategy according to different model identifications to make the model output more in line with the user's expectations. By matching the model identification and the corresponding training parameters, it can ensure that the model parameters most suitable for the current dialogue context are used, which helps to improve the quality and accuracy of the response to the user input. By replacing the parameter values ​​in the base model to generate the target model, the model can be updated and iterated quickly, which greatly saves time and computing resources.

[0162] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned model training method when executing the computer program. The electronic device can be any intelligent terminal including a desktop computer, a tablet computer, a mobile phone, and a car computer.

[0163] See also Figure 6 , Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application, wherein the electronic device includes:

[0164] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0165] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the model training method of the embodiment of this application;

[0166] Input / output interface 903, used to implement information input and output;

[0167] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0168] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0169] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0170] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned model training method and model application method.

[0171] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0172] The model training method provided in the embodiment of the present application obtains multiple training tasks, and trains the training parameters in the base model according to the training data in each training task to obtain a target model. The training parameters are parameters related to the personalized needs of the user. By training the training parameters, the training parameters corresponding to each training task, i.e., the first parameter value, are obtained; that is, the data related to the personalized needs of the user in the base model is trained to efficiently generate a target model that is more suitable for the user's specific application scenario.

[0173] The model application method provided in the embodiment of the present application can more accurately understand the user's input by acquiring the conversation text and model identification, and adjust the response strategy according to different model identifications so that the output of the model is more in line with the user's expectations. By matching the model identification and the corresponding training parameters, it can ensure that the model parameters most suitable for the current conversation context are used, which helps to improve the quality and accuracy of the response to the user input. By replacing the parameter values ​​in the base model to generate the target model, the model can be updated and iterated quickly, which greatly saves time and computing resources.

[0174] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0175] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0176] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0177] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0178] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0179] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0180] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0181] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0182] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0183] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0184] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A model training method, characterized in that: Applied to a first electronic device, the method includes: Acquire multiple training tasks, each of which includes training parameters and multiple training data, the training data includes first data and second data, the first data is used to be input into the base model, the second data is the true value of the data output by the base model when the first data is input into the base model, and the training parameters are parameters in the base model related to the personalized needs of the user; For each training task, the following processing is performed: The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

2. The method according to claim 1, characterized in that The obtaining of multiple training tasks includes: For each of the training tasks, perform the following processing: Get training parameters; Receiving uploaded data, and performing sample construction on the uploaded data to obtain a plurality of training data; and / or, receiving a first input, wherein the first input is used to select a target scene from a plurality of preset scenes; In response to the first input, a plurality of the training data corresponding to the target scene are acquired from a sample library, wherein the sample library includes the training data corresponding to each of the preset scenes.

3. The method according to claim 2, characterized in that The obtaining of training parameters includes: Displaying multiple parameters of the base model, each of which is a parameter related to the personalized needs of the user; receiving a second input for a plurality of said parameters; In response to the second input, the parameters selected by the second input are used as the training parameters.

4. The method according to claim 1, characterized in that: After training the training parameters belonging to the training task in the base model by the training data in the training task to obtain the target model corresponding to the training task and the first parameter value of the training parameter of the training task, the method further includes: Storing the target model corresponding to the training task in the first database; The identifier of the user who constructs the training task, the model identifier of the target model corresponding to the training task, and the first corresponding relationship between the training parameters in the training task are stored in the first database.

5. A model application method, characterized in that: Applied to a second electronic device, the method includes: Get the dialogue text and the first model identifier; Matching the first model identifier with a model identifier in a pre-acquired second corresponding relationship to obtain a training parameter corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and a training parameter corresponding to each of the model identifiers; Obtaining a first parameter value of a training parameter corresponding to the first model identifier, where the first parameter value is obtained by training using the model training method according to any one of claims 1 to 4; Replacing the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model; The dialogue text is input into the target model to obtain a reply text of the dialogue text.

6. The method according to claim 5, characterized in that The obtaining a first parameter value of a training parameter corresponding to the first model identifier includes: Obtain a first parameter value of a training parameter corresponding to the first model identifier from a first electronic device or a third electronic device, wherein the third electronic device is a device for performing online processing on a target model in the first electronic device; after completing the online processing of the target model, the third electronic device stores the first parameter value of the training parameter corresponding to the model identifier of the target model, and the model identifier of the target model that has completed the online processing and the training parameters corresponding to the model identifier are recorded in the second corresponding relationship.

7. A model training device, characterized in that: The device comprises: A task acquisition module, used to acquire multiple training tasks, each of which includes training parameters and multiple training data, the training data includes first data and second data, the first data is used to be input into the base model, the second data is the true value of the data output by the base model when the first data is input into the base model, and the training parameters are parameters in the base model related to the personalized needs of the user; The parameter training module is used to perform the following processing according to each training task: The training parameters in the base model belonging to the training task are trained using the training data in the training task to obtain a target model corresponding to the training task and a first parameter value of the training parameter of the training task.

8. A model application device, characterized in that: The device comprises: A data acquisition module, used to acquire the conversation text and the first model identifier; a parameter matching module, configured to match the first model identifier with a model identifier in a pre-acquired second corresponding relationship to obtain a training parameter corresponding to the first model identifier, wherein the second corresponding relationship includes at least one model identifier and a training parameter corresponding to each of the model identifiers; A parameter acquisition module, used to acquire a first parameter value of a training parameter corresponding to the first model identifier, wherein the first parameter value is obtained by training using the model training method according to any one of claims 1 to 4; A parameter replacement module, used to replace the parameter value of the training parameter corresponding to the first model identifier in the base model with the first parameter value to obtain a target model; The text reply module is used to input the dialogue text into the target model to obtain a reply text of the dialogue text.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the model training method as described in any one of claims 1 to 4, and / or the model application method as described in any one of claims 5 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the model training method as described in any one of claims 1 to 4, and / or the model application method as described in any one of claims 5 to 6.

Citation Information

Cited By

  • Video processing model training method, video processing method, electronic equipment, storage medium and computer program product

    CN121169713A