Method, device, electronic device and medium for processing text data to be annotated

By using deep learning models to identify and encrypt custom keywords during text data annotation process, the contradiction between data privacy leakage and labeling efficiency is solved, the security desensitization and accurate labeling of text data is achieved, and information security is improved. .

CN112800465BActive Publication Date: 2024-12-24THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202110176118.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2024-12-24
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

In the process of text data annotation, there is a lack of effective solutions between the risk of data privacy leakage and the improvement of labeling efficiency, and the existing technology does not fully pay attention to data desensitization.

Method used

The machine learning model is used to identify custom keywords in text data and replace them with ciphertext through encryption algorithms to form desensitized text data to reduce the amount of data and ensure information security. The model is trained and verified through deep learning algorithms such as BERT-CRF to improve the accuracy and security of keyword recognition.

Benefits of technology

It improves the accuracy of the recognition of custom keywords, reduces the amount of data, ensures the security of information transmission, reduces the data storage space requirements, and effectively protects sensitive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112800465B_ABST
    Figure CN112800465B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and medium for processing file data to be annotated, the method comprising: obtaining a machine learning model for identifying custom keywords in text data; identifying each of the custom keywords in the text data to be annotated based on the machine learning model; encrypting each of the identified custom keywords respectively to obtain each ciphertext corresponding to each of the custom keywords; replacing each of the custom keywords in the text data to be annotated with a corresponding ciphertext to obtain the desensitized text data to be annotated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and more specifically, to a method for processing text data to be annotated, a device for processing text data to be annotated, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the process of text data annotation, due to the huge workload, the work is often outsourced to other data annotation agencies. However, there is a risk of privacy leakage during the annotation process within the data annotation agency.

[0003] Among the related technologies, the technology in the data labeling process also mainly focuses on how to assist manual work to speed up the labeling efficiency, and rarely pays attention to the data desensitization problem in the labeling process. Summary of the Invention

[0004] One purpose of the embodiments of the present disclosure is to provide a new technical solution for processing text data to be annotated.

[0005] According to a first aspect of the present disclosure, a method for processing text data to be annotated is provided, comprising:

[0006] Obtain a machine learning model for identifying custom keywords in text data;

[0007] Based on the machine learning model, identifying each of the custom keywords in the text data to be annotated;

[0008] Encrypting the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively;

[0009] Each of the custom keywords in the text data to be annotated is replaced with a corresponding ciphertext to obtain the desensitized text data to be annotated.

[0010] Optionally, the custom keyword involves at least one of entity name, entity relationship, mobile phone number, account name, and account password.

[0011] Optionally, obtaining a machine learning model for identifying custom keywords in text data includes:

[0012] Obtain the training text dataset according to the set acquisition rules;

[0013] Based on a deep learning algorithm, the machine learning model is trained using the training text dataset;

[0014] The set acquisition rules satisfy any one or more of the following:

[0015] The total number of characters included in the training text data set exceeds a first set number;

[0016] The total number of words included in the training text data set exceeds a second set number;

[0017] The total number of each type of custom keywords included in the training text data set exceeds a third set number.

[0018] Optionally, after the machine learning model is trained using the training text dataset based on the deep learning algorithm, the method further includes:

[0019] According to the machine learning model, the custom keywords in each verification text data in the verification text data set are obtained as predicted custom keywords;

[0020] Comparing each predicted custom keyword in each verification text data with each corresponding actual custom keyword to obtain an evaluation index value of the machine learning model;

[0021] When the evaluation index value is greater than or equal to the evaluation index threshold, the step of identifying each of the custom keywords in the text data to be annotated based on the machine learning model is performed.

[0022] Optionally, the method further includes:

[0023] When the evaluation index value is less than the evaluation index threshold, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the numerical value of the hyperparameter in the machine learning model.

[0024] Optionally, the deep learning algorithm is a BERT-CRF algorithm.

[0025] Optionally, after identifying each of the custom keywords in the text data to be annotated, the method further includes:

[0026] Obtaining the total number of the identified custom keywords;

[0027] In the case that the total number of the identified custom keywords is greater than zero, the step of respectively encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords is performed.

[0028] Optionally, the method further includes:

[0029] When the total number of identified custom keywords is zero, the text data to be annotated is first input into a confidential environment to re-identify each custom keyword in the text data to be annotated in the confidential environment, and then the steps of encrypting each identified custom keyword separately to obtain each ciphertext corresponding to each custom keyword are performed.

[0030] Optionally, encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords includes:

[0031] Based on a preset encryption algorithm, the identified custom keywords are encrypted respectively to obtain ciphertexts corresponding to the custom keywords respectively.

[0032] Optionally, the preset encryption algorithm includes any one of a random perturbation encryption algorithm and a hash algorithm.

