Text sample marking method, device, equipment and computer-readable storage medium

By constructing an initial marking model and a simulated marking network model, the automated marking network model realizes automatic marking of large-scale unmarked text samples, solving the complex and time-consuming problem of manual marking in the existing technology and ensuring Ensure the accuracy and balance of marking results.

CN110288011BActive Publication Date: 2024-09-10PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910522329.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-17
Publication Date
2024-09-10
Estimated Expiration
2039-06-17

AI Technical Summary

Technical Problem

It is difficult to automatically label large-scale unlabeled text samples with existing technology, which makes manual labeling complex and time-consuming in terms of manpower and financial resources, and it is difficult to ensure balanced distribution.

Method used

The initial marking model is constructed, which consists of a marking network model and multiple simulated marking network models. The marking network model is trained by presetting unmarked text samples in the training text sample set, and the back propagation algorithm is used to adjust the weight coefficient until The output results are consistent with the preset marking results, realizing automatic marking of text samples to be marked.

Benefits of technology

It realizes automatic marking of large-scale unlabeled text samples, reduces the cost and time of manual marking, and ensures the accuracy and balance of marking results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110288011B
    Figure CN110288011B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and discloses a text sample labeling method, which includes the following steps: constructing an initial labeling model, wherein the initial labeling model is composed of a labeling network model and a plurality of simulated labeling network models; using unlabeled text samples in a preset training text sample set to train the labeling network model to obtain a final labeling network model; using unlabeled text samples in the training text sample set to train the final labeling network model and a plurality of simulated labeling network models to obtain a labeling model; inputting the text sample to be labeled into the labeling model for labeling, and outputting the labeled text sample. The present invention also discloses a text sample labeling device, equipment, and computer-readable storage medium. The present invention realizes automatic labeling of text sample data by training and generating a labeling model, thereby improving the efficiency of labeling of massive data while ensuring the accuracy of the labeled data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text sample labeling method, device, equipment and computer-readable storage medium. Background Art

[0002] At present, the industry mainly uses manual labeling to label unlabeled text samples. The main disadvantages of manual labeling include: complex operation, great consumption of manpower and financial resources. For example, it is easy to label one hundred text samples, but it is very difficult to label ten thousand or even more text samples. In addition, human factors will cause the distribution of labeled text samples to be uneven, and it is difficult to automatically label large-scale unlabeled text samples. How to automatically label a large number of unlabeled text samples in big data scenarios is a technical problem that needs to be solved urgently in this technical field. Summary of the invention

[0003] The main purpose of the present invention is to provide a text sample marking method, device, equipment and computer-readable storage medium, aiming to solve the technical problem in the prior art that it is difficult to automatically mark large-scale unmarked text samples.

[0004] To achieve the above object, the present invention provides a text sample marking method, which comprises the following steps:

[0005] Constructing an initial marking model, wherein the initial marking model is composed of a marking network model and a plurality of simulated marking network models;

[0006] The unlabeled text samples in the preset training text sample set are used to train the labeling network model to obtain the final labeling network model;

[0007] Using the unlabeled text samples in the training text sample set to train the final labeling network model and multiple simulated labeling network models to obtain a labeling model;

[0008] The text sample to be marked is input into the marking model for marking, and the labeled text sample is output.

[0009] Optionally, the constructing of the initial marking model comprises the following steps:

[0010] Monitor the construction process of the labeling network model using long short-term memory network and multi-layer perceptron through the preset monitoring program;

[0011] The construction process of the marking network model is learned by using the Monte Carlo method to obtain multiple simulated marking network models.

[0012] Optionally, the step of training the marking network model using unmarked text samples in the preset training text sample set to obtain the final marking network model comprises the following steps:

[0013] Input the unlabeled text samples in the training text sample set into the labeling network model to perform text sample labeling training, and output the training results;

[0014] Determine whether the training results output by the labeling network model are consistent with the preset labeling results;

[0015] If the training result output by the marking network model is consistent with the preset marking result, the marking network model training is determined to be completed, and the final marking network model is obtained. If the training result output by the marking network model is inconsistent with the preset marking result, the weight coefficient of the marking network model is adjusted through the back propagation algorithm until they are consistent.

[0016] Optionally, the step of using unlabeled text samples in the training text sample set to train a final labeling network model and a plurality of simulated labeling network models to obtain a labeling model comprises the following steps:

[0017] Input the unlabeled text samples in the training text sample set into the final labeling network model and each simulated labeling network model for labeling training, and output the final labeling network model training results and the simulated labeling network model training results;

[0018] Perform weighted calculation on the training results of the marking network model and the training results of the simulated marking network model to obtain a comprehensive training result;

[0019] The comprehensive training results are input into the normalized exponential function for normalization to obtain the machine marking results;

[0020] Compare the machine marking results with the preset marking results of the unmarked text samples in the training text sample set to determine whether the machine marking results are consistent with the preset marking results;

[0021] If the machine marking result is consistent with the preset marking result, it is determined that the marking model training is completed, otherwise the weight ratio is adjusted until the output machine marking result is consistent with the preset marking result.

[0022] Optionally, after the step of learning the construction process of the marking network model by the Monte Carlo method to obtain multiple simulated marking network models, the following steps are also included:

[0023] Input the unlabeled text samples in the training text sample set into the long short-term memory network to obtain the long short-term memory network output result;

[0024] Input the output results of the long short-term memory network into the multi-layer perceptron, and output the training results of the labeling network model for text sample labeling training;

[0025] The unlabeled text samples in the training text sample set are input into the simulated labeling network model, and the training results of the simulated labeling network model are output.

[0026] Optionally, before the step of constructing the initial marking model, the following steps are also included:

[0027] Obtain unlabeled text samples, and input the unlabeled text samples into a text sample set.

[0028] Optionally, after the step of obtaining the unmarked text sample and inputting the unmarked text sample into the text sample set, the following steps are further included:

[0029] The unlabeled text samples in the training text sample set are classified, and different labels are set for the text samples according to the classification to obtain the preset labeling results.

[0030] Furthermore, in order to achieve the above object, the present invention also provides a text sample marking device, which includes the following modules:

[0031] A construction module is used to construct an initial marking model, which is composed of a marking network model and multiple simulated marking network models;

[0032] The first training module is used to train the labeling network model using unlabeled text samples in the preset training text sample set to obtain a final labeling network model;

[0033] The second training module is used to train the final marking network model and multiple simulated marking network models using unmarked text samples in the training text sample set to obtain a marking model;

[0034] The labeling module is used to input the text sample to be labeled into the labeling model for labeling, and output the labeled text sample.

[0035] Optionally, the building block includes the following units:

[0036] A first construction unit is used to monitor the construction process of building a labeling network model using a long short-term memory network and a multilayer perceptron through a preset monitoring program;

[0037] The second construction unit is used to learn the construction process of the labeling network model through the Monte Carlo method.

[0038] Optionally, the first training module is specifically used for:

[0039] Input the unlabeled text samples in the training text sample set into the labeling network model to perform text sample labeling training, and output the training results;

[0040] Determine whether the training results output by the labeling network model are consistent with the preset labeling results;

[0041] If the training result output by the marking network model is consistent with the preset marking result, the marking network model training is determined to be completed, and the final marking network model is obtained. If the training result output by the marking network model is inconsistent with the preset marking result, the weight coefficient of the marking network model is adjusted through the back propagation algorithm until they are consistent.

[0042] Optionally, the second training module includes the following units:

[0043] A training unit, used to input unlabeled text samples in the training text sample set into the final labeling network model and each simulated labeling network model for labeling training, and output the final labeling network model training results and the simulated labeling network model training results;

[0044] A calculation unit, used for performing weighted calculation on the training results of the marking network model and the training results of the simulated marking network model to obtain a comprehensive training result;

[0045] A processing unit, used for inputting the comprehensive training result into a normalized exponential function for normalization processing to obtain a machine marking result;

[0046] A comparison unit, used to compare the machine marking result with the preset marking result of the unmarked text sample in the training text sample set to determine whether the machine marking result is consistent with the preset marking result;

[0047] A determination unit, used to determine that the marking model training is completed when the machine marking result is consistent with the preset marking result;

[0048] The adjusting unit is used to adjust the weight ratio if the machine marking result is inconsistent with the preset marking result, until the output machine marking result is consistent with the preset marking result.

[0049] Optionally, the second construction unit is specifically used for:

[0050] Input the unlabeled text samples in the training text sample set into the long short-term memory network to obtain the long short-term memory network output result;

[0051] Input the output results of the long short-term memory network into the multi-layer perceptron, and output the training results of the labeling network model for text sample labeling training;

[0052] The unlabeled text samples in the training text sample set are input into the simulated labeling network model, and the training results of the simulated labeling network model are output.

[0053] Optionally, the text sample marking device further includes the following modules:

[0054] The acquisition module is used to acquire unlabeled text samples and input the unlabeled text samples into the text sample set.

[0055] Optionally, the text sample marking device further includes the following modules:

[0056] The classification module is used to classify the unlabeled text samples in the training text sample set, and set different labels for the text samples according to the classification to obtain preset labeling results.

[0057] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a text sample marking device, which includes a memory, a processor, and a text sample marking program stored in the memory and executable on the processor, and when the text sample marking program is executed by the processor, the steps of the text sample marking method as described in any one of the above items are implemented.

[0058] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, on which a text sample marking program is stored, and when the text sample marking program is executed by a processor, the steps of the text sample marking method as described in any one of the above items are implemented.

[0059] The present invention provides a text sample labeling method, constructing an initial labeling model, the initial labeling model is composed of a labeling network model and a plurality of simulated labeling network models; using unlabeled text samples in a training text sample set to train the labeling network model; using unlabeled text samples in the training text sample set to train a final labeling network model and a plurality of simulated labeling network models, and obtaining a labeling model; inputting a text sample to be labeled into the labeling model for labeling, and outputting a labeled text sample. The present invention solves the technical problem in the prior art that it is difficult to realize automatic labeling of large-scale unlabeled text samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a structural schematic diagram of the operating environment of the text sample marking device involved in the embodiment of the present invention;

[0061] Figure 2 This is a flow chart of a first embodiment of a text sample marking method of the present invention;

[0062] Figure 3 for Figure 2 A detailed flow chart of step S10 in an embodiment;

[0063] Figure 4 for Figure 2 A detailed flow chart of step S20 in an embodiment;

