Sensitive data labeling method and device based on natural language processing and storage medium

By using at least two label classification models to label sensitive data and evaluate its accuracy, the problem that regular expressions are difficult to cover all business situations is solved, and sensitive data annotation with high precision is achieved and maintenance costs are reduced.

CN119150340AActive Publication Date: 2024-12-17SHANGHAI GUAN AN INFORMATION TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410818751.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-12-17
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

In the prior art, regular expressions are difficult to cover complex and diverse data types and rapidly changing business scenarios, resulting in low labeling accuracy of sensitive data and high maintenance costs.

Method used

At least two label classification models are used to label classification of sensitive data, and the accuracy of label classification results is evaluated based on the attribute information of the sensitive data in the database. If the preset standards are met, automatic marking will be performed.

Benefits of technology

Improve the labeling accuracy of sensitive data, adapt to complex and diverse data types and rapidly changing business scenarios, and reduce maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150340A_ABST
    Figure CN119150340A_ABST
Patent Text Reader

Abstract

The invention discloses a sensitive data labeling method and device based on natural language processing and a storage medium. The method relates to the technical field of data security, and comprises the following steps: obtaining sensitive data to be labeled and attribute information of the sensitive data in a database; performing label classification on the sensitive data by utilizing at least two label classification models to obtain label classification results corresponding to the at least two label classification models; according to the tag classification result, counting the tag number of the sensitive data belonging to target tags; evaluating the accuracy of the label classification result according to the attribute information and the label number of the target labels; and if the accuracy of the label classification result reaches a preset standard, determining a marking label corresponding to the sensitive data according to the label number of the target labels, and labeling the sensitive data. According to the invention, the labeling precision of the sensitive data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a sensitive data labeling method, device and storage medium based on natural language processing. Background Art

[0002] In today's digital age, data security has become an indispensable and important issue for enterprises and organizations. As the scale of data continues to expand and the types of data become more diverse, the classification and labeling of sensitive data has become increasingly critical. The leakage of sensitive data may lead to serious legal liability, reputation loss, and financial losses. Faced with massive amounts of data, how to quickly and accurately label sensitive data is a technical problem that needs to be solved urgently.

[0003] Currently, sensitive data is usually labeled by regular expression matching. However, in this method, the definition of regular expressions is mainly based on rules formulated based on human experience and prior knowledge. When faced with complex and diverse data types and rapidly changing business scenarios, the rules are difficult to cover all situations, which will affect the accuracy of sensitive data labeling. Summary of the invention

[0004] In view of this, the present application provides a sensitive data labeling method, device and storage medium based on natural language processing, which mainly aims to improve the labeling accuracy of sensitive data.

[0005] According to the first aspect of the present application, a sensitive data labeling method based on natural language processing is provided, the method comprising:

[0006] Acquire sensitive data to be marked and attribute information of the sensitive data in the database;

[0007] Using at least two label classification models to classify the sensitive data respectively, and obtaining label classification results corresponding to the at least two label classification models;

[0008] According to the label classification result, the number of labels of the sensitive data belonging to the target label is counted;

[0009] Evaluating the accuracy of the label classification result according to the attribute information and the number of labels of the target label;

[0010] If the accuracy of the label classification result reaches a preset standard, the labeling label corresponding to the sensitive data is determined according to the label quantity of the target label, and the sensitive data is marked.

[0011] According to a second aspect of the present application, a sensitive data labeling device based on natural language processing is provided, the device comprising:

[0012] An acquisition unit, used to acquire sensitive data to be marked and attribute information of the sensitive data in a database;

[0013] A classification unit, used to perform label classification on the sensitive data using at least two label classification models, and obtain label classification results corresponding to the at least two label classification models;

[0014] A counting unit, used for counting the number of labels of the sensitive data belonging to the target label according to the label classification result;

[0015] An evaluation unit, configured to evaluate the accuracy of the label classification result according to the attribute information and the number of labels of the target label;

[0016] The labeling unit is used to determine the labeling label corresponding to the sensitive data according to the label quantity of the target label and mark the sensitive data if the accuracy of the label classification result reaches a preset standard.

[0017] According to a third aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned sensitive data labeling method based on natural language processing is implemented.

[0018] According to the fourth aspect of the present application, an electronic device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned sensitive data labeling method based on natural language processing when executing the program.