[0033] Optionally, before encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords, the method further includes:

[0034] The mapping relationship between each of the user-defined keywords in the text data to be annotated and the position information thereof in the text data to be annotated is stored in the security device.

[0035] Optionally, after obtaining the desensitized text data to be annotated, the method further includes:

[0036] The desensitized text data to be annotated is annotated.

[0037] Optionally, after marking the encrypted text data to be marked, the method further includes:

[0038] Acquiring the mapping relationship from the security device;

[0039] According to the mapping relationship, the annotated text data to be annotated is traversed, and each ciphertext information is replaced with a corresponding custom keyword to obtain the decrypted annotated text data to be annotated.

[0040] According to a second aspect of the present disclosure, there is also provided a device for processing text data to be annotated, comprising:

[0041] An acquisition module, used to obtain a machine learning model for identifying custom keywords in text data;

[0042] an identification module, configured to identify each of the custom keywords in the text data to be annotated based on the machine learning model;

[0043] An encryption module encrypts the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively;

[0044] The replacement module is used to replace each of the custom keywords in the text data to be annotated with the corresponding ciphertext to obtain the desensitized text data to be annotated.

[0045] Optionally, the custom keyword involves at least one of entity name, entity relationship, mobile phone number, account name, and account password.

[0046] Optionally, the acquisition module is specifically configured to:

[0047] Obtain the training text dataset according to the set acquisition rules;

[0048] Based on a deep learning algorithm, the machine learning model is trained using the training text dataset;

[0049] The set acquisition rules satisfy any one or more of the following:

[0050] The total number of characters included in the training text data set exceeds a first set number;

[0051] The total number of words included in the training text data set exceeds a second set number;

[0052] The total number of each type of custom keywords included in the training text data set exceeds a third set number.

[0053] Optionally, the device further includes a verification module, configured to:

[0054] According to the machine learning model, the custom keywords in each verification text data in the verification text data set are obtained as predicted custom keywords;

[0055] Comparing each predicted custom keyword in each verification text data with each corresponding actual custom keyword to obtain an evaluation index value of the machine learning model;

[0056] When the evaluation index value is greater than or equal to the evaluation index threshold, the recognition module identifies each of the custom keywords in the text data to be annotated based on the machine learning model.

[0057] Optionally, the verification module is further configured to:

[0058] When the evaluation index value is less than the evaluation index threshold, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the numerical value of the hyperparameter in the machine learning model.

[0059] Optionally, the deep learning algorithm is a BERT-CRF algorithm.

[0060] Optionally, the acquisition module is further configured to:

[0061] Obtaining the total number of the identified custom keywords;

[0062] In the case that the total number of the identified custom keywords is greater than zero, the encryption module encrypts the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively.

[0063] Optionally, the acquisition module is further configured to:

[0064] When the total number of identified custom keywords is zero, the text data to be annotated is first input into a confidential environment to re-identify each custom keyword in the text data to be annotated in the confidential environment, and then the encryption module encrypts each identified custom keyword separately to obtain ciphertext corresponding to each custom keyword.

[0065] Optionally, the encryption module is specifically configured to:

[0066] Based on a preset encryption algorithm, the identified custom keywords are encrypted respectively to obtain ciphertexts corresponding to the custom keywords respectively.

[0067] Optionally, the preset encryption algorithm includes any one of a random perturbation encryption algorithm and a hash algorithm.

[0068] Optionally, the device further includes a storage module, configured to:

[0069] The mapping relationship between each of the user-defined keywords in the text data to be annotated and the position information thereof in the text data to be annotated is stored in the security device.

[0070] Optionally, the device further includes a marking module, configured to:

[0071] The desensitized text data to be annotated is annotated.

[0072] Optionally, the device further includes a decryption module, configured to:

[0073] Acquiring the mapping relationship from the security device;

[0074] According to the mapping relationship, the annotated text data to be annotated is traversed, and each ciphertext information is replaced with a corresponding custom keyword to obtain the decrypted annotated text data to be annotated.

[0075] According to a third aspect of the present disclosure, there is further provided an electronic device comprising at least one computing device and at least one storage device, wherein the at least one storage device is used to store instructions, and the instructions are used to control the at least one computing device to execute the method according to the first aspect above; or, the device implements the device according to the second aspect above through the computing device and the storage device.

[0076] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the method described in the first aspect above is implemented.

[0077] One beneficial effect of the present disclosure is that the method, device, electronic device, and medium according to the embodiments of the present disclosure are based on a machine learning model for identifying custom keywords in text data, and identify each custom keyword in the text data to be annotated, which can improve the accuracy of each custom keyword extracted. At the same time, after identifying each custom keyword in the text data to be annotated, it will encrypt each custom keyword to obtain each ciphertext corresponding to each custom keyword, and replace each custom keyword in the file data to be annotated with the corresponding ciphertext to obtain desensitized data to be annotated. The storage space of the desensitized text data to be annotated is much smaller than the storage space of the initial text data to be annotated. Therefore, on the one hand, this can reduce the amount of data, and on the other hand, it can desensitize key information to ensure the security of information transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0079] Figure 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure;