[0064] Figure 5 for Figure 2 A detailed flow chart of step S30 in an embodiment;

[0065] Figure 6 This is a flow chart of a second embodiment of the text sample marking method of the present invention;

[0066] Figure 7 It is a flowchart of a third embodiment of the text sample marking method of the present invention;

[0067] Figure 8 This is a flow chart of a fourth embodiment of the text sample marking method of the present invention;

[0068] Fig. 9 It is a schematic diagram of the functional modules of an embodiment of a text sample marking device of the present invention.

[0069] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0070] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0071] The invention provides a text sample marking device.

[0072] Reference Figure 1 , Figure 1 It is a structural schematic diagram of the operating environment of the text sample marking device involved in the embodiment of the present invention.

[0073] like Figure 1 As shown, the text sample marking device includes: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.

[0074] Those skilled in the art will understand that Figure 1 The hardware structure of the text sample marking device shown in the figure does not constitute a limitation on the text sample marking device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0075] like Figure 1 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a text sample marking program. The operating system is a program for managing and controlling text sample marking equipment and software resources, and supports the operation of the text sample marking program and other software and / or programs.

[0076] exist Figure 1 In the hardware structure of the text sample marking device shown, the network interface 1004 is mainly used to access the network; the user interface 1003 is mainly used to detect confirmation instructions and editing instructions, etc. The processor 1001 can be used to call the text sample marking program stored in the memory 1005 and perform the operations of the following embodiments of the text sample marking method.

[0077] Based on the hardware structure of the above-mentioned text sample marking device, various embodiments of the text sample marking method of the present invention are proposed.

[0078] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the text sample marking method of the present invention. In this embodiment, the text sample marking method includes the following steps:

[0079] Step S10, constructing an initial marking model, wherein the initial marking model is composed of a marking network model and a plurality of simulated marking network models;

[0080] In this embodiment, in order to realize automatic labeling, it is necessary to pre-build an initial labeling model, which consists of two parts: one is a network labeling model, and the other is a plurality of simulated network labeling models. The purpose of setting up a network labeling model is to facilitate users to use the network labeling model to realize automatic labeling. However, if the labeling task is performed by relying solely on the network labeling model, the execution efficiency and accuracy cannot be guaranteed.

[0081] The initial tagging network model is composed of a long short-term memory network and a multi-layer perceptron. Before inputting the text sample into the simulated tagging network model, the text sample needs to be pre-segmented, for example, "Who am I" is divided into "I / am / who", and then the divided words are represented in a computer-friendly way, that is, in the form of word vectors. In this embodiment, a word vector with 200 dimensions is preferably used.

[0082] For example, in the scoring of subjective questions, the scoring results are classified, different labels are set for the obtained classifications, and the text samples are marked according to the labels, respectively represented by numbers, -2 means all wrong, -1 means most wrong, 0 means half wrong, 1 means most correct, and 2 means all correct. Assume that the dimension of the word vector of a word is 200 dimensions, and the 200-dimensional word vector is input into the long short-term memory network. In order to obtain a higher computing speed, the 200-dimensional word vector entering and leaving the long short-term memory network needs to be reduced in dimension. The algorithm used for the dimensionality reduction processing is not limited, and it can be singular value decomposition, referred to as SVD, or PCA dimensionality reduction algorithm. After the 200-dimensional word vector is reduced in dimension, a 50-dimensional word vector can be obtained, and then the 50-dimensional word vector is input into the multilayer perceptron. The role of the multilayer perceptron in this scheme is mainly to divide the labels to which the word vectors belong, because the rules of artificial labeling and the types of divided labels have been memorized in the multilayer perceptron when the initial labeling network model is constructed. Therefore, when a new word vector is input, the multilayer perceptron will convert the word vector dimension into the corresponding number of labels according to the pre-stored label category. Because the text samples are divided into 5 categories in total in this embodiment, the 50-dimensional word vector is obtained by dimensionality reduction processing to obtain a 5-dimensional word vector, and the probability of the occurrence of the 5 categories is obtained. Because the processing process and output result process of the simulated labeling network model for the unlabeled text samples are basically similar to the processing process and output result process of the labeling network model for the unlabeled text samples, they will not be repeated here. For example, after the above processing, the output of the simulation marking network model may be: the probability of all wrong is 10%, the probability of most wrong is 10%, the probability of half wrong is 10%, the probability of most correct is 10%, and the probability of all correct is 70%. The output of the marking network model may be: the probability of all wrong is 70%, the probability of most wrong is 10%, the probability of half wrong is 10%, the probability of most correct is 10%, and the probability of all correct is 70%.

[0083] Step S20, using unlabeled text samples in the preset training text sample set to train the labeling network model to obtain a final labeling network model;

[0084] In this embodiment, it is necessary to first input the unlabeled text samples into the preset training text sample set for training the labeling network model. In order to obtain a labeling network model that can label the unlabeled text samples, it is necessary to use the unlabeled text samples in the preset training text sample set to train the labeling network model. The types of unlabeled text samples are not limited, for example, they can be samples of passing and failing subjective questions. The specific training method is not limited, for example, it can be some algorithms in machine learning, such as long short-term memory network.

[0085] Step S30, using the unlabeled text samples in the training text sample set to train the final labeling network model and multiple simulated labeling network models to obtain a labeling model;