[0019] By means of the above technical solution, the present application provides a method, device and storage medium for labeling sensitive data based on natural language processing. First, at least two label classification models are used to label and classify the sensitive data respectively. Then, the accuracy of the label classification results is evaluated according to the attribute information of the sensitive data in the database. Finally, when the accuracy of the label classification results meets the requirements, the sensitive data is automatically labeled according to the label classification results. It can be seen that the present application can adapt to complex and diverse data types and rapidly changing business scenarios by adopting a label classification model to label sensitive data, thereby effectively solving the problem that regular expressions are difficult to cover all business situations and have high maintenance costs, and thus can ensure the labeling accuracy of sensitive data. In addition, the present application can further improve the labeling accuracy of sensitive data by adopting at least two label classification models to label and classify sensitive data, and evaluating the label classification results according to the attribute information of the sensitive data in the database.

[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1 A schematic diagram of a process of a sensitive data labeling method based on natural language processing provided in an embodiment of the present application is shown;

[0023] Figure 2 A schematic diagram of a process of another sensitive data labeling method based on natural language processing provided in an embodiment of the present application is shown;

[0024] Figure 3 A schematic diagram of the structure of a sensitive data labeling device based on natural language processing provided in an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of the structure of another sensitive data labeling device based on natural language processing provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0027] The definition of regular expressions is mainly based on rules formulated based on manual experience and prior knowledge. When faced with complex and diverse data types and rapidly changing business scenarios, the rules are difficult to cover all situations, which will affect the annotation accuracy of sensitive data.

[0028] In order to solve the above problems, an embodiment of the present invention provides a sensitive data labeling method based on natural language processing, such as Figure 1 As shown, the method includes:

[0029] Step 101: Obtain sensitive data to be marked and attribute information of the sensitive data in a database.

[0030] Among them, the sensitive data to be labeled include personal identity information, financial data, medical record data, etc. Attribute information is the attribute name of the column or row where the sensitive data is located in the database, such as user name, ID number, etc.

[0031] The embodiment of the present invention is mainly applicable to the scenario of automatically marking sensitive data. The execution subject of the embodiment of the present invention is a device or equipment capable of automatically marking sensitive data, which can be specifically set on the server side.

[0032] According to the embodiment of the present invention, sensitive data to be marked can be obtained from the database, and at the same time, the attribute information of the corresponding row or column in the data table where the sensitive data is located can be obtained through the database query statement.

[0033] Step 102: Use at least two label classification models to perform label classification on the sensitive data respectively, and obtain label classification results corresponding to the at least two label classification models.

[0034] Among them, at least two label classification models may include different types of label classification models, or models of the same classification model but obtained through training with different training sets, or a combination of different types of label classification models and models obtained through training with different training sets. For example, label classification model A and label classification model B are two different types of label classification models, A1, A2 and A3 are three models obtained by training label classification model A with different training sets, and similarly, B1, B2 and B3 are three models obtained by training label classification model B with different training sets, and at least two label classification models include A1, A2 and A3, and B1, B2 and B3. In addition, the type of label classification model may specifically be a logistic regression model, a decision tree model, a support vector machine model, a neural network model, a Bayesian classification model, a BERT model, etc. It should be noted that the type of label classification model in the embodiment of the present invention is not limited to the model types listed above, and may also be other model types. In addition, the label classification results output by each model include labels such as personal information, financial data, and medical data. The number and type of labels can be set according to actual business needs, and the embodiment of the present invention does not specifically limit this.

[0035] For example, sensitive data is input into A1, A2 and A3, and B1, B2 and B3 label classification models for label classification. Each label classification model can obtain a label classification result, and the label classification results output by each label classification model can be the same or different.

[0036] Step 103: According to the label classification result, count the number of labels of the sensitive data belonging to the target label.

[0037] The target label is the label in the label library involved in the label classification result. For example, the labels in the label library include personal information, financial data, medical data, business secrets and government secrets. The labels involved in the label classification result output by the label classification model include personal information, financial data and medical data. Personal information, financial data and medical data are the target labels. In addition, the types of target labels involved in the label classification result can be one, two or more.