[0080] Figure 2 is a flowchart of a method for processing text data to be annotated according to an embodiment of the present disclosure;

[0081] Figure 3 is a flowchart of a method for processing text data to be annotated according to another embodiment of the present disclosure;

[0082] Figure 4 is a flowchart of a method for processing text data to be annotated according to an example of the present disclosure;

[0083] Figure 5 is a principle block diagram of a device for processing text data to be annotated according to an embodiment of the present disclosure;

[0084] Figure 6 is a principle block diagram of an electronic device according to an embodiment of the present invention;

[0085] Figure 7 FIG. 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0086] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention.

[0087] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0088] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0089] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0090] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0091] <Hardware Configuration>

[0092] The method of the embodiment of the present disclosure may be implemented by at least one electronic device, that is, the apparatus 5000 for implementing the method may be disposed on the at least one electronic device. Figure 1 The hardware structure of any electronic device is shown. Figure 1 The electronic device shown may be a portable computer, a desktop computer, a workstation, a server, etc., or any other device having a computing device such as a processor and a storage device such as a memory, and is not limited here.

[0093] like Figure 1As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 is configured to execute a computer program. The computer program may be written using an instruction set such as an x86, Arm, RISC, MIPS, or SSE architecture. The memory 1200 may include, for example, ROM (read-only memory), RAM (random access memory), or a non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface or a headphone jack. The communication device 1400 may be capable of wired or wireless communication, and may specifically include Wi-Fi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, and the like. The display device 1500 may be, for example, an LCD display or a touch screen display. The input device 1600 may include, for example, a touch screen, a keyboard, or somatosensory input. The electronic device 1000 can output voice information through the speaker 1700 and can collect voice information through the microphone 1800.

[0094] Figure 1 The electronic device shown is merely illustrative and in no way limits the present invention, its application, or use. In the embodiments of the present disclosure, the memory 1200 of the electronic device 1000 is used to store instructions that control the processor 1100 to perform the method for processing text data to be annotated according to the embodiments of the present disclosure. A skilled person can design instructions based on the disclosed scheme. How instructions control the processor's operation is well known in the art and will not be described in detail here.

[0095] In one embodiment, an electronic device is provided, including at least one computing device and at least one storage device, wherein the at least one storage device is used to store instructions for controlling the at least one computing device to execute a method according to any embodiment of the present disclosure.

[0096] The device may include at least one Figure 1 The electronic device 1000 shown provides at least one computing device such as a processor and at least one storage device such as a memory, which are not limited herein.

[0097] <Method Example>

[0098] Figure 2 is a flow chart of a method for processing text data to be annotated according to an embodiment of the present disclosure, the method being executed by the electronic device 1000, such as Figure 2 As shown, the method may include the following steps S2100 to S2400:

[0099] Step S2100: Obtain a machine learning model for identifying custom keywords in text data.

[0100] In this embodiment, the minimum granularity when processing text data is no longer a single character in the text data, but a word in the text data. The words in the text data may include custom keywords and other words except the custom keywords.

[0101] The custom keywords may be predefined sensitive words based on actual needs and actual application scenarios. The custom keywords may, for example, involve at least one of entity names, entity relationships, mobile phone numbers, account names, and account passwords.

[0102] The above entity names can be person names, organization names, location names, and all other entities identified by names.

[0103] The machine learning model can be a neural network model, such as but not limited to a BP (Back Propagation) neural network model, a convolutional neural network model, etc. Of course, the machine learning model can also be a logistic regression model. The machine learning model is not specifically limited here.

[0104] In this embodiment, obtaining a machine learning model for identifying custom keywords in text data in step S2100 may further include the following steps S2110 to S2120:

[0105] Step S2110: Acquire a training text dataset according to the set acquisition rules.

[0106] In this step S2110, the set acquisition rules can satisfy any one or more of the following items: the total number of characters included in the training text data set exceeds the first set number; the total number of words included in the training text data set exceeds the second set number; the total number of each type of custom keywords included in the training text data set exceeds the third set number.

[0107] The above first set quantity, second set quantity and third set quantity can be values ​​set according to actual application scenarios and actual needs, and this embodiment does not limit them here.

[0108] Step S2120: Based on the deep learning algorithm, a machine learning model is trained using the training text dataset.

[0109] The deep learning algorithm may be a BERT-CRF algorithm.