[0086] In this embodiment, it is necessary to use the unlabeled text samples in the training text sample set to train the labeling network model and multiple simulated labeling network models. The method used during training is not limited, for example, it can be a long short-term memory network. The purpose of training is to obtain a labeling model. After obtaining the labeling model, the obtained labeling model can be used to label the unlabeled model.

[0087] Step S40: input the text sample to be marked into the marking model for marking, and output the labeled text sample.

[0088] In this embodiment, the text sample to be marked is input into the marking model for marking, and a labeled text sample can be obtained. For example, the marking model can label "A" for text samples with a score of 60 points or more (including 60 points), and label "B" for text samples with a score below 60 points. Then, the unlabeled text sample A and the unlabeled text sample B are respectively input into the marking model. The marking model can obtain the scores of text sample A and text sample B through machine learning, and label text sample A and text sample B with "A" or "B" according to the scores.

[0089] By inputting unlabeled text samples into the labeling model, labeled text samples can be output. This solution solves the problem of high cost and time-consuming manual labeling, and can achieve the purpose of labeling unlabeled text samples automatically and in large quantities.

[0090] Reference Figure 3 , Figure 3 for Figure 2 Detailed flow chart of step S10 in an embodiment. In this embodiment, the above step S10 further includes the following steps:

[0091] Step S101, monitoring the construction process of building a labeling network model using a long short-term memory network and a multilayer perceptron through a preset monitoring program;

[0092] In this embodiment, the construction process of the marking network model constructed using the long short-term memory network and the multilayer perceptron is monitored by a preset monitoring program, wherein the long short-term memory network is a recursive neural network that can learn on a long sequence. It enables information to be continuously preserved, and the long short-term memory network includes: an input gate, an output gate, a forget gate, and a memory cell. The state of the memory cell is called the cell state, and the cell state can control the information from one moment to the next. The multilayer perceptron (MLP) is a feedforward artificial neural network model, and the multilayer perceptron can map multiple input data sets to a single output data set. The multilayer perceptron consists of three parts, namely the input layer, the hidden layer, and the output layer.

[0093] Step S102, learning the construction process of the marking network model through the Monte Carlo method to obtain multiple simulated marking network models.

[0094] In this embodiment, the Monte Carlo method is based on the principle of probability statistics and is a method for simulating the formation process of things to achieve the purpose of understanding the characteristics of things and their changing laws. The Monte Carlo method can be used to simulate the process of the labeling network model processing unlabeled text samples, thereby obtaining a simulated labeling network model. For example, to label different text samples, assuming that it is a text sample of a candidate's subjective question, first obtain the word vector X in the candidate's subjective question, where X can be , ...... , and input the word vector X into the long short-term memory network. The long short-term memory network processes the word vector and inputs the processing result into the input layer to obtain X, and then X is input into the hidden layer ,get , and Input and output layer: ,get { + )}, in the above formula, W1 represents the weight coefficient of the hidden layer, b1 represents the bias coefficient of the function f(X), and the purpose of setting these coefficients is to adjust the coefficients of each layer through the back propagation algorithm to make the result correct when the output of the model is inaccurate.

[0095] Reference Figure 4 , Figure 4 for Figure 2 Detailed flow chart of step S20 in an embodiment. In this embodiment, the above step S20 further includes the following steps:

[0096] Step S201, inputting unlabeled text samples in the training text sample set into the labeling network model to perform text sample labeling training, and outputting the training results;

[0097] In this embodiment, because the initial labeling model is composed of a labeling network model and multiple simulated labeling network models, it is necessary to use the unlabeled text samples in the training text sample set to train the pre-built labeling network model. The training process mainly includes the following steps: input the unlabeled text samples in the training text sample set into the labeling network model, and output the training results.

[0098] Step S202, determining whether the training result output by the marking network model is consistent with the preset marking result;

[0099] In this embodiment, the unlabeled text samples in the training text sample set are input into the labeling network model, and the training results are output. It is judged whether the training results output by the labeling network model are consistent with the preset labeling results. Because the preset labeling results are accurate and known, the preset labeling results can be used as a reference to judge whether the training results output by the labeling network model are accurate.

[0100] Step S203, if the training result output by the marking network model is consistent with the preset marking result, the marking network model training is completed and the final marking network model is obtained. If the training result output by the marking network model is inconsistent with the preset marking result, the weight coefficient of the marking network model is adjusted through the back propagation algorithm until they are consistent.

[0101] In this embodiment, the obtained result is compared with the preset labeling result to determine whether the two are consistent. If they are consistent, it means that the labeling network model training is completed and the final labeling network model is obtained. If they are inconsistent, the labeling network model is adjusted and the text sample labeling training continues.

[0102] Reference Figure 5 , Figure 5 for Figure 2 Detailed flow chart of step S30 in an embodiment. In this embodiment, the above step S30 further includes the following steps:

[0103] Step S301, inputting the unlabeled text samples in the training text sample set into the final labeling network model and each simulated labeling network model for labeling training, and outputting the final labeling network model training results and the simulated labeling network model training results;

