A method, device, equipment and computer storage medium for assisting corpus annotation
By comparing similar corpus data and labels in the corpus database during the corpus data annotation process, the most accurate labels are determined, solving the problems of high labor costs and low efficiency, and achieving high efficiency and accuracy in corpus data annotation.
Patent Information
- Application Number
- CN202110208697.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-25
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-02-25
AI Technical Summary
In the existing technology, the labor cost in the corpus data annotation process is high, and repeated sampling inspections lead to low efficiency and increased costs.
When obtaining objections to predicted labels, the label with the most occurrences is determined from the preset corpus database, using semantic or character similarity to filter similar corpus data, comparing labels to determine the most accurate label, and reducing the number of manual reviews.
It improves the accuracy and efficiency of corpus data annotation, reduces labor costs, and reduces the need for multiple manual inspections.
Smart Images

Figure CN112925910B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing, and in particular to an auxiliary corpus annotation method, device, equipment and computer storage medium. Background Art
[0002] Corpus data annotation is a very important stage in natural language processing (NLP) technology. The accuracy of corpus data annotation determines the communication efficiency of human-computer communication. At present, in order to improve the accuracy of corpus data annotation, the existing labels are often reviewed again through manual sampling after the first manual annotation. The result of manual sampling depends on the annotator's understanding of the corpus. Therefore, during the sampling process, it often happens that the annotator does not recognize the existing labels and re-annotates. The re-annotated labels are also based on the annotator's understanding of the corpus data. Therefore, more repeated sampling may be required to continuously improve the accuracy of corpus annotation. Repeated sampling not only reduces the annotation efficiency, but also increases a lot of labor costs. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device and computer-readable storage medium for auxiliary corpus annotation, which can solve the problem of high labor costs in the corpus data annotation stage.
[0004] In a first aspect, an embodiment of the present application provides an auxiliary corpus annotation method, the method comprising: obtaining a first label, the first label being an objection label annotated on the first corpus data when there is an objection to a predicted label of a preset first corpus data; determining a second label that appears most frequently in a first set from a preset corpus database, the first set comprising a plurality of second corpus data whose similarity to the first corpus data meets a first preset condition and labels corresponding to the plurality of second corpus data respectively; determining a label of the first corpus data from the labels corresponding to the first label and the plurality of second corpus data respectively according to a comparison result of the second label and the first label.
[0005] Using an auxiliary corpus annotation method provided by the present application, when the annotator determines that the predicted label corresponding to the first corpus data is incorrect, and selects or inputs the first label that he thinks is correct, the annotator can judge whether the first label is correct based on the second label that appears the most times in the first set, and then determine the label of the first corpus data from the first label and the labels corresponding to the multiple second corpus data respectively according to the comparison result of the second label and the first label. The above method can avoid the annotator completely relying on his own understanding of the corpus data to annotate the corpus data, thereby improving the accuracy of the corpus data annotation. Therefore, there is no need to improve the accuracy of the corpus data annotation by performing multiple manual sampling, thereby reducing the number of reviews to reduce labor costs.
[0006] Optionally, determining the second tag that appears most frequently in the first set from a preset corpus database includes: obtaining a second set from the corpus database, the second set including a plurality of third corpus data whose semantic similarity with the first corpus data satisfies a second preset condition and tags corresponding to the plurality of third corpus data respectively; determining the first set from the second set according to a preset character similarity condition; counting the number of occurrences of each tag in the first set, and determining that the tag that appears most frequently is the second tag.
[0007] Optionally, according to the comparison result of the second label and the first label, the label of the first corpus data is determined from the first label and the labels respectively corresponding to the multiple second corpus data, including: if the first label is consistent with the second label, updating the predicted label to the first label; if the first label is inconsistent with the second label, determining a third label selected by the annotation personnel from the labels respectively corresponding to the multiple second corpus data, and updating the predicted label to the third label.
[0008] Optionally, the determining of the third label selected by the labeling personnel from the labels corresponding to the plurality of second corpus data includes: determining the labels with the top N occurrences from the labels corresponding to the plurality of second corpus data, N≥1; and determining the third label selected by the labeling personnel from the labels with the top N occurrences. By means of the above method, the labeling personnel can determine the label corresponding to the first corpus data from the labels with the top N occurrences, further narrowing the scope of the labeling personnel determining the label corresponding to the first corpus data, improving the speed at which the labeling personnel annotate the corpus data, and improving the efficiency of the corpus data annotation.
[0009] Optionally, the first preset condition is that the similarity is greater than or equal to a preset similarity threshold, or the first preset condition is that the similarity is ranked in the top M, wherein the similarity is semantic similarity or character similarity, and M is greater than or equal to 1 and is an integer.
[0010] Optionally, the predicted label is obtained by predicting the first corpus data through a trained machine learning model, and the corpus database includes a training set of the machine learning model. On the one hand, the existing machine learning model can be fully utilized, and on the other hand, the predicted label of the first corpus data can be quickly obtained. The use of the above method to obtain the predicted label reduces the investment in labor costs, increases the speed of obtaining the predicted label, and further improves the annotation efficiency of the corpus data.
[0011] In a second aspect, an embodiment of the present application provides a device for assisting corpus annotation, the device comprising: an acquisition unit, for acquiring a first label, the first label being an objection label annotated on the first corpus data when there is an objection to a predicted label of a preset first corpus data; a first determination unit, for determining, from a preset corpus database, a second label that appears most frequently in a first set, the first set comprising a plurality of second corpus data whose similarity to the first corpus data meets a first preset condition and labels corresponding to the plurality of second corpus data respectively; a second determination unit, for determining, based on a comparison result of the second label and the first label, a label of the first corpus data from the first label and labels corresponding to the plurality of second corpus data respectively.
[0012] Optionally, the first determination unit determines the second tag that appears most frequently in the first set from a preset corpus database, including: obtaining a second set from the corpus database, the second set including a plurality of third corpus data whose semantic similarity with the first corpus data satisfies a preset condition and tags corresponding to the plurality of third corpus data respectively; determining the first set from the second set according to a preset character similarity condition; counting the number of occurrences of each tag in the first set, and determining that the tag that appears most frequently is the second tag.
[0013] In a third aspect, an embodiment of the present application provides an auxiliary corpus annotation device, the device comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program from the memory, so that the device executes the auxiliary corpus annotation method described in any one of the first aspects.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the auxiliary corpus annotation method described in any one of the first aspects.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program code, which, when executed by a computer, enables the computer to execute the auxiliary corpus annotation method described in any one of the first aspects.
[0016] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 This is a schematic diagram of an application scenario of an auxiliary corpus annotation method provided by an embodiment of the present application;
[0019] Figure 2 It is a flowchart of an auxiliary corpus annotation method provided in one embodiment of the present application;
[0020] Figure 3 is a flow chart of an auxiliary corpus annotation method provided by an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of an auxiliary corpus annotation device provided by an embodiment of the present application;
[0022] Figure 5 It is a schematic diagram of an auxiliary corpus annotation device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0023] Human-computer interaction refers to the process of dialogue between humans and machines. Figure 1In the dialogue scenario shown, the user uses the terminal device to talk to the robot. Taking the insurance industry as an example, suppose the user wants to inquire about the specific coverage of the "Terms of Use of Comprehensive Medical Insurance for Middle-aged and Elderly People". Then the user uses the terminal device to open the corresponding insurance application, and enters "What are the specific coverages of the "Terms of Use of Comprehensive Medical Insurance for Middle-aged and Elderly People"?" The customer service robot recognizes the user's intention of the question by running the corresponding machine learning model and gives the corresponding answer.
[0024] In the process of human-computer interaction, the accuracy of the robot's answers depends on the training data set used by the machine learning model in the early training process. The higher the accuracy of the corpus data annotation in the training data set, the better the performance of the machine learning model and the more accurate the robot's answers.
[0025] At present, in order to improve the accuracy of corpus data annotation, after completing the first round of corpus data annotation, it is often necessary to review the labels of the first round of annotation through manual sampling. Since the results of manual sampling depend on the annotator's understanding of the corpus, it is common for the annotator to disagree with the existing labels and re-annotate them during the sampling process. The re-annotated labels are also based on the annotator's understanding of the corpus, so there may be inaccuracies, which requires more repeated sampling to continuously improve the accuracy of corpus annotation. Repeated sampling not only reduces the efficiency of corpus data annotation, but also increases a lot of labor costs due to multiple manual sampling.
[0026] In order to solve the problem of high labor cost in the process of corpus data annotation, the present application proposes a method of auxiliary corpus annotation. In the manual sampling stage, the auxiliary corpus annotation device will provide reference labels for the annotation of each corpus data, so that the annotation personnel can determine the annotation results of each corpus data through the reference labels provided by the auxiliary corpus annotation device. Therefore, the auxiliary corpus annotation method provided by the present application can avoid the annotation personnel completely relying on their own understanding of the corpus data for annotation, and improve the accuracy and efficiency of corpus data annotation. Therefore, there is no need to improve the accuracy of corpus data annotation by performing multiple manual sampling according to the traditional annotation method. Thereby, the manual sampling process can be reduced, and the labor cost increased by multiple manual sampling can be reduced.
[0027] The method for assisting corpus annotation provided in the embodiment of the present application can be applied to any scenario where the annotation of corpus data needs to be reviewed or sampled, so as to improve the accuracy of corpus data annotation and reduce a large amount of manpower costs. For example, the method for assisting corpus annotation provided in the present application can be applied to the following three scenarios.
[0028] The first scenario: the scenario of the first annotation of the corpus database to be annotated by combining machine and manual methods. The existing machine learning model is used to perform the first round of annotation on the corpus data in the corpus database to be annotated to obtain the predicted label of each corpus data. The predicted label output by the machine learning model is then manually reviewed.
[0029] The second scenario: the scenario where the corpus database to be annotated is annotated for the first time manually. First, one (or a group of) annotators perform the first round of annotation on each corpus data in the corpus database to be annotated to obtain the predicted label of each corpus data. Then another (or another group of) annotators manually review the predicted labels of the first round of annotation.
[0030] The third scenario: when updating the machine learning model, the corpus data obtained by the machine learning model during the application process is reviewed. For example, the machine learning model is a model that has been trained and applied to human-computer interaction. In order to ensure the accuracy of the machine learning model, the machine learning model is often updated periodically based on the corpus data collected by the machine learning model during the application process to continuously optimize the performance of the machine learning model. In this process, it is necessary to manually review the corpus data collected by the machine learning model and the predicted labels given by the machine learning model for the collected corpus data.
[0031] It is understandable that in the above three scenarios, the manual review process can use an auxiliary corpus annotation method provided by this application to improve the efficiency and accuracy of corpus data annotation, so there is no need to improve the accuracy of corpus data annotation by performing multiple manual sampling in the traditional way. This can reduce the manual sampling process and further reduce the labor cost increased by multiple manual sampling.
[0032] The above three scenarios are only some embodiments of the present application. For ordinary technicians in this field, they can still modify the technical solutions recorded in the aforementioned scenarios, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the technical solutions provided by the present application deviate from the spirit and scope of the various application scenarios of the present application, and should all be included in the protection scope of the present application.
[0033] This application embodiment proposes a method for auxiliary corpus annotation. Figure 2 The figure shows a schematic flow chart of the above auxiliary corpus annotation method. The method comprises:
[0034] S201, obtaining a first label, where the first label is a dissenting label that is marked on the first corpus data when there is a dissenting opinion about a predicted label of the preset first corpus data.
[0035] The first corpus data may be any corpus data with an existing predicted label, and the annotator determines whether the corresponding predicted label is correct.
[0036] For example, for the first scenario, the first corpus data may be corpus data in a corpus database to be annotated, and its corresponding predicted label is the predicted label output by the existing machine learning model when performing the first round of annotation. For the second scenario, the first corpus data may also be corpus data in a corpus database to be annotated, and its corresponding predicted label is the predicted label obtained by the annotator when performing the first round of annotation. It is understandable that the corpus data in the corpus database to be annotated may be obtained from an existing corpus database, from conversations between people, or by extracting lines from movies, television, or radio, etc.
[0037] For the third scenario, the first corpus data and the corresponding prediction labels can be obtained from a machine learning model that has been trained and applied to human-computer interaction based on the dialogue log corresponding to the human-computer dialogue when the human-computer dialogue is performed.
[0038] For example, for the insurance industry, the first corpus data is equivalent to user questions, that is, questions asked by users to the robot using terminal devices in a conversation scenario. The label corresponding to the first corpus data is the user's intention, that is, what is the purpose of the user's question. The above user's intention (i.e., label) is used to identify the user's question. Clarifying the user's question and the user's intention is conducive to improving the accuracy of corpus data annotation.
[0039] For example, the question asked by the user is: "How long is the validity period of insurance?" The user question corresponding to this question is the question asked by the above user. The intention of the user's question can be time, so time can be used as a label of the above user's question to predict the purpose of the user's question.
[0040] Exemplarily, the above-mentioned machine learning model can be fastText, text convolutional neural network (TextConvolutional Neural Network, TextCNN) or region-based convolutional neural network (Region-basedConvolutional Neural Networks, RCNN), etc.
[0041] In actual application, the predicted labels directly obtained by using the existing machine learning model may be inaccurate. For example, there may be some errors in the previous model corpus, or the model corpus data is difficult to classify, or the selected machine learning model has poor classification ability, resulting in deviations in the accuracy of the predicted labels obtained by the existing machine learning model. In the above cases, if the labeler believes that the predicted label obtained by the machine learning model is incorrect and does not recognize the predicted label, then the labeler needs to select or enter the first label.
[0042] It is not difficult to understand that multiple labels can be displayed through the auxiliary corpus annotation device so that the annotator can select the first label that he thinks is correct, or the annotator can input the first label that he thinks is correct through the input device corresponding to the auxiliary corpus annotation device.
[0043] For example, the user mentioned two words, "insurance money" and "insurance amount" in the conversation. There is only a slight difference between the two words, but the actual meanings are different. "Insurance money" refers to the money received by the insured or beneficiary from the insurance company after the insurance accident occurs; and "insurance amount" refers to the maximum limit of the insurance company's compensation or insurance liability. For machine learning models with poor classification capabilities, it is easy to annotate the prediction labels corresponding to the corpus data of "insurance money" and "insurance amount" as the same prediction label, so that the annotator does not recognize the above prediction label, which requires the annotator to select or enter the first label that he thinks is correct.
[0044] S202, determining the second tag with the largest number of occurrences in a first set from a preset corpus database, the first set including a plurality of second corpus data whose similarity with the first corpus data meets a first preset condition and tags respectively corresponding to the plurality of second corpus data.
[0045] Exemplarily, the first preset condition may be a similarity threshold condition. For example, a similarity threshold is set, and all second corpus data in the corpus database whose similarity to the first corpus data is greater than or equal to the similarity threshold is determined through similarity calculation. Then all the second corpus data and the labels corresponding to each second corpus data are determined as the first set.
[0046] Optionally, the first preset condition may also be a sorting condition. For example, a threshold M (M≥1) is set to determine all second corpus data in the corpus database whose similarity to the first corpus data ranks in the top M. Then all the second corpus data and the labels corresponding to each second corpus data are determined as the first set.
[0047] In the above two possible implementations, the similarity between the first corpus data and the second corpus data may be semantic similarity or character similarity.
[0048] The similarity can be calculated using currently commonly used neural networks. For example, neural networks such as Deep Structured Semantic Models (DSSM), Convolutional Neural Network-Deep Structured Semantic Models (CNN-DSSM), Long-Short-Term Memory-Deep Structured Semantic Models (LSTM-DSSM) are used to calculate semantic similarity. Neural networks such as simple character matching model, position weight matching model or center of gravity backward rule matching model are used to calculate character similarity.
[0049] Of course, the calculation of similarity may not be limited to the above-mentioned neural network, and this application does not impose any limitation on this.
[0050] Optionally, the first preset condition may also be a semantic similarity condition and a character similarity condition, that is, the first set satisfies both the semantic similarity condition and the character similarity condition.
[0051] Exemplarily, a second set can be first obtained from the corpus database, the second set including multiple third corpus data whose semantic similarity with the first corpus data meets a second preset condition and labels corresponding to the multiple third corpus data respectively; then the first set is determined from the second set based on character similarity.
[0052] The second preset condition may be that the semantic similarity between the first corpus data is greater than or equal to a preset semantic similarity threshold, or that the semantic similarity between the first corpus data is ranked in the top K (K ≥ 1). All corpus data in the corpus database whose semantic similarity with the first corpus data meets the second preset condition are determined as third corpus data, and then the third corpus data and the labels corresponding to each third corpus data are determined as the second set.
[0053] Afterwards, based on the character similarity, all second corpus data whose character similarity with the first corpus data ranks in the top M can be selected from the second set, or all second corpus data whose character similarity with the first corpus data is greater than or equal to a preset character similarity threshold can be selected. The second corpus data and the labels corresponding to each second corpus data are determined as the first set.
[0054] After the first set is determined, the number of occurrences of each tag in the first set can be counted, and the tag with the largest number of occurrences can be determined as the second tag.
[0055] In one example, Elastic Search is a distributed, highly scalable and highly real-time search and data analysis engine, which is widely used in distributed full-text searches with different search requirements. Since ElasticSearch can achieve fast, stable and reliable search results in the cloud computing process, and the Elastic Search tool is easy to install. Therefore, the Elastic Search tool can be directly selected in this application to search for the second tag in the above optional manner.
[0056] It is worth noting that the corpus data for searching the second label can be an existing corpus database related to the first corpus data. For example, for the first scenario, the corpus database can be a training set used when training a machine learning model, or it can be a first corpus database (including the first corpus data and the predicted labels corresponding to the first corpus data) obtained after the machine learning model performs the first round of annotation on the corpus database to be annotated, or it can be a corpus database composed of the first corpus database and the training set. For the second scenario, the corpus database can be a second corpus database (including the first corpus data and the predicted labels corresponding to the first corpus data) obtained after the annotator performs the first round of annotation on the corpus database to be annotated. For the third scenario, the corpus database can be a third corpus database, or a corpus database composed of the third corpus database and the training set used when training the machine learning model. Among them, the third corpus database includes the corpus data collected by the machine learning model during the execution of the human-computer dialogue process and the corresponding predicted labels output by the machine model. Exemplarily, the third corpus database can be collected from the dialogue log corresponding to the human-computer dialogue process.
[0057] S203: According to the comparison result of the second label and the first label, determine the label of the first corpus data from the labels corresponding to the first label and the plurality of second corpus data respectively.
[0058] Exemplarily, if the first label is consistent with the second label, it means that compared with the predicted label, the accuracy of the first label re-labeled by the labeler is greater, so the predicted label can be updated to the first label.
[0059] If the first label is inconsistent with the second label, it means that the first label re-labeled by the annotator may be inaccurate. Therefore, the labels corresponding to the plurality of second corpus data can be displayed as reference labels to provide a reference for the annotator. Then the annotator determines the third label from the labels corresponding to the plurality of second corpus data, and updates the predicted label to the third label.
[0060] In one example, when providing reference tags for annotators, in order to improve the accuracy of the reference tags and the tagging efficiency of the annotators, the tags with the top N (N≥1) occurrences can be determined from the tags corresponding to the multiple second corpus data to narrow the selection range.
[0061] The following uses the Elastic Search tool, where the first corpus data comes from a conversation log, and the label corresponding to the first corpus data is a predicted label output by a fast text model as an example to exemplify the above steps S201-S203.
[0062] like Figure 3 As shown, assume that the auxiliary corpus annotation device displays the first corpus data as "How much insurance money do you need to pay to the insurance company for XX type of insurance?" and its corresponding predicted label "insurance money". The annotator believes that the predicted label is inaccurate based on his or her understanding of the first corpus data. At this time, the annotator can select or input the first label "insurance premium" that he or she believes to be correct through the auxiliary corpus annotation device. When the annotator selects or inputs the first label, the conflict detection mechanism is triggered. The conflict detection mechanism can obtain the second label with the most occurrences to determine whether the first label selected or input by the annotator is accurate.
[0063] The above-mentioned conflict detection mechanism is as follows: ① Call the Elastic Search tool to search the preset corpus database for the existing first user questions that are semantically similar to the user question “How much insurance premium do I need to pay to the insurance company for XX type of insurance?”
[0064] Suppose the following five items are obtained after searching: First, how much do I need to pay to your insurance company? Second, if I choose XX type of insurance, how much insurance do I need to pay to the insurance company? Third, how much insurance do I need to pay to the insurance company for XX type of insurance? Fourth, if I have chosen a one-year comprehensive medical insurance for the middle-aged and elderly, and have paid 8,000 yuan in insurance premiums, how much insurance can I get when it expires? Fifth, how much insurance can I get for XX type of insurance? The above five corpus data constitute the first user question dataset C.
[0065] ② The method for calculating character similarity embedded in the Elastic Search tool is called to calculate the character similarity between each user question in the first user question dataset C and the actual user question. Then, based on the above calculation results, user questions with a literal similarity of not less than 80% are screened out. If the literal similarities of the user questions in the above first user question dataset C are 50%, 90%, 95%, 30% and 75% respectively, then the user question data constituting the first user question sub-dataset C' are the second user question and the third user question.
[0066] ③ Call the Elastic Search tool to sort and count the number of occurrences of the corresponding tags of the user questions in the existing user question sub-datasets. If it is found through statistics that in the above-mentioned first user question sub-dataset C', the tag with the largest number of occurrences is "insurance premium", and the number of occurrences is 10, then it is determined that the second tag with the largest number of occurrences is "insurance premium".
[0067] ④ By comparing the auxiliary corpus annotation, the second label with the highest number of occurrences is consistent with the first label selected by the annotator, both of which are "insurance premium". This indicates that there is no conflict between the second label and the first label. It is possible not to display the statistically obtained user questions and the user's intentions on the auxiliary corpus annotation device, or to display the user questions with the highest number of occurrences and their corresponding user intentions on the auxiliary corpus annotation device.
[0068] On the contrary, through comparison, it is found that in the above-mentioned first user question sub-dataset C', the second label that appears more frequently is "insurance amount", and the number of occurrences is 11. Then, the second label "insurance amount" that appears the most times is inconsistent with the first label "insurance premium" selected by the annotator, which means that there is a conflict between the second label and the first label. At this time, the top two labels with the highest number of occurrences and their corresponding user questions can be counted, so as to display the intentions of the top three user questions and their corresponding user questions on the auxiliary corpus annotation device, so as to help the annotator select or enter the first label that he thinks is accurate.
[0069] In summary, the auxiliary corpus annotation method provided by the present application can avoid the annotator completely relying on his or her own understanding of the corpus data to annotate the corpus data, thereby improving the accuracy of the corpus data annotation. Therefore, there is no need to improve the accuracy of the corpus data annotation by performing multiple manual sampling checks, thereby reducing the number of reviews and reducing the labor costs increased by multiple reviews.
[0070] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0071] Corresponding to the auxiliary corpus annotation method described in the above embodiment, Figure 4 The structure diagram of a device for assisting corpus annotation provided by an embodiment of the present application is shown. For the sake of convenience, only the parts related to the embodiment of the present application are shown. The device 400 includes: an acquisition unit 401, a first determination unit 402 and a second determination unit 403.
[0072] The acquisition unit 401 is used to acquire a first label, where the first label is a dissenting label that is marked on the first corpus data when there is a dissenting opinion about a preset predicted label of the first corpus data.
[0073] The first determining unit 402 is used to determine the second tag with the largest number of occurrences in the first set from a preset corpus database, wherein the first set includes a plurality of second corpus data whose similarity with the first corpus data meets a first preset condition and tags corresponding to the plurality of second corpus data.
[0074] The second determining unit 403 is configured to determine the label of the first corpus data from the first label and labels corresponding to the plurality of second corpus data, according to a comparison result between the second label and the first label.
[0075] Optionally, determining the second tag that appears most frequently in the first set from a preset corpus database includes: obtaining a second set from the corpus database, the second set including a plurality of third corpus data whose semantic similarity with the first corpus data satisfies a second preset condition and tags corresponding to the plurality of third corpus data respectively; determining the first set from the second set according to a preset character similarity condition; counting the number of occurrences of each tag in the first set, and determining the tag that appears most frequently as the second tag.
[0076] Optionally, based on the comparison result of the second label and the first label, the label of the first corpus data is determined from the first label and the labels respectively corresponding to the multiple second corpus data, including: if the first label is consistent with the second label, updating the predicted label to the first label; if the first label is inconsistent with the second label, determining a third label selected by the annotation personnel from the labels respectively corresponding to the multiple second corpus data, and updating the predicted label to the third label.
[0077] Optionally, determining a third label selected by the labeler from labels corresponding to multiple second corpus data includes: determining labels with top N occurrences from labels corresponding to multiple second corpus data, where N≥1; and determining a third label selected by the labeler from labels with top N occurrences.
[0078] Optionally, the first preset condition is that the similarity is greater than or equal to a preset similarity threshold, or the first preset condition is that the similarity is ranked in the top M, where the similarity is semantic similarity or character similarity, and M is greater than or equal to 1 and is an integer.
[0079] Optionally, the predicted label is obtained by predicting the first corpus data through a trained machine learning model, and the corpus database includes a training set of the machine learning model.
[0080] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0081] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0082] like Figure 5 As shown, an embodiment of the present application also provides a device for assisting corpus annotation, the device 500 includes: at least one processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the at least one processor, and when the processor 501 executes the computer program 503, the steps in any of the above-mentioned method embodiments are implemented.
[0083] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0084] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0086] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0087] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0088] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0089] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0090] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0091] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0092] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0093] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0094] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0095] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0096] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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 application, and should all be included in the protection scope of the present application.
Claims
1. A method for auxiliary corpus annotation, characterized in that: The method comprises: Obtaining a first label, where the first label is an objection label that is marked on the first corpus data when there is an objection to a predicted label of the preset first corpus data; Determine, from a preset corpus database, a second tag that appears most frequently in a first set, wherein the first set includes a plurality of second corpus data whose similarity to the first corpus data satisfies a first preset condition and tags corresponding to the plurality of second corpus data respectively; According to a comparison result between the second label and the first label, determining a label of the first corpus data from labels corresponding to the first label and the plurality of second corpus data respectively; The step of determining the label of the first corpus data from the labels respectively corresponding to the first label and the plurality of second corpus data according to the comparison result of the second label and the first label comprises: If the first label is consistent with the second label, updating the predicted label to the first label; If the first label is inconsistent with the second label, determining a third label selected by the annotator from the labels respectively corresponding to the plurality of second corpus data, and updating the predicted label to the third label; The determining of the third label selected by the annotator from the labels respectively corresponding to the plurality of second corpus data includes: Determine, from the tags corresponding to the plurality of second corpus data, the tags with the top N occurrences, where N≥1; Determine the third label selected by the labeler from the labels with the top N occurrences.
2. The method according to claim 1, characterized in that The determining, from a preset corpus database, the second tag that appears most frequently in the first set includes: Acquire a second set in the corpus database, the second set including a plurality of third corpus data whose semantic similarity with the first corpus data satisfies a second preset condition and labels corresponding to the plurality of third corpus data respectively; determining the first set from the second set according to a preset character similarity condition; The number of occurrences of each tag in the first set is counted, and the tag with the largest number of occurrences is determined to be the second tag.
3. The method according to claim 1, characterized in that The first preset condition is that the similarity is greater than or equal to a preset similarity threshold, or the first preset condition is that the similarity is ranked in the top M, wherein the similarity is semantic similarity or character similarity, and M is greater than or equal to 1 and is an integer.
4. The method according to claim 1, characterized in that The predicted label is obtained by predicting the first corpus data through a trained machine learning model, and the corpus database includes a training set of the machine learning model.
5. A device for assisting corpus annotation, characterized in that: The device comprises: An acquiring unit, configured to acquire a first label, wherein the first label is a dissenting label annotated on the first corpus data when there is a dissenting opinion on a predicted label of the preset first corpus data; A first determining unit is used to determine, from a preset corpus database, a second tag that appears most frequently in a first set, wherein the first set includes a plurality of second corpus data whose similarity to the first corpus data satisfies a first preset condition and tags corresponding to the plurality of second corpus data respectively; A second determining unit, configured to determine a label of the first corpus data from labels corresponding to the first label and the plurality of second corpus data respectively according to a comparison result of the second label and the first label; The step of determining the label of the first corpus data from the labels respectively corresponding to the first label and the plurality of second corpus data according to the comparison result of the second label and the first label comprises: If the first label is consistent with the second label, updating the predicted label to the first label; If the first label is inconsistent with the second label, determining a third label selected by the annotator from the labels respectively corresponding to the plurality of second corpus data, and updating the predicted label to the third label; The determining of the third label selected by the annotator from the labels respectively corresponding to the plurality of second corpus data includes: Determine, from the tags corresponding to the plurality of second corpus data, the tags with the top N occurrences, where N≥1; Determine the third label selected by the labeler from the labels with the top N occurrences.
6. The device for assisting corpus annotation according to claim 5, characterized in that: The first determining unit determines the second tag with the largest number of occurrences in the first set from a preset corpus database, including: Acquire a second set in the corpus database, the second set including a plurality of third corpus data whose semantic similarity with the first corpus data meets a preset condition and labels corresponding to the plurality of third corpus data respectively; determining the first set from the second set according to a preset character similarity condition; The number of occurrences of each tag in the first set is counted, and the tag with the largest number of occurrences is determined to be the second tag.
7. An auxiliary corpus annotation device, characterized in that: The device comprises: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device executes the method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method according to any one of claims 1 to 4.