[0110] Specifically, the electronic device executing the embodiments of the present disclosure may pre-store training data sets corresponding to a variety of application scenarios. The training data may be, for example, image data, text data, or voice data. Based on the application scenario input through the provided application scenario setting entry, a training data set matching the application scenario is obtained to perform machine learning training. In this way, the obtained machine learning model can be applied to the input application scenario. After obtaining the machine learning model corresponding to the application scenario, the final machine learning model can be input into an application project that matches the application scenario to which it is applicable, so that the final machine learning model can be used in the corresponding application project to process the sample information in the application project.

[0111] The more training data you have, the more accurate your training results will generally be. However, after reaching a certain amount of training data, the accuracy of the training results will increase more slowly until the orientation stabilizes. The amount of training data required can be determined by balancing the accuracy of the training results with the data processing cost.

[0112] Taking the application scenario of custom keyword recognition as an example, the training data is text data, and each custom keyword in the text data has been labeled. The training data can be trained based on a deep learning algorithm to train a machine learning model, which is used to recognize each custom keyword in the text data.

[0113] After obtaining the machine learning model for identifying custom keywords in text data, proceed to:

[0114] Step S2200: identifying each defined keyword in the text data to be annotated based on the machine learning model.

[0115] In this embodiment, any piece of text data to be annotated can be input into a machine learning model to obtain the custom keywords in the text data to be annotated. For example, the identified custom keywords include, but are not limited to, names, family relationships, company names, account numbers, mobile phone numbers, etc. This embodiment utilizes a pre-trained machine learning model for identifying custom keywords in text data to identify custom keywords in the text data to be annotated, which can improve the accuracy of the extracted custom keywords.

[0116] In one example, after identifying each custom keyword in the text data to be annotated based on a machine learning model, the following steps may be directly performed to encrypt each identified custom keyword to obtain each ciphertext corresponding to each custom keyword.

[0117] In one example, after identifying each custom keyword in the text data to be annotated, the total number of the identified custom keywords is first obtained, and when the total number of the identified custom keywords is greater than zero, the following steps are performed to encrypt each identified custom keyword separately to obtain each ciphertext corresponding to each custom keyword.

[0118] In this example, for example, only when the total number of custom keywords identified in the text data to be annotated is greater than zero, the following steps of encrypting the identified custom keywords separately to obtain ciphertexts corresponding to the custom keywords are performed to avoid performing subsequent encryption steps when no custom keywords are identified in the text data to be annotated.

[0119] In one example, after identifying each custom keyword in the text data to be annotated, the total number of the identified custom keywords is first obtained, and when the total number of the identified custom keywords is zero, the text data to be annotated is first input into a confidential environment to re-identify each custom keyword in the text data to be annotated in the confidential environment, and then the following steps are performed to encrypt each identified custom keyword respectively to obtain ciphertext corresponding to each custom keyword.

[0120] A confidential environment refers to an operating environment in which operations on text data are supervised and confidentiality is controlled, such as but not limited to an operating room that uses an access control system to isolate the space, installs cameras, and isolates the computer network.

[0121] In this example, if the total number of custom keywords identified in the text data to be annotated is zero, the text data to be annotated can be returned to a secure environment, and after manually extracting the custom keywords from the text data to be annotated, the following steps are performed to encrypt the identified custom keywords and obtain ciphertexts corresponding to the custom keywords. In other words, if the machine learning model fails to identify the custom keywords, the custom keywords in the text data to be annotated will be manually extracted and then encrypted to ensure reliable information transmission.

[0122] After identifying the defined keywords in the text data to be annotated based on the machine learning model, proceed to:

[0123] In step S2300 , the identified custom keywords are encrypted to obtain ciphertexts corresponding to the custom keywords.

[0124] In this embodiment, each identified custom keyword can be encrypted based on a preset encryption algorithm to obtain a ciphertext corresponding to each custom keyword. This embodiment can reduce the amount of data by encrypting the custom keyword, and can also desensitize key information to ensure the security of information transmission.

[0125] The above preset encryption algorithm may include any one of a random perturbation encryption algorithm and a hash algorithm.

[0126] The above encryption algorithm uses a cryptographic hash function to encrypt custom keywords. The cryptographic hash function can be any function that can implement hash processing, such as, but not limited to, the MD5 message digest algorithm, the Digital Signature Algorithm (DSA), and the PBKDF2 algorithm. Here, the same cryptographic hash function can be used to encrypt each identified custom keyword, or different cryptographic hash functions can be used to encrypt each identified custom keyword.

[0127] The above ciphertext may be a character string, such as dccbsfg, or a combination of characters and numbers, such as f4dcc3b5aa, without limitation.

[0128] For example, taking the identified custom keyword as a name as an example, a cryptographic hash function may be used to perform hash encryption on the name, and the corresponding ciphertext obtained is dccbsfg.