[0104] In this embodiment, it is necessary to input the unlabeled text samples in the text sample set into the labeling network model to obtain the labeling network model training results. Because we have artificially divided the text samples in the set, we only need to input the unlabeled text samples in the text sample set into the labeling network model, and continuously train the initial labeling network model according to the results of artificial labeling, until the initial labeling network model can learn the rules of artificial labeling, and then obtain a trained labeling network model, and finally achieve the purpose of automatically labeling the unlabeled text samples in the text sample set through the labeling network model. After obtaining the trained labeling network model, a simulated labeling network model can be constructed according to the trained labeling network model according to the rules of text sample labeling, and the unlabeled text samples can be input into the simulated labeling network model to obtain the simulated labeling network model training results.

[0105] Step S302, performing weighted calculation on the training results of the marking network model and the training results of the simulated marking network model to obtain a comprehensive result;

[0106] In this embodiment, for example, the text sample data of the subjective question with the title "struggle" is used to train the labeling network model. Then, when "struggle" appears in the text sample data, the text sample data is labeled. However, there is another situation. For example, when the examinee writes the subjective question with the title "struggle", "struggle" does not appear throughout the text, but words such as "effort" appear. Although these two words are similar, when scoring, the weights of scoring when "struggle" and "effort" appear are different. For example, the scoring standard is that the appearance of "struggle" is closer to the theme than the appearance of "effort", so the score should be higher accordingly. In this embodiment, the use of multiple simulation labeling network models can effectively solve the above problems. If the candidate's score is above 80 points (including 80 points), the label "A" is marked; if the candidate's score is below 80 points, the label "B" is marked. If only the marking network model is used and the score of the candidate's answer is 80 points, then the label is "A". If the marking network model is combined with multiple simulated marking network models, then the marking network model scores the candidate's answer with 80 points, the simulated marking network model 1 scores the candidate's answer with 70 points, and the simulated marking network model 2 scores the candidate's answer with 70 points. The score is 75 points, of which the weight of the marking network model is 40, the weight of the simulated marking network model 1 is 50, and the weight of the simulated marking network model 2 is 10. Then, the final score of the candidate's answer is: (80*40+70*50+75*10) / (40+50+10)=74.5, so the label "B" should be marked. It can be seen that the combination of the marking network model and multiple simulated marking network models can improve the accuracy of the marking model.

[0107] In this embodiment, when an unlabeled sample is input, it is input to the labeling network model and each simulated labeling network model at the same time, so that when the unlabeled text sample is labeled, the simulated labeling network model also needs to make a decision on the label division for the unlabeled text sample, that is, the training result of the simulated labeling network model. The decisions made by each simulated labeling network model and the labeling network model (labeling network model training result) are weighted according to the weight ratio. For example, if the initial weight ratio of the labeling network model to the simulated labeling network model is 3:1, the credibility of the decision made by the labeling network model is higher. For example, for a sample, the result made by the labeling network model is that the probability of labeling "positive" is 60%, and the probability of labeling "negative" is 40%. The result made by the simulated labeling network model is that the probability of labeling "positive" is 40%, and the probability of labeling "negative" is 60%. After calculation: the comprehensive probability of labeling "positive" is: (60%*3+40%*1) / (3+1)=55%, the comprehensive probability of labeling "negative" is: (40%*3+60%*1) / (3+1)=45%, so the comprehensive result is: the comprehensive probability of labeling "positive" is 55%, and the comprehensive probability of labeling "negative" is 45%. It can be seen that the size of the initial weight ratio of the marking network model and the simulated marking network model will affect the comprehensive result. In this embodiment, the output results of the marking network model and the output results of the simulated marking network model are calculated according to the weighted ratio to obtain the comprehensive result.

[0108] For example, the initial weight ratio of the output results of the labeling network model and the output results of the simulated labeling network model is 3:1; when manually labeling text samples, the text samples need to be labeled "2", and the initial labeling text samples label the text samples with "-2". It is necessary to adjust the weight ratio of the output results of the labeling network model and the output results of the simulated labeling network model until the labeling is correct. In addition, by adjusting the weight ratio of the output results of the labeling network model and the output results of the simulated labeling network model, the labeling can be made more balanced. For example, the current labeling result is: the probability of labeling "positive" is 90%, and the probability of labeling "negative" is 10%, that is, the number of labels "positive" is currently large. If you want to obtain more text samples with the label "negative", you can achieve balanced or personalized labeling by adjusting the weight ratio of the output results of the labeling network model and the output results of the simulated labeling network model.

[0109] Step S303, inputting the comprehensive result into a normalized exponential function for normalization processing to obtain a machine marking result;

[0110] In this embodiment, a normalized exponential function is required to process the obtained comprehensive result. The formula of the normalized exponential function is as follows: softmax(textrm{x})i=frac{exp(xi)} {sumlimits {j=1}^{n}exp(xj)}. The normalized exponential function "compresses" a K-dimensional vector textrm{z} containing any real number into another K-dimensional real vector sigma(textrm{z}) so that the range of each element is between {0,1}, and the sum of all elements is 1. When the comprehensive result is input into the normalized exponential function for normalization, a result with the highest probability of occurrence will be obtained, that is, the machine marking result.

[0111] Step S304, comparing the machine marking result with the preset marking result of the unmarked text sample in the training text sample set to determine whether the machine marking result is consistent with the preset marking result;

