Human-computer collaborative text classification method and device based on reason basis
Data enhanced the initial training set through the reason for labeling, and generated semi -fact data to solve the problem of the neural network model that is easy to introduce pseudo -mode under the training of small samples, and improved the accuracy and robustness of the text classification model.
Patent Information
- Application Number
- CN202210281154.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In the prior art, data-driven neural network models are prone to introduce pseudo-modes under small sample size training, resulting in inaccurate classification results.
The initial training set of small samples is enhanced through the reason for labeling, and multiple groups of semi -fact data are generated to form a number of semi -factual data to form the first data enhancement training set. Based on this, the text classification model is trained to eliminate the impact of the pseudo -mode.
The accuracy of text classification models treats the classification results of classified texts, and enhances the robustness and generalization ability of the model.
Smart Images

Figure CN114880464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text classification, and in particular to a human-computer collaborative text classification method and device centered on reason basis. Background Art
[0002] Text classification refers to a technical means of automatically classifying and marking text according to certain standards. As known from the related art, a text classification model can be used to process the input text to output the classification result of the text.
[0003] However, data-driven neural network models (such as text classification models) are prone to introduce pseudo-patterns when trained with small sample sizes. Pseudo-patterns refer to features and labels that have no causal relationship being mistakenly considered to have a causal relationship. It is understandable that the features under the pseudo-patterns are mistakenly identified by the text classification model as reason information for determining the text label (also known as the classification label), that is, the association between this pseudo-feature and the correct prediction is called a pseudo-pattern. This type of neural network model based on pseudo-patterns (such as text classification models) usually does not conform to logical causality during the testing phase, which will damage the accuracy of classification tasks in actual scenarios. Summary of the invention
[0004] The present invention provides a human-machine collaborative text classification method and device centered on reason basis, so as to solve the defect of inaccurate classification results of text classification models in the prior art due to the existence of pseudo-patterns, realize data enhancement of a small sample training set based on label reasons, and train the text classification model based on the training set after data enhancement, so as to eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, thereby improving the accuracy of the classification results.
[0005] The present invention provides a human-machine collaborative text classification method centered on reason basis, the method comprising: training a text classification model based on a first data-enhanced training set to obtain a target text classification model; obtaining a text to be classified, and inputting the text to be classified into the target text classification model to obtain a text classification result output by the target text classification model; wherein the first data-enhanced training set is determined in the following manner: obtaining an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; performing data enhancement on the initial training set based on the label reason to obtain the first data-enhanced training set.
[0006] According to a reason-based human-computer collaborative text classification method provided by the present invention, the initial training set is data enhanced based on the label reasons to obtain the first data-enhanced training set, including: based on the label reasons, the training samples corresponding to the label reasons in the initial training set are data enhanced to obtain label-reason enhanced training samples corresponding to the training samples; based on the training samples and the label-reason enhanced training samples to obtain the first data-enhanced training set.
[0007] According to a reason-based human-computer collaborative text classification method provided by the present invention, based on the label reason, data enhancement is performed on the training samples corresponding to the label reason in the initial training set to obtain label reason enhanced training samples corresponding to the training samples, including: based on the label reason, determining non-label reasons in the training samples corresponding to the label reason, wherein the non-label reasons are other text fragments in the training samples except the label reason; and performing synonym replacement on the non-label reasons of the training samples to obtain label reason enhanced training samples corresponding to the training samples.
[0008] According to a human-machine collaborative text classification method centered on reason basis provided by the present invention, after the text classification model is trained based on the first data-enhanced training set to obtain the target text classification model, the method further includes: respectively determining the wrong label reason and the missing label reason of each training sample in the initial training set, wherein the wrong label reason is a text segment of the training sample that has no causal relationship with the classification label but is mistakenly identified as a label reason by the target text classification model, and the missing label reason is a text segment of the training sample that has a causal relationship with the classification label but is not identified as a label reason by the target text classification model; based on the wrong label reason and the missing label reason, the initial training set is data enhanced to obtain a second data-enhanced training set; based on the second data-enhanced training set, the target text classification model is trained to obtain an optimized target text classification model, and the optimized target text classification model is used as the target text classification model for classifying the text to be classified.
[0009] According to a reason-based human-computer collaborative text classification method provided by the present invention, the initial training set is data enhanced based on the wrong label reasons and the lost label reasons to obtain a second data-enhanced training set, including: based on the wrong label reasons, the training samples corresponding to the wrong label reasons in the initial training set are data enhanced to obtain wrong label reason enhanced training samples corresponding to the training samples; based on the lost label reasons, the training samples corresponding to the lost label reasons in the initial training set are data enhanced to obtain lost label reason enhanced training samples corresponding to the training samples; based on the training samples, the wrong label reason enhanced training samples and the lost label reason enhanced training samples, the second data-enhanced training set is obtained.
[0010] According to a reason-based human-computer collaborative text classification method provided by the present invention, based on the wrong label reasons, data enhancement is performed on the training samples corresponding to the wrong label reasons in the initial training set to obtain wrong label reason enhanced training samples corresponding to the training samples, including: synonym replacement of the wrong label reasons of the training samples to obtain wrong label reason enhanced training samples corresponding to the training samples.
[0011] According to a reason-based human-computer collaborative text classification method provided by the present invention, based on the lost label reason, data enhancement is performed on the training samples corresponding to the lost label reason in the initial training set to obtain lost label reason enhanced training samples corresponding to the training samples, including: extracting a text segment containing the lost label reason from the training sample, and using the text segment containing the lost label reason as the lost label reason enhanced training sample corresponding to the training sample.
[0012] According to a human-computer collaborative text classification method centered on reason basis provided by the present invention, the reason for the wrong label is determined in the following manner: based on a post-combination component analysis algorithm, a phrase in the text information of a first training sample is removed to obtain a first test training sample; based on the target text classification model, a first confidence level for the text classification result of the first test sample is obtained; based on the target text classification model, a reference confidence level for the text classification result of the first training sample is obtained; if the absolute value of the difference between the first confidence level and the reference confidence level is greater than a first numerical threshold, and the removed phrase is different from the label reason of the first training sample, the phrase is used as the reason for the wrong label of the first training sample.
[0013] According to a reason-based human-computer collaborative text classification method provided by the present invention, the reason for lost labels is determined in the following manner: based on a post-combination component analysis algorithm, a phrase in the text information of a second training sample is removed to obtain a second test training sample; based on the target text classification model, a second confidence level for the text classification result of the second test sample is obtained; based on the target text classification model, a reference confidence level for the text classification result of the second training sample is obtained; if the absolute value of the difference between the second confidence level and the reference confidence level is less than a second numerical threshold, and the removed phrase has the same label reason as the second training sample, the phrase is used as the reason for lost labels for the second training sample.
[0014] The present invention also provides a human-machine collaborative text classification device centered on reason basis, the device comprising: a determination module, used to train a text classification model based on a first data-enhanced training set to obtain a target text classification model, wherein the first data-enhanced training set is determined in the following manner: an initial training set is obtained, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the text information of the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; data enhancement is performed on the initial training set based on the label reason to obtain the first data-enhanced training set; a processing module is used to obtain the text to be classified, and input the text to be classified into the target text classification model to obtain the text classification result output by the target text classification model.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the human-computer collaborative text classification method based on reason basis as described above is implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described human-computer collaborative text classification methods centered on reason basis.
[0017] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned human-computer collaborative text classification methods centered on reason basis.
[0018] The human-machine collaborative text classification method and device based on reason basis provided by the present invention performs data enhancement on the initial training set of a small sample size through label reasons to obtain a first data-enhanced training set, and trains the text classification model based on the first data-enhanced training set to obtain a target text classification model. Then, the text to be classified is classified based on the target text classification model to eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, thereby improving the accuracy of the classification results of the target text classification model for the text to be classified. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 is a schematic diagram of an example of a pseudo mode described in the present invention;
[0021] Figure 2 It is one of the flow charts of the human-machine collaborative text classification method centered on reason basis provided by the present invention;
[0022] Figure 3 This is the second flow chart of the human-machine collaborative text classification method based on reason basis provided by the present invention;
[0023] Figure 4 It is a flow chart of performing data enhancement on an initial training set based on wrong label reasons and missing label reasons to obtain a second data enhanced training set provided by the present invention;
[0024] Figure 5 is a schematic diagram of a flow chart for determining the reason for an erroneous label provided by the present invention;
[0025] Figure 6 It is a schematic diagram of a flow chart of determining the reason for losing a tag provided by the present invention;
[0026] Figure 7 It is a schematic diagram of a scenario application of the human-machine collaborative text classification method centered on reason basis provided by the present invention;
[0027] Figure 8 It is a structural schematic diagram of a human-machine collaborative text classification device centered on reason basis provided by the present invention;
[0028] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. 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.
[0030] Text classification refers to a technical means of automatically classifying and marking text according to certain standards. As known from the related art, a text classification model can be used to process the input text to output the classification result of the text.
[0031] Data-driven neural network models (such as text classification models) are prone to introduce pseudo-patterns when trained with small sample sizes, which in turn leads to low accuracy of the output text classification results. Pseudo-patterns refer to features and labels that have no causal relationship being mistakenly considered to have a causal relationship. Figure 1 Explain pseudo-patterns. Suppose a neural network model correctly predicts a movie review as a negative label, and neutral words such as "performance and details" (underlined words) are mistakenly identified by the model as key information that leads to the negative sentiment of the movie review. However, according to human common sense, "terrible" and "disappointing" (bold words) are the real reasons why the movie review has negative sentiment. Here, the features that are mistakenly identified as reason information by the model can be called pseudo-features, and the association between such pseudo-features and correct predictions is called pseudo-patterns.
[0032] These pseudo-pattern-based neural network models are usually not consistent with logical causality during the testing phase (especially on cross-domain distributed test data), which will damage the accuracy of classification tasks in actual scenarios. In addition, the generalization and robustness of neural networks that rely on pseudo-patterns are also limited.
[0033] Most of these pseudo-patterns are caused by artificial dataset flaws or deviations in the training data. In particular, when the amount of training data is very small (i.e., there is only a small amount of labeled data), the model is more likely to rely on pseudo-patterns. Despite these problems, using a small amount of labeled data to train deep neural networks (also known as small sample learning) is still a compelling scenario, because in real applications, unlabeled data may be very abundant, but labeled data is very expensive to obtain. In the present invention, model pseudo-patterns in small sample situations will be corrected by data enhancement guided by causality.
[0034] The present invention proposes a dual robustness deep learning model centered on reason basis, which is a framework for data enhancement in small sample scenarios. It is an efficient, robust, model-independent, and cross-task universal method. Through the human-machine collaborative text classification method centered on reason basis provided by the present invention, the influence of pseudo-patterns on the classification accuracy of the text classification model can be eliminated, thereby improving the accuracy of the classification results of the target text classification model for the text to be classified.
[0035] In order to further introduce the human-computer collaborative text classification method centered on reason basis provided by the present invention, it will be described in conjunction with the following embodiments.
[0036] Figure 2 This is one of the flow charts of the human-computer collaborative text classification method centered on reason basis provided by the present invention.
[0037] In an exemplary embodiment of the present invention, Figure 2 As shown, the human-computer collaborative text classification method centered on reason basis may include step 210 and step 220, and each step will be introduced below.
[0038] In step 210, a text classification model is trained based on a first data-enhanced training set to obtain a target text classification model, wherein the first data-enhanced training set is determined in the following manner: an initial training set is obtained, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; data enhancement is performed on the initial training set based on the label reason to obtain a first data-enhanced training set.
[0039] It should be noted that the quantity threshold can be adjusted according to actual conditions, and the quantity threshold is not specifically limited in this embodiment. It is understandable that the initial training set can be a training set with a small sample size. In one example, the initial training set can be a training set with a small sample size of 50 samples.
[0040] In one example, a label reason refers to a text segment in a training sample that determines a classification label. For a movie review with a positive sentiment label (corresponding to a training sample), "good" and "like" in "this movie is good, I like it" can be used as label reasons for this movie review with a positive sentiment label.
[0041] In step 220, the text to be classified is obtained, and the text to be classified is input into a target text classification model to obtain a text classification result output by the target text classification model.
[0042] In one embodiment, a text classification model may be trained based on the first data-enhanced training set to obtain a target text classification model, and then the text to be classified may be classified based on the target text classification model to obtain a text classification result for the text to be classified.
[0043] Among them, the first data-enhanced training set is included on the basis of the initial training set with a small sample size, and multiple groups of semi-factual data are generated based on the label reasons of each training sample. In this embodiment, multiple groups of semi-factual data are generated based on label reasons to achieve data enhancement of the initial training set (i.e., obtain the first data-enhanced training set), which can spend less time to generate more effective enhanced data about the initial training set. In this embodiment, based on more effective enhanced data about the initial training set, it can be ensured that the trained target text classification model can eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, thereby improving the accuracy of the classification results of the target text classification model for the classified text. And based on the experimental results, it is shown that in this embodiment, the model trained by annotating 50 examples (corresponding to the target text classification model) can maintain a similar accuracy rate to the model trained by 1707 examples under the same conditions.
[0044] The human-machine collaborative text classification method based on reason basis provided by the present invention performs data enhancement on an initial training set of a small sample size through label reasons to obtain a first data-enhanced training set, and trains a text classification model based on the first data-enhanced training set to obtain a target text classification model. Then, based on the target text classification model, the text to be classified is classified to eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, thereby improving the accuracy of the classification results of the target text classification model for the text to be classified.
[0045] The following will describe the process of performing data enhancement on the initial training set based on label reasons to obtain the first data enhanced training set in conjunction with the following embodiments.
[0046] In an exemplary embodiment of the present invention, data enhancement is performed on the initial training set based on label reasons, and the first data-enhanced training set can be determined in the following manner: based on label reasons, data enhancement is performed on the training samples corresponding to the label reasons in the initial training set to obtain label-reason enhanced training samples corresponding to the training samples; and the training samples are enhanced based on the training samples and the label reasons to obtain the first data-enhanced training set.
[0047] During the application process, data enhancement can be performed on each training sample based on the label reason of each training sample in the initial training set to obtain a label reason enhanced training sample corresponding to the training sample. Then, based on all the training samples and all the corresponding label reason enhanced training samples, a first data enhanced training set is formed. It can be understood that the first data enhanced training set includes expanding more effective label reason enhanced training samples based on the initial training set with a small sample size. The first data enhanced training set can be formed based on the label reason enhanced training samples and the initial training set. In this embodiment, it is achieved that a data enhanced training set with a larger sample size can be obtained based on a training set with a small sample size, thereby ensuring that the trained target text classification model can eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, and improve the accuracy of the classification results of the target text classification model for the text to be classified.
[0048] In order to further introduce the reason-based human-machine collaborative text classification method provided by the present invention, the following will be combined with the following embodiments to illustrate the process of performing data enhancement on the training samples corresponding to the label reasons in the initial training set based on label reasons to obtain label reason enhanced training samples corresponding to the training samples.
[0049] In an exemplary embodiment of the present invention, based on label reasons, data enhancement is performed on the training samples corresponding to the label reasons in the initial training set, and the label reason enhanced training samples corresponding to the training samples can be determined in the following manner: based on the label reasons, non-label reasons in the training samples corresponding to the label reasons are determined, wherein the non-label reasons are other text fragments in the training samples except the label reasons; the non-label reasons of the training samples are replaced with synonyms to obtain the label reason enhanced training samples corresponding to the training samples.
[0050] In one example, the non-label reason refers to other text segments in the training sample except the label reason. Let's continue to use the training sample "This movie is good, I like it" as an example. Since the label reasons of this training sample are "good" and "like", the non-label reason of this training sample can be "this movie".
[0051] During the application process, the label reason part of the training sample can be fixed, and the non-label reason part can be replaced with multiple synonyms to generate a variety of different semi-factual data, thereby obtaining a label reason enhanced training sample corresponding to the training sample.
[0052] Continuing with the aforementioned training sample "This movie is good, I like it" as an example, the label reason enhanced training sample obtained based on the label reason of the training sample can be "This movie is really good, I like it". It can be understood that the classification label of the label reason enhanced training sample is consistent with the classification label of the corresponding training sample. It can be understood that the label of "This movie is really good, I like it" is a positive emotion. In this embodiment, by constructing the first data enhanced training set, the dependence of the text classification model on label reasons can be enhanced while reducing the dependence of the text classification model on non-label reasons, thereby ensuring that the trained target text classification model can eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model.
[0053] In one embodiment, given a training instance xi=[t i1 ,t i2 ,…,t ij ](where t ij is the jth label of the i-th document) and its corresponding sentiment label y i . We can create a label justification vector r i =[a i1 ,a i2 , …, a ij ], where a ij It means t ij Is it the value of the label reason (set a ij =1 means t ij is the label reason, otherwise set to 0). To generate a semi-fact instance x i '(corresponding to the label reason enhancement training sample), a certain number of non-label reasons can be randomly replaced, where a ij =0), and remove punctuation. Among them, synonyms can be automatically retrieved from vocabulary libraries such as WordNet, or generated using the mask function of a pre-trained context-aware language model. In this embodiment, the mask prediction function of the RoBERTa model can be used to automatically generate synonymous replacement words. In one example, 5% of non-label reasons can be randomly replaced, and RoBERTa can be used to generate corresponding semi-factual enhanced data.
[0054] During the application process, data enhancement of 1:n can be performed for each training sample to generate semi-factual data (corresponding to label reason enhanced training samples). Among them, the value of n is a positive integer greater than or equal to 1, and the specific value of n can be adjusted according to the actual situation. Considering that artificially generating counterfactual data requires more time and it is more difficult to control the quality of data generation, the data enhancement method of the initial training set provided by the present invention (to obtain the first data enhanced training set) saves time and effort.
[0055] Human intelligent activities can be divided into three levels: observation, intervention, and counterfactuals. In the past, artificial intelligence model research has focused on the observation layer, that is, observing the correlation between data and labels from the data rather than the causal relationship to train the model. However, in order to achieve general strong artificial intelligence in real scenarios, intervention is particularly important. Therefore, the present invention will consider dynamic intervention to achieve rapid and accurate generalization of the model under a small sample size training set.
[0056] The present invention will illustrate the process of another human-computer collaborative text classification method centered on reason basis in conjunction with the following embodiments.
[0057] Figure 3 This is the second flow chart of the human-computer collaborative text classification method centered on reason basis provided by the present invention.
[0058] In an exemplary embodiment of the present invention, Figure 3 As shown, the reason-based human-computer collaborative text classification method may include steps 310 to 350, wherein step 310 is the same as or similar to step 210. For its specific implementation and beneficial effects, please refer to the previous description, which will not be repeated in this embodiment. Steps 320 to 350 will be introduced separately below.
[0059] In step 320, the wrong label reason and the missing label reason of each training sample in the initial training set are determined respectively, wherein the wrong label reason is a text segment of the training sample that has no causal relationship with the classification label but is mistakenly identified as a label reason by the target text classification model, and the missing label reason is a text segment of the training sample that has a causal relationship with the classification label but is not identified as a label reason by the target text classification model.
[0060] In one embodiment, the wrong label reason refers to a text segment of the training sample that has no causal relationship with the classification label but is mistakenly identified as a label reason by the target text classification model. The missing label reason refers to a text segment of the training sample that has a causal relationship with the classification label but is not identified as a label reason by the target text classification model.
[0061] Continuing with the training sample "This movie is really good, I like it" mentioned above, the text classification model determines that the label is positive emotion based on the information of "this movie". Since the real label reason of the training sample is "good" or "like", and the text classification model identifies the wrong label reason (this movie), this reason can be used as the wrong label reason for the training sample. In another example, the text classification model does not determine that the label of the training sample is positive emotion based on "good" or "like", that is, the text classification model misses the correct reason ("good" or "like"), and this reason can be used as the missing label reason for the training sample.
[0062] In step 330, data enhancement is performed on the initial training set based on the reasons for the wrong labels and the reasons for the missing labels to obtain a second data-enhanced training set.
[0063] During the application process, semi-factual data about the training samples can be generated based on the reasons for the wrong labels and the reasons for the missing labels, so as to expand the initial training set to obtain the second data-enhanced training set.
[0064] The following will be combined Figure 4 The process of obtaining the second data-enhanced training set is described.
[0065] In an exemplary embodiment of the present invention, Figure 4 It can be seen that performing data enhancement on the initial training set based on the reasons for the wrong labels and the reasons for the missing labels to obtain the second data enhanced training set may include steps 410 to 430, and each step will be introduced below.
[0066] In step 410, based on the wrong label reasons, data enhancement is performed on the training samples corresponding to the wrong label reasons in the initial training set to obtain wrong label reason enhanced training samples corresponding to the training samples.
[0067] In one embodiment, based on the reasons for the wrong labels, data enhancement is performed on the training samples corresponding to the reasons for the wrong labels in the initial training set, and the training samples enhanced with the reasons for the wrong labels corresponding to the training samples can be determined in the following manner: synonyms are replaced for the reasons for the wrong labels of the training samples to obtain the training samples enhanced with the reasons for the wrong labels corresponding to the training samples.
[0068] In step 420, based on the missing label reasons, data enhancement is performed on the training samples corresponding to the missing label reasons in the initial training set to obtain missing label reason enhanced training samples corresponding to the training samples.
[0069] In one embodiment, based on the reasons for missing labels, data enhancement is performed on the training samples corresponding to the reasons for missing labels in the initial training set, and the training samples enhanced with reasons for missing labels corresponding to the training samples can be determined in the following manner: a text segment containing the reasons for missing labels is extracted from the training samples, and the text segment containing the reasons for missing labels is used as the training sample enhanced with reasons for missing labels corresponding to the training samples.
[0070] In step 430, a second data-enhanced training set is obtained based on the training samples, the training samples enhanced by the reasons for the wrong labels, and the training samples enhanced by the reasons for the missing labels.
[0071] In the application process, for training samples corresponding to wrong label reasons, synonym replacement can be used to generate semi-factual data (corresponding to wrong label reason enhanced training samples). In one example, synonym replacement can be performed on wrong label reasons to obtain wrong label reason enhanced training samples.
[0072] For the training samples corresponding to the reasons for missing labels, a simple semi-factual data (corresponding to the training samples enhanced with the reasons for missing labels) generation strategy can be adopted. That is, sentences containing the reasons for missing labels are extracted from the corresponding training samples to obtain the training samples enhanced with the reasons for missing labels. Specifically, given a training sample containing the reasons for missing labels, a text segment containing the reasons for missing labels can be extracted from the training sample as a new instance, wherein the classification label of the newly generated instance is the same as the classification label of the training sample. In one example, there is a movie review with a positive sentiment label "Robert is a good actor who makes this TV movie expressive". The model failed to identify "very good" and "expressive" as label reasons. Therefore, we extract this sentence separately as a new example, and still set the label of this example to positive sentiment. Extracting an entire sentence can retain more semantic information than extracting the label reasons that the model fails to recognize separately. Furthermore, the generated instance can be added to the initial small sample training set to retrain the model.
[0073] In step 340, a target text classification model is trained based on the second data-enhanced training set to obtain an optimized target text classification model.
[0074] In step 350, the text to be classified is obtained, and the text to be classified is input into the optimized target text classification model to obtain the text classification result output by the optimized target text classification model.
[0075] In the application process, the training samples, the training samples enhanced by the reasons for the wrong labels and the training samples enhanced by the reasons for the lost labels can be used to obtain the second data-enhanced training set. Further, the target text classification model is trained based on the second data-enhanced training set to obtain the optimized target text classification model. In the application process, the optimized target text classification model can be used as the target text classification model for classifying the classified text, that is, the optimized target text classification model is used as the final target text classification model for the text classification result output based on the optimized target text classification model. Through this embodiment, the accuracy of the classification result of the text classification model can be further improved. And based on the experimental results, it is shown that in this embodiment, the model trained by annotating 50 examples (corresponding to the optimized target text classification model) can maintain a similar accuracy rate to the model trained by 3414 examples under the same conditions.
[0076] It should be noted that, for the second data-enhanced training set, it can be composed of enhanced training samples with reasons for incorrect labels and an initial training set, and can also be composed of enhanced training samples with reasons for missing labels and an initial training set.
[0077] Figure 5 It is a schematic diagram of a flow chart for determining the reason for an erroneous label provided by the present invention.
[0078] The present invention will combine Figure 5 Describe the process for determining the reason for an incorrect label.
[0079] In an exemplary embodiment of the present invention, Figure 5 It can be seen that determining the reason for the wrong label may include steps 510 to 540, and each step will be introduced below.
[0080] In step 510, the phrases in the text information of the first training sample are removed based on a post-combination component analysis algorithm to obtain a first test training sample.
[0081] The post-combination component analysis algorithm (also known as the SCD algorithm) is an algorithm that evaluates the importance of deleted words by continuously deleting words and measuring the changes in the model classification prediction. In one embodiment, the phrases can be determined according to actual conditions and can be divided into units of single words, double words or three words.
[0082] In step 520, a first confidence level of a text classification result of a first test sample is obtained based on the target text classification model.
[0083] In step 530, a reference confidence level of a text classification result of the first training sample is obtained based on the target text classification model.
[0084] In step 540, if the absolute value of the difference between the first confidence and the reference confidence is greater than the first numerical threshold, and the removed phrase is different from the label reason of the first training sample, the phrase is used as the wrong label reason of the first training sample.
[0085] The first numerical threshold can be determined according to actual conditions and is not specifically limited in this embodiment.
[0086] Figure 6 It is a schematic diagram of a flow chart for determining the reason for losing a label provided by the present invention.
[0087] The present invention will combine Figure 6 Describe the process for determining the reason for missing tags.
[0088] In an exemplary embodiment of the present invention, Figure 6It can be seen that determining the reason for losing the tag may include steps 610 to 640, and each step will be introduced below.
[0089] In step 610, the phrases in the text information of the second training sample are removed based on a post-combination component analysis algorithm to obtain a second test training sample.
[0090] In step 620, a second confidence level of a text classification result of a second test sample is obtained based on the target text classification model.
[0091] In step 630, a reference confidence level of a text classification result of a second training sample is obtained based on the target text classification model.
[0092] In step 640, if the absolute value of the difference between the second confidence and the reference confidence is less than the second numerical threshold, and the removed phrase is the same as the label reason of the second training sample, the phrase is used as the missing label reason of the second training sample.
[0093] The second numerical threshold may be determined according to actual conditions and is not specifically limited in this embodiment.
[0094] In the application process, the post-combination component analysis algorithm can be applied to the target text classification model to obtain the attention score of the deleted words on the model judgment (the greater the impact on the model judgment, the higher the score). At the same time, the label reasons in the training samples can be compared with the model attention score to obtain two common errors of the model: the wrong reasons recognized by the model (corresponding to the wrong label reasons) and the correct reasons omitted by the model (corresponding to the missing label reasons).
[0095] In order to further introduce the human-computer collaborative text classification method based on reason basis provided by the present invention, Figure 7 Provide explanation.
[0096] Figure 7 It is a schematic diagram of a scenario application of the human-computer collaborative text classification method centered on reason basis provided by the present invention.
[0097] In one embodiment, in combination Figure 7 It can be seen that the process of training a text classification model based on the first data-enhanced training set can be called a process of replacing part of the static irrational basis. In the application process, the training sample "This movie is good, I like it" (classification label is positive emotion) is used as an example for explanation. The reason basis of the training sample can be annotated, that is, the text segments "good" and "like" that determine the classification label can be annotated and used as the label reason of the training sample. Furthermore, the initial training set can be data enhanced based on the label reason to obtain the first data-enhanced training set.
[0098] During the application process, based on the label reasons, the non-label reasons in the training samples corresponding to the label reasons can be determined, where the non-label reasons are other text fragments in the training samples except the label reasons; the non-label reasons of the training samples are replaced with synonyms to obtain the label reason enhanced training samples corresponding to the training samples.
[0099] Continuing with the training sample "This movie is good, I like it" mentioned above, the non-label reason is "this movie", which is replaced by "this movie" after synonymous substitution, and then the label reason enhanced training sample "This movie is really good, I like it" corresponding to the training sample can be obtained. Further, based on the training sample and the label reason enhanced training sample, the first data enhanced training set is obtained. The text classification model is trained based on the first data enhanced training set to obtain the target text classification model.
[0100] Furthermore, the process of training the target text classification model based on the training set after the second data enhancement can be called a process of dynamic manual intervention to correct the basis for model judgment. In the application process, the reasons for the wrong labels and the reasons for the missing labels of the training samples can be obtained through the post-combination component analysis algorithm. And the basis for model errors is corrected based on the reasons for the wrong labels, and the basis for model omissions is corrected based on the reasons for the missing labels.
[0101] Continuing with the training sample "This movie is really good, I like it" mentioned above as an example, the text classification model determines that the label is a positive emotion based on the information "The movie is good". Since the real label reason of the training sample is "good" or "like", and the text classification model identifies the wrong reason (the movie is good), this reason can be used as the reason for the wrong label of the training sample.
[0102] In another example, the text classification model did not determine that the label of the training sample was positive sentiment based on "like", that is, the text classification model missed the correct reason ("like"), which can be used as the reason for the missing label of the training sample.
[0103] During the application process, semi-factual data about the training samples can be generated based on the reasons for the wrong labels and the reasons for the missing labels, so as to expand the initial training set to obtain the second data-enhanced training set. During the application process, for the training samples corresponding to the reasons for the wrong labels, synonym replacement can be used to generate semi-factual data (corresponding to the wrong label reason enhanced training samples). In one example, the wrong label reasons can be replaced with synonyms to obtain wrong label reason enhanced training samples. Continuing with the example of the wrong label reason "the movie is true" mentioned above, the wrong label reasons are replaced with synonyms to obtain wrong label reason enhanced training samples (the movie is quite good, I like it).
[0104] In another example, for the training samples corresponding to the reasons for missing labels, a simple semi-factual data (corresponding to the training samples enhanced with the reasons for missing labels) generation strategy can be adopted. That is, sentences containing the reasons for missing labels are extracted from the corresponding training samples to obtain the training samples enhanced with the reasons for missing labels. Continuing with the example of the reason for missing labels being "like" mentioned above, a text segment containing the reasons for missing labels is extracted from the training samples as a new instance, and a training sample enhanced with the reasons for missing labels (I like it) can be obtained.
[0105] Furthermore, a second data-enhanced training set can be obtained based on the training samples, the training samples enhanced with reasons for wrong labels, and the training samples enhanced with reasons for missing labels, and a target text classification model can be trained based on the second data-enhanced training set to obtain an optimized target text classification model. The text to be classified is classified based on the target text classification model to eliminate the influence of the pseudo-pattern on the classification accuracy of the text classification model, thereby improving the accuracy of the classification result of the target text classification model for the text to be classified.
[0106] The human-machine collaborative text classification method centered on reason basis provided by the present invention can improve the generalizability of pre-trained language (such as text classification model) in task classification through a small number of training sample sets. The present invention proposes a training method for training a text classifier based on a large-scale pre-trained language model under a small sample. Its unique data construction method and the training method of introducing manual annotation (corresponding to the label reason of the training sample) are intended to allow the model to obtain the best generalization and robustness with the least data training (by controlling the model judgment basis to be consistent with the human judgment logic). Experimental results show that the model trained by annotating 50 examples can maintain a similar accuracy to the model trained by 1707 examples under the same conditions. The present invention can be applied to any scenario in the industry that requires text classification (such as market sentiment analysis scenarios, news data classification scenarios, and dialogue intent recognition scenarios, etc.), and has a wide range of use value. In addition, the present invention only requires a small number of training samples, reducing the cost of model training.
[0107] According to the above description, the human-machine collaborative text classification method based on reason basis provided by the present invention performs data enhancement on the initial training set of a small sample size through label reasons to obtain a first data-enhanced training set, and trains the text classification model based on the first data-enhanced training set to obtain a target text classification model. Then, the text to be classified is classified based on the target text classification model to eliminate the influence of pseudo-patterns on the classification accuracy of the text classification model, thereby improving the accuracy of the classification results of the target text classification model for the text to be classified.
[0108] Based on the same concept, the present invention also provides a human-machine collaborative text classification device centered on reason basis.
[0109] The following is a description of the human-machine collaborative text classification device based on reason basis provided by the present invention. The human-machine collaborative text classification device based on reason basis described below and the human-machine collaborative text classification method based on reason basis described above can be referenced to each other.
[0110] Figure 8 It is a structural schematic diagram of the human-machine collaborative text classification device centered on reason basis provided by the present invention.
[0111] In an exemplary embodiment of the present invention, a human-machine collaborative text classification device centered on reason basis may include a determination module 810 and a processing module 820, and each module will be introduced below.
[0112] The determination module 810 can be configured to train a text classification model based on a first data-enhanced training set to obtain a target text classification model, wherein the first data-enhanced training set is determined in the following manner: an initial training set is obtained, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the text information of the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; data enhancement is performed on the initial training set based on the label reason to obtain a first data-enhanced training set.
[0113] The processing module 820 may be configured to obtain the text to be classified, and input the text to be classified into a target text classification model to obtain a text classification result output by the target text classification model.
[0114] In an exemplary embodiment of the present invention, the determination module 810 can perform data enhancement on the initial training set based on label reasons to obtain a first data enhanced training set in the following manner: based on label reasons, perform data enhancement on the training samples corresponding to the label reasons in the initial training set to obtain label reason enhanced training samples corresponding to the training samples; enhance the training samples based on the training samples and the label reasons to obtain the first data enhanced training set.
[0115] In an exemplary embodiment of the present invention, the determination module 810 can perform data enhancement on the training samples corresponding to the label reasons in the initial training set based on the label reasons to obtain the label reason enhanced training samples corresponding to the training samples in the following manner: based on the label reasons, determine the non-label reasons in the training samples corresponding to the label reasons, wherein the non-label reasons are other text segments in the training samples except the label reasons; perform synonym replacement on the non-label reasons of the training samples to obtain the label reason enhanced training samples corresponding to the training samples.
[0116] In an exemplary embodiment of the present invention, the determination module 810 can also be configured to respectively determine the wrong label reasons and missing label reasons for each training sample in the initial training set, wherein the wrong label reason is a text segment of the training sample that has no causal relationship with the classification label but is mistakenly identified as a label reason by the target text classification model, and the missing label reason is a text segment of the training sample that has a causal relationship with the classification label but is not identified as a label reason by the target text classification model; the initial training set is data enhanced based on the wrong label reasons and the missing label reasons to obtain a second data-enhanced training set; the target text classification model is trained based on the second data-enhanced training set to obtain an optimized target text classification model, and the optimized target text classification model is used as the target text classification model for classifying the text to be classified, that is, the optimized target text classification model is used as the final target text classification model.
[0117] In an exemplary embodiment of the present invention, the determination module 810 can perform data enhancement on the initial training set based on the wrong label reasons and the lost label reasons to obtain a second data enhanced training set in the following manner: based on the wrong label reasons, data enhancement is performed on the training samples corresponding to the wrong label reasons in the initial training set to obtain wrong label reason enhanced training samples corresponding to the training samples; based on the lost label reasons, data enhancement is performed on the training samples corresponding to the lost label reasons in the initial training set to obtain lost label reason enhanced training samples corresponding to the training samples; based on the training samples, the wrong label reason enhanced training samples and the lost label reason enhanced training samples, the second data enhanced training set is obtained.
[0118] In an exemplary embodiment of the present invention, the determination module 810 can perform data enhancement on the training samples corresponding to the wrong label reasons in the initial training set based on the wrong label reasons to obtain the wrong label reason enhanced training samples corresponding to the training samples in the following manner: replace the wrong label reasons of the training samples with synonyms to obtain the wrong label reason enhanced training samples corresponding to the training samples. The synonym replacement step can be implemented by the function interface of the prediction mask word provided by the pre-training model.
[0119] In an exemplary embodiment of the present invention, the determination module 810 can perform data enhancement on the training samples corresponding to the reasons for missing labels in the initial training set based on the reasons for missing labels in the following manner to obtain training samples enhanced with reasons for missing labels corresponding to the training samples: extract text segments containing reasons for missing labels from the training samples, and use the text segments containing reasons for missing labels as training samples enhanced with reasons for missing labels corresponding to the training samples.
[0120] In an exemplary embodiment of the present invention, the determination module 810 can determine the reason for the wrong label in the following manner: based on the post-combination component analysis algorithm, remove the phrase in the text information of the first training sample to obtain a first test training sample; based on the target text classification model, obtain a first confidence level for the text classification result of the first test sample; based on the target text classification model, obtain a reference confidence level for the text classification result of the first training sample; if the absolute value of the difference between the first confidence level and the reference confidence level is greater than the first numerical threshold, and the removed phrase is different from the label reason of the first training sample, then the phrase is used as the reason for the wrong label of the first training sample.
[0121] In an exemplary embodiment of the present invention, the determination module 810 can determine the reason for missing labels in the following manner: based on a post-combination component analysis algorithm, remove the phrase in the text information of the second training sample to obtain a second test training sample; based on the target text classification model, obtain a second confidence level for the text classification result of the second test sample; based on the target text classification model, obtain a reference confidence level for the text classification result of the second training sample; if the absolute value of the difference between the second confidence level and the reference confidence level is less than a second numerical threshold, and the removed phrase is the same as the label reason of the second training sample, then the phrase is used as the reason for missing labels for the second training sample.
[0122] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the human-machine collaborative text classification method centered on the reason basis, the method comprising: training a text classification model based on a first data-enhanced training set to obtain a target text classification model; obtaining a text to be classified, and inputting the text to be classified into the target text classification model to obtain a text classification result output by the target text classification model; wherein the first data-enhanced training set is determined in the following manner: obtaining an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; performing data enhancement on the initial training set based on the label reason to obtain a first data-enhanced training set.
[0123] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0124] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the human-computer collaborative text classification method centered on reason basis provided by the above methods, and the method includes: training a text classification model based on a first data-enhanced training set to obtain a target text classification model; obtaining a text to be classified, and inputting the text to be classified into a target text classification model to obtain a text classification result output by the target text classification model; wherein the first data-enhanced training set is determined in the following manner: obtaining an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; data enhancement is performed on the initial training set based on the label reason to obtain a first data-enhanced training set.
[0125] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the human-computer collaborative text classification method based on reason basis provided by the above-mentioned methods, the method comprising: training a text classification model based on a first data-enhanced training set to obtain a target text classification model; obtaining a text to be classified, and inputting the text to be classified into the target text classification model to obtain a text classification result output by the target text classification model; wherein the first data-enhanced training set is determined in the following manner: obtaining an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason being a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; performing data enhancement on the initial training set based on the label reason to obtain a first data-enhanced training set.
[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0128] It is further understood that, although the operations are described in a specific order in the accompanying drawings in the embodiments of the present invention, it should not be understood as requiring the operations to be performed in the specific order or serial order shown, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A human-computer collaborative text classification method centered on reason basis, characterized in that: The method comprises: Training a text classification model based on the first data-enhanced training set to obtain a target text classification model; Acquire a text to be classified, and input the text to be classified into the target text classification model to obtain a text classification result output by the target text classification model; The first data-enhanced training set is determined in the following manner: Acquire an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, the label reason is a text segment in the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; The initial training set is data enhanced based on the label reason to obtain the first data-enhanced training set, wherein after training the text classification model based on the first data-enhanced training set to obtain the target text classification model, the method further includes: Respectively determine the wrong label reason and the missing label reason of each training sample in the initial training set, wherein the wrong label reason is a text segment of the training sample that has no causal relationship with the classification label but is mistakenly recognized as a label reason by the target text classification model, and the missing label reason is a text segment of the training sample that has a causal relationship with the classification label but is not recognized as a label reason by the target text classification model; Performing data enhancement on the initial training set based on the reasons for the wrong labels and the reasons for the missing labels to obtain a second data-enhanced training set; The target text classification model is trained based on the second data-enhanced training set to obtain an optimized target text classification model, and the optimized target text classification model is used as the target text classification model for classifying the text to be classified.
2. The human-computer collaborative text classification method based on reason basis according to claim 1 is characterized in that: The performing data enhancement on the initial training set based on the label reason to obtain the first data-enhanced training set includes: Based on the label reason, data enhancement is performed on the training samples corresponding to the label reason in the initial training set to obtain label reason enhanced training samples corresponding to the training samples; The training samples are enhanced based on the training samples and the label reasons to obtain the first data-enhanced training set.
3. The human-computer collaborative text classification method based on reason basis according to claim 2 is characterized in that: The step of performing data enhancement on the training samples corresponding to the label reasons in the initial training set based on the label reasons to obtain label reason enhanced training samples corresponding to the training samples includes: Based on the label reason, determining a non-label reason in the training sample corresponding to the label reason, wherein the non-label reason is other text segments in the training sample except the label reason; The non-label reasons of the training samples are replaced with synonyms to obtain label reason enhanced training samples corresponding to the training samples.
4. The human-computer collaborative text classification method based on reason basis according to claim 1 is characterized in that: The step of performing data enhancement on the initial training set based on the reasons for the wrong labels and the reasons for the missing labels to obtain a second data-enhanced training set includes: Based on the wrong label reason, data enhancement is performed on the training sample corresponding to the wrong label reason in the initial training set to obtain an wrong label reason enhanced training sample corresponding to the training sample; Based on the reason for missing labels, data enhancement is performed on the training samples corresponding to the reason for missing labels in the initial training set to obtain training samples enhanced with the reason for missing labels corresponding to the training samples; Based on the training samples, the training samples enhanced by the reasons for the wrong labels and the training samples enhanced by the reasons for the missing labels, the second data-enhanced training set is obtained.
5. The human-machine collaborative text classification method based on reason basis according to claim 4 is characterized in that: The step of performing data enhancement on the training samples corresponding to the wrong label reasons in the initial training set based on the wrong label reasons to obtain wrong label reason enhanced training samples corresponding to the training samples includes: The wrong label reasons of the training samples are replaced with synonyms to obtain wrong label reason enhanced training samples corresponding to the training samples.
6. The human-machine collaborative text classification method based on reason basis according to claim 4 is characterized in that: The step of performing data enhancement on the training samples corresponding to the reasons for losing labels in the initial training set based on the reasons for losing labels to obtain training samples enhanced with reasons for losing labels corresponding to the training samples includes: A text segment containing the reason for the lost label is extracted from the training sample, and the text segment containing the reason for the lost label is used as a lost label reason enhanced training sample corresponding to the training sample.
7. The human-computer collaborative text classification method based on reason basis according to claim 1 is characterized in that: The error label reason is determined in the following way: Removing phrases from the text information of the first training sample based on a post-combination component analysis algorithm to obtain a first test training sample; Based on the target text classification model, obtaining a first confidence level of a text classification result of the first test training sample; Based on the target text classification model, obtaining a reference confidence of a text classification result of the first training sample; If the absolute value of the difference between the first confidence and the reference confidence is greater than a first numerical threshold, and the removed phrase has a different label reason from that of the first training sample, the phrase is used as an incorrect label reason for the first training sample.
8. The human-computer collaborative text classification method based on reason basis according to claim 1 is characterized in that: The reason for the lost label is determined in the following manner: Removing phrases from the text information of the second training sample based on a post-combination component analysis algorithm to obtain a second test training sample; Based on the target text classification model, obtaining a second confidence level of a text classification result of the second test training sample; Based on the target text classification model, obtaining a reference confidence of a text classification result of the second training sample; If the absolute value of the difference between the second confidence and the reference confidence is less than a second numerical threshold, and the removed phrase has the same label reason as the second training sample, the phrase is used as the missing label reason for the second training sample.
9. A human-machine collaborative text classification device centered on reason basis, characterized in that: The device comprises: A determination module is used to train a text classification model based on a first data-enhanced training set to obtain a target text classification model, wherein the first data-enhanced training set is determined in the following manner: obtaining an initial training set, wherein each training sample in the initial training set includes a classification label and a label reason, wherein the label reason is a text segment in the text information of the training sample that determines the classification label, and the sample size of the initial training set is less than a quantity threshold; performing data enhancement on the initial training set based on the label reason to obtain the first data-enhanced training set; The processing module is used to obtain the text to be classified, and input the text to be classified into the target text classification model to obtain the text classification result output by the target text classification model, wherein the determination module is further configured to: Respectively determine the wrong label reason and the missing label reason of each training sample in the initial training set, wherein the wrong label reason is a text segment of the training sample that has no causal relationship with the classification label but is mistakenly recognized as a label reason by the target text classification model, and the missing label reason is a text segment of the training sample that has a causal relationship with the classification label but is not recognized as a label reason by the target text classification model; Performing data enhancement on the initial training set based on the reasons for the wrong labels and the reasons for the missing labels to obtain a second data-enhanced training set; The target text classification model is trained based on the second data-enhanced training set to obtain an optimized target text classification model, and the optimized target text classification model is used as the target text classification model for classifying the text to be classified.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the human-computer collaborative text classification method based on reason basis as described in any one of claims 1 to 8 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the human-computer collaborative text classification method based on reason basis as described in any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the human-computer collaborative text classification method based on reason basis as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Incremental learning method and system based on small number of labeled samples
CN112132179A
Multi-label microblog text classification method based on semi-supervised learning
CN113254599A