A data labeling method and device
The server extracts part of the data from the data to be annotated for training and generates a data annotation model, which solves the problems of high manual annotation cost and low accuracy in the existing technology, and achieves efficient and accurate data annotation.
Patent Information
- Application Number
- CN201911423635.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-31
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-12-31
AI Technical Summary
Data annotation in the existing technology relies on manual methods, which results in high costs and difficulty in ensuring accuracy in large-scale data processing.
The server extracts part of the data from the data to be labeled for statistical analysis and classification, generates a template and performs training to obtain a data labeling model, and then uses the model to label the remaining data, reducing manual participation and improving labeling accuracy.
It reduces the cost and time of manual annotation, improves the accuracy and efficiency of data annotation, and reduces the modification process of subsequent manual verification.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a data annotation method and apparatus. Background Art
[0002] In recent years, with the continuous development of Internet technology and computer science technology, artificial intelligence has become increasingly popular, and the demand for data annotation has become more and more urgent.
[0003] Currently, data annotation is completely carried out by manual methods. That is, annotators need to manually annotate tens of thousands or even more data. Due to the increase in the amount of data, this manual annotation method requires a relatively high labor cost, and it is difficult to guarantee the accuracy of manual annotation when the amount of data is relatively large. Summary of the Invention
[0004] This application provides a data annotation method and apparatus to improve the accuracy of data annotation.
[0005] In a first aspect, this application provides a data annotation method, which includes: the server obtains M pieces of data to be annotated; M is an integer greater than 1; the server extracts N pieces of data from the M pieces of data, and performs statistical analysis on the N pieces of data to obtain at least one template; each template includes at least one slot, and each slot is used to fill in at least one key information; N is an integer greater than 1, and N < M; the server substitutes multiple stored key information into the at least one template respectively to obtain P pieces of data; the server uses part of the P pieces of data for training to obtain a data annotation model; the server uses the data annotation model to annotate the data other than the N pieces of data in the M pieces of data.
[0006] In the above technical solution, a data annotation model is obtained by training with a part of the data, and then the trained data annotation model is used to annotate the unannotated data, which can reduce manual participation and improve the accuracy and efficiency of data annotation. Moreover, in this method, the extracted data is statistically analyzed, and keywords are filled in the slots to obtain P pieces of data, which can be understood as expanding the extracted data to obtain more data, and then using the expanded data for training to obtain a data annotation model, which can improve the annotation accuracy of the data annotation model.
[0007] In a possible design, extracting N pieces of data from the M pieces of data includes: classifying the M pieces of data to obtain Q categories of data; Q is a positive integer; and extracting part of the data from each of the Q categories of data to obtain the N pieces of data.
[0008] In the above technical solution, the data to be labeled can be classified, and then part of the data can be extracted from each category of the classified data as sample data. In this way, the extracted data can include more categories of data, which is convenient for subsequent training of the data labeling model and can improve the accuracy of the data labeling model training.
[0009] In a possible design, the M pieces of data are classified, including: converting the M pieces of data into their respective corresponding feature vectors to obtain M feature vectors; and treating data corresponding to feature vectors with the same or similar feature vectors among the M feature vectors as a category of data.
[0010] In a possible design, the server uses part of the P data for training to obtain a data annotation model, including: the server uses part of the P data for training a preset initial model to obtain a data annotation model.
[0011] In one possible design, after the server obtains the data annotation model, the method also includes the server using the remaining data in the P data except the partial data to verify the data annotation model, so as to verify the annotation accuracy of the data annotation model, improve the accuracy and efficiency of data annotation, and reduce the process of manual modification in the subsequent manual verification of the annotation results.
[0012] In a second aspect, a device is provided, which may be a server, and which has the function of implementing the data labeling method in the first aspect or any possible implementation of the first aspect. The function may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0013] In one possible design, the device includes an acquisition unit, a processing unit, a training unit and a labeling unit, which can perform corresponding functions in the above-mentioned first aspect or any possible implementation of the first aspect. For details, please refer to the detailed description in the method example.
[0014] In another possible design, the device includes a communication interface, a processor, and a memory, wherein the communication interface is used to receive and send data, and the processor is configured to support the device to perform the corresponding functions in the first aspect or any possible implementation of the first aspect. The memory is coupled to the processor and stores program instructions necessary for the device.
[0015] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method in the first aspect and each embodiment.
[0016] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method in the first aspect and each embodiment described above.
[0017] In a fifth aspect, a chip is provided, wherein logic in the chip is used to execute the method in the first aspect and each embodiment described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A data annotation system architecture diagram provided for an embodiment of the present application;
[0019] Figure 2 A schematic diagram of a data labeling method provided in an embodiment of the present application;
[0020] Figure 3 A flowchart of a data labeling method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of another data labeling method provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of a data labeling device provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of another data labeling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.
[0025] A data labeling method provided in an embodiment of the present application can be applied to any scenario that requires data labeling or training of a data labeling model, such as application to a data labeling platform, a data labeling device, etc.
[0026] See also Figure 1 As shown in FIG. 1 , a data annotation system architecture diagram provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the system may include a data annotation platform, an electronic device 1 used by data annotation personnel 1, an electronic device 2 used by data annotation personnel 2, and an electronic device 3 used by data annotation personnel 3. Among them, the data annotation personnel can use the electronic device to log in to the data annotation platform to perform data annotation. The electronic device used by the data annotation personnel is connected to the data annotation platform through a communication network. The communication network can be a local area network or a wide area network transferred through a relay device.
[0027] When the communication network is a local area network, exemplarily, the communication network may be a short-range communication network such as a wireless fidelity (wifi) hotspot network, a bluetooth (BT) network or a near field communication (NFC) network. When the communication network is a wide area network, exemplarily, the communication network may be a third-generation wireless telephone technology (3G) network, a fourth-generation mobile communication technology (4G) network, a fifth-generation mobile communication technology (5G) network, a future-evolved public land mobile network (PLMN) or the Internet.
[0028] It should be noted that the data annotation platform can be a server, etc., and the electronic device used by the data annotation personnel can be a mobile phone, tablet, laptop computer, or other electronic device with a display screen, which is not limited in this embodiment of the present application.
[0029] It is understandable that there may be multiple labelers who perform data labeling. The above schematic diagram only uses three as an example for illustration, and the present application is not limited to this.
[0030] At present, in the existing technology, data are usually labeled by manual labeling methods. Due to the increase in data volume, manual labeling will make the cost relatively high, and it is difficult for labelers to ensure the accuracy of labeling under large amounts of long-term repetitive work.
[0031] In view of this, an embodiment of the present application provides a data labeling method, which obtains a labeling model through training data, and then automatically labels the data using the data labeling model, thereby reducing the manual participation in the labeling process, reducing costs, and improving the accuracy of data labeling.
[0032] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0033] It should be noted that the data involved in this application can be text, pictures, videos, etc., and this application does not limit this. In the embodiments, only text is used as an example for explanation, and other forms of data such as pictures and videos are similar to their implementation process.
[0034] See also Figure 2 As shown, first, the process of the data annotation method of the present application is briefly introduced. Exemplarily, it may include data collection 201, sentence extraction 202, manual entity annotation 203, entity vocabulary collection 204, self-made data 205, annotation model training 206, data annotation 207, and verification and correction 208. Among them, the two steps of manual entity annotation 203 and verification and correction 208 are completed manually, and data annotation 207 is completed by the model. The data annotation is completed by the model, thereby reducing the process of manual participation and reducing costs.
[0035] The following data annotation platform takes the server as an example. Figure 2 The data annotation method shown in the figure is described in detail. Figure 3 The figure is a flow chart of a data annotation method provided by an embodiment of the present application, see Figure 3 As shown, the method may include the following steps:
[0036] S301: The server obtains original data.
[0037] In the embodiment of the present application, the data labeler can upload the data to be labeled to the server. For example, in the present application, 40,000 pieces of original data and two data labelers are used as an example, such as data labeler A and data labeler B. Data labeler A and data labeler B can upload the data to be labeled to the server respectively.
[0038] It should be noted that the original data in this application may be questions manually input by the user on the user interface of the electronic device or instructions input by the user through voice, etc. Of course, it is understandable that the original data may also be data in other forms such as pictures and videos, and this application does not limit this.
[0039] S302: The server preprocesses the original data and classifies the preprocessed data.
[0040] It should be noted that in the embodiments of the present application, the data annotation process is introduced below using text data as an example.
[0041] After the data labeling personnel upload the data to be labeled to the server using an electronic device, the server can pre-process the data to be labeled. For example, the server can perform operations such as de-duplication, de-nullification, and de-noising on the original data to obtain the pre-processed data.
[0042] The deduplication operation can be understood as screening the same and repeated sentences in the original data and removing any one of them.
[0043] Since the original data may include special symbols or emoticons, when the original data is uploaded to the server, the server may not support emoticons and may display the special symbols or emoticons included in the original data as spaces. Therefore, in this application, the original data can be stripped, which can be understood as removing the special symbols or emoticons in the original data.
[0044] Questions input by different users may have similar meanings, that is, the original data may contain data with similar meanings. Of course, the original data may also contain some irrelevant data, or data that is not very meaningful for labeling. Therefore, in this application, the original data can be denoised, which can be understood as eliminating some irrelevant data in the original data, or data that is not very meaningful for labeling.
[0045] It should be noted that the operations of preprocessing the raw data are not limited to deduplication, de-duplication, denoising and the like, and this application does not impose any limitation on this.
[0046] After the server preprocesses the raw data, the preprocessed data may be classified. For example, the raw data may be sentence-analyzed, and then data with the same sentence structure may be classified into one category, as shown in Table 1. It should be noted that when the server performs sentence analysis on the raw data, it may analyze the semantics of the raw data and classify raw data with the same or similar semantics into one category.
[0047] Table 1
[0048] Does Honor 20i support transportation cards? How many transportation cards can Huawei phones support binding at most? Does Maimang 7 support transportation cards? Maimang 6 has NFC function, why doesn’t it support transportation cards? Does Huawei Note4 support transportation cards? Does my Maimang 6 phone support the transportation card function? Hello, can my mobile phone model be used with a transportation card? Does Huawei Enjoy 7x support activating transportation cards?
[0049] It is understandable that Table 1 is only a schematic illustration, and the data in Table 1 can be understood as part of a category of data. Of course, when classifying, data with similar semantics can be classified into one category, or classified according to the content of the data, and the classification method is not limited in this application.
[0050] As a possible implementation method, the server can use the feature extraction model to convert the original data into vectors of multiple dimensions, and then use the clustering algorithm k-means to select N center classes to aggregate the data belonging to the same class in the original data. Wherein N is a positive integer, and N is greater than or equal to 2. It can be understood that when the original data is converted into vectors of multiple dimensions using the feature extraction model, the vectors converted from the data of the same sentence structure or similar sentence structure are the same or similar. That is, the server can convert each original data into vectors of multiple dimensions, and then classify the vectors converted from the original data, and aggregate the vectors with the same or similar vectors into one category.
[0051] It should be noted that the feature extraction model and the k-means clustering algorithm are involved in the prior art. For details, please refer to the implementation methods in the prior art, and no further details will be given here.
[0052] S303: The server extracts first data from the classified data.
[0053] For each category of data, M pieces of data can be selected respectively, that is, N*M pieces of data are extracted from the original data, where N represents the number of categories obtained by classifying the original data in the above step S302. For example, it is assumed that N is 50, that is, the pre-processed data is divided into 50 categories in S302. Assuming that 100 pieces of data are selected from each category of data, 5000 pieces of data can be selected from 40,000 pieces of original data. It can be understood that the 100 pieces of data in each category can be understood as data with different expressions, and this data is data with the same or similar semantics.
[0054] In the embodiment of the present application, the selected 5000 data can be used as a sample, and the data labeler can manually label the 5000 data. Exemplarily, the labeler can extract the physical slots in the 5000 data and leave the physical slots empty. For the convenience of description, the selected 5000 sample data can be recorded as "first data".
[0055] The entity slot can be understood as the attribute information defined for the entity. For example, if the sentence is: Buy a ticket from Beijing to Shanghai, Beijing can be understood as the location slot of the departure place, and Shanghai can be understood as the location slot of the destination.
[0056] It should be understood that the physical slots in the data are not limited to the following examples, and may also include physical slots for bank cards, etc. This application does not limit this.
[0057] For example, the original data is: Does Huawei Enjoy 7x support the activation of transportation cards?
[0058] Data labelers can label the above data. For example, they can label the above data as: Does (Huawei Enjoy 7x) [phone_type] support the activation of (transportation card) [traffic_type]?
[0059] Extract the mobile phone entity and traffic card entity in the above data and leave the corresponding entity slots vacant, and get standard sentence 1: Does [phone_type] support the activation of [traffic_type]?
[0060] For another example, the original data is: Can Jiangsu's One Card be used in Wuxi?
[0061] The data labeler labels the above data, for example, it can be labeled as: Can (Jiangsu) [city]'s (card) [traffic_type] (Wuxi) [city] be used?
[0062] Similarly, extract the location entity and the traffic card entity and leave the corresponding entity slots vacant to obtain standard sentence pattern 2: Can [city]'s [traffic_type][city] be used?
[0063] It should be noted that the 100 pieces of data in each category in this application can be understood as 100 sentence patterns, and the standard sentence patterns are not limited to the above two examples. In this application, the sentence patterns of the data can be divided into multiple standard sentence patterns, and there is no limitation on this.
[0064] S304: The server collects entity words corresponding to the manually marked entity slots, and combines the collected entity words with standard sentence patterns to obtain second data.
[0065] As a possible implementation method, after the data annotator annotates the first data, the vacant entity slots and the entity vocabulary corresponding to the entity slots can be uploaded to the server, and then the server can collect the entity vocabulary corresponding to the entity slots uploaded by the data annotator, for example, collecting multiple entity vocabulary corresponding to the entity slots in the above example, such as mobile phone [phone_type], traffic card [traffic_type], city [city], etc. It should be noted that when the data annotator uploads the entity vocabulary corresponding to the entity slot to the server, the selected entity vocabulary can be selected by the data annotator, and this application does not limit this.
[0066] For example, the entity vocabulary can be found in Table 2.
[0067] Table 2
[0068]
[0069]
[0070] It can be understood that Table 2 is only a schematic illustration, and the data in Table 2 can be understood as part of the vocabulary in the entity vocabulary, and the present application is not limited to the above examples.
[0071] Furthermore, in step S303, common sentence patterns are obtained by extracting entity slots in the data, and the vocabulary in Table 2 can be substituted into the common sentence patterns according to the common sentence patterns to obtain second data. For the convenience of description, the combined data can be recorded as "second data" in this application.
[0072] As a possible implementation method, a random method can be used to randomly combine entity words and bring them into each sentence pattern, or a traversal method can be used to combine entity words one by one and bring them into each sentence pattern, which is not limited in this application. It is understandable that after using a random method to randomly combine entity words and bring them into each sentence pattern, the newly formed data needs to be deduplicated to avoid redundant data.
[0073] For example, assuming that the standard sentence is: Does [phone_type] support the opening of [traffic_type]? Substituting the words in Table 2 into the above standard sentence can obtain the following annotated data:
[0074] For example, data 1: Does (Honor 20i) [phone_type] support the activation of (traffic_card) [traffic_card]?
[0075] Data 2: Does (Mate20) [phone_type] support the activation of (Jinlingtong) [traffic_card]?
[0076] Data 3: (p30) Does [phone_type] support the activation of (Guangzhou Tong) [traffic_card]?
[0077] Data 4: Does (Mate20 Pro) [phone_type] support the activation of (Shenzhen Tong) [traffic_card]?
[0078] …
[0079] It should be noted that the above data 1, data 2, data 3, and data 4 are only some data examples, and the three entity words can also be substituted into other standard sentence patterns, and this application does not limit this.
[0080] Assuming that 50 categories are obtained in step S402, 100 data items are selected in each category in step S403, and the entity words of mobile phone [phone_type] and traffic card [traffic_type] in Table 2 are respectively substituted into the 100 sentence patterns of the above standard sentence pattern "Does [phone_type] support the opening of [traffic_type]?", then one category can obtain 7*7*100=4900 data items, and 50 categories can obtain 4900*50=245000 data items. That is, it can be understood that 245000 data items can be obtained by using the traversal method to combine the entity words one by one and bring them into each sentence pattern.
[0081] As an example, the server can select 35,000 pieces of data from the 245,000 pieces of data obtained by the traversal method as training data. Of course, the random method can also be used to randomly combine entity words into each sentence pattern to obtain 35,000 pieces of data as training data.
[0082] It should be noted that 35,000 pieces of data are only an example, and 40,000 pieces of data or other amounts of data may also be selected, and this application is not limited thereto.
[0083] S305: The server extracts part of the data in the second data, and trains the extracted part of the data to obtain a labeling model.
[0084] In the embodiment of the present application, a part of the second data may be selected for training to obtain a labeling model. For example, assuming that the second data has a total of 35,000 data, 30,000 data may be selected for training.
[0085] As a possible implementation, model A can be trained with 30,000 pieces of data to obtain a labeled model A with labeling capability. As an example, a bidirectional encoder representations from transformers (BERT) model can be trained with 30,000 pieces of data to obtain a labeled model.
[0086] For example, part of the data 1, data 2, data 3, data 4, etc. obtained in step S304 can be input into the model, and the model can learn the input labeled data to obtain a general labeled model. When a new unlabeled data is input into the general labeled model, the labeled model can automatically label the unlabeled data.
[0087] S306: The server verifies the annotation model using the remaining data in the second data except the training data to obtain a final annotation model.
[0088] After the annotation model is trained, it is necessary to calibrate the annotation model to verify the accuracy of the annotation model. Exemplarily, the remaining 5000 data in the second data can be used to calibrate the annotation model, for example, 5000 data are input into the model to determine whether the data annotation output by the model is correct. If most of the data in the annotation results of the 5000 data are correctly labeled, it can be determined that the accuracy of the annotation model is relatively high. If more of the data in the annotation results of the 5000 data are incorrect, it can be returned to step S305 to retrain the data.
[0089] S307: The server labels the unlabeled data using the final labeling model.
[0090] Since there are 40,000 original data, 5,000 data are selected as sample data in step S303, and the 5,000 sample data have been manually labeled, then the unlabeled data is 40,000-5,000=35,000. The server can use the final labeling model to label the 35,000 unlabeled data in the original data.
[0091] For example, suppose the unlabeled data in the original data is: How to add an access card to Huawei Mate 30? The server can input the unlabeled data into the final labeling model, and then the labeling model can label the unlabeled data. For example, the labeling model can output the labeled data: (Huawei Mate 30) [phone_type] How to add (bank card) [card_type]? .
[0092] It should be noted that Figure 3 In the method flow shown, step S301 may correspond to Figure 2 201, S302 can correspond to 202, S303 can correspond to 203, S304 can correspond to 204 and 205, S305 and S306 can correspond to 206, and S307 can correspond to 207.
[0093] After the server completes the labeling of the unlabeled data in the original data, the labelers can manually check and correct the 35,000 data labeled by the labeling model. In addition, the labelers can exchange the labeled data with each other. For example, labeler A and labeler B can exchange the labeled data and recheck the labeled data to improve the accuracy of data labeling. It can be understood that this step can correspond to Figure 2 Checksum correction 308 in.
[0094] Based on the above embodiments, the present application also provides a data labeling method, see Figure 4 As shown, the method includes:
[0095] S401: The server obtains M pieces of data to be marked, where M is an integer greater than 1.
[0096] S402: The server extracts N pieces of data from the M pieces of data, and performs statistical analysis on the N pieces of data to obtain at least one template.
[0097] Each of the templates includes at least one slot, and each slot is used to fill in at least one key information; N is an integer greater than 1, and N <M。
[0098] As an example, when the data is text, such as sentences input by the user, N sentences can be statistically analyzed to obtain multiple standard sentence patterns. Each standard sentence pattern may include multiple slots, such as location slots, time slots, etc. And each slot can be used to fill in key information. For example, the standard sentence pattern is: [city] [traffic_type][city] can be used? The slots can be [city], [traffic_type], and the key information can be the city name (for example, Beijing, Shanghai, etc.), the type of transportation card (One Card, Beijing Pass, etc.).
[0099] S403: The server substitutes the stored multiple key information into at least one template respectively to obtain P pieces of data.
[0100] In an embodiment of the present application, the data labeling personnel can upload and save the slots and the key information corresponding to the slots to the server. The server can substitute multiple key information into the template respectively to obtain multiple data.
[0101] S404: The server uses part of the P pieces of data for training to obtain a data annotation model.
[0102] S405: The server uses the data annotation model to annotate the M pieces of data except the N pieces of data.
[0103] In an embodiment of the present application, part of the P pieces of data obtained in S503 may be used for training, and the trained data annotation model may be verified using data other than part of the P pieces of data to verify the accuracy of the data annotation model.
[0104] In a possible implementation, extracting N pieces of data from the M pieces of data includes: classifying the M pieces of data to obtain Q types of data; Q is a positive integer; and extracting part of the data from the Q types of data to obtain the N pieces of data.
[0105] In the above method steps, classifying the M pieces of data includes:
[0106] The M pieces of data are respectively converted into corresponding feature vectors to obtain M feature vectors; and data corresponding to feature vectors with the same or similar feature vectors among the M feature vectors are taken as a type of data.
[0107] In a possible implementation, the server uses part of the P pieces of data for training to obtain a data annotation model, including:
[0108] The server uses part of the P pieces of data to train a preset initial model to obtain a data annotation model.
[0109] Furthermore, after the server obtains the data annotation model, the method further includes:
[0110] The server uses the remaining data in the P pieces of data except the partial data to verify the data annotation model.
[0111] It is understandable that the network devices in the above embodiments may include hardware structures and / or software modules corresponding to the execution of each function in order to realize the corresponding functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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.
[0112] Figure 5 Schematic diagram of the structure of a data annotation device 500 is shown. The device 500 may include an acquisition unit 501, a processing unit 502, a training unit 503 and a labeling unit 504. The processing unit 502 is used to perform Figure 5 S402, S403 in the illustrated embodiment, and / or other processes for supporting the technology described herein. The marking unit 504 may be used to perform Figure 4 S405 in the illustrated embodiment, and / or other processes for supporting the techniques described herein.
[0113] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0114] In the embodiments of the present application, the division of modules is illustrative, merely a logical function division. In actual implementation, there may be other division methods. Additionally, in each embodiment of the present application, the various functional modules may be integrated in a processor, may exist separately physically, or two or more modules may be integrated in one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0115] As Figure 6 shown, another device 600 provided by the embodiments of the present application, where the device 600 may be Figure 3 or Figure 4 the server in the embodiments shown, capable of implementing the functions of the server in the method provided by the embodiments of the present application; the device 600 may also be a device capable of supporting the server to implement the functions of the server in the method provided by the embodiments of the present application.
[0116] The device 600 includes at least one processor 602, configured to implement or support the device 600 to implement the functions of the server in the method provided by the embodiments of the present application.
[0117] In the present application, the processor 602 may call program instructions in the memory to execute: obtaining M pieces of data to be labeled; M is an integer greater than 1; extracting N pieces of data from the M pieces of data, and performing statistical analysis on the N pieces of data to obtain at least one template; each template includes at least one slot, and each slot is used to fill in at least one key information; N is an integer greater than 1, and N < M; substituting the stored multiple key information into the at least one template respectively to obtain P pieces of data; using some of the P pieces of data for training to obtain a data annotation model; using the data annotation model to annotate the data other than the N pieces of data in the M pieces of data.
[0118] In a possible design, when the processor 602 executes extracting N pieces of data from the M pieces of data, it is specifically configured to: classify the M pieces of data to obtain Q types of data; Q is a positive integer; extracting partial data from the Q types of data respectively to obtain the N pieces of data.
[0119] In a possible design, when the processor 602 executes classifying the M pieces of data, it is specifically configured to: convert the M pieces of data into their respective corresponding feature vectors to obtain M feature vectors; regarding the data corresponding to the feature vectors that are the same or similar among the M feature vectors as one type of data.
[0120] In a possible design, the processor 602 executes training using part of the P pieces of data to obtain a data annotation model, specifically for: training a preset initial model using part of the P pieces of data to obtain a data annotation model.
[0121] In a possible design, after the processor 602 obtains the data annotation model, it is further used to execute: using the remaining data in the P data except the partial data to verify the data annotation model.
[0122] The device 600 may also include at least one memory 601 for storing program instructions. The memory 601 is coupled to the processor 602. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 602 may operate in conjunction with the memory 601. The processor 602 may execute program instructions and / or data stored in the memory 601. At least one of the at least one memory may be included in the processor.
[0123] The apparatus 600 may further include a communication interface 603 for communicating with other devices via a transmission medium. The processor 602 may use the communication interface 603 to send and receive data.
[0124] The present application does not limit the specific connection medium between the communication interface 603, the processor 602 and the memory 601. Figure 6 In the embodiment, the memory 601, the processor 602 and the communication interface 603 are connected via a bus 604. Figure 6 The bus can be divided into address bus, data bus, control bus, etc. For the convenience of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0125] In the embodiment of the present application, the processor 602 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application may be directly executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0126] In the embodiment of the present application, the memory 601 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as RAM. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can realize a storage function, for storing program instructions.
[0127] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0128] The present application also provides a computer-readable storage medium including instructions, which, when executed on a computer, causes the computer to execute Figure 3 or Figure 4 The method is executed by a server in the illustrated embodiment.
[0129] The present application also provides a computer program product, including instructions, which, when executed on a computer, causes the computer to execute Figure 3 or Figure 4 The method is executed by a server in the illustrated embodiment.
[0130] The present application also provides a chip in an embodiment of the present invention. The logic in the chip is used to execute Figure 3 or Figure 4 The method is executed by a server in the illustrated embodiment.
[0131] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by instructions. These instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0132] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0134] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data labeling method, characterized in that: include: The server obtains M pieces of data to be annotated; The M is an integer greater than 1; The server extracts N pieces of data from the M pieces of data, and performs statistical analysis on the N pieces of data to obtain at least one template; each of the templates includes at least one slot, and each slot is used to fill in at least one key information; N is an integer greater than 1, and N <M; The server substitutes the stored multiple key information into the at least one template respectively to obtain P pieces of data; The server uses part of the P pieces of data for training to obtain a data annotation model; The server uses the data annotation model to annotate the data of the M pieces of data except the N pieces of data.
2. The method according to claim 1, characterized in that Extracting N pieces of data from the M pieces of data includes: Classify the M pieces of data to obtain Q types of data; Q is a positive integer; Part of the data is extracted from the Q-type data to obtain the N pieces of data.
3. The method according to claim 2, characterized in that Classifying the M pieces of data includes: Convert the M pieces of data into their corresponding feature vectors respectively to obtain M feature vectors; Data corresponding to feature vectors that are identical or similar to the M feature vectors are regarded as a type of data.
4. The method according to any one of claims 1 to 3, characterized in that The server uses part of the P pieces of data for training to obtain a data annotation model, including: The server uses part of the P pieces of data to train a preset initial model to obtain a data annotation model.
5. The method according to claim 4, characterized in that After the server obtains the data annotation model, the method further includes: The server uses the remaining data in the P pieces of data except the partial data to verify the data annotation model.
6. A data labeling device, characterized in that: include: A memory for storing instructions; Communication interface, used to receive and send data; A processor, configured to call program instructions in the memory to execute: Obtain M pieces of data to be marked, where M is an integer greater than 1; N pieces of data are extracted from the M pieces of data, and statistical analysis is performed on the N pieces of data to obtain at least one template; each of the templates includes at least one slot, and each slot is used to fill in at least one key information; N is an integer greater than 1, and N <M; Substituting the stored multiple key information into the at least one template respectively to obtain P pieces of data; Using part of the P pieces of data for training to obtain a data annotation model; The data annotation model is used to annotate the M pieces of data except the N pieces of data.
7. The device according to claim 6, characterized in that The processor executes to extract N pieces of data from the M pieces of data, specifically for: Classify the M pieces of data to obtain Q types of data; Q is a positive integer; Part of the data is extracted from the Q-type data to obtain the N pieces of data.
8. The device according to claim 7, characterized in that The processor performs classification of the M pieces of data, specifically for: Convert the M pieces of data into their corresponding feature vectors respectively to obtain M feature vectors; Data corresponding to feature vectors that are identical or similar to the M feature vectors are regarded as a type of data.
9. The device according to any one of claims 6 to 8, characterized in that The processor performs training using part of the P pieces of data to obtain a data annotation model, specifically for: A preset initial model is trained using part of the P pieces of data to obtain a data annotation model.
10. The device according to claim 9, characterized in that After the processor executes to obtain the data annotation model, it is also used to execute: The data annotation model is verified using the remaining data in the P pieces of data except the partial data.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 5.
12. A computer program product, characterized in that The method comprises program instructions, which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 5.