[0112] In this embodiment, in order to determine whether the machine marking result is consistent with the preset marking result, it is necessary to manually mark the unmarked text samples in the training text sample set to obtain the preset marking result, and compare the machine marking result with the preset marking result to determine whether the marking results of the two are consistent.

[0113] Step S305, if the machine marking result is consistent with the preset marking result, the marking model training is completed, if not, the weight ratio is adjusted until the output marking result is consistent.

[0114] In this embodiment, if the machine marking result is consistent with the preset marking result, the marking model training is completed. If not, the weight ratio is adjusted until the output marking result is consistent. For example, the initial weight ratio of the marking network model output result and the simulation marking network model output result is 3:1; the result output by the marking network model is: the probability of all wrong is 60%, the probability of most wrong is 10%, the probability of half wrong is 10%, the probability of most correct is 10%, and the probability of all correct is 10%; the result output by the simulation marking network model is: the probability of all wrong is 10%, the probability of most wrong is 10%, the probability of half wrong is 10%, the probability of most correct is 10%, and the probability of all correct is 60%; the comprehensive result is: the probability of all wrong is 47.5%, the probability of most wrong is 10%, the probability of half wrong is 10%, the probability of most correct is 10%, and the probability of all correct is 22.5%. By inputting the comprehensive results obtained into the normalized exponential function, we can get the result with the highest probability, that is, the probability of all mistakes is 47.5%, because all mistakes are represented by the label "-2", so when outputting the results, we need to label the text sample with "-2", that is, to obtain the initial labeled text sample. It should be noted that because the final result is obtained using the initial weight ratio, the labeling of the initial labeled text sample at this time may not be correct. If you want to obtain a labeled text sample that meets the labeling requirements in the actual scenario, you need to adjust the initial weight ratio. Because the text samples have been artificially divided into several categories in the early stage, as long as the initial weight ratio is adjusted according to the preset labeling results until the machine labeling results are consistent with the preset labeling results, the training of the labeling model is completed.

[0115] Reference Figure 6 , Figure 6 This is a flow chart of the second embodiment of the text sample marking method of the present invention. Figure 3 After step S102, the following steps are also included:

[0116] Step S50, inputting the unlabeled text samples in the training text sample set into the long short-term memory network to obtain the long short-term memory network output result;

[0117] In this embodiment, the unlabeled text samples in the training text sample set are input into the long short-term memory network to obtain the long short-term memory network output result. The specific steps of the long short-term memory network processing the unlabeled text samples are as follows:

[0118] Step 1: The first step of the long short-term memory network is to decide what text sample information can pass through the cellstate. This decision is controlled by the "forget gate" through sigmoid, which will be based on the output of the previous moment and the current input To generate a 0 to 1 value to decide whether to let the information Ct−1 learned at the last moment pass or partially pass. The specific formula is: ). For example, the long short-term memory network has learned a lot from previous sentences, some of which are useless at present, and can be selectively filtered out by the above formula.

[0119] Step 2: Generate new information that we need to update. This step consists of two parts. The first is an "inputgate" layer that uses sigmoid to determine which values ​​to update. The second is a tanh layer that generates new candidate values ​​Ct, which may be added to the cell state as the candidate values ​​generated by the current layer. We will combine the values ​​generated by these two parts to update. The specific formula is: ; .

[0120] Step 3: Now we update the old cell state. First, we multiply the old cell state by to forget the information we don't need, and then *Ct is added to get the candidate value. The combination of the first and second steps is the process of discarding unnecessary information and adding new information: .

[0121] The final step is to determine the output of the model. First, we use the sigmoid layer to get an initial output, and then use tanh to convert The values ​​are scaled to between -1 and 1, and then multiplied pairwise with the outputs obtained by sigmoid to obtain the output of the model. The formula is as follows: ; .

[0122] For example, word vectors can be "remembered" by the LSTM network. If the input gate is closed, the word vector cannot be "remembered" by the LSTM network. The principle is that the LSTM network can learn the rules of the text sample data by learning, that is, manually inputting the text sample data required by the human into the LSTM network. The opening and closing of the output gate determines whether the "remembered" text sample data is output, and the forget gate determines whether the "remembered" text sample data is saved. This can achieve both short-term memory and long-term memory. For example, the input gate of the LSTM network receives the word vector of "cat walks into the kitchen" and saves the word vector. When receiving the word vectors of "dog runs into the bedroom" and "lion runs into the kitchen", the LSTM network will judge whether the word vectors of "dog runs into the bedroom" and "lion runs into the kitchen" should be saved based on the saved word vector of "cat walks into the kitchen". Through learning, the LSTM network can judge that there is a connection between dog and cat, running and walking, kitchen and bedroom, that is, cat and dog are both pets, running and walking are both verbs, and kitchen and bedroom are both rooms. Therefore, "dog runs into the bedroom" and "cat walks into the kitchen" will be labeled with the same label, and the identified "lion runs into the kitchen" will be labeled with another label, because cats are pets and lions are wild beasts, so "lion runs into the kitchen" is obviously unreasonable. The "forget gate" uses sigmoid to control whether "lion runs into the kitchen" is "remembered".

[0123] Step S60, inputting the output result of the long short-term memory network into the multilayer perceptron, and outputting the training result of the marking network model for text sample marking training;

