Method for performing various information extraction tasks based on uie and adapter
By using adapters and adapter fusion layers in the UIE model, fine-tuning for a variety of information extraction tasks solves the problems of knowledge forgetting and inter-task influence in traditional methods, and improves the performance and efficiency of information extraction tasks.
Patent Information
- Application Number
- CN202410726743.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-01
AI Technical Summary
When facing a variety of specific information extraction tasks, traditional fine-tuning methods tend to forget the knowledge learned in previous tasks, and multi-task learning is difficult to balance the impact of different tasks and the gap in data set size.
Adopting a method based on UIE and adapter, by loading the pre-trained UIE model as the base model, and loading and training the adapter and adapter fusion layer for each information extraction task, freezing the base model parameters, and only training the adapter, forming a multi-faceted model. A model for information extraction tasks.
It effectively solves the problem of historical forgetting and high GPU occupancy, avoids the mutual influence between tasks, and improves the performance of information extraction tasks.
Abstract
Description
Technical Field
[0001] The invention relates to the field of software technology, and in particular to a method for performing multiple information extraction tasks based on UIe and an adapter. Background Art
[0002] The UIE model is a general information extraction model. The pre-trained UIE model can directly perform various information extraction tasks. However, when applied to specific information extraction tasks in specific scenarios, the pre-trained UIE model needs to be fine-tuned to achieve better performance in specific information extraction tasks. When facing multiple specific information extraction tasks at the same time, traditional methods mainly include sequential fine-tuning and multi-task learning. However, the former is prone to forgetting the knowledge learned in the previous task, and the latter has different tasks that affect each other, and it is difficult to balance tasks with large differences in data set size. Summary of the invention
[0003] In order to solve the above problems, the present invention proposes a method for performing multiple information extraction tasks based on uie and adapter to obtain better performance when facing multiple information extraction tasks in specific scenarios:
[0004] A method for performing multiple information extraction tasks based on uie and adapter, comprising the following steps:
[0005] S1: Load the pre-trained uie model as the base model;
[0006] S2: Load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model, and then load the pre-trained adapter fusion layer onto the base model to obtain an information extraction model for multiple information extraction tasks;
[0007] S3: Use the information extraction model to perform information extraction tasks.
[0008] Preferably, for various information extraction tasks, the process of training corresponding adapters is as follows:
[0009] For each information extraction task, load a pre-trained uie model as the base model, and load an adapter to be trained on the base model to obtain the model to be trained;
[0010] Use the training data corresponding to each information extraction task to train the corresponding model to be trained. During the training process, freeze the parameters of the base model in the model to be trained, and only train the adapter in the model to be trained, and finally obtain the pre-trained adapter corresponding to each information extraction task.
[0011] Preferably, the process of training the adapter fusion layer is:
[0012] Load the pre-trained uie model as the base model, and then load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model; then load an adapter fusion layer to be trained onto the base model;
[0013] Use the training data of all the information extraction tasks that need to be performed for training. During the training process, freeze the parameters of other parts except the adapter fusion layer, and only train the adapter fusion layer, and finally obtain the pre-trained adapter fusion layer.
[0014] Beneficial effect: The present invention applies an adapter to the uie model. By adding adapters corresponding to different information extraction tasks and adding an adapter fusion layer, the historical forgetting problem, high GPU occupancy rate and the problem of different tasks affecting each other in traditional methods can be effectively solved. DETAILED DESCRIPTION
[0015] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0016] A method for performing multiple information extraction tasks based on uie and adapter, comprising the following steps:
[0017] S1: Load the pre-trained uie model as the base model;
[0018] S2: Load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model, and then load the pre-trained adapter fusion layer onto the base model to obtain an information extraction model for multiple information extraction tasks;
[0019] The specific structures of the adapter and the adapter fusion layer belong to the prior art and will not be described in detail in the present invention. The method of loading the adapter into the base model and the method of loading the adapter fusion layer into the base model are described in the official documents of the corresponding libraries and will not be described in detail here.
[0020] S3: Use the information extraction model to perform information extraction tasks.
[0021] The process of training corresponding adapters for various information extraction tasks:
[0022] For each information extraction task, load a pre-trained uie model as the base model, and load an adapter to be trained on the base model to obtain the model to be trained;
[0023] Use the training data corresponding to each information extraction task to train the corresponding model to be trained. During the training process, freeze the parameters of the base model in the model to be trained, and only train the adapter in the model to be trained, and finally obtain the pre-trained adapter corresponding to each information extraction task.
[0024] The process of training the adapter fusion layer:
[0025] Load the pre-trained uie model as the base model, and then load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model; then load an adapter fusion layer to be trained onto the base model;
[0026] Use the training data of all the information extraction tasks that need to be performed for training. During the training process, freeze the parameters of other parts except the adapter fusion layer, and only train the adapter fusion layer, and finally obtain the pre-trained adapter fusion layer.
[0027] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for performing multiple information extraction tasks based on uie and adapter, which is characterized by , The following steps are involved: S1: Load the pre-trained uie model as the base model; S2: Load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model, and then load the pre-trained adapter fusion layer onto the base model to obtain an information extraction model for multiple information extraction tasks; S3: Use the information extraction model to perform information extraction tasks.
2. According to the method for performing multiple information extraction tasks based on uie and adapter according to claim 1, it is characterized in that, for multiple information extraction tasks, the corresponding adapter is trained: For each information extraction task, load a pre-trained uie model as the base model, and load an adapter to be trained on the base model to obtain the model to be trained; Use the training data corresponding to each information extraction task to train the corresponding model to be trained. During the training process, freeze the parameters of the base model in the model to be trained, and only train the adapter in the model to be trained, and finally obtain the pre-trained adapter corresponding to each information extraction task.
3. According to claim 1, a method for performing multiple information extraction tasks based on uie and adapter, characterized in that , The process of training the adapter fusion layer: Load the pre-trained uie model as the base model, and then load the pre-trained adapters corresponding to each information extraction task to be performed onto the base model; then load an adapter fusion layer to be trained on the base model; Use the training data of all the information extraction tasks that need to be performed for training. During the training process, freeze the parameters of other parts except the adapter fusion layer, and only train the adapter fusion layer to finally obtain the pre-trained adapter fusion layer.
