Universal evaluation method and device for continuous learning model and electronic equipment
By testing the continuous learning model and the single-task model for classification tasks and general text representation, the universality of the continuous learning model in the continuous learning scenario is evaluated, which solves the problem of difficulty in evaluating the universality of the continuous learning model in the existing technology and realizes the universality of the model. Accurate assessment of sexual changes and improved multi-task accuracy.
Patent Information
- Application Number
- CN202310255313.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-02
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-03-02
AI Technical Summary
The existing technology is difficult to effectively evaluate the versatility of the continuous learning model and the changes in general representation of text in the continuous learning scenario, which limits the exploration and improvement of this scenario.
By using the target classification task and the probe task to conduct classification task tests and text general representation tests on the continuous learning language model and the single-task language model, the accuracy and test result differences between the two are calculated to determine the target general evaluation results, expressed Generalizability changes in continuous learning models.
It achieves accurate assessment of changes in the versatility of continuous learning models, can effectively control the text universal representation ability of a single model, increase the diversity of model applications, avoid training separate models for each classification task, and improve the accuracy of multiple classification tasks.
Smart Images

Figure CN118586444A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and electronic device for evaluating the universality of a continuous learning model. Background Art
[0002] Existing evaluations of continuous learning models mainly focus on the effectiveness of the tasks that the continuous learning models have learned. This ignores the growth potential and storage of general knowledge of large-scale language models in continuous learning scenarios, and cannot explain the changes in the general representation of language in continuous learning models. This limits the exploration and improvement of the continuous learning scenario. Summary of the invention
[0003] In view of the above-mentioned technical problems, the present application proposes a method, device and electronic device for evaluating the universality of a continuous learning model.
[0004] According to one aspect of the present application, a method for evaluating the universality of a continuous learning model is provided, the method comprising:
[0005] The continuous learning language model and the single-task language model are respectively subjected to classification task test processing using the target test task set corresponding to the target classification task, to obtain a first classification accuracy rate corresponding to the continuous learning language model and a second classification accuracy rate corresponding to the single-task language model; the continuous learning language model is a language model after the initial pre-trained language model continuously learns the target classification task and completes the learning; the single-task language model is a language model after the initial pre-trained language model learns the target classification task alone; the target classification task is any one of a plurality of classification tasks used for continuous learning;
[0006] Using the probe task set, respectively test the text universal representations of the continuous learning language model and the initial pre-trained language model to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model;
[0007] A target general evaluation result is determined based on the difference between the first classification accuracy and the second classification accuracy, and the difference between the first test result and the second test result; the target general evaluation result is used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuously learning the multiple classification tasks and the general representation ability of the discontinuous learning model, and the discontinuous learning model includes the initial pre-trained language model and the single-task language model.
[0008] According to another aspect of the present application, a device for evaluating the universality of a continuous learning model is provided, the device comprising:
[0009] A classification task testing module is used to perform classification task testing on the continuous learning language model and the single-task language model respectively using the target test task set corresponding to the target classification task, to obtain a first classification accuracy rate corresponding to the continuous learning language model and a second classification accuracy rate corresponding to the single-task language model; the continuous learning language model is a language model after the initial pre-trained language model continuously learns the target classification task and completes the learning; the single-task language model is a language model after the initial pre-trained language model learns the target classification task alone; the target classification task is any one of a plurality of classification tasks used for continuous learning;
[0010] A general representation test module, used to test the general text representations of the continuous learning language model and the initial pre-trained language model using a probe task set, and obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model;
[0011] A general evaluation module is used to determine a target general evaluation result based on the difference between the first classification accuracy and the second classification accuracy, and the difference between the first test result and the second test result; the target general evaluation result is used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuously learning the multiple classification tasks and the general representation ability of the discontinuous learning model, and the discontinuous learning model includes the initial pre-trained language model and the single-task language model.
[0012] According to another aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the above method.
[0013] According to another aspect of the present application, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.
[0014] According to another aspect of the present application, a computer program product is provided, comprising computer instructions, and when the computer instructions are executed by a processor, the computer executes the above method.
[0015] The target test task set corresponding to the target classification task is used to test the continuous learning language model and the single-task language model respectively, and the classification accuracy difference between the continuous learning language model and the single-task language model is obtained. The text universal representation of the continuous learning language model and the initial pre-trained language model is tested and processed respectively through the probe task set, and the difference between the continuous learning language model and the initial pre-trained language model in the ability to represent the universal representation of the style can be obtained. Therefore, based on these two differences, the target universal evaluation result of the continuous learning language model that continuously learns to the target classification task can be determined, so that the target universal evaluation result can not only represent the change in the universal representation of the classification task between continuous learning and non-continuous learning, but also represent the change in the universal representation of the text between continuous learning and the initial pre-trained language model. The target universal evaluation result is more accurate and can more accurately and effectively explain the universal changes of the continuous learning model. Based on this, by utilizing the target universal evaluation results, when using a single model to implement multiple classification functions, the universal text representation capability of a single model can be effectively and flexibly controlled, thereby increasing the diversity of single model applications and avoiding training a model for each classification task, while also meeting the requirements of the continuous learning model for universal text representation in multiple classification tasks, thereby improving the classification accuracy of the continuous learning model in multiple classification tasks.
[0016] Other features and aspects of the present application will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.
[0018] Figure 1 A schematic diagram of an application system provided according to an embodiment of the present application is shown.
[0019] Figure 2 A flowchart of a method for evaluating the universality of a continuous learning model provided according to an embodiment of the present application is shown.
[0020] Figure 3 A schematic diagram of a process framework for a classification task test process provided according to an embodiment of the present application is shown.
[0021] Figure 4 A flowchart is shown of a method for testing the universal text representations of a continuous learning language model and an initial pre-trained language model using a probe task set according to an embodiment of the present application to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model.
[0022] Figure 5 A schematic diagram of a syntax characterization test process provided according to an embodiment of the present application is shown.
[0023] Figure 6 A schematic diagram of a semantic representation test process provided according to an embodiment of the present application is shown.
[0024] Figure 7 A schematic diagram of a process for evaluating the universality of a continuous learning model provided according to an embodiment of the present application is shown.
[0025] Figure 8 A schematic diagram showing classification accuracy and target general evaluation results in continuous learning provided according to an embodiment of the present application is shown.
[0026] Fig. 9 A block diagram of a versatility evaluation device for a continuous learning model provided according to an embodiment of the present application is shown.
[0027] Fig.10 It is a block diagram of an electronic device for evaluating the universality of a continuous learning model according to an exemplary embodiment. DETAILED DESCRIPTION
[0028] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0029] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0030] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
[0031] 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. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning.
[0032] In recent years, with the research and progress of artificial intelligence technology, artificial intelligence technology has been widely used in many fields. The solution provided in the embodiment of the present application involves natural language processing technology, machine learning / deep learning and other technologies, which are specifically described by the following embodiments:
[0033] See also Figure 1 , Figure 1 A schematic diagram of an application system provided according to an embodiment of the present application is shown. The application system can be used for the universality evaluation method of the continuous learning model of the present application. Figure 1 As shown, the application system may at least include a server 01 and a terminal 02 .
[0034] In an embodiment of the present application, the server 01 can be used for universal evaluation processing of a continuous learning model. The server 01 may include an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0035] In the embodiment of the present application, the terminal 02 can be used to trigger the execution of the universal evaluation process and receive and display the target universal evaluation results, and can collect language texts for the server 01 to construct a test task set and a probe task set by the server 01. The terminal 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. Physical devices may also include software running in physical devices, such as applications. The operating system running on the terminal 02 in the embodiment of the present application may include but is not limited to Android system, IOS system, linux, windows, etc.
[0036] In the embodiments of this specification, the terminal 02 and the server 01 may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0037] In a specific embodiment, when the server 02 is a distributed system, the distributed system can be a blockchain system. When the distributed system is a blockchain system, it can be formed by multiple nodes (any form of computing devices in the access network, such as servers and user terminals), and the nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. In a distributed system, any machine such as a server or a terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. Specifically, the functions of each node in the blockchain system may include:
[0038] 1) Routing: a basic function of a node, used to support communication between nodes.
[0039] In addition to the routing function, the node can also have the following functions:
[0040] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.
[0041] It should be noted that in the specific implementation of this application, user-related data is involved. When the following embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0042] Figure 2 A flowchart of a method for evaluating the universality of a continuous learning model provided according to an embodiment of the present application is shown. Figure 2 As shown, the universal evaluation method of the continuous learning model may include:
[0043] S201, using the target test task set corresponding to the target classification task to perform classification task test processing on the continuous learning language model and the single-task language model respectively, to obtain a first classification accuracy rate corresponding to the continuous learning language model and a second classification accuracy rate corresponding to the single-task language model.
[0044] In the embodiments of this specification, the target classification task can be any one of the multiple classification tasks used for continuous learning. For example, the number of multiple classification tasks can be N, and N can be an integer greater than or equal to 2. The present application does not limit the continuous learning order of the multiple classification tasks. After the learning of any classification task is completed, the continuous learning language model corresponding to the initial pre-trained language model after learning any classification task can be obtained, that is, the continuous learning language model can be the language model after the initial pre-trained language model continuously learns the target classification task and completes the learning. Based on this, N continuous learning language models corresponding to N classification tasks can be obtained. Exemplarily, the initial pre-trained language model can be BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model for bidirectional encoding), DistilBERT (distilled BERT model, i.e., a model obtained by performing knowledge distillation on BERT), etc., and the present application does not limit this.
[0045] As an example, the classification task may be to classify the emotion expressed in the text, to classify the subject matter of the text, to classify the content theme of the text, etc., which is not limited in this application.
[0046] For example, when N=3, the order of continuous learning is classification task A, classification task B, and classification task C. After the initial pre-trained language model learns classification task A, the continuous learning language model corresponding to classification task A can be obtained. At this time, classification task A can be classified, which can be called continuous learning model A. After the initial pre-trained language model learns classification tasks A and classification tasks B in sequence, the continuous learning language model AB can be obtained, and the continuous learning language model AB can classify classification tasks A and classification tasks B. After the initial pre-trained language model learns classification tasks A, classification tasks B, and classification tasks C in sequence, the continuous learning model ABC can be obtained, and the continuous learning model ABC can classify classification tasks A, classification tasks B, and classification tasks C. In the process of continuous learning, continuous learning model A, continuous learning model AB, and continuous learning model ABC can be obtained.
[0047] Among them, the continuous learning language model can be obtained by training the continuous learning model after the previous classification task learning based on the sample text corresponding to the classification task and the task label corresponding to the classification task. For example, after continuously learning classification task A and classification task B, when learning classification task C, the sample text corresponding to classification task C and the task label corresponding to the sample text, such as the subject label, can be obtained. Then the sample text corresponding to classification task C can be input into the continuous learning model AB, and the text representation prediction process can be performed to obtain the text prediction feature. Thus, the text prediction feature can be input into the initial task classifier, and the subject classification process can be performed to obtain the subject prediction information. Based on this, the loss information can be determined according to the subject label and the subject prediction information, so that the gradient information can be calculated according to the loss information, and the gradient can be returned to adjust the parameters of the continuous learning model AB and the parameters of the initial task classifier until the iteration condition is met. Then, the continuous learning model AB corresponding to the iteration condition can be used as the continuous learning model ABC, and the initial task classifier corresponding to the iteration condition can be used as the first classifier corresponding to the continuous learning model AB. Among them, the iteration condition can be an iteration number threshold, a loss threshold, etc., which is not limited in this application.
[0048] For a single-task language model, the single-task language model may be a language model after the initial pre-trained language model learns the target classification task separately. Accordingly, taking the above case of N=3 as an example, the single-task language model may include single-task language model A, single-task language model B and single-task language model C. Among them, the single-task language model A may refer to a language model that learns classification task A separately and is used to classify classification task A separately; the single-task language model B may refer to a language model that learns classification task B separately and is used to classify classification task B separately; the single-task language model C may refer to a language model that learns classification task C separately and is used to classify classification task C separately.
[0049] In the embodiments of this specification, the target test task set may be any one of a plurality of test task sets, which may correspond to a plurality of classification tasks and can be used to test the accuracy of the model (continuous learning language model and single-task language model) for a plurality of classification tasks. As an example, the test task set may include text data for testing.
[0050] It should be noted that the single-task language model can be pre-trained or trained synchronously with the continuous learning language model. The present application does not limit the training timing of the single-task language model. The single-task language model can be obtained through supervised learning based on sample text data and corresponding classification task labels. For example, for a single-task language model C, sample text data and classification task labels corresponding to each sample text data can be obtained. For example, if classification task C is to classify the subject matter of the text, then the corresponding classification task label can be a text subject label, such as prose and non-prose. Thus, the sample text data can be input into the initial pre-trained language model to obtain a text vector representation, and then the text vector representation can be classified based on a preset classifier to obtain a predicted text subject matter. Based on this, the loss information can be determined based on the predicted text subject matter and the text subject matter label, so that the gradient information can be calculated based on the loss information, and the gradient can be returned to adjust the parameters of the initial pre-trained language model and the parameters of the preset classifier until the iteration condition is met. Then, the initial pre-trained language model when the iteration condition is met can be used as the single-task language model C, and the preset classifier when the iteration condition is met can be used as the second classifier corresponding to the single-task language model C, such as Figure 3 As shown. Among them, the iteration condition can be an iteration number threshold, a loss threshold, etc., which is not limited in this application. Based on this training method, a single-task language model A, a single-task language model B, a single-task language model C, and a second classifier corresponding to the single-task language model A, a second classifier corresponding to the single-task language model B, and a second classifier corresponding to the single-task language model C can be obtained.
[0051] In the embodiments of this specification, since the classification task test processing of the continuous learning language model is performed after the continuous learning language model is obtained in the process of continuous learning and before the next classification task learning is performed, the classification task test processing of the continuous learning language model can be performed using the target test task set corresponding to the target classification task when the initial pre-trained language model continuously learns the target classification task and completes the learning. As for the timing of using the target test task set corresponding to the target classification task to perform the classification task test processing on the single-task language model, this application does not limit this, as long as it is obtained before it is needed in step S203. And the test task set corresponding to each of the N classification tasks can be used to perform the classification task test processing on the corresponding single-task language model to obtain N second classification accuracy rates.
[0052] Specifically, an output layer can be connected to the output side of the pre-trained language model to implement classification processing for multiple classification tasks. The initial state of the output layer can be an initial task classifier (such as a multi-layer perceptron). Thus, the pre-trained language model and the initial task classifier can be trained based on the sample text to obtain the corresponding continuous learning language model and the first classifier corresponding to the continuous learning language model. Figure 3 . The specific training process can refer to the training process of the continuous learning language model mentioned above, which will not be repeated here. Accordingly, taking the three classification tasks of classification task A, classification task B and classification task C as an example, when learning classification task A, a continuous learning model A and a first classifier corresponding to the continuous learning model A can be obtained; when continuously learning classification task A and classification task B, a continuous learning model AB and a first classifier corresponding to the continuous learning model AB can be obtained; when continuously learning classification task A, classification task B and classification task C, a continuous learning model ABC and a first classifier corresponding to the continuous learning model ABC can be obtained.
[0053] like Figure 3 As shown, the text data used for testing in the target test task set can be input into the continuous learning language model, and the text feature extraction process can be performed to obtain the first text feature. Further, the first text feature can be input into the first classifier for text classification processing to obtain the first task classification result. Thus, the first task classification result can be compared with the task label of the target test task set to obtain the first classification accuracy, and the first classification accuracy can be the ratio of the first number of task labels matched in the first task classification result to the total number of first task classification results. The total number of text data used for testing in the target test task set of classification task m is 100. After the text data is continuously learned by the language model and the first classifier, the first number of task labels matched in the first task classification result is 90. One text data corresponds to one first task classification result, and the total number of first task classification results is 100. Then, the first classification accuracy = 90 / 100 can be obtained. That is, the first classification accuracy of the continuous learning language model that has continuously learned classification tasks 1 to m under classification task m is 90%.
[0054] Accordingly, when testing a single-task language model, the text data used for testing in the target test task set can be input into the single-task language model, and text feature extraction processing can be performed to obtain a second text feature. Further, the second text feature can be input into a second classifier for text classification processing to obtain a second task classification result. Thus, the second task classification result can be compared with the task label of the target test task set to obtain a second classification accuracy, which can be the ratio of the second number of tasks that match the task label in the second task classification result to the total number of second task classification results.
[0055] S203, using the probe task set to test the text universal representations of the continuous learning language model and the initial pre-training language model respectively, to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-training language model.
[0056] In the embodiments of this specification, the probe task set may refer to a task set for testing the universal text representation of the continuous learning language model and the initial pre-trained language model, and may include universal test text data. The present disclosure does not limit the universal test text data, as long as the universal text representation of the model can be effectively tested. As an example, the universal test text data may include syntactic test text data and semantic test text data. For example, the syntactic test text data may include text data for testing whether two consecutive tags in a sentence are reversed, the maximum depth of the syntactic tree of the sentence, and the singular and plural of the object and subject of the sentence. The semantic test text data may include text data for testing whether the order of the conjunctions of two coordinated sentences is reversed, whether the main verb of the sentence is marked as present tense or past tense, and whether each pair captures the interpretation / semantic equivalence relationship. For example, the maximum depth of the syntactic tree can be indicated using textbf.
[0057] In the embodiments of this specification, the general test text data can be input into the continuous learning language model and the initial pre-training language model respectively to extract general features, and the respectively extracted general features can be input into the trained general feature classifier to perform classification prediction processing of the general features, so as to obtain the first classification prediction result corresponding to the continuous learning language model and the second classification prediction result corresponding to the initial pre-training language model. Thus, the first classification prediction result can be determined as the first test result, and the second classification prediction result can be determined as the second test result.
[0058] In a possible implementation, step S203 may include:
[0059] S401, input the common test text data in the probe task set into the continuous learning language model and the initial pre-trained language model respectively, perform text common feature extraction processing, and obtain the first text common feature corresponding to the continuous learning language model and the second text common feature corresponding to the initial pre-trained language model.
[0060] The first text universal feature and the second text universal feature may be features representing syntax or semantics, which is not limited in the present application.
[0061] S403, inputting the first text universal feature into a universal feature classifier, performing universal feature classification processing, and obtaining a first test result;
[0062] S405: Input the second text universal feature into a universal feature classifier to perform universal feature classification processing to obtain a second test result.
[0063] The general feature classifier can be obtained by training the initial classifier based on the sample probe task data and the corresponding general feature classification labels under the condition of fixing the parameters of the continuous learning language model. The specific training process is described in detail below and will not be repeated here.
[0064] In a possible implementation, the probe task set may include a syntactic task set and a semantic task set, and the universal test text data may include syntactic test text data in the syntactic task set and semantic test text data in the semantic task set; accordingly, the first text universal feature may include a first syntactic feature and a first semantic feature; the universal feature classifier may include a syntactic classifier and a semantic classifier, such as Figure 5 and Figure 6 As shown. Accordingly, the step of inputting the first text universal feature into the universal feature classifier for universal feature classification processing to obtain the first test result may include: inputting the first syntactic feature into the syntactic classifier, performing syntactic classification task processing, and obtaining the first syntactic classification result; inputting the first semantic feature into the semantic classifier, performing semantic classification task processing, and obtaining the first semantic classification result; and using the first syntactic classification result and the first semantic classification result as the first test result.
[0065] Reference Figure 5 and Figure 6 , the syntactic test text data and the semantic test text data can be respectively input into the initial pre-trained language model, and the syntactic and semantic feature extraction processing can be performed to obtain the second text universal feature corresponding to the initial pre-trained language model, and the second text universal feature can include a second syntactic feature and a second semantic feature. Accordingly, inputting the second text universal feature into a universal feature classifier, performing universal feature classification processing, and obtaining a second test result can include: inputting the second syntactic feature into a syntactic classifier, performing syntactic classification task processing, and obtaining a second syntactic classification result, such as Figure 5 Furthermore, the second semantic feature can be input into the semantic classifier to perform semantic classification task processing to obtain a second semantic classification result; thus, the second syntactic classification result and the second semantic classification result can be used as the second test result.
[0066] The first syntactic classification result and the second syntactic classification result may include that the object and subject of the sentence are singular, the object and subject of the sentence are plural, etc.; the first semantic classification result and the second semantic classification result may include that the order of the conjunctions of the two coordinated sentences is reversed, the order of the conjunctions of the two coordinated sentences is not reversed, etc. This application does not limit these.
[0067] S205 , determining a target general evaluation result according to a difference between the first classification accuracy and the second classification accuracy, and a difference between the first test result and the second test result.
[0068] Among them, the target general evaluation result can be used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuous learning of multiple classification tasks and the general representation ability of the discontinuous learning model, such as the difference in general representation ability, the change trend of general representation ability, etc., which is not limited in this application. The discontinuous learning model here can include the initial pre-trained language model and the single-task language model.
[0069] In a possible implementation, step S205 may include: determining a first general evaluation result based on the difference between the first classification accuracy and the second classification accuracy, for example, the difference between the first classification accuracy and the second classification accuracy may be used as the first general evaluation result. And the second general evaluation result may be determined based on the difference between the first test result and the second test result, for example, the difference between the first test result and the second test result may be used as the second general evaluation result. Thus, the first general evaluation results and the second general evaluation results corresponding to each of the multiple classification tasks may be counted to obtain a target general evaluation result. For example, the statistical results of the first general evaluation results corresponding to each of the multiple classification tasks and the statistical results of the second general evaluation results corresponding to each of the multiple classification tasks may be used as the target general evaluation result. The statistical results here may be the results of statistics such as average and sum, which are not limited in this application.
[0070] In an optional implementation, determining a second general evaluation result based on the difference between the first test result and the second test result may include: taking the difference between the first test result and the second test result as general difference information; and determining the ratio of the general difference information to the second test result as the second general evaluation result.
[0071] The target test task set corresponding to the target classification task is used to test the continuous learning language model and the single-task language model respectively, and the classification accuracy difference between the continuous learning language model and the single-task language model is obtained. The text universal representation of the continuous learning language model and the initial pre-trained language model is tested and processed respectively through the probe task set, and the difference between the continuous learning language model and the initial pre-trained language model in the ability to represent the universal representation of the style can be obtained. Therefore, based on these two differences, the target universal evaluation result of the continuous learning language model that continuously learns to the target classification task can be determined, so that the target universal evaluation result can not only represent the change in the universal representation of the classification task between continuous learning and non-continuous learning, but also represent the change in the universal representation of the text between continuous learning and the initial pre-trained language model. The target universal evaluation result is more accurate and can more accurately and effectively explain the universal changes of the continuous learning model. Based on this, by utilizing the target universal evaluation results, when using a single model to implement multiple classification functions, the universal text representation capability of a single model can be effectively and flexibly controlled, thereby increasing the diversity of single model applications and avoiding training a model for each classification task, while also meeting the requirements of the continuous learning model for universal text representation in multiple classification tasks, thereby improving the classification accuracy of the continuous learning model in multiple classification tasks.
[0072] In the embodiments of this specification, the universal feature classifier corresponds to the classification task. After continuously learning any classification task, the parameters of the continuous learning language model can be fixed. In this case, the initial classifier is trained based on the sample probe task data and the corresponding universal feature classification label.
[0073] Taking the above three classification tasks as an example, three continuous learning language models can be obtained in the continuous learning process: continuous learning model A, continuous learning model AB and continuous learning model ABC. In this way, three universal feature classifiers corresponding to continuous learning model A, continuous learning model AB and continuous learning model ABC can be obtained, such as universal feature classifier A corresponding to continuous learning model A, universal feature classifier AB corresponding to continuous learning model AB, and universal feature classifier ABC corresponding to continuous learning model ABC. In this process, for example, the pre-trained language model continuously learns classification task A and classification task B, and then the continuous learning model AB is obtained. Next, the model parameters of the continuous learning model AB can be fixed, and the subsequent classification task C is not learned. In this case, the initial classifier (such as the initial multi-layer perceptron) can be connected behind the continuous learning model AB (output side), and then the initial classifier is trained using the sample probe task data and the corresponding universal feature classification label to obtain the universal feature classifier AB corresponding to the continuous learning model AB that meets the iteration conditions.
[0074] Based on the above introduction, taking the training process of a general feature classifier corresponding to any classification task (target task) as an example, the general feature classifier can be trained through the following steps, including:
[0075] When the initial pre-trained language model continuously learns the target classification task and completes the learning, the continuously learned language model corresponding to the target classification task can be obtained. For example, the model parameters of the initial pre-trained language model that continuously learns the target classification task can be frozen to obtain the continuously learned language model corresponding to the target classification task.
[0076] Therefore, the sample probe task data can be input into the continuous learning language model to perform text universal feature extraction processing to obtain sample universal features; and the sample universal features can be classified based on the initial classifier to obtain sample universal feature classification results.
[0077] Furthermore, the loss information can be determined based on the general feature classification result and the general feature classification label corresponding to the sample probe task data. For example, the general feature classification result can be compared with the general feature classification label, and the classification error rate can be used as the loss information; or the loss between the general feature classification result and the general feature classification label can be calculated using a preset loss function to obtain the loss information. This application does not limit the preset loss function.
[0078] Finally, the loss information can be used to adjust the parameters of the initial classifier until the training iteration conditions are met to obtain a universal feature classifier. For example, if the training iteration conditions are not met, the gradient information can be determined based on the loss information, so that the parameters of the initial classifier can be adjusted using the gradient feedback, and the sample probe task data can be input into the continuous learning language model, and the above training process can be iterated until the training iteration conditions are met. Thus, the initial classifier corresponding to the training iteration conditions can be used as the universal feature classifier.
[0079] It should be noted that during the training process of the general feature classifier, the parameters of the continuous learning language model are not adjusted.
[0080] In an optional embodiment, the sample probe task data may include sample syntactic data and / or sample semantic data; based on this, the trained general feature classifier may include a syntactic classifier and / or a semantic classifier. In this case, specifically, the training process for the syntactic classifier may include: inputting the sample syntactic data into a continuous learning language model, performing syntactic feature extraction processing, and obtaining sample syntactic features; thereby performing syntactic feature classification processing on the sample syntactic features based on the initial classifier to obtain sample syntactic classification results; and determining loss information based on the sample syntactic classification results and the syntactic classification labels corresponding to the sample syntactic data. Furthermore, the loss information may be used to adjust the parameters of the initial classifier until the training iteration conditions are met to obtain a syntactic classifier.
[0081] Based on a training process similar to that of a syntactic classifier, the initial classifier can be trained based on sample semantic data to obtain a semantic classifier. Specifically, the sample semantic data can be input into a continuous learning language model to perform semantic feature extraction processing to obtain sample semantic features; thereby, the sample semantic features can be subjected to semantic feature classification processing based on the initial classifier to obtain sample semantic classification results; and loss information can be determined based on the sample semantic classification results and the semantic classification labels corresponding to the sample semantic data. Furthermore, the loss information can be used to adjust the parameters of the initial classifier until the training iteration conditions are met to obtain a semantic classifier.
[0082] Among them, the syntactic classification label may include labels such as two consecutive marks in a sentence are reversed, two consecutive marks in a sentence are not reversed, the maximum depth of the syntax tree, the object and subject of the sentence are singular, the object and subject of the sentence are plural, etc. The semantic classification label may include labels such as the order of two coordinating sentence conjunctions is reversed, the order of two coordinating sentence conjunctions is not reversed, the main verb of the sentence is marked as present tense, the main verb of the sentence is marked as past tense, etc. This application does not limit the syntactic classification labels and semantic classification labels, and sample syntactic data and sample semantic data can be set according to the syntactic representation and semantic representation that need to be evaluated, so as to set corresponding syntactic classification labels and semantic classification labels for the sample syntactic data and sample semantic data.
[0083] It should be noted that the above-mentioned initial classifier is connected to the last layer of the continuous learning language model. Optionally, the initial classifier can also be connected to each layer of the continuous learning language model to train the universal feature classifiers of each layer. For example, if the BERT model has 12 layers, 12 universal feature classifiers can be trained under the target classification task. Among them, the training process of the universal feature classifier of each layer can refer to the training process of the universal feature classifier mentioned above, that is, in each iteration process, 12 loss information can be obtained, so that the model parameters of the corresponding layer in the continuous learning language model can be adjusted based on the 12 loss information, and the parameters of the 12 initial classifiers can be adjusted accordingly, which will not be repeated here. Accordingly, in the case where the universal feature classifier includes a syntactic classifier and a semantic classifier, based on this training method in which the initial classifier is connected to each layer of the continuous learning language model, 12 syntactic classifiers and 12 semantic classifiers can be obtained after learning each classification task.
[0084] Reference Figure 7 In an application example, it is assumed that multiple classification tasks are classification tasks 1 to N, N is greater than or equal to 2, and classification task m is taken as an example, m belongs to 1 to N. The test task set corresponding to classification task m can be used to perform classification task test processing on the continuous learning language model and the single-task language model respectively, and the first classification accuracy corresponding to the continuous learning language model and the second classification accuracy corresponding to the single-task language model can be obtained. Among them, the continuous learning language model can refer to the pre-trained language model obtained after continuous learning of classification tasks 1 to m. Specifically, the test task set corresponding to classification task m can be input into the continuous learning language model for text representation processing to obtain the first text feature, so that the first text feature can be input into the first classifier for classification task prediction processing to obtain the first task classification result. Therefore, the first task classification result can be compared with the task label corresponding to the text data tested in the test task set corresponding to classification task m to obtain the first classification accuracy, and the first classification accuracy can be the ratio of the first number of matching task labels in the first task classification result to the total number of first task classification results. Accordingly, when testing a single-task language model, the text data used for testing in the test task set corresponding to the classification task m can be input into the single-task language model (only the pre-trained language model of the classification task m has been learned), and text feature extraction processing can be performed to obtain a second text feature. Furthermore, the second text feature can be input into a second classifier for text classification processing to obtain a second task classification result. Thus, the second task classification result can be compared with the task label to obtain a second classification accuracy, which can be the ratio of the second number of second task classification results that match the task label to the total number of second task classification results.
[0085] In the embodiment of the present specification, the universal test text data in the probe task set can be respectively input into the continuous learning language model and the initial pre-training language model, and the universal feature extraction process of the text can be performed to obtain the first universal feature of the text corresponding to the continuous learning language model and the second universal feature of the text corresponding to the initial pre-training language model. Specifically, the universal test text data may include syntactic test text data and semantic test text data. Based on this, the syntactic test text data can be input into the continuous learning language model for syntactic representation processing to obtain the first syntactic feature; then the first syntactic feature can be input into the syntactic classifier for syntactic classification prediction processing to obtain the first syntactic classification result. The first semantic feature is input into the semantic classifier for semantic classification task processing to obtain the first semantic classification result; the first syntactic classification result and the first semantic classification result are used as the first test result. In addition, the semantic test text data can be input into the continuous learning language model for semantic representation processing to obtain the first semantic feature, so that the first semantic feature can be input into the semantic classifier for semantic classification task processing to obtain the first semantic classification result; then the first syntactic classification result and the first semantic classification result can be used as the first test result.
[0086] Further, the first general evaluation result can be determined according to the difference between the first classification accuracy and the second classification accuracy; and the second general evaluation result can be determined according to the difference between the first test result and the second test result. Thus, the target general evaluation result can be obtained according to the first general evaluation result and the second general evaluation result. In an example, the target general evaluation result can be calculated by the following formula, that is, the target general evaluation result can include the following GD, SynF and SemF.
[0087]
[0088]
[0089]
[0090] Where GD represents the first general evaluation result, and N represents the number of multiple classification tasks; represents the second classification accuracy corresponding to classification task m, R m,m represents the first classification accuracy of classification task m when classification task m is continuously learned; SynF and SemF represent the second general evaluation results, SynF can represent the syntactic general evaluation result, and SemF can represent the semantic general evaluation result; p s It can represent the probe task set, p Syn Can represent syntactic test text data, Can represent the second syntactic classification result, It can represent the first syntactic classification result corresponding to the classification task m after continuous learning; p Sem Can represent semantic test text data, Can represent the second semantic classification result, It can represent the first semantic classification result corresponding to the classification task m after continuous learning. Syn | can represent the number of syntactic tasks that can be tested by the syntactic task set, that is, the number of task types that test syntax; |p Sem | represents the number of semantic tasks that can be tested by the semantic task set, that is, the number of task types that test semantics.
[0091] Based on the above formula, the syntax and semantics can be counted separately. For example, the above formula (2) can calculate the difference between the second syntax classification result and the first syntax classification result, and calculate the first ratio of the difference to the second syntax classification result. Thus, the first ratio under multiple classification tasks can be counted to obtain the mean of the first ratio as the syntax general evaluation result. Correspondingly, the semantic general evaluation result can be calculated according to the above formula (3). For example, the difference between the second semantic classification result and the first semantic classification result can be calculated, and the second ratio of the difference to the second semantic classification result can be calculated. Thus, the second ratio under multiple classification tasks can be counted to obtain the mean of the second ratio as the semantic general evaluation result. Thus, the syntax general evaluation result and the semantic general evaluation result can be used as the second general evaluation result. Thus, the first general evaluation result and the second general evaluation result can be used as the target general evaluation result.
[0092] Optionally, the target general evaluation result can be used to analyze the change in the general representation ability of the pre-trained language model during the continuous learning process, and a trend graph or change information of the change can be given, and the trend graph or change information of the change can be fed back to the terminal to realize the display and notification of the trend graph or change information of the change. Alternatively, a general representation threshold can be set in advance, and the general representation threshold can be used to indicate the critical value at which the general representation ability meets the general requirements. Based on this, after continuously learning a certain classification task, the obtained target general evaluation result is compared with the general representation threshold. If the target general evaluation result is greater than or equal to the general representation threshold, the continuous learning can be stopped because the general representation ability has decreased and does not meet the general requirements or just meets the general requirements; if the target general evaluation result is less than the general representation threshold, it means that the pre-trained language model of continuous learning can meet the general requirements, so that other classification tasks can continue to be learned. This can effectively balance the number of continuous learning classification tasks and the general representation ability. Among them, the general characterization threshold may include a GD threshold, a SynF threshold and a SemF threshold. Based on this, the above-mentioned target general evaluation result greater than or equal to the general characterization threshold may mean greater than or equal to at least one of the GD threshold, the SynF threshold and the SemF threshold; the target general evaluation result less than the general characterization threshold may mean that GD, SynF and SemF are all less than the corresponding GD threshold, SynF threshold and SemF threshold, and this application does not limit this.
[0093] As shown in Table 1 below, for different pre-trained language models, GD, SemF, and SynF show a positive correlation, indicating that different evaluation indicators can mutually support changes in the generality of the model.
[0094] Table 1
[0095]
[0096] Reference Figure 8, ACC represents the classification accuracy of the continuous learning language model after learning multiple classification tasks and testing, that is, the average accuracy. Catastrophic forgetting can be effectively alleviated under a variety of continuous learning methods, so that a high classification accuracy can be maintained after continuous learning. Among them, a variety of continuous learning methods may include BERT-FT, BERT-LwF, BERT-ER, BERT-DERPP and other methods. BERT-FT is based on BERT and optimizes the model directly on the training task by adding a linear classification layer. This method is the baseline model; BERT-LwF is based on BERT-FT and alleviates catastrophic forgetting by controlling the parameters of the model so as not to deviate significantly; BERT-ER is based on BERT-FT and alleviates the catastrophic forgetting of the model by replaying the memory data; BERT-DERPP combines any two of the above strategies. From Figure 8 It can be seen that the universality evaluation method of the continuous learning model of the present application can accurately determine the changes in universal knowledge under different continuous learning methods. During the continuous learning process, the number of classification tasks can be controlled according to the changes in the universal knowledge, so that the continuous learning language model can maintain the ability to process more downstream tasks.
[0097] Fig. 9 FIG. 1 is a block diagram of a versatility evaluation device for a continuous learning model according to an embodiment of the present application. Fig. 9 As shown, the device may include:
[0098] The classification task test module 901 is used to perform classification task test processing on the continuous learning language model and the single-task language model respectively using the target test task set corresponding to the target classification task, and obtain the first classification accuracy corresponding to the continuous learning language model and the second classification accuracy corresponding to the single-task language model; the continuous learning language model is a language model after the initial pre-trained language model continuously learns the target classification task and completes the learning; the single-task language model is a language model after the initial pre-trained language model learns the target classification task alone; the target classification task is any one of the multiple classification tasks used for continuous learning;
[0099] The general representation test module 903 is used to test the general text representations of the continuous learning language model and the initial pre-trained language model using the probe task set to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model;
[0100] The general evaluation module 905 is used to determine a target general evaluation result based on the difference between the first classification accuracy and the second classification accuracy, and the difference between the first test result and the second test result; the target general evaluation result is used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuously learning the multiple classification tasks and the general representation ability of the discontinuous learning model, and the discontinuous learning model includes the initial pre-trained language model and the single-task language model.
[0101] The target test task set corresponding to the target classification task is used to test the continuous learning language model and the single-task language model respectively, and the classification accuracy difference between the continuous learning language model and the single-task language model is obtained. The text universal representation of the continuous learning language model and the initial pre-trained language model is tested and processed respectively through the probe task set, and the difference between the continuous learning language model and the initial pre-trained language model in the ability to represent the universal representation of the style can be obtained. Therefore, based on these two differences, the target universal evaluation result of the continuous learning language model that continuously learns to the target classification task can be determined, so that the target universal evaluation result can not only represent the change in the universal representation of the classification task between continuous learning and non-continuous learning, but also represent the change in the universal representation of the text between continuous learning and the initial pre-trained language model. The target universal evaluation result is more accurate and can more accurately and effectively explain the universal changes of the continuous learning model. Based on this, by utilizing the target universal evaluation results, when using a single model to implement multiple classification functions, the universal text representation capability of a single model can be effectively and flexibly controlled, thereby increasing the diversity of single model applications and avoiding training a model for each classification task, while also meeting the requirements of the continuous learning model for universal text representation in multiple classification tasks, thereby improving the classification accuracy of the continuous learning model in multiple classification tasks.
[0102] In a possible implementation, the general characterization test module 903 may include:
[0103] A universal feature extraction unit, used to input the universal test text data in the probe task set into the continuous learning language model and the initial pre-training language model respectively, perform text universal feature extraction processing, and obtain a first text universal feature corresponding to the continuous learning language model and a second text universal feature corresponding to the initial pre-training language model;
[0104] A first testing unit is used to input the first text universal feature into a universal feature classifier to perform universal feature classification processing to obtain the first test result; the universal feature classifier is obtained by training an initial classifier based on sample probe task data and corresponding universal feature classification labels while fixing the parameters of the continuous learning language model;
[0105] The second testing unit is used to input the second text universal feature into the universal feature classifier, perform universal feature classification processing, and obtain the second test result.
[0106] In a possible implementation, the probe task set includes a syntactic task set and a semantic task set, the universal test text data includes syntactic test text data in the syntactic task set and semantic test text data in the semantic task set; accordingly, the first text universal feature includes a first syntactic feature and a first semantic feature; the universal feature classifier includes a syntactic classifier and a semantic classifier; the above-mentioned first test unit may include:
[0107] A first syntactic classification subunit, configured to input the first syntactic feature into the syntactic classifier, perform syntactic classification task processing, and obtain a first syntactic classification result;
[0108] A first semantic classification subunit is used to input the first semantic feature into the semantic classifier, perform semantic classification task processing, and obtain a first semantic classification result;
[0109] The first testing subunit is used to use the first syntactic classification result and the first semantic classification result as the first testing result.
[0110] In a possible implementation, the second text common feature includes a second syntactic feature and a second semantic feature; and the second test unit may include:
[0111] A second syntactic classification subunit is used to input the second syntactic feature into the syntactic classifier, perform syntactic classification task processing, and obtain a second syntactic classification result;
[0112] A second semantic classification subunit is used to input the second semantic feature into the semantic classifier, perform semantic classification task processing, and obtain a second semantic classification result;
[0113] The second testing subunit is used to use the second syntactic classification result and the second semantic classification result as the second testing result.
[0114] In a possible implementation, the device may further include the following module for training a general feature classifier, including:
[0115] A continuous learning language model acquisition module, used for acquiring the continuous learning language model corresponding to the target classification task when the initial pre-trained language model continuously learns the target classification task and the learning is completed;
[0116] A feature extraction module, used to input the sample probe task data into the continuous learning language model, perform text universal feature extraction processing, and obtain sample universal features;
[0117] A general feature classification module, used for performing general feature classification processing on the general features of the samples based on the initial classifier to obtain a general feature classification result of the samples;
[0118] A loss information determination module, configured to determine loss information according to the general feature classification result and the general feature classification label corresponding to the sample probe task data;
[0119] A parameter adjustment module is used to adjust the parameters of the initial classifier using the loss information until the training iteration condition is met to obtain the universal feature classifier.
[0120] In a possible implementation, the classification task test module 901 may include:
[0121] a first general evaluation result determining unit, configured to determine a first general evaluation result according to a difference between the first classification accuracy and the second classification accuracy;
[0122] a second general evaluation result determining unit, configured to determine a second general evaluation result according to a difference between the first test result and the second test result;
[0123] The target general evaluation result acquisition unit is used to count the first general evaluation results and the second general evaluation results corresponding to each of the multiple classification tasks to obtain the target general evaluation result.
[0124] In a possible implementation, the second general evaluation result determination unit may include:
[0125] a general difference information determination subunit, configured to use a difference between the first test result and the second test result as general difference information;
[0126] The second general evaluation result determination subunit is used to determine the ratio of the general difference information to the second test result as the second general evaluation result.
[0127] Regarding the device in the above embodiment, the specific manner in which each module and unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0128] Fig.10 A block diagram of an electronic device for asynchronous data snapshot according to an embodiment of the present application is shown. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The electronic device includes a processor 1001, a memory and a network interface 1004 connected via a system bus 1002. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory 1003. The non-volatile storage medium stores an operating system 1005 and a computer program 1006. The internal memory 1003 provides an environment for the operation of the operating system 1005 and the computer program 1006 in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for asynchronous snapshot of data is implemented.
[0129] Those skilled in the art will understand that Fig.10 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In an exemplary embodiment, an electronic device is also provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a universality evaluation method for a continuous learning model as in an embodiment of the present application.
[0131] In an exemplary embodiment, a storage medium is also provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the universality evaluation method of the continuous learning model in the embodiment of the present application.
[0132] In an exemplary embodiment, a computer program product containing instructions is also provided, which, when executed on a computer, enables the computer to execute the universality evaluation method of the continuous learning model in the embodiment of the present application.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0134] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0135] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for evaluating the universality of a continuous learning model, characterized in that: The method comprises: The continuous learning language model and the single-task language model are respectively subjected to classification task test processing using the target test task set corresponding to the target classification task, to obtain a first classification accuracy rate corresponding to the continuous learning language model and a second classification accuracy rate corresponding to the single-task language model; the continuous learning language model is a language model after the initial pre-trained language model continuously learns the target classification task and completes the learning; the single-task language model is a language model after the initial pre-trained language model learns the target classification task alone; the target classification task is any one of a plurality of classification tasks used for continuous learning; Using the probe task set, respectively test the text universal representations of the continuous learning language model and the initial pre-trained language model to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model; A target general evaluation result is determined based on the difference between the first classification accuracy and the second classification accuracy, and the difference between the first test result and the second test result; the target general evaluation result is used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuously learning the multiple classification tasks and the general representation ability of the discontinuous learning model, and the discontinuous learning model includes the initial pre-trained language model and the single-task language model.
2. The method according to claim 1, characterized in that The method of using the probe task set to test the text universal representations of the continuous learning language model and the initial pre-training language model respectively to obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-training language model includes: Inputting the universal test text data in the probe task set into the continuous learning language model and the initial pre-training language model respectively, performing text universal feature extraction processing, and obtaining a first text universal feature corresponding to the continuous learning language model and a second text universal feature corresponding to the initial pre-training language model; Inputting the first text universal feature into a universal feature classifier to perform universal feature classification processing to obtain the first test result; the universal feature classifier is obtained by training an initial classifier based on sample probe task data and corresponding universal feature classification labels while fixing the parameters of the continuous learning language model; The second text universal feature is input into the universal feature classifier, and universal feature classification processing is performed to obtain the second test result.
3. The method according to claim 2, characterized in that The probe task set includes a syntactic task set and a semantic task set, and the universal test text data includes the syntactic test text data in the syntactic task set and the semantic test text data in the semantic task set; accordingly, the first text universal feature includes a first syntactic feature and a first semantic feature; the universal feature classifier includes a syntactic classifier and a semantic classifier; The step of inputting the first text universal feature into a universal feature classifier to perform universal feature classification processing to obtain the first test result comprises: Inputting the first syntactic feature into the syntactic classifier to perform syntactic classification task processing to obtain a first syntactic classification result; Inputting the first semantic feature into the semantic classifier to perform semantic classification task processing to obtain a first semantic classification result; The first syntactic classification result and the first semantic classification result are used as the first test result.
4. The method according to claim 3, characterized in that The second text universal feature includes a second syntactic feature and a second semantic feature; the inputting the second text universal feature into a universal feature classifier to perform universal feature classification processing to obtain the second test result includes: Inputting the second syntactic feature into the syntactic classifier to perform syntactic classification task processing to obtain a second syntactic classification result; Inputting the second semantic feature into the semantic classifier to perform semantic classification task processing to obtain a second semantic classification result; The second syntactic classification result and the second semantic classification result are used as the second test result.
5. The method according to claim 2, characterized in that: The general feature classifier is obtained by the following steps: When the initial pre-trained language model continuously learns the target classification task and completes the learning, obtaining the continuously learned language model corresponding to the target classification task; Inputting the sample probe task data into the continuous learning language model, performing text universal feature extraction processing, and obtaining sample universal features; Performing general feature classification processing on the general features of the samples based on the initial classifier to obtain a general feature classification result of the samples; Determining loss information according to the general feature classification result and the general feature classification label corresponding to the sample probe task data; The loss information is used to adjust the parameters of the initial classifier until a training iteration condition is met to obtain the universal feature classifier.
6. The method according to claim 1, characterized in that The determining a target general evaluation result according to a difference between the first classification accuracy and the second classification accuracy, and a difference between the first test result and the second test result, comprises: Determining a first general evaluation result according to a difference between the first classification accuracy and the second classification accuracy; determining a second general evaluation result based on a difference between the first test result and the second test result; The first general evaluation results and the second general evaluation results corresponding to each of the multiple classification tasks are counted to obtain the target general evaluation result.
7. The method according to claim 6, characterized in that Determining a second general evaluation result according to a difference between the first test result and the second test result includes: using a difference between the first test result and the second test result as universal difference information; The ratio of the general difference information to the second test result is determined as the second general evaluation result.
8. A device for evaluating the universality of a continuous learning model, characterized in that: include: A classification task testing module is used to perform classification task testing on the continuous learning language model and the single-task language model respectively using the target test task set corresponding to the target classification task, to obtain a first classification accuracy rate corresponding to the continuous learning language model and a second classification accuracy rate corresponding to the single-task language model; the continuous learning language model is a language model after the initial pre-trained language model continuously learns the target classification task and completes the learning; the single-task language model is a language model after the initial pre-trained language model learns the target classification task alone; the target classification task is any one of a plurality of classification tasks used for continuous learning; A general representation test module, used to test the general text representations of the continuous learning language model and the initial pre-trained language model using a probe task set, and obtain a first test result corresponding to the continuous learning language model and a second test result corresponding to the initial pre-trained language model; A general evaluation module is used to determine a target general evaluation result based on the difference between the first classification accuracy and the second classification accuracy, and the difference between the first test result and the second test result; the target general evaluation result is used to indicate the correlation between the general representation ability of the initial pre-trained language model after continuously learning the multiple classification tasks and the general representation ability of the discontinuous learning model, and the discontinuous learning model includes the initial pre-trained language model and the single-task language model.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the method described in any one of claims 1 to 7.
10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Sentiment classification continuous learning method based on adaptive uncertainty regularization
CN112559738A
Language model training method and device, electronic equipment and computer readable medium
CN112966712A
Image classification method and device based on small sample continuous learning, and storage medium
CN113762402A
Automated early anomaly detection in a continuous learning model
US20200065630A1
Method of training classification model, method of classifying sample, and device
US20220383190A1
Cited By
Training data validity evaluation method, system and device
CN119441805A