[0124] In this embodiment, the multilayer perceptron consists of three parts, namely, the input layer, the hidden layer and the output layer. The formula of the input layer is: , that is, every time you input an X, you will get an X, and input the obtained X into the hidden layer. The output formula of the hidden layer is: ,in is the weight, also called the connection coefficient, is the bias, the function f can be the commonly used sigmoid function or tanh function, and the formula of the output layer is: = ( + ), Represents the output of the hidden layer The hidden layer to the output layer is actually a classifier softmax regression.

[0125] Step S70, inputting the unlabeled text samples in the training text sample set into the simulated labeling network model, and outputting the simulated labeling network model training results.

[0126] In this embodiment, the output result of the long short-term memory network is input into a multilayer perceptron (MLP), and the training result of the labeling network model for text sample labeling training is output. The unlabeled text samples in the training text sample set are input into the simulated labeling network model, and the training result of the simulated labeling network model is output. In this embodiment, since the simulated labeling network model is constructed according to the training process of the labeling network model, after the unlabeled text samples are input into the simulated labeling network model, the training result of the simulated labeling network model will be obtained. Since the processing process is consistent with the labeling network model processing process, it will not be repeated.

[0127] Reference Figure 7 , Figure 7 This is a flow chart of the third embodiment of the text sample marking method of the present invention. Figure 2 Before step S10, the following steps are also included:

[0128] Step S80, obtaining unlabeled text samples, and putting the unlabeled text samples into a text sample set.

[0129] In this embodiment, in order to determine whether the results output by the labeling network model are consistent with the preset labeling results in the training text sample set, it is necessary to obtain unlabeled text samples in advance, put the unlabeled text samples into the training text sample set, and manually label the unlabeled text samples in the text sample set to obtain the preset labeling results.

[0130] Reference Figure 8 , Figure 8 This is a flow chart of the fourth embodiment of the text sample marking method of the present invention. Figure 7 After step S80, the following steps are also included:

[0131] Step S90, classifying the unlabeled text samples in the training text sample set, and setting different labels for the text samples according to the classification to obtain a preset labeling result.

[0132] In this embodiment, before manual labeling, the text samples need to be classified. The classification can be performed by a support vector machine, and different categories of labels can be set for the classified text samples. For example, the text samples of the answers to the subjective test papers can be divided into five categories: all wrong, most wrong, half wrong, most correct, and all correct. The various text samples are labeled with labels -2, -1, 0, 1, and 2 respectively.

[0133] Since the labeling is not accurate at the beginning, it is necessary to adjust the initial weight ratio of the labeling network model output results and the simulated labeling network model output results according to the results of manual labeling until the labeling is correct. This scheme can realize the labeling of text samples outside the text sample space based on the constructed labeling model.

[0134] The invention also provides a text sample marking device.

[0135] Reference Fig. 9 , Fig. 9 This is a functional module diagram of an embodiment of a text sample marking device of the present invention. In this embodiment, the text sample marking device includes the following modules:

[0136] A construction module 10 is used to construct an initial marking model, wherein the initial marking model is composed of a marking network model and a plurality of simulated marking network models;

[0137] The first training module 20 is used to train the marking network model using unmarked text samples in the preset training text sample set to obtain a final marking network model;

[0138] A second training module 30 is used to train a final marking network model and a plurality of simulated marking network models using unmarked text samples in a training text sample set, and obtain a marking model;

[0139] The marking module 40 is used to input the text sample to be marked into the marking model for marking, and output the text sample with a label.

[0140] In this embodiment, the construction module 10 is used to construct an initial labeling model, which is composed of a labeling network model and a plurality of simulated labeling network models; the first training module 20 is used to train the labeling network model using unlabeled text samples in a preset training text sample set to obtain a final labeling network model; the second training module 30 is used to train the final labeling network model and a plurality of simulated labeling network models using unlabeled text samples in the training text sample set to obtain a labeling model; the labeling module 40 is used to input the text sample to be labeled into the labeling model for labeling, and output the labeled text sample. By using the unlabeled text samples in the text sample set to train the final labeling network model and a plurality of simulated labeling network models, and obtaining the labeling model, the labeling model is used to realize automatic labeling of the text sample to be labeled. This device can free people from manual labeling and achieve the purpose of mass labeling.

[0141] The present invention also provides a computer-readable storage medium.

[0142] In this embodiment, a text sample marking program is stored on the computer-readable storage medium, and when the text sample marking program is executed by the processor, the steps of the text sample marking method described in any of the above embodiments are implemented.

[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM) and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0144] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims. All equivalent structures or equivalent process changes made using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, are protected by the present invention.

Claims