[0038] For example, the label classification results output by label classification models A1, A2, A3, B1, B2 and B3 are personal information, financial data, medical data, medical data, personal information, and personal information, respectively. From this, it can be calculated that the number of labels of sensitive data belonging to personal information is 3, the number of labels belonging to medical data is 2, and the number of labels belonging to financial data is 1.

[0039] Step 104: Evaluate the accuracy of the label classification result according to the attribute information and the number of labels of the target label.

[0040] The types of target labels involved in the label classification result may be one, two or more.

[0041] For the embodiment of the present invention, when the label classification result involves only one target label, it is not necessary to evaluate the accuracy of the label classification result, and the unique target label can be directly determined as the labeling label of the sensitive data; when the label classification result involves at least two target labels, it is necessary to evaluate the accuracy of the label classification result. During the specific evaluation, the accuracy of the label classification result can be evaluated in combination with the attribute information of the column or row where the sensitive data is located in the database, and the number of each target label. Among them, the closer each target label is to the attribute information, the better the label classification result of the model is. On the contrary, the farther each target label is from the attribute information, the worse the label classification result of the model is. In addition, the quantitative difference between any two target labels can be calculated based on the number of labels of each target label. The larger the quantitative difference, the better the label classification result of the model is. On the contrary, the smaller the quantitative difference, the worse the label classification result of the model is.

[0042] Step 105: If the accuracy of the label classification result reaches a preset standard, determine the labeling label corresponding to the sensitive data according to the label quantity of the target label, and mark the sensitive data.

[0043] Among them, the preset standards can be set according to actual business needs.

[0044] For an embodiment of the present invention, if the accuracy of the label classification result does not meet the preset standard, the label classification result output by the model will not be adopted; if the accuracy of the label classification result meets the preset standard, the target label corresponding to the maximum number of labels can be selected as the labeling label of the sensitive data based on the number of labels of each target label, and finally the sensitive data is automatically labeled based on the labeling label.

[0045] The sensitive data labeling method based on natural language processing provided by the embodiment of the present invention can adapt to complex and diverse data types and rapidly changing business scenarios by adopting a label classification model to label sensitive data, thereby effectively solving the problem that regular expressions are difficult to cover all business situations and have high maintenance costs, thereby ensuring the labeling accuracy of sensitive data. In addition, the present application can further improve the labeling accuracy of sensitive data by adopting at least two label classification models to label sensitive data and evaluating the label classification results according to the attribute information of the sensitive data in the database.

[0046] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the implementation of this embodiment, this embodiment also provides another sensitive data labeling method based on natural language processing, such as Figure 2 As shown, the method includes:

[0047] Step 201: Obtain sensitive data to be marked and attribute information of the sensitive data in a database.

[0048] According to the embodiment of the present invention, sensitive data to be marked can be obtained from the database, and at the same time, the attribute information of the corresponding row or column in the data table where the sensitive data is located can be obtained through the database query statement.

[0049] Step 202: Use at least two label classification models to classify the sensitive data respectively, obtain label classification results corresponding to the at least two label classification models, and count the number of labels of the sensitive data belonging to the target label based on the label classification results.

[0050] For example, the label classification results output by label classification models A1, A2, A3, B1, B2 and B3 are personal information, financial data, medical data, medical data, personal information, and personal information, respectively. From this, it can be calculated that the number of labels of sensitive data belonging to personal information is 3, the number of labels belonging to medical data is 2, and the number of labels belonging to financial data is 1.

[0051] The embodiment of the present invention can ensure the accuracy of the label classification results by adopting multiple label classification models when labeling sensitive data, thereby improving the labeling accuracy of sensitive data.

[0052] Step 203: When the label classification result involves at least two target labels, the maximum label quantity is determined according to the label quantity of each target label.

[0053] For example, the number of labels for sensitive data belonging to personal information is 3, the number of labels for medical data is 2, and the number of labels for financial data is 1. At this time, it can be determined that the maximum number of labels is 3, and the target label corresponding to the maximum number of labels is personal information.

[0054] Step 204: If the maximum number of tags is greater than the preset number of tags, the target tag corresponding to the maximum number of tags is determined as the marking tag corresponding to the sensitive data.

[0055] Among them, the preset number of tags is usually related to the number of tag classification models. The preset number of tags can be set to half of the number of tag classification models, or other setting methods can be adopted according to actual business needs. The embodiment of the present invention does not make specific limitations on this.