[0129] According to the method of the embodiment of the present disclosure, it is based on a machine learning model for identifying custom keywords in text data, and identifies each custom keyword in the text data to be annotated, which can improve the accuracy of the extracted custom keywords. At the same time, after identifying each custom keyword in the text data to be annotated, it will encrypt each custom keyword to obtain each ciphertext corresponding to each custom keyword, and replace each custom keyword in the file data to be annotated with the corresponding ciphertext to obtain the desensitized data to be annotated. The storage space of the desensitized text data to be annotated is much smaller than the storage space of the initial text data to be annotated. Therefore, on the one hand, this can reduce the amount of data, and on the other hand, it can desensitize key information to ensure the security of information transmission.

[0130] In one embodiment, after a machine learning model is trained using a training text dataset based on a deep learning algorithm, the method for processing text data to be annotated disclosed herein may further include the following steps S3100 to S3400:

[0131] Step S3100: According to the machine learning model, each custom keyword in each verification text data in the verification text data set is obtained as each predicted custom keyword.

[0132] In step S3100 , a small amount of data may be selected for manual annotation of custom keywords as actual custom keywords for verifying the text data.

[0133] Step S3200 : Compare each predicted custom keyword in each verification text data with the corresponding actual custom keyword to obtain an evaluation index value of the machine learning model.

[0134] In step S3200, the custom keywords in each verification text data can be obtained as predicted custom keywords based on the machine learning model, so as to compare the predicted custom keywords of each verification text data with the actual custom keywords of each verification text data, and then obtain the evaluation index value of the machine learning model.

[0135] Evaluation metrics for machine learning models are used to judge their quality. These metrics include at least one of the following: mean squared error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE), R², AUC, KS, recall, accuracy, precision, f1, and logloss.

[0136] Step S3300: When the evaluation index value is less than the evaluation index threshold, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the numerical value of the hyperparameter in the machine learning model.

[0137] In step S3300, an evaluation index threshold may be set to determine whether the machine learning model is valid based on the evaluation index threshold. For example, if the evaluation index value is less than the evaluation index threshold, the machine learning model may be determined to be invalid, or if the evaluation index value does not exceed the evaluation index threshold, the machine learning model may be determined to be valid.

[0138] In this example, when the machine learning model is judged to be invalid based on the evaluation index value, the machine learning model can be retrained by adjusting the number of training times of the machine learning model and at least one of the values ​​of the hyperparameters in the machine learning model to make the identified custom keywords more accurate.

[0139] Step S3400: When the evaluation index value is greater than or equal to the evaluation index threshold, the step of identifying each custom keyword in the text data to be annotated based on the machine learning model is executed.

[0140] After obtaining the machine learning model, this embodiment selects verification text data and compares the actual custom keywords in each verification text data with the corresponding predicted custom keywords to obtain an evaluation index value for the machine learning model. Only when the machine learning model is determined to be valid based on the evaluation index value does it perform the step of identifying each custom keyword in the text data to be annotated based on the machine learning model, thereby ensuring the accuracy of the identified custom keywords. At the same time, if the machine learning model is determined to be invalid based on the evaluation index value, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the value of a hyperparameter in the machine learning model, so that the identified custom keywords become increasingly accurate.

[0141] In one embodiment, before encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords, the method for processing text data to be annotated may further include:

[0142] The mapping relationship between each self-defined keyword in the text data to be annotated and the position information of the keyword in the text data to be annotated is stored in the security device.

[0143] The above-mentioned confidential devices refer to dedicated computing and storage devices for storing confidential information, such as computers that are network isolated and use account and password authentication.

[0144] In this embodiment, the electronic device 1000 can establish a mapping relationship between each custom keyword in the text data to be annotated and its location information in the text data to be annotated, and store the mapping relationship in a confidential device to avoid information leakage. At the same time, the mapping relationship can be used as a decryption file for the electronic device 1000 to decrypt the custom keywords.

[0145] In one embodiment, after obtaining the desensitized text data to be annotated, the method for processing the text data to be annotated may further include: annotating the desensitized text data to be annotated.

[0146] In one example, the text data to be annotated may be directly encrypted by an encryption party of the text data to be annotated.

[0147] In one example, the encryption party may encrypt the text data to be annotated and then entrust the desensitized text data to be annotated to a data annotation agency, so that the data annotation agency annotates the desensitized text data to be annotated.

[0148] According to the method of this embodiment, what is provided to the data annotation agency is the desensitized text data to be annotated, which can desensitize key information and ensure the security of information transmission.

[0149] In one embodiment, after the desensitized text data to be annotated is annotated, the method for processing the text data to be annotated also includes: obtaining a mapping relationship from a confidential device; according to the mapping relationship, traversing the annotated text data to be annotated, and replacing each ciphertext information with a corresponding custom keyword to obtain the decrypted annotated text data to be annotated.