1. A text sample labeling method, characterized in that: The text sample marking method comprises the following steps: Constructing an initial marking model, wherein the initial marking model is composed of a marking network model and a plurality of simulated marking network models; The unlabeled text samples in the preset training text sample set are used to train the labeling network model to obtain the final labeling network model; Using the unlabeled text samples in the training text sample set to train the final labeling network model and multiple simulated labeling network models to obtain a labeling model; Inputting the text sample to be marked into the marking model for marking, and outputting the labeled text sample; The construction of the initial marking model comprises the following steps: Monitor the construction process of the labeling network model using long short-term memory network and multi-layer perceptron through the preset monitoring program; The construction process of the marking network model is learned by using the Monte Carlo method to obtain multiple simulated marking network models; The method of using unlabeled text samples in the training text sample set to train the final labeling network model and multiple simulated labeling network models to obtain the labeling model includes the following steps: Input the unlabeled text samples in the training text sample set into the final labeling network model and each simulated labeling network model for labeling training, and output the final labeling network model training results and the simulated labeling network model training results; Perform weighted calculation on the training results of the marking network model and the training results of the simulated marking network model to obtain a comprehensive training result; The comprehensive training results are input into the normalized exponential function for normalization to obtain the machine marking results; Compare the machine marking results with the preset marking results of the unmarked text samples in the training text sample set to determine whether the machine marking results are consistent with the preset marking results; If the machine marking result is consistent with the preset marking result, it is determined that the marking model training is completed, otherwise the weight ratio is adjusted until the output machine marking result is consistent with the preset marking result.

2. The text sample marking method according to claim 1, characterized in that: The method of using the unlabeled text samples in the preset training text sample set to train the labeling network model to obtain the final labeling network model includes the following steps: Input the unlabeled text samples in the training text sample set into the labeling network model to perform text sample labeling training, and output the training results; Determine whether the training results output by the labeling network model are consistent with the preset labeling results; If so, it is determined that the training of the marking network model is completed and the final marking network model is obtained. If not, the weight coefficient of the marking network model is adjusted by the back propagation algorithm until they are consistent.

3. The text sample marking method according to claim 1, characterized in that: After the step of learning the construction process of the marking network model by the Monte Carlo method to obtain multiple simulated marking network models, the following steps are also included: Input the unlabeled text samples in the training text sample set into the long short-term memory network to obtain the long short-term memory network output result; Input the output results of the long short-term memory network into the multi-layer perceptron, and output the training results of the labeling network model for text sample labeling training; The unlabeled text samples in the training text sample set are input into the simulated labeling network model, and the training results of the simulated labeling network model are output.

4. The text sample marking method according to claim 1, characterized in that: Before the step of constructing the initial marking model, the following steps are also included: Obtain unlabeled text samples, and input the unlabeled text samples into a text sample set.

5. The text sample marking method according to claim 4, characterized in that: After the step of obtaining the unmarked text sample and inputting the unmarked text sample into the text sample set, the following steps are also included: The unlabeled text samples in the training text sample set are classified, and different labels are set for the text samples according to the classification to obtain the preset labeling results.

6. A text sample marking device, characterized in that: The text sample marking device includes the following modules: A construction module, used to construct an initial marking model, wherein the initial marking model is composed of a marking network model and a plurality of simulated marking network models; The first training module is used to train the labeling network model using unlabeled text samples in the preset training text sample set to obtain a final labeling network model; A second training module is used to train a final marking network model and a plurality of simulated marking network models using unmarked text samples in the training text sample set to obtain a marking model; A labeling module, used for inputting a text sample to be labeled into the labeling model for labeling, and outputting a labeled text sample; The building blocks include the following units: A first construction unit is used to monitor the construction process of building a labeling network model using a long short-term memory network and a multilayer perceptron through a preset monitoring program; A second construction unit is used to learn the construction process of the labeling network model through a Monte Carlo method; The second training module includes the following units: A training unit, used to input unlabeled text samples in the training text sample set into the final labeling network model and each simulated labeling network model for labeling training, and output the final labeling network model training results and the simulated labeling network model training results; A calculation unit, used for performing weighted calculation on the training results of the marking network model and the training results of the simulated marking network model to obtain a comprehensive training result; A processing unit, used for inputting the comprehensive training result into a normalized exponential function for normalization processing to obtain a machine marking result; A comparison unit, used to compare the machine marking result with the preset marking result of the unmarked text sample in the training text sample set to determine whether the machine marking result is consistent with the preset marking result; A determination unit, used to determine that the marking model training is completed when the machine marking result is consistent with the preset marking result; The adjusting unit is used to adjust the weight ratio if the machine marking result is inconsistent with the preset marking result, until the output machine marking result is consistent with the preset marking result.

7. The text sample marking device according to claim 6, characterized in that: The first training module is specifically used for: Input the unlabeled text samples in the training text sample set into the labeling network model to perform text sample labeling training, and output the training results; Determine whether the training results output by the labeling network model are consistent with the preset labeling results; If the training result output by the marking network model is consistent with the preset marking result, the marking network model training is determined to be completed, and the final marking network model is obtained. If the training result output by the marking network model is inconsistent with the preset marking result, the weight coefficient of the marking network model is adjusted through the back propagation algorithm until they are consistent.

8. The text sample marking device according to claim 6, characterized in that: The second building block is specifically used for: Input the unlabeled text samples in the training text sample set into the long short-term memory network to obtain the long short-term memory network output result; Input the output results of the long short-term memory network into the multi-layer perceptron, and output the training results of the labeling network model for text sample labeling training; The unlabeled text samples in the training text sample set are input into the simulated labeling network model, and the training results of the simulated labeling network model are output.

9. A text sample marking device, characterized in that: The text sample marking device comprises the following steps: a processor, a memory, and a text sample marking program stored in the memory and executable by the processor. When the text sample marking program is executed by the processor, the steps of the text sample marking method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a text sample marking program, and when the text sample marking program is executed by a processor, the steps of the text sample marking method according to any one of claims 1 to 5 are implemented.