[0056] For example, the maximum number of tags is 6 and the preset number of tags is 5. Since the maximum number of tags 6 is greater than the preset number of tags 5, the target tag corresponding to the maximum number of tags can be directly determined as the labeling tag corresponding to the sensitive data. At this time, there is no need to evaluate the accuracy of the tag classification results.

[0057] Step 205: If the maximum number of tags is less than or equal to the preset number of tags, then respectively determine the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag.

[0058] For an embodiment of the present invention, if the maximum number of tags is less than or equal to the preset number of tags, the accuracy of the tag classification results needs to be evaluated at this time. During the specific evaluation, it is necessary to first determine the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag. Regarding the method of determining the embedding vector, TF-IDF can be used to compare the words (or phrases) appearing in the attribute information and each target tag with the frequency in the corpus to determine the importance of each word in the attribute information and each target tag, and convert it into a vector representation. Word2Vec can also be used to determine the embedding vectors of the words in the attribute information and each target tag, thereby determining the embedding vector of the entire attribute information and the embedding vector of each target tag.

[0059] Step 206: Calculate the average distance between the attribute information and each target tag based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag.

[0060] For the embodiment of the present invention, in order to evaluate the accuracy of the label classification result, it is necessary to calculate the average distance between the attribute information and each target label. For the calculation process of the average distance, as an optional implementation method, step 206 specifically includes: based on the embedding vector corresponding to the attribute information, the embedding vector corresponding to each target label, and the number of labels of each target label, respectively calculate the first distance between the attribute information and each target label; according to the first distance corresponding to each target label, calculate the average distance between the attribute information and each target label. Among them, the specific calculation formula of the first distance is as follows:

[0061]

[0062] Among them, A i Represents the embedding vector corresponding to the attribute information, B i represents the embedding vector corresponding to any target label, k is the number of occurrences of any target label, and d(A,B) is the first distance between the attribute information and any target label. After calculating the first distance between the attribute information and each target label, the average distance of each first distance is calculated. The larger the average distance, the lower the accuracy of the label classification result. On the contrary, the smaller the average distance, the higher the accuracy of the label classification result.

[0063] When calculating the first distance between the attribute information and the target tag, the embodiment of the present invention fully considers the influencing factor of the number of tags, thereby ensuring the accuracy of the distance calculation.

[0064] Step 207: Calculate the average quantity difference between any two target tags based on the tag quantity of each target tag.

[0065] For the embodiment of the present invention, in order to evaluate the accuracy of the label classification results, it is necessary to calculate the average quantity difference between any two target labels. For the calculation process of the average quantity difference, as an optional implementation method, step 207 specifically includes: based on the label quantity of each target label, calculating the quantity difference between any two target labels; according to the quantity difference between the any two target labels, calculating the average quantity difference.

[0066] For example, the target labels involved in the label classification results include personal information, financial data, and medical data. The number of labels corresponding to personal information is 5, the number of labels corresponding to financial data is 3, and the number of labels corresponding to medical data is 2. The quantity difference between personal information and financial data is 2, the quantity difference between financial data and medical data is 1, and the quantity difference between personal information and medical data is 3. Finally, the average value of each quantity difference is calculated, and the average quantity difference is (2+1+3) / 3=2.

[0067] Step 208: Evaluate the accuracy of the label classification result according to the average distance and the average quantity difference.

[0068] The embodiment of the present invention adopts a scoring method to specifically evaluate the accuracy of the label classification result. For this process, as an optional implementation method, step 208 specifically includes: based on the average distance, determining a first score corresponding to the label classification result; based on the average quantity difference, determining a second score corresponding to the label classification result; adding the first score and the second score to obtain a total score; based on the total score, evaluating the accuracy of the label classification result.

[0069] Specifically, the embodiment of the present invention can pre-divide the average distance into multiple distance intervals, and different distance intervals correspond to different first scores. The smaller the average distance, the higher the first score, and conversely, the larger the average distance, the lower the first score. Similarly, the average quantity difference can be divided into multiple quantity difference intervals, and different quantity difference intervals correspond to different second scores. The larger the average quantity difference, the higher the second score, and conversely, the smaller the average quantity difference, the lower the second score.

[0070] When evaluating the label classification results of the model, the embodiment of the present invention simultaneously considers the distance between the attribute information and each target label, as well as the quantitative difference between each target label, thereby ensuring the accuracy of the evaluation results and further ensuring the accuracy of sensitive data labeling.