[0150] According to this embodiment, after annotating the desensitized text data to be annotated, the annotated text data will be restored through the mapping relationship between each custom keyword in the text data to be annotated and its position information in the text data to be annotated that is pre-stored in the confidential device.

[0151] <Example>

[0152] Next, another example of a method for processing text data to be annotated is shown. In this example, combined with Figure 4 As shown, the method for processing the text data to be annotated may include the following steps:

[0153] Step S4010: Obtain a machine learning model for identifying custom keywords in text data.

[0154] Step S4020: Identify each defined keyword in the text data to be annotated based on the machine learning model.

[0155] Step S4030: Obtain the total number of identified custom keywords. If the total number of identified custom keywords is greater than zero, execute the following step S4050. Otherwise, execute the following step S4040.

[0156] Step S4040: input the text data to be annotated into a confidential environment, and after re-identifying each custom keyword in the text data to be annotated in the confidential environment, continue to perform the following step S4050.

[0157] In this step S4040, if the machine learning model fails to identify the custom keywords in the text data to be annotated, the text data to be annotated can be returned to a confidential environment so that the custom keywords in the text data to be annotated can be manually extracted in the confidential environment.

[0158] Step S4050: storing in the security device a mapping relationship between each self-defined keyword in the text data to be annotated and its position information in the text data to be annotated.

[0159] In step S4060 , the identified custom keywords are encrypted based on a preset encryption algorithm to obtain ciphertexts corresponding to the custom keywords.

[0160] Step S4070: Replace each custom keyword in the text data to be annotated with the corresponding ciphertext to obtain the desensitized text data to be annotated.

[0161] Step S4080: annotate the desensitized text data to be annotated.

[0162] Step S4090, obtaining a mapping relationship from a security device; traversing the annotated text data according to the mapping relationship, and replacing each ciphertext information with a corresponding custom keyword to obtain the decrypted annotated text data.

[0163] <Device Example>

[0164] In this embodiment, a device 5000 for processing text data to be annotated is also provided. Figure 5 As shown, the processing device 5000 for the text data to be annotated includes an acquisition module 5100, an identification module 5200, an encryption module 5300 and a replacement module 5400, which are used to implement the processing method for the text data to be annotated provided in this embodiment. The various modules of the processing device 5000 for the text data to be annotated can be implemented by software or by hardware, which is not limited here.

[0165] The acquisition module 5100 is used to obtain a machine learning model for identifying custom keywords in text data.

[0166] The identification module 5200 is used to identify each of the custom keywords in the text data to be annotated based on the machine learning model.

[0167] The encryption module 5300 encrypts the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively.

[0168] The replacement module 5400 is configured to replace each of the user-defined keywords in the text data to be annotated with a corresponding ciphertext to obtain the desensitized text data to be annotated.

[0169] In one embodiment, the custom keyword involves at least one of entity name, entity relationship, mobile phone number, account name, and account password.

[0170] In one embodiment, the acquisition module 5100 is specifically used to: acquire a training text dataset according to a set acquisition rule; and train the machine learning model using the training text dataset based on a deep learning algorithm.

[0171] The set acquisition rules meet any one or more of the following:

[0172] The total number of characters included in the training text data set exceeds a first set number;

[0173] The total number of words included in the training text data set exceeds a second set number;

[0174] The total number of each type of custom keywords included in the training text data set exceeds a third set number.

[0175] In one embodiment, the device 5000 also includes a verification module (not shown in the figure), which is used to: obtain the custom keywords in each verification text data in the verification text data set as predicted custom keywords based on the machine learning model; compare the predicted custom keywords in each verification text data with the corresponding actual custom keywords to obtain an evaluation index value of the machine learning model; when the evaluation index value is greater than or equal to the evaluation index threshold, the recognition module then identifies the custom keywords in the text data to be annotated based on the machine learning model.

[0176] In one embodiment, the verification module is also used to: when the evaluation index value is less than the evaluation index threshold, retrain the machine learning model by adjusting at least one of the number of training times of the machine learning model and the numerical value of the hyperparameter in the machine learning model.

[0177] In one embodiment, the deep learning algorithm is a BERT-CRF algorithm.

[0178] In one embodiment, the acquisition module 5100 is further used to: obtain the total number of the identified custom keywords; when the total number of the identified custom keywords is greater than zero, the encryption module encrypts the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively.

[0179] In one embodiment, the acquisition module 5100 is also used to: when the total number of identified custom keywords is zero, first input the text data to be annotated into a confidential environment, so as to re-identify each of the custom keywords in the text data to be annotated in the confidential environment, and then use the encryption module to encrypt each of the identified custom keywords respectively to obtain ciphertext corresponding to each of the custom keywords.

