Model training method and device, computer readable storage medium and computer equipment
By matching target weights to the prefix parameters and dynamically adjusting the length of the prefix parameters, the problem of overfitting or underfitting in the prefix fine-tuning is solved, and the performance of the model on specific tasks is improved.
Patent Information
- Application Number
- CN202210461145.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-04-28
AI Technical Summary
Existing prefix fine-tuning methods, due to the fixed number of prefix parameters, cannot fully adapt to different downstream tasks, leading to overfitting or underfitting problems in the model.
By matching different target weights to the prefix parameters in the initial task model, the length of the prefix parameters is dynamically adjusted to optimize the model for a specific task.
It improves the model's performance on specific tasks, solves the overfitting or underfitting problems caused by excessively long or short prefixes, and enhances the model's adaptability.
Smart Images

Figure CN115018043B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, and in particular, to a model training method and device, a computer readable storage medium and a computer device. BACKGROUND
[0002] In order to apply the pre-training model to a downstream task, a conventional fine-tuning method usually needs to fine-tune all parameters of the model. For different downstream tasks, multiple different fine-tuned models need to be saved. With the popularity of large-scale pre-training models and the diversity of downstream tasks, the difficulty of fine-tuning training and the difficulty of parameter saving also increase. Prefix-tuning in lightweight fine-tuning usually freezes the pre-training model and only uses a small number of additional tasks to train the prefix parameters to adapt to the downstream task, which not only avoids forgetting the prior knowledge of the pre-training model, but also improves the time efficiency of training and the space efficiency of parameter storage. However, since the prefix parameters are artificially set and the number is fixed, the use of such prefixes to fine-tune the model cannot completely adapt to different tasks.
[0003] At present, no effective solution has been proposed for the above problems. SUMMARY
[0004] The embodiments of the present application provide a model training method and device, a computer readable storage medium and a computer device to at least solve the technical problem that the pre-training model with added prefixes may be over-fitted or under-fitted due to the prefixes being too long or too short.
[0005] According to an aspect of an embodiment of the present application, a model training method is provided, comprising: obtaining an initial task model, wherein the initial task model comprises a pre-training model and a set of prefix parameters, the prefix parameters being hyperparameters of the initial task model, used to adapt the initial task model to different tasks; training the initial task model based on training sample data to obtain target weights in the initial task model corresponding to the prefix parameters, wherein the training sample data corresponds to a target task; determining a target task model based on the target weights and the initial task model.
[0006] Optionally, the training of the initial task model based on the training sample data to obtain the target weights in the initial task model corresponding to the prefix parameters comprises: determining a pending weight corresponding to the prefix parameter based on the pre-training model; and optimizing training the pending weight of the initial task model and the prefix parameter based on the training sample data to obtain a target prefix parameter and a target weight corresponding to the target prefix parameter.
[0007] Optionally, the determining, based on the pre-trained model, the pending weight corresponding to the prefix parameter comprises: in a case where the pre-trained model comprises a plurality of network layers, the pending weight comprises an intra-layer pending weight; the determining, for any one of the prefix parameters, the intra-layer pending weight corresponding to the prefix parameter comprises: determining a target network layer corresponding to the any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers comprised by the pre-trained model; and obtaining a model parameter of a previous network layer of the target network layer in the pre-trained model; and the determining, based on the model parameter of the previous network layer, the intra-layer pending weight.
[0008] Optionally, the determining, based on the model parameter of the previous network layer, the intra-layer pending weight comprises: obtaining a learning feature of the previous network layer according to the model parameter of the previous network layer; and constructing the intra-layer pending weight according to the learning feature.
[0009] Optionally, the constructing the intra-layer pending weight according to the learning feature comprises: generating a pending factor; and converting the pending factor and the learning feature to a probability value interval by a logistic function to obtain the intra-layer pending weight.
[0010] Optionally, the determining, based on the pre-trained model, the pending weight corresponding to the prefix parameter comprises: in a case where the pre-trained model comprises a plurality of network layers, the pending weight comprises an inter-layer pending weight; the determining, for any one of the prefix parameters, the inter-layer pending weight corresponding to the prefix parameter comprises: determining the inter-layer pending weight corresponding to any one of the plurality of network layers; determining a target network layer corresponding to the any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers; and determining the inter-layer pending weight corresponding to the target network layer as the inter-layer pending weight corresponding to the any one of the prefix parameters.
[0011] Optionally, the method further comprises: sending the target weight and the prefix parameter to a first target device storing the pre-trained model, wherein the first target device is configured to generate the target task model according to the target weight, the prefix parameter and the pre-trained model.
[0012] Optionally, the pre-trained model comprises any one of the following: a pre-trained language model, a pre-trained image recognition model.
[0013] According to a further aspect of the embodiments of the present application, a model training method is also provided, comprising: sending training sample data to a second target device, wherein the training sample data corresponds to a target task; receiving a target weight and a prefix parameter returned by the second target device, wherein the prefix parameter is a set of hyperparameters of an initial task model, used to adapt the initial task model to different tasks, and the target weight is a weight corresponding to the prefix parameter obtained by training the initial task model based on the training sample data; and determining a target task model based on the target weight, the prefix parameter, and a pre-trained model pre-existing locally, wherein the pre-trained model is the same as a pre-trained model in the initial task model.
[0014] According to a further aspect of the embodiments of the present application, a model training apparatus is also provided, comprising: an obtaining module, configured to obtain an initial task model, wherein the initial task model comprises a pre-trained model and a set of prefix parameters, the prefix parameters being hyperparameters of the initial task model, used to adapt the initial task model to different tasks; a training module, configured to train the initial task model based on training sample data, to obtain a target weight corresponding to the prefix parameters in the initial task model, wherein the training sample data corresponds to a target task; and a first determining module, configured to determine a target task model based on the target weight and the initial task model.
[0015] According to a further aspect of the embodiments of the present application, a model training apparatus is also provided, comprising: a sending module, configured to send training sample data to a second target device, wherein the training sample data corresponds to a target task; a receiving module, configured to receive a target weight and a prefix parameter returned by the second target device, wherein the prefix parameter is a set of hyperparameters of an initial task model, used to adapt the initial task model to different tasks, and the target weight is a weight corresponding to the prefix parameter obtained by training the initial task model based on the training sample data; and a second determining module, configured to determine a target task model based on the target weight, the prefix parameter, and a pre-trained model pre-existing locally, wherein the pre-trained model is the same as a pre-trained model in the initial task model.
[0016] According to a further aspect of the embodiments of the present application, a computer readable storage medium is also provided, comprising a stored program, wherein the program, when executed, controls a device in which the computer readable storage medium is located to perform any of the model training methods described above.
[0017] According to another aspect of the embodiments of the present application, a computer device is also provided, comprising a memory and a processor, the memory storing a computer program, and the processor configured to execute the computer program stored in the memory, so that the processor performs the model training method according to any one of the embodiments of the present application.
[0018] In the embodiments of the present application, the weights are matched for the prefix parameters in the initial task model, different target weight values are matched for different prefix parameters through model training, the influence of each prefix parameter on the model is appropriately scaled, the purpose of dynamically adjusting the "length" of the prefix parameters of the pre-training model is achieved, the technical effect of improving the initial task model to improve the performance of the initial task model when processing specific tasks is achieved, and the technical problem that the pre-training model with prefix is prone to overfitting or underfitting due to the prefix being too long or too short is solved. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the principles of the present application, and do not limit the present application in any manner. In the drawings:
[0020] Figure 1 Fig. 1 shows a hardware structure block diagram of a computer terminal for implementing the model training method;
[0021] Figure 2 Fig. 2 is a flowchart of the model training method one according to the embodiments of the present application;
[0022] Figure 3 Fig. 3 is a structure schematic diagram of the dynamic prefix fine-tuning model according to the optional embodiments of the present application;
[0023] Figure 4 Fig. 4 is a flowchart of the model training method two according to the embodiments of the present application;
[0024] Figure 5 Fig. 5 is a structure block diagram of the model training device one according to the embodiments of the present application;
[0025] Figure 6 Fig. 6 is a structure block diagram of the model training device two according to the embodiments of the present application;
[0026] Figure 7 Fig. 7 is a structure block diagram of a computer terminal according to the embodiments of the present application. DETAILED DESCRIPTION
[0027] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work should belong to the protection scope of the present application.
[0028] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0029] First, some nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
[0030] The pre-trained model, i.e. the initial model trained with a larger data set, needs to be fine-tuned according to the characteristics of the target task when the pre-trained model is applied to the target task, so as to adapt the fine-tuned model to the target task.
[0031] Lightweight fine-tuning, which aims to adjust the model with a small number of parameters based on freezing the parameters of the pre-trained model, so that the adjusted model adapts to a specific target task and obtains better results.
[0032] Prefix-tuning, a lightweight fine-tuning method, adds a continuous task-specific vector sequence to the input, called prefix. Unlike prompt-tuning, the prefix is composed entirely of free parameters and does not correspond to a real token. It is similar to a virtual token. When optimizing the model, prefix-tuning only optimizes the prefix. By giving some prefixes in front of the input text data or each layer of the pre-trained model, the prior knowledge of the pre-trained model can be better mined, so that the model performs well in low-resource scenarios or with a small number of training parameters.
[0033] The prefix parameters, or the prefix in the prefix fine-tuning method, consist of free parameters. When optimizing the model, prefix fine-tuning only optimizes the prefix parameters and freezes the model parameters of the pre-trained model.
[0034] Example 1
[0035] According to an embodiment of the present invention, a method embodiment for model training is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0036] The method embodiment provided in Embodiment 1 of this application can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing a model training method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0037] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a form of processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0038] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the model training method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned vulnerability detection method for the application. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0039] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of computer terminal 10. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0040] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0041] Under the aforementioned operating environment, this application provides the following: Figure 2 The model training method shown is one. Figure 2 This is a flowchart of a model training method according to an embodiment of the present invention. Figure 2 As shown, the method includes the following steps:
[0042] Step S202: Obtain the initial task model, which includes a pre-trained model and a set of prefix parameters. The prefix parameters are the hyperparameters of the initial task model, used to adapt the initial task model to different tasks.
[0043] In this embodiment, the pre-trained model is an initial model trained on a large dataset. During subsequent fine-tuning for the target task, the parameters of the pre-trained model are no longer adjusted; it is essentially "frozen." The set of prefix parameters and the pre-trained model in this step constitute the initial task model, which is the prefix-tuning model. After fine-tuning, the prefix parameters, combined with the pre-trained model, allow the resulting model to be adapted to the downstream task.
[0044] It should be noted that the prefix parameter as a hyperparameter of the initial task model is a parameter directly set by the staff as an input, and the number of parameters is fixed, while the model parameters in the pre-trained model are obtained based on a large data set. In addition, the value of the prefix parameter can also be optimized by training, for example, after freezing the pre-trained model and keeping its model parameters unchanged, training the prefix parameter with a small sample set to obtain the specific value of the prefix parameter.
[0045] In step S204, the initial task model is trained based on the training sample data to obtain the target weight corresponding to the prefix parameter in the initial task model, wherein the training sample data corresponds to the target task.
[0046] Since the prefix parameter is a fixed number of hyperparameters set by the staff, and the learning ability of the pre-trained model is different, the number of parameters required is also different, so if the number of prefix parameters is too much or too little, it may cause overfitting or underfitting of the entire model, resulting in poor performance in processing the target task. However, the prior art cannot change the number of prefix parameters, so this technical problem cannot be solved. In this step, by matching the target weight for the prefix parameter, if some prefix parameters are given a lower target weight, the current prefix parameter is suppressed, reducing the influence of this part of the prefix parameter on the execution of the downstream target task, which is equivalent to reducing the overall "length" of the prefix parameter corresponding to the pre-trained model, and the "number" of prefix parameters is adjusted, making the adjusted target task model more suitable for executing the target task. Conversely, some other prefix parameters can also be amplified by the target weight.
[0047] In step S206, the target task model is determined based on the target weight and the initial task model. It should be noted that the target task model and the initial task model both include a pre-trained model, and the parameters of the pre-trained model remain the same. The target task model adds a target weight to the prefix parameter in the model, so that the initial task model is further optimized in the direction of adapting to the execution of the target task, improving the model performance in processing the target task.
[0048] Through the above steps, the prefix parameter in the initial task model is matched with the weight, and different target weight values are matched for different prefix parameters through model training, appropriately scaling the influence of each prefix parameter on the model, achieving the purpose of dynamically adjusting the "length" of the prefix parameter of the pre-trained model, thereby realizing the technical effect of improving the initial task model to improve its performance in processing specific tasks, and further solving the technical problem that the pre-trained model with added prefix may cause overfitting or underfitting due to the prefix being too long or too short.
[0049] As an optional embodiment, in order to obtain the value of the target weight, the model training manner can be used for continuous optimization. First, the undetermined weight corresponding to the prefix parameter can be determined based on the pre-trained model; and then the undetermined weight of the initial task model and the prefix parameter are optimized and trained based on the training sample data, to obtain the target prefix parameter and the target weight corresponding to the target prefix parameter.
[0050] The undetermined weight determined based on the pre-trained model can be an initial value of a weight. When determining the undetermined weight, the undetermined weight can be initialized according to the structure of the pre-trained model, the model parameters, and some features learned by the pre-trained model. In this optional embodiment, the optimization process of the weight of the prefix parameter can be synchronized with the optimization process of the prefix parameter itself in the machine learning-based training, or only the weight can be optimized. The undetermined weight of the initial task model is optimized and trained based on the training sample data, to obtain the target weight. It should be noted that the values of the plurality of target weights do not need to be normalized. Through training and optimization, if the values of the target weights of part of the prefix parameters are close to 0, it means that the influence of these part of the prefix parameters on the model is “eliminated”. Although these prefix parameters are not deleted, they have the effect of reducing the number of prefix parameters in a disguised manner, so that the target task model can have better performance.
[0051] As an optional embodiment, based on the pre-trained model, the undetermined weight corresponding to the prefix parameter can include the following manner: in the case that the pre-trained model includes a plurality of network layers, the undetermined weight includes an intra-layer undetermined weight; determining the intra-layer undetermined weight corresponding to any one of the prefix parameters includes: determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers included in the pre-trained model; obtaining the model parameters of the last network layer of the target network layer in the pre-trained model; and determining the intra-layer undetermined weight based on the model parameters of the last network layer.
[0052] Optionally, the pre-training model can be a deep neural network model comprising a plurality of network layers, each network layer corresponding to a plurality of prefix parameters, and the layer-to-be-determined weight being a layer weight assigned to the plurality of prefix parameters corresponding to each network layer. By assigning the layer-to-be-determined weight to the prefix parameters of each network layer and optimizing the layer-to-be-determined weight to a layer-target weight through model training, the purpose of assigning different numbers of prefix parameters to different network layers can be achieved, and the learning ability of the prefix can be dynamically adjusted. For the pre-training model, the knowledge and learning ability contained in each network layer are different, and the required prefix length for different tasks is also different. Therefore, the method of assigning the same number of prefix parameters to each network layer in the prior art cannot fully adapt to different network layers and different tasks of the model. By adding a layer-to-be-determined weight to the prefix parameters of different network layers and training the layer-to-be-determined weight to obtain a layer-target weight, the prefix parameters corresponding to each network layer can be suppressed or amplified, which is equivalent to reducing or increasing the number of prefix parameters corresponding to the network layer, and the dynamic adjustment of the number of prefix parameters of the entire lightweight fine-tuning model is realized, so that the model can better adapt to the target task.
[0053] As an optional embodiment, determining the layer-to-be-determined weight based on the model parameters of the previous network layer can include the following steps: obtaining a learning feature of the previous network layer according to the model parameters of the previous network layer; and constructing the layer-to-be-determined weight according to the learning feature.
[0054] By obtaining the model parameters of the previous network layer of the pre-training model, and then specifying the layer-to-be-determined weight of the current network layer according to the model parameters, the initial construction of the parameters of the next layer can be facilitated by using the information, knowledge and training results of the previous layer. Optionally, the learning feature of the previous network layer can include a classification feature CLS (classification, CLS for short), and other tokens of the previous layer can also be used to assist in constructing the layer-to-be-determined weight.
[0055] As an optional embodiment, constructing the layer-to-be-determined weight according to the learning feature can include generating a to-be-determined factor; and converting the to-be-determined factor and the learning feature to a probability value interval through a logistic function to obtain the layer-to-be-determined weight. The to-be-determined factor represents the parameters in the layer-to-be-determined weight that need to be automatically learned in the model training process. Through the logistic function, the to-be-determined factor and the learning feature of the previous network layer can be converted to a probability value, and the probability value interval ranges from 0 to 1. The probability value is determined as the value of the layer-to-be-determined weight. Subsequently, the layer-to-be-determined weight can be combined with an initial task model to form a to-be-trained model, and then the to-be-trained model is trained using training sample data to obtain the value of the to-be-determined factor, i.e., to determine the target value of the layer-to-be-determined weight corresponding to each prefix parameter.
[0056] Optionally, the undetermined weights within the layer can be constructed according to the following formula:
[0057] α i =sigmoid(w·[CLS]) i-1 )
[0058] Where, α i The undetermined weights corresponding to the target network layer are represented by , where i represents the layer number of the target network layer, and w represents the undetermined factor. [CLS] i-1 The target network layer represents the learned feature of the previous network layer, and sigmoid represents the logistic function.
[0059] As an optional embodiment, the undetermined weights corresponding to the prefix parameters can also be determined in the following manner: when the pre-trained model includes multiple network layers, the undetermined weights include inter-layer undetermined weights; determining the inter-layer undetermined weights corresponding to any one of the prefix parameters includes: determining the inter-layer undetermined weights corresponding to any one of the multiple network layers; determining the target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the multiple network layers; and determining the inter-layer undetermined weights corresponding to the target network layer as the inter-layer undetermined weights corresponding to any one of the prefix parameters.
[0060] Compared to intra-layer undetermined weights, inter-layer undetermined weights can be viewed as coarse-grained weight coefficients. Corresponding to different network layers of the pre-trained model, each network layer can have an inter-layer undetermined weight. Each prefix parameter of the network layer needs to be suppressed or amplified using this inter-layer undetermined weight. This weight coefficient can adjust the weight ratio between all prefix parameters of the network layer and the model parameters of the pre-trained model of the network layer. This inter-layer undetermined weight can also be automatically learned through model training, that is, the target value corresponding to the inter-layer undetermined weight is learned, and the target value is the target weight.
[0061] As an optional implementation, when the pre-trained model includes multiple network layers, the undetermined weights can include two parts: inter-layer undetermined weights and intra-layer undetermined weights. Similarly, the target weights can also include two parts: inter-layer target weights and intra-layer target weights. After model training and optimization, the inter-layer undetermined weights are optimized into inter-layer target weights, and the intra-layer undetermined weights are optimized into intra-layer target weights. The inter-layer target weights can be called coarse-grained parameters, and the intra-layer target weights can be called fine-grained parameters. For the prefix parameters of the initial task model, multiplying the original prefix parameters by the fine-grained and coarse-grained parameters respectively yields the target prefix parameters in the target task model. For example, the parameters of the i-th layer of the target task model can be represented as follows: h i ′←[h i ;λ i ·α i ·Δhi ]。
[0062] wherein, h i denotes the sum of the model parameters of the i-th layer of the pre-training model and the prefix parameters corresponding to the layer in the initial task model, Δh i denotes the prefix parameters corresponding to the i-th layer of the pre-training model, λ i denotes the inter-layer target weight corresponding to the i-th layer, i.e., the coarse-grained parameter, α i denotes the intra-layer target weight corresponding to the i-th layer, i.e., the fine-grained parameter, h i denotes the parameters of the i-th layer of the target task model after the weights with the prefix parameters are introduced.
[0063] As an optional embodiment, after obtaining the target task model, the target weights and the prefix parameters can be sent to a first target device storing the pre-training model, wherein the first target device is configured to generate the target task model according to the target weights, the prefix parameters and the pre-training model. In this embodiment, the pre-training model can be pre-stored in the first target device for executing the downstream task, and only the target weights and the prefix parameters need to be downloaded from the server to generate the target task model locally. Through the transmission and storage of the very light prefix parameter data and the target weight data, the model data transmission pressure and the model data storage pressure of the first target device are greatly reduced.
[0064] As an optional embodiment, the pre-training model includes any one of the following: a pre-training language model, a pre-training image recognition model. The pre-training language model can include a prefix-tuning model. The prefix-tuning model adds trainable continuous tokens, called prefixes, to the beginning of each layer of the pre-training model and the input. During training, the model parameters of the pre-training model are fixed, and only the prefix parameters are updated. In addition, the above method can also be applied to a transformer-based language model to improve parameter utilization, reduce parameter redundancy, reduce overfitting, and help improve the effect of the pre-training model trained on public datasets when processing downstream tasks, and better complete the task. For example, when the pre-training model is a language model and the target task is a reasoning task, the accuracy of using the prefix-tuning model to reason whether there is a correlation between the question and the answer is 66%, and by adding target weights to the prefix parameters, the accuracy of the reasoning task can be improved to 68%, which obviously improves the performance of the model on a specific downstream task.
[0065] Figure 3 is a structural diagram of a dynamic prefix fine-tuning model according to an optional embodiment of the present application, as shown in Figure 3As shown, Prefix-tuning refers to a model that consists of a fixed-length, fixed-number prefix parameter and a frozen pre-trained model. Dynamic Prefix-tuning refers to a model that consists of prefix parameters, target weights corresponding to the prefix parameters, and a frozen pre-trained model. Figure 3 The pre-trained model in the diagram consists of multiple network layers, specifically layers 1 through N. Each layer corresponds to the model parameters and a set of prefix parameters of the pre-trained model. In the diagram, fine-grained parameters represent the target weights or undetermined weights within a layer, while coarse-grained parameters represent the target weights or undetermined weights between layers, depending on whether the dynamically tuned prefix model has been trained. As shown in the diagram, each coarse-grained parameter covers all prefix parameters within a layer; that is, all prefix parameters in that layer correspond to the same coarse-grained parameter. This parameter adjusts the weight ratio between the overall prefix parameters and the model parameters of that layer. Fine-grained parameters assign a weight value to each prefix parameter in a layer. Through these fine-grained parameters, the prefix parameters within each layer can be suppressed or amplified, achieving dynamic adjustment of the "number" of prefix parameters between different layers. This makes the final dynamically tuned prefix model more suitable for the target task. Figure 3 The dynamic prefix fine-tuning model in the above method is a specific embodiment of the target task model.
[0066] Example 2
[0067] This application also provides, as follows: Figure 4 The second model training method shown is... Figure 4 This is a flowchart of model training method two according to an embodiment of the present invention. Figure 4 As shown, the method includes the following steps:
[0068] Step S402: Send training sample data to the second target device, wherein the training sample data corresponds to the target task.
[0069] Step S404: Receive the target weights and prefix parameters returned by the second target device. The prefix parameters are a set of hyperparameters of the initial task model, used to adapt the initial task model to different tasks. The target weights are the weights corresponding to the prefix parameters obtained by training the initial task model based on training sample data.
[0070] Step S406: Determine the target task model based on the target weights, prefix parameters, and the pre-trained model stored locally, wherein the pre-trained model is the same as the pre-trained model in the initial task model.
[0071] Through the above steps, a method that can be applied to a terminal device is provided, and a target task model is obtained through data interaction between the terminal device and a second target device to realize fast training and generated in the terminal device. The second target device in the embodiment can be a server, and the terminal device is used to execute a downstream target task, which needs to obtain a target task model capable of executing the target task. At this time, the terminal device can send training sample data corresponding to the target task to the second target device. The second target device trains the initial task model with the prefix fine-tuning model based on the model type, adds target weights to the prefix parameters in the model, and obtains a target task model adapted to the target task. Then, the second target device can return only the prefix parameters and the target weights to the terminal device. Both of the two kinds of data are lightweight data, and the transmission speed is fast. The terminal storage is not under pressure. The terminal device can generate the target task model in the terminal device based on the pre-trained model pre-stored in the terminal device combined with the prefix parameters and the target weights, complete the fast creation and transmission of the model, improve the generation speed of the model and the adaptability to the target task, and improve the performance of the model by adding weights to the prefix parameters.
[0072] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0073] Through the description of the above embodiments, those skilled in the art can clearly understand that the model training method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions to make a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute the method of each embodiment of the present application.
[0074] Embodiment 3
[0075] According to the embodiments of the present application, a device for implementing the above model training method one is also provided, Figure 5 is a structural block diagram of the model training device one according to the embodiments of the present application, like Figure 5As shown, the model training apparatus 50 includes an obtaining module 52, a training module 54 and a first determining module 56, and the following describes each part of the apparatus:
[0076] The obtaining module 52 is configured to obtain an initial task model, where the initial task model includes a pre-training model and a set of prefix parameters, and the prefix parameters are hyperparameters of the initial task model and are used to adapt the initial task model to different tasks.
[0077] The training module 54 is connected to the obtaining module 52 and is configured to train the initial task model based on training sample data to obtain target weights corresponding to the prefix parameters in the initial task model, where the training sample data corresponds to a target task.
[0078] The first determining module 56 is connected to the training module 54 and is configured to determine a target task model based on the target weights and the initial task model.
[0079] It should be noted that the obtaining module 52, the training module 54 and the first determining module 56 correspond to steps S202 to S206 in Embodiment 1, and the multiple modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the modules as part of the apparatus can run in the computer terminal 10 provided in Embodiment 1.
[0080] Embodiment 4
[0081] According to the embodiments of the present application, a device for implementing the above-mentioned model training method two is further provided, Figure 6 is a structural block diagram of the model training apparatus two according to the embodiments of the present application, as Figure 6 shown, the model training apparatus two 60 includes a sending module 62, a receiving module 64 and a second determining module 66, and the following describes each part of the model training apparatus two 60:
[0082] The sending module 62 is configured to send training sample data to a second target device, where the training sample data corresponds to a target task.
[0083] The receiving module 64 is connected to the sending module 62 and is configured to receive target weights and prefix parameters returned by the second target device, where the prefix parameters are a set of hyperparameters of an initial task model and are used to adapt the initial task model to different tasks, and the target weights are weights corresponding to the prefix parameters obtained by training the initial task model based on the training sample data.
[0084] The second determining module 66 is connected to the receiving module 64, and is configured to determine a target task model based on the target weight, the prefix parameter, and a pre-trained model pre-stored in the local, wherein the pre-trained model is the same as the pre-trained model in the initial task model.
[0085] It should be noted that the sending module 62, the receiving module 64, and the second determining module 66 correspond to steps S402 to S406 in Embodiment 2, and the plurality of modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 2. It should be noted that the modules as part of the device can run in the computer terminal 10 provided in Embodiment 1.
[0086] Embodiment 5
[0087] The embodiments of the present application can provide a computer terminal, which can be any one of the computer terminal devices in the computer terminal group. Alternatively, in the present embodiment, the computer terminal can be replaced by a terminal device such as a mobile terminal.
[0088] Alternatively, in the present embodiment, the computer terminal can be located in at least one of the plurality of network devices in the computer network.
[0089] In the present embodiment, the computer terminal can execute the program code of the following steps in the model training method of the application program: obtaining an initial task model, wherein the initial task model includes a pre-trained model and a set of prefix parameters, and the prefix parameters are hyperparameters of the initial task model, and are used to adapt the initial task model to different tasks; training the initial task model based on training sample data to obtain target weights corresponding to the prefix parameters in the initial task model, wherein the training sample data correspond to a target task; and determining a target task model based on the target weights and the initial task model.
[0090] Alternatively, Figure 7 is a structural block diagram of a computer terminal according to an embodiment of the present application. As shown in the figure, the computer terminal can include one or more (only one is shown in the figure) processors, memories, and the like. Figure 7
[0091] The memory can be configured to store software programs and modules, such as program instructions / modules corresponding to the model training method and device in the embodiments of the present application. The processor executes various functions and data processing by running the software programs and modules stored in the memory, that is, implements the model training method described above. The memory can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the computer terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0092] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining an initial task model, wherein the initial task model includes a pre-training model and a set of prefix parameters, the prefix parameters being hyperparameters of the initial task model, and being used to adapt the initial task model to different tasks; training the initial task model based on training sample data to obtain target weights corresponding to the prefix parameters in the initial task model, wherein the training sample data corresponds to a target task; and determining a target task model based on the target weights and the initial task model.
[0093] Optionally, the processor can further execute program codes of the following steps: training the initial task model based on the training sample data to obtain the target weights corresponding to the prefix parameters in the initial task model, including: determining the to-be-determined weights corresponding to the prefix parameters based on the pre-training model; and optimizing training the to-be-determined weights of the initial task model and the prefix parameters based on the training sample data to obtain the target prefix parameters and the target weights corresponding to the target prefix parameters.
[0094] Optionally, the processor can further execute program codes of the following steps: determining the to-be-determined weights corresponding to the prefix parameters based on the pre-training model, including: in the case that the pre-training model includes a plurality of network layers, the to-be-determined weights include: intra-layer to-be-determined weights; determining the intra-layer to-be-determined weights corresponding to any one of the prefix parameters, including: determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers included in the pre-training model; obtaining model parameters of a previous network layer of the target network layer in the pre-training model; and determining the intra-layer to-be-determined weights based on the model parameters of the previous network layer.
[0095] Optionally, the processor can further execute program codes of the following steps: determining the intra-layer to-be-determined weights based on the model parameters of the previous network layer, including: obtaining a learning feature of the previous network layer according to the model parameters of the previous network layer; and constructing the intra-layer to-be-determined weights according to the learning feature.
[0096] Optionally, the processor can further execute program codes of the following steps: constructing the to-be-determined weight in the layer according to the learning feature, comprising: generating a to-be-determined factor; converting the to-be-determined factor and the learning feature into a probability value interval by a logistic function to obtain the to-be-determined weight in the layer.
[0097] Optionally, the processor can further execute program codes of the following steps: determining the to-be-determined weight corresponding to the prefix parameter based on the pre-trained model, comprising: in the case that the pre-trained model comprises a plurality of network layers, the to-be-determined weight comprises: an inter-layer to-be-determined weight; determining the inter-layer to-be-determined weight corresponding to any one of the prefix parameters, comprising: determining the inter-layer to-be-determined weight corresponding to any one of the network layers; determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers; determining the inter-layer to-be-determined weight corresponding to the target network layer as the inter-layer to-be-determined weight corresponding to any one of the prefix parameters.
[0098] Optionally, the processor can further execute program codes of the following steps: sending the target weight and the prefix parameter to a first target device storing the pre-trained model, wherein the first target device is configured to generate the target task model according to the target weight, the prefix parameter and the pre-trained model.
[0099] Optionally, the pre-trained model can comprise any one of the following: a pre-trained language model, a pre-trained image recognition model.
[0100] Optionally, the processor can further execute program codes of the following steps: sending the training sample data to a second target device, wherein the training sample data corresponds to the target task; receiving the target weight and the prefix parameter returned by the second target device, wherein the prefix parameter is a set of hyperparameters of the initial task model, used to adapt the initial task model to different tasks, and the target weight is a weight corresponding to the prefix parameter obtained by training the initial task model based on the training sample data; determining the target task model based on the target weight, the prefix parameter and the pre-trained model pre-existing locally, wherein the pre-trained model is the same as the pre-trained model in the initial task model.
[0101] Those skilled in the art can understand that, Figure 7 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, etc. Figure 7 It does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 70 can further include more Figure 7more or less components than those shown, such as no network interface, one network interface, multiple network interfaces, etc., or a different configuration of components than those shown. Figure 7
[0102] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructing the terminal device related hardware through a program, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0103] Embodiment 6
[0104] The embodiments of the present application also provide a computer readable storage medium. Optionally, in the present embodiment, the above-mentioned computer readable storage medium can be used to save the program code executed by the model training method provided in the above-mentioned embodiment 1.
[0105] Optionally, in the present embodiment, the above-mentioned storage medium can be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0106] Optionally, in the present embodiment, the storage medium is configured to store program code for performing the following steps: obtaining an initial task model, wherein the initial task model comprises a pre-training model and a set of prefix parameters, and the prefix parameters are hyperparameters of the initial task model, and are used to adapt the initial task model to different tasks; training the initial task model based on training sample data to obtain target weights corresponding to the prefix parameters in the initial task model, wherein the training sample data corresponds to a target task; and determining a target task model based on the target weights and the initial task model.
[0107] Optionally, in the present embodiment, the storage medium is configured to store program code for performing the following steps: training the initial task model based on the training sample data to obtain the target weights corresponding to the prefix parameters in the initial task model, comprising: determining the to-be-determined weights corresponding to the prefix parameters based on the pre-training model; and performing optimization training on the to-be-determined weights of the initial task model and the prefix parameters based on the training sample data to obtain the target prefix parameters and the target weights corresponding to the target prefix parameters.
[0108] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: determining the pending weight corresponding to the prefix parameter based on the pre-trained model, including: in the case that the pre-trained model includes a plurality of network layers, the pending weight includes: an intra-layer pending weight; determining the intra-layer pending weight corresponding to any one of the prefix parameters, including: determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers included in the pre-trained model; obtaining a model parameter of a previous network layer of the target network layer in the pre-trained model; and determining the intra-layer pending weight based on the model parameter of the previous network layer.
[0109] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: determining the intra-layer pending weight based on the model parameter of the previous network layer, including: obtaining a learning feature of the previous network layer according to the model parameter of the previous network layer; and constructing the intra-layer pending weight according to the learning feature.
[0110] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: constructing the intra-layer pending weight according to the learning feature, including: generating a pending factor; and converting the pending factor and the learning feature to a probability value interval by a logistic function to obtain the intra-layer pending weight.
[0111] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: determining the pending weight corresponding to the prefix parameter based on the pre-trained model, including: in the case that the pre-trained model includes a plurality of network layers, the pending weight includes: an inter-layer pending weight; determining the inter-layer pending weight corresponding to any one of the prefix parameters, including: determining the inter-layer pending weight corresponding to any one of the network layers in the plurality of network layers; determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers; and determining the inter-layer pending weight corresponding to the target network layer as the inter-layer pending weight corresponding to any one of the prefix parameters.
[0112] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: the method further includes: sending the target weight and the prefix parameter to a first target device storing the pre-trained model, wherein the first target device is configured to generate a target task model according to the target weight, the prefix parameter, and the pre-trained model.
[0113] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: the pre-trained model includes any one of the following: a pre-trained language model, a pre-trained image recognition model.
[0114] Optionally, in the embodiment, the storage medium is configured to store program code for performing the following steps: sending training sample data to the second target device, wherein the training sample data corresponds to the target task; receiving the target weight and the prefix parameter returned by the second target device, wherein the prefix parameter is a set of hyperparameters of the initial task model, and is used to adapt the initial task model to different tasks, and the target weight is a weight corresponding to the prefix parameter obtained by training the initial task model based on the training sample data; and determining the target task model based on the target weight, the prefix parameter, and the pre-trained model pre-existing locally, wherein the pre-trained model is the same as the pre-trained model in the initial task model.
[0115] The serial numbers of the above embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0116] In the above embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0117] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other means. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0118] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0119] In addition, each functional unit in each embodiment of the application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0120] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0121] The above is only the preferred embodiment of the present application, it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, can make a number of improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A model training method, characterized in that, The method comprises: acquiring an initial task model, wherein the initial task model comprises a pre-training model and a set of prefix parameters, the prefix parameters being hyperparameters of the initial task model, and the prefix parameters being used for adapting the initial task model to different tasks; training, based on training sample data, a to-be-determined weight corresponding to the prefix parameters in the initial task model and the prefix parameters, to obtain a target weight corresponding to the prefix parameters in the initial task model, wherein the training sample data correspond to a target task, and the to-be-determined weight is determined based on the pre-training model; determining a target task model based on the target weight and the initial task model; the pre-training model comprises a pre-training image recognition model; in a case where the pre-training model comprises a plurality of network layers, the training, based on the training sample data, of the to-be-determined weight corresponding to the prefix parameters in the initial task model comprises: determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers comprised by the pre-training model; constructing the to-be-determined weight based on a previous network layer of the target network layer.
2. The method of claim 1, wherein, the to-be-determined weight comprises an intra-layer to-be-determined weight, and the constructing the to-be-determined weight based on the previous network layer of the target network layer comprises: acquiring model parameters of the previous network layer of the target network layer in the pre-training model; determining the intra-layer to-be-determined weight based on the model parameters of the previous network layer.
3. The method of claim 2, wherein, the determining the intra-layer to-be-determined weight based on the model parameters of the previous network layer comprises: acquiring learning features of the previous network layer according to the model parameters of the previous network layer; constructing the intra-layer to-be-determined weight according to the learning features.
4. The method of claim 3, wherein, the constructing the intra-layer to-be-determined weight according to the learning features comprises: generating a to-be-determined factor; converting the to-be-determined factor and the learning features to a probability value interval by a logistic function to obtain the intra-layer to-be-determined weight.
5. The method of claim 1, wherein, in a case where the pre-training model comprises a plurality of network layers, the to-be-determined weight comprises an inter-layer to-be-determined weight; the determining the inter-layer to-be-determined weight corresponding to any one of the prefix parameters comprises: determining the inter-layer to-be-determined weight corresponding to any one of the network layers; determining a target network layer corresponding to any one of the prefix parameters, wherein the target network layer is one of the plurality of network layers; determining the inter-layer to-be-determined weight corresponding to the target network layer as the inter-layer to-be-determined weight corresponding to the any one of the prefix parameters. The method further comprises:
6. The method of claim 1, wherein, sending the target weight and the prefix parameters to a first target device storing the pre-training model, wherein the first target device is configured to generate the target task model according to the target weight, the prefix parameters, and the pre-training model. The method comprises:
7. A model training method, comprising: sending training sample data to a second target device, wherein the training sample data correspond to a target task; receive a target weight and a prefix parameter returned by the second target device, the prefix parameter being a set of hyperparameters of an initial task model, and the target weight being a weight corresponding to the prefix parameter obtained by training the initial task model based on training sample data, the initial task model including a set of pending weights corresponding to the prefix parameter, the set of pending weights being determined based on a pre-trained model, the second target device being in a case where the pre-trained model includes a plurality of network layers; determine a target network layer corresponding to any one of the prefix parameters, the target network layer being one of the plurality of network layers included in the pre-trained model; and construct the set of pending weights based on a previous network layer of the target network layer; determine a target task model based on the target weight, the prefix parameter, and a pre-trained model pre-stored locally, the pre-trained model being the same as a pre-trained model in the initial task model; wherein the pre-trained model includes a pre-trained image recognition model.
8. A model training apparatus, comprising: The method comprises: an obtaining module configured to obtain an initial task model, the initial task model including a pre-trained model and a set of prefix parameters, the prefix parameters being hyperparameters of the initial task model, and the prefix parameters being used to adapt the initial task model to different tasks; a training module configured to train a set of pending weights corresponding to the prefix parameters in the initial task model and the prefix parameters based on training sample data, to obtain a target weight corresponding to the prefix parameters in the initial task model, the training sample data corresponding to a target task, and the set of pending weights being determined based on the pre-trained model; a first determining module configured to determine a target task model based on the target weight and the initial task model; wherein the pre-trained model includes a pre-trained image recognition model; the training module is further configured to, in a case where the pre-trained model includes a plurality of network layers, determine a target network layer corresponding to any one of the prefix parameters, the target network layer being one of the plurality of network layers included in the pre-trained model, and construct the set of pending weights based on a previous network layer of the target network layer.
9. A model training apparatus, comprising: The method comprises: a sending module configured to send training sample data to a second target device, the training sample data corresponding to a target task. The receiving module is configured to receive a target weight returned by the second target device and a prefix parameter, wherein the prefix parameter is a set of hyperparameters of an initial task model, and is used to adapt the initial task model to different tasks, the initial task model comprises a pre-trained model and the set of hyperparameters, the target weight is a weight corresponding to the prefix parameter, which is obtained by training a pending weight corresponding to the prefix parameter and the prefix parameter in the initial task model based on training sample data, the pending weight is determined based on the pre-trained model, and the second target device determines a target network layer corresponding to any one of the prefix parameters in a case where the pre-trained model comprises a plurality of network layers, wherein the target network layer is one of the plurality of network layers comprised in the pre-trained model; and the pending weight is constructed based on a previous network layer of the target network layer. The second determining module is configured to determine a target task model based on the target weight, the prefix parameter, and a pre-trained model pre-stored locally, wherein the pre-trained model is the same as the pre-trained model in the initial task model. The pre-trained model comprises a pre-trained image recognition model.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium comprises a stored program, wherein the program controls a device where the computer-readable storage medium is located to perform the model training method in any one of claims 1 to 7 when the program is running.
11. A computer device, comprising: Comprise: a memory and a processor, The memory stores a computer program; The processor is configured to execute the computer program stored in the memory, and the computer program makes the processor execute the model training method in any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Field identification method based on prefix tree features and convolutional neural network
CN113553844A
Automatic input method and device based on translation, equipment and computer storage medium
CN113761945A