[0071] Step 209: If the accuracy of the label classification result reaches a preset standard, determine the labeling label corresponding to the sensitive data according to the label quantity of the target label, and mark the sensitive data.

[0072] For the embodiment of the present invention, if the total score is greater than the preset total score, it is determined that the accuracy of the label classification result reaches the preset standard; if there is only one target label corresponding to the maximum number of labels, the target label corresponding to the maximum number of labels is determined as the labeling label corresponding to the sensitive data; if there are at least two target labels corresponding to the maximum number of labels, the first minimum distance is determined from the first distances corresponding to the target labels, and the target label corresponding to the first minimum distance is determined as the labeling label corresponding to the sensitive data. Among them, the preset total score can be set according to actual business needs, and the embodiment of the present invention does not specifically limit this.

[0073] Specifically, if the preset total score is greater than the preset total score, it means that the accuracy of the label classification result obtained by using the label classification model is high, and the label classification result can be used for labeling. When labeling, the target label corresponding to the maximum number of labels can be selected as the labeling label to mark the sensitive data. If there is only one target label corresponding to the maximum number of labels, it is directly used as the labeling label; if there is more than one target label corresponding to the maximum number of labels, it is also necessary to combine the first distance between the target label and the attribute information for specific analysis to determine the final labeling label. For example, the number of labels for financial data and financial data is 4, and 4 is the maximum number of labels. Since there are two target labels corresponding to the maximum number of labels, the first distance between financial data and medical data and attribute information should be considered at this time. If the first distance between financial data and attribute information is less than the first distance between medical data and attribute information, financial data is selected as the labeling label; if the first distance between medical data and attribute information is less than the first distance between financial data and attribute information, medical data is selected as the labeling label.

[0074] The embodiment of the present invention uses a scoring method to accurately evaluate the accuracy of the label classification result, thereby ensuring the accuracy of the labeling result. At the same time, when there are at least two target labels corresponding to the maximum number of labels, the embodiment of the present invention can combine the first distance between the attribute information and the target label for specific analysis, accurately select the labeling label, and further improve the labeling accuracy of sensitive data.

[0075] Furthermore, if the total score is less than or equal to the preset total score, the embedding vector corresponding to each label in the label library is determined; based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each label, the second distance between the attribute information and each label is calculated; the second minimum distance is determined from the second distances corresponding to each label, and the label corresponding to the second minimum distance is determined as the labeling label corresponding to the sensitive data.

[0076] Specifically, if the preset total score is less than or equal to the preset total score, it means that the label classification result obtained using the label classification model has low accuracy and the label classification result cannot be used for labeling. At this time, it is necessary to calculate the second distance between the attribute information and each label in the label library respectively, and select the corresponding labeling label from the label library based on the second distance.

[0077] For example, the labels in the label library include personal information, financial data, medical data, business secrets and government secrets. The second distance between the attribute information of the sensitive data and the above labels is calculated respectively. If the second distance between the financial data and the attribute information is the smallest, the financial data is determined as the labeled label and the sensitive data is marked.

[0078] Another sensitive data labeling method based on natural language processing provided by an embodiment of the present invention can adapt to complex and diverse data types and rapidly changing business scenarios by adopting a label classification model to label sensitive data, thereby effectively solving the problem that regular expressions are difficult to cover all business situations and have high maintenance costs, thereby ensuring the labeling accuracy of sensitive data. In addition, the present application can further improve the labeling accuracy of sensitive data by adopting at least two label classification models to label sensitive data and evaluating the label classification results based on the attribute information of the sensitive data in the database.

[0079] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the embodiment provides a sensitive data labeling device based on natural language processing, such as Figure 3 As shown, the device includes: an acquisition unit 31, a classification unit 32, a statistical unit 33, an evaluation unit 34 and a marking unit 35.

[0080] The acquisition unit 31 may be used to acquire sensitive data to be marked and attribute information of the sensitive data in a database.

[0081] The classification unit 32 may be configured to perform label classification on the sensitive data using at least two label classification models to obtain label classification results corresponding to the at least two label classification models.

[0082] The statistical unit 33 may be used to count the number of tags of the sensitive data belonging to the target tag according to the tag classification result.