[0180] In one embodiment, the encryption module 5300 is specifically configured to: encrypt the identified custom keywords based on a preset encryption algorithm to obtain ciphertexts corresponding to the custom keywords.

[0181] In one embodiment, the preset encryption algorithm includes any one of a random perturbation encryption algorithm and a hash algorithm.

[0182] In one embodiment, the apparatus 5000 further includes a storage module (not shown in the figure), which is used to store in a security device a mapping relationship between each of the custom keywords in the text data to be annotated and its location information in the text data to be annotated.

[0183] In one embodiment, the apparatus 5000 further includes a labeling module (not shown in the figure), which is configured to label the desensitized text data to be labeled.

[0184] In one embodiment, the device 5000 also includes a decryption module (not shown in the figure), which is used to: obtain the mapping relationship from the confidentiality device; traverse the text data to be annotated after the annotation according to the mapping relationship, and replace each ciphertext information with the corresponding custom keyword to obtain the decrypted text data to be annotated after the annotation.

[0185] <Equipment Example>

[0186] Corresponding to the above method embodiment, in this embodiment, an electronic device is also provided, such as Figure 6 As shown, it may include a device 5000 for processing text data to be annotated according to any embodiment of the present disclosure, for implementing a method for processing text data to be annotated according to any embodiment of the present disclosure.

[0187] like Figure 7 As shown, the electronic device 6000 may also include a processor 6200 and a memory 6100, wherein the memory 6100 is used to store executable instructions; the processor 6200 is used to run the electronic device according to the control of the instructions to execute the method for processing text data to be annotated according to any embodiment of the present disclosure.

[0188] The various modules of the above device 5000 can be implemented by the processor 6200 running the instructions to execute the method according to any embodiment of the present disclosure.

[0189] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0190] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0191] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0192] The computer program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. The computer readable program instructions can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), is personalized by utilizing the state information of the computer readable program instructions, and the electronic circuit can execute the computer readable program instructions, thereby realizing various aspects of the present invention.

[0193] Various aspects of the present invention are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0194] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0195] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0196] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.

[0197] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for processing text data to be annotated, comprising: Obtaining a machine learning model for identifying custom keywords in text data; wherein the custom keywords involve at least one of entity names, entity relationships, mobile phone numbers, account names, and account passwords; Based on the machine learning model, identify each of the custom keywords in the text data to be annotated; wherein the input of the machine learning model is the text data to be annotated, and the output is each of the custom keywords in the text data to be annotated; Encrypting the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively; Replacing each of the custom keywords in the text data to be annotated with a corresponding ciphertext to obtain the desensitized text data to be annotated; Wherein, the acquisition of the machine learning model for identifying the custom keywords in the text data includes: acquiring a training text data set according to a set acquisition rule; training the machine learning model using the training text data set based on a deep learning algorithm; wherein the set acquisition rule satisfies any one or more of the following items: the total number of characters included in the training text data set exceeds a first set number; the total number of words included in the training text data set exceeds a second set number; the total number of each type of custom keywords included in the training text data set exceeds a third set number; Among them, after the machine learning model is trained by using the training text data set based on the deep learning algorithm, it also includes: according to the machine learning model, obtaining each of the custom keywords in each verification text data in the verification text data set as each predicted custom keyword; comparing each predicted custom keyword in each verification text data with the corresponding actual custom keyword to obtain an evaluation index value of the machine learning model; when the evaluation index value is greater than or equal to the evaluation index threshold, executing the step of identifying each of the custom keywords in the text data to be annotated based on the machine learning model.

2. The method according to claim 1, wherein: The method further comprises: When the evaluation index value is less than the evaluation index threshold, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the numerical value of a hyperparameter in the machine learning model.

3. The method according to claim 1, wherein: The deep learning algorithm is the BERT-CRF algorithm.

4. The method according to claim 1, wherein: After identifying each of the custom keywords in the text data to be annotated, the method further includes: Obtaining the total number of the identified custom keywords; In the case that the total number of the identified custom keywords is greater than zero, the step of respectively encrypting the identified custom keywords to obtain ciphertexts respectively corresponding to the custom keywords is performed.

5. The method according to claim 4, wherein: The method further comprises: In the case that the total number of identified custom keywords is zero, the text data to be annotated is first input into a confidential environment to re-identify each custom keyword in the text data to be annotated in the confidential environment, and then the steps of encrypting each identified custom keyword separately to obtain each ciphertext corresponding to each custom keyword are performed.

6. The method according to claim 1, wherein: The step of respectively encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords comprises: Based on a preset encryption algorithm, the identified custom keywords are encrypted respectively to obtain ciphertexts corresponding to the custom keywords respectively.

7. The method according to claim 6, wherein: The preset encryption algorithm includes any one of a random perturbation encryption algorithm and a hash algorithm.