[0083] The evaluation unit 34 may be configured to evaluate the accuracy of the label classification result according to the attribute information and the number of labels of the target label.

[0084] The labeling unit 35 can be used to determine the labeling label corresponding to the sensitive data according to the label quantity of the target label and mark the sensitive data if the accuracy of the label classification result reaches a preset standard.

[0085] In some implementations, the device further includes: a determining unit 36.

[0086] The determination unit 36 ​​can be used to determine the maximum number of labels based on the number of labels of each target label when the label classification result involves at least two target labels; if the maximum number of labels is greater than the preset number of labels, the target label corresponding to the maximum number of labels is determined as the labeling label corresponding to the sensitive data.

[0087] In some embodiments, the evaluation unit 34, such as Figure 4 As shown, it includes: a determination module 341, a calculation module 342 and an evaluation module 343.

[0088] The determination module 341 may be configured to respectively determine the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag if the maximum number of tags is less than or equal to the preset number of tags.

[0089] The calculation module 342 may be configured to calculate an average distance between the attribute information and each target tag based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag.

[0090] The calculation module 342 may also be used to calculate an average quantity difference between any two target tags based on the tag quantity of each target tag.

[0091] The evaluation module 343 may be used to evaluate the accuracy of the label classification result according to the average distance and the average quantity difference.

[0092] In some embodiments, the calculation module 342 can be specifically used to calculate the first distance between the attribute information and each target tag based on the embedding vector corresponding to the attribute information, the embedding vector corresponding to each target tag, and the number of tags of each target tag; and calculate the average distance between the attribute information and each target tag based on the first distance corresponding to each target tag.

[0093] In some implementations, the calculation module 342 may also be specifically configured to calculate the quantity difference between any two target tags based on the quantity of tags of each target tag; and calculate the average quantity difference based on the quantity difference between any two target tags.

[0094] In some embodiments, the evaluation module 343 can be specifically used to determine a first score corresponding to the label classification result based on the average distance; determine a second score corresponding to the label classification result based on the average quantity difference; add the first score and the second score to obtain a total score; and evaluate the accuracy of the label classification result based on the total score.

[0095] In some implementation modes, the labeling unit 35 can be specifically used to determine that the accuracy of the label classification result meets a preset standard if the total score is greater than a preset total score; if there is only one target label corresponding to the maximum number of labels, the target label corresponding to the maximum number of labels is determined as the labeling label corresponding to the sensitive data; if there are at least two target labels corresponding to the maximum number of labels, a first minimum distance is determined from the first distances corresponding to each target label, and the target label corresponding to the first minimum distance is determined as the labeling label corresponding to the sensitive data.

[0096] In some embodiments, the labeling unit 35 can also be specifically used to determine the embedding vector corresponding to each label in the label library if the total score is less than or equal to the preset total score; calculate the second distance between the attribute information and the labels based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each label; determine the second minimum distance from the second distances corresponding to each label, and determine the label corresponding to the second minimum distance as the labeling label corresponding to the sensitive data.

[0097] It should be noted that for other corresponding descriptions of the functional units involved in the sensitive data labeling device based on natural language processing provided in this embodiment, please refer to Figure 1 and Figure 2 The corresponding description in will not be repeated here.

[0098] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The sensitive data labeling method based on natural language processing is shown.

[0099] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.

[0100] Based on the above Figure 1 and Figure 2 The method shown, and Figure 3 and Figure 4In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, which can be a personal computer, a tablet computer, a server, or other network equipment, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The sensitive data labeling method based on natural language processing is shown.

[0101] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0102] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0103] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.

[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware.

[0105] The embodiments of the present invention can adapt to complex and diverse data types and rapidly changing business scenarios by using a label classification model to label sensitive data, thereby effectively solving the problem that regular expressions are difficult to cover all business situations and have high maintenance costs, thereby ensuring the labeling accuracy of sensitive data. In addition, the present application can further improve the labeling accuracy of sensitive data by using at least two label classification models to label sensitive data and evaluating the label classification results based on the attribute information of the sensitive data in the database.

[0106] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0107] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A sensitive data labeling method based on natural language processing, characterized in that: include: Acquire sensitive data to be marked and attribute information of the sensitive data in the database; Using at least two label classification models to classify the sensitive data respectively, and obtaining label classification results corresponding to the at least two label classification models; According to the label classification result, the number of labels of the sensitive data belonging to the target label is counted; Evaluating the accuracy of the label classification result according to the attribute information and the number of labels of the target label; If the accuracy of the label classification result reaches a preset standard, the labeling label corresponding to the sensitive data is determined according to the label quantity of the target label, and the sensitive data is marked.