8. The method according to claim 1, wherein: Before encrypting the identified custom keywords to obtain ciphertexts corresponding to the custom keywords, the method further includes: The mapping relationship between each of the self-defined keywords in the text data to be annotated and the location information thereof in the text data to be annotated is stored in the security device.

9. The method according to claim 8, wherein: After obtaining the desensitized text data to be annotated, the method further includes: The desensitized text data to be annotated is annotated.

10. The method according to claim 9, wherein: After the desensitized text data to be annotated is annotated, the method further includes: Acquire the mapping relationship from the security device; According to the mapping relationship, the annotated text data to be annotated is traversed, and each ciphertext information is replaced with the corresponding each custom keyword to obtain the decrypted annotated text data to be annotated.

11. A device for processing text data to be annotated, comprising: An acquisition module, used to acquire a machine learning model for identifying custom keywords in text data; wherein the custom keywords involve at least one of entity names, entity relationships, mobile phone numbers, account names, and account passwords; An identification module, used to identify each of the custom keywords in the text data to be annotated based on the machine learning model; wherein the input of the machine learning model is the text data to be annotated, and the output is each of the custom keywords in the text data to be annotated; An encryption module, encrypting the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively; A replacement module, used to replace each of the custom keywords in the text data to be annotated with a corresponding ciphertext to obtain the desensitized text data to be annotated; The acquisition module is specifically used to acquire a training text data set according to a set acquisition rule; based on a deep learning algorithm, the machine learning model is trained using the training text data set; wherein the set acquisition rule satisfies any one or more of the following items: the total number of characters included in the training text data set exceeds a first set number; the total number of words included in the training text data set exceeds a second set number; the total number of each type of custom keywords included in the training text data set exceeds a third set number; Among them, the device also includes a verification module, which is used to: obtain each of the custom keywords in each verification text data in the verification text data set as each predicted custom keyword according to the machine learning model; compare each predicted custom keyword in each verification text data with the corresponding actual custom keyword to obtain an evaluation index value of the machine learning model; when the evaluation index value is greater than or equal to the evaluation index threshold, the recognition module then identifies each of the custom keywords in the text data to be annotated based on the machine learning model.

12. The device according to claim 11, wherein The verification module is further used for: When the evaluation index value is less than the evaluation index threshold, the machine learning model is retrained by adjusting at least one of the number of training times of the machine learning model and the numerical value of a hyperparameter in the machine learning model.

13. The device according to claim 11, wherein: The deep learning algorithm is the BERT-CRF algorithm.

14. The device according to claim 11, wherein: The acquisition module is further used for: Obtaining the total number of the identified custom keywords; In the case that the total number of the identified custom keywords is greater than zero, the encryption module encrypts the identified custom keywords respectively to obtain ciphertexts corresponding to the custom keywords respectively.

15. The device according to claim 14, wherein: The acquisition module is further used for: When the total number of identified custom keywords is zero, the text data to be annotated is first input into a confidential environment to re-identify each custom keyword in the text data to be annotated in the confidential environment, and then the encryption module encrypts each identified custom keyword separately to obtain each ciphertext corresponding to each custom keyword.

16. The device according to claim 11, wherein The encryption module is specifically used for: Based on a preset encryption algorithm, the identified custom keywords are encrypted respectively to obtain ciphertexts corresponding to the custom keywords respectively.

17. The device according to claim 16, wherein: The preset encryption algorithm includes any one of a random perturbation encryption algorithm and a hash algorithm.

18. The device according to claim 11, wherein The device also includes a storage module, which is used to: The mapping relationship between each of the self-defined keywords in the text data to be annotated and the location information thereof in the text data to be annotated is stored in the security device.

19. The device according to claim 18, wherein: The device also includes a marking module, which is used to: The desensitized text data to be annotated is annotated.

20. The device according to claim 19, wherein The device also includes a decryption module, which is used to: Acquire the mapping relationship from the security device; According to the mapping relationship, the annotated text data to be annotated is traversed, and each ciphertext information is replaced with a corresponding custom keyword to obtain the decrypted annotated text data to be annotated.

21. An electronic device comprising at least one computing device and at least one storage device, wherein: The at least one storage device is used to store instructions, and the instructions are used to control the at least one computing device to execute the method according to any one of claims 1 to 10.

22. A computer-readable storage medium, wherein: A computer program is stored thereon, which implements the method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Patent Citations

  • Sensitive information desensitization method and system for data sharing

    CN107480549A

  • Text key information identification method, electronic apparatus and readable storage medium

    CN108664473A

  • An emotion analysis method and system based on keyword extraction

    CN109214008A

  • Text encryption method, device and storage medium

    CN109409103A

  • Target content extraction method and related equipment

    CN110427482A