2. The method according to claim 1, characterized in that After counting the number of tags of the sensitive data belonging to the target tag according to the tag classification result, the method further includes: When the label classification result involves at least two target labels, the maximum number of labels is determined according to the number of labels of each target label; If the maximum number of tags is greater than the preset number of tags, the target tag corresponding to the maximum number of tags is determined as the marking tag corresponding to the sensitive data.

3. The method according to claim 2, characterized in that Evaluating the accuracy of the label classification result according to the attribute information and the number of labels of the target label, including: If the maximum number of tags is less than or equal to the preset number of tags, respectively determining the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target tag; Based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target label, calculating the average distance between the attribute information and each target label; Based on the number of tags of each target tag, calculate the average number difference between any two target tags; The accuracy of the label classification result is evaluated based on the average distance and the average quantity difference.

4. The method according to claim 3, characterized in that The calculating the average distance between the attribute information and each target label based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each target label includes: Based on the embedding vector corresponding to the attribute information, the embedding vector corresponding to each target tag, and the number of tags of each target tag, respectively calculate the first distance between the attribute information and each target tag; Calculating the average distance between the attribute information and each target tag according to the first distance corresponding to each target tag; and / or The calculating the average quantity difference between any two target labels based on the label quantity of each target label includes: Based on the number of labels of each target label, calculate the difference in number between any two target labels; According to the quantity difference between any two target labels, an average quantity difference is calculated.

5. The method according to claim 4, characterized in that Evaluating the accuracy of the label classification result according to the average distance and the average quantity difference includes: Based on the average distance, determining a first score corresponding to the label classification result; Based on the average quantity difference, determining a second score corresponding to the label classification result; Add the first score and the second score to obtain a total score; Based on the total score, the accuracy of the label classification result is evaluated.

6. The method according to claim 5, characterized in that If the accuracy of the label classification result reaches a preset standard, determining the labeling label corresponding to the sensitive data according to the label quantity of the target label includes: If the total score is greater than the preset total score, it is determined that the accuracy of the label classification result meets the preset standard; If there is only one target tag corresponding to the maximum number of tags, the target tag corresponding to the maximum number of tags is determined as the marking tag corresponding to the sensitive data; If there are at least two target tags corresponding to the maximum number of tags, a first minimum distance is determined from the first distances corresponding to the target tags, and the target tag corresponding to the first minimum distance is determined as the marking tag corresponding to the sensitive data.

7. The method according to claim 6, characterized in that The method further comprises: If the total score is less than or equal to the preset total score, then determining the embedding vector corresponding to each tag in the tag library; Calculate a second distance between the attribute information and each of the labels based on the embedding vector corresponding to the attribute information and the embedding vector corresponding to each of the labels; A second minimum distance is determined from the second distances corresponding to the tags, and the tag corresponding to the second minimum distance is determined as the marked tag corresponding to the sensitive data.

8. A sensitive data labeling device based on natural language processing, characterized in that: include: An acquisition unit, used to acquire sensitive data to be marked and attribute information of the sensitive data in a database; A classification unit, used to perform label classification on the sensitive data using at least two label classification models, and obtain label classification results corresponding to the at least two label classification models; A counting unit, used for counting the number of labels of the sensitive data belonging to the target label according to the label classification result; An evaluation unit, configured to evaluate the accuracy of the label classification result according to the attribute information and the number of labels of the target label; A labeling unit is used to determine the labeling label corresponding to the sensitive data according to the label quantity of the target label and mark the sensitive data if the accuracy of the label classification result reaches a preset standard.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data labeling method and device, electronic equipment and storage medium

    CN113159133A

  • Data classification method and device and storage medium

    CN113868497A

  • Method, apparatus and storage medium for object attribute classification model training

    US20230035995A1

  • Method for constructing information review classification model, and information review method

    WO2022134588A1

  • Teacher consensus aggregation learning method based on randomized response differential privacy technology

    WO2022160623A1