A sensitive information detection method based on deep model and knowledge base
By combining the BERT depth model and knowledge base, combined with the method of miscorrected corpus vector library and filter layer, the problem of insufficient detection accuracy and adaptability of sensitive information in the prior art is solved, and higher detection accuracy and adaptability are achieved .
Patent Information
- Application Number
- CN202411224205.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The existing Chinese sensitive information detection technology has shortcomings in accuracy and adaptability, and it is difficult to flexibly adapt to changes in sensitive information, especially in emerging and complex information detection.
The sensitive information detection method based on the depth model and the knowledge base is adopted, and the sensitive information detection of text information is detected by combining the BERT depth model and the knowledge base, and the error detection rate is reduced through the miscorrected corpus vector library and filter layer.
It improves the accuracy and adaptability of sensitive information detection, enhances the coverage of diverse sensitive information, and reduces the error detection rate.
Smart Images

Figure CN118734842B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet information processing, and in particular to a sensitive information detection method based on a deep model and a knowledge base. Background Art
[0002] There are a series of challenges in the field of Chinese sensitive information detection technology. The accuracy problem is prominent. Traditional methods are difficult to flexibly adapt to the constant changes of sensitive information, especially when dealing with emerging and complex sensitive information. The accuracy of the system is limited. In addition, the adaptability problem is also of great concern. Due to the diversity of sensitive information, the existing technology is not adaptable enough when facing different fields or emerging forms of sensitive information.
[0003] As sensitive information is constantly evolving, a single technical means is difficult to fully cover multiple categories and sensitive information in various specific fields. Although the deep learning method has a high accuracy rate and can perform sensitive detection based on the semantics of the input text content during the detection process, it is inaccurate for detecting some sensitive words or corpus variants; the recognition results of knowledge base detection depend on the preferences of the builder of the knowledge base and the size of the knowledge base, so the existing technology has obvious deficiencies in providing comprehensive coverage detection. The existence of these problems makes it urgent to improve the accuracy, adaptability, and diversity coverage of Chinese sensitive information detection technology. Summary of the invention
[0004] In order to address the deficiencies in the prior art, the present invention proposes a sensitive information detection method based on a deep model and a knowledge base, which can improve the accuracy of sensitive information detection.
[0005] In order to achieve the above purpose, a sensitive information detection method based on a deep model and a knowledge base includes the following steps:
[0006] S1. Preprocessing the text information input by the user;
[0007] S2. Detect sensitive information in text information through BERT deep model and knowledge base;
[0008] S3. Filter sensitive information detection results;
[0009] S4. Merge and output the filtered sensitive information.
[0010] Preferably, in step S2:
[0011] The BERT deep model is trained using a collected dataset of sensitive information.
[0012] Preferably, in step S2:
[0013] Input text information into the constructed knowledge base, and perform rule retrieval and similar corpus detection.
[0014] Preferably, rule retrieval is based on sensitive words in the knowledge base combined with variant conversions of sensitive words, and matches the input text according to the set specific phrases, specific languages, and specific grammatical structures. When sensitive information features that meet the rule definition appear in the text, the text will be marked as containing sensitive information.
[0015] Preferably, similar corpus detection calculates similarity between the input text and the vectors and variants of the long and short sentence corpus information stored in the knowledge base, and determines whether it is sensitive information based on the weighted similarity result.
[0016] Preferably, similar corpus detection does not include tone when performing phonetic variant conversion representation on sensitive corpus.
[0017] Preferably, the BERT deep model sensitive information detection result filtering calls the deep model miscorrection corpus vector library through a linear filtering layer to perform similarity calculation with the current sensitive information result. When the similarity between the deep model sensitive detection sentence and the collected deep model misdetection data is higher than 95%, and there are no less than four identical characters, it is a misdetection result.
[0018] Preferably, the rule retrieval detection result filtering performs semantic analysis on the sentence containing the sensitive word through the BERT deep model to determine whether it is an actual sensitive word.
[0019] Preferably, the corpus detection results are filtered through the LDA algorithm, and the sensitive sentences are subjected to topic analysis to determine whether they are misidentified.
[0020] Preferably, if a sentence contains both sensitive words and sensitive sentences, the sensitive sentences are kept first and the sensitive words are not output.
[0021] Compared with the prior art, the advantages of this application are as follows:
[0022] By combining deep model sensitive information detection with knowledge base sensitive information detection methods, the detection rate of sensitive information can be improved.
[0023] By building a deep model miscorrection corpus vector library and adding a filtering layer based on the original structure of the BERT model, the false detection rate of the BERT deep model can be reduced.
[0024] By expanding the variants of sensitive words and corpus, the ability to detect sensitive information and the ability to adapt to the environment can be improved.
[0025] Corresponding detection result filtering is performed on rule retrieval and similar corpus retrieval respectively to improve the detection capability of sensitive information. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 Flow chart of the present invention
[0027] Figure 2 This is a schematic diagram of the sensitive information detection principle based on the BERT deep model of the present invention.
[0028] Figure 3 This is the principle diagram of sensitive information filtering of the BERT deep model of the present invention
[0029] Figure 4 This is a diagram of the steps for detecting sensitive information in the knowledge base of the present invention. DETAILED DESCRIPTION
[0030] The following detailed description is illustrative and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those of ordinary skill in the art to which the present application belongs. It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application.
[0031] This embodiment provides a method for identifying obstacles at intersections based on multi-path laser radars. Figure 1 As shown, the following steps are included:
[0032] S1 obtains the text information input by the user and preprocesses the text information
[0033] Since text often contains non-standard language phenomena in daily use, such as special symbols, it is necessary to perform preliminary processing and preparation on the text information input by the user, including but not limited to text segmentation, removal of special characters, and removal of stop words. Furthermore, the processed text information is converted into a processable format, including characters, word vectors, text vectors, and position vectors. The vectors are used as inputs for the deep model and knowledge base sensitive information detection.
[0034] Traditional methods that use knowledge bases may perform poorly when processing complex language structures and implicit information, and deep models have limited recognition of sensitive words, corpora, and their variants. Therefore, the present invention combines the BERT deep model with a sensitive knowledge base detection method to improve the accuracy of sensitive information detection.
[0035] S2 will process the processed text information through the BERT deep model and the knowledge base at the same time, and filter the identified sensitive information separately, such as Figure 2 Specifically shown include:
[0036] The training process steps of the SA1 BERT model include: data preparation, model building, model training and evaluation. In the data preparation stage, the abnormal data in the Qilu Evening News news library is annotated, and the sensitive information data set is formed by combining other annotated data sets, and preprocessing and segmentation are performed, and a classification label system is created for sensitive information types. In the model building stage, a classifier is built based on the BERT model, including adding a classification layer and fine-tuning the BERT model parameters. Next, in the model training stage, the constructed classifier is trained using the prepared data set, and the model parameters are optimized through repeated iterations to improve the classification accuracy. Finally, the evaluation data set is used to evaluate the performance of the trained model, including indicators such as accuracy, recall rate, and F1 value, to verify the effectiveness and generalization ability of the model.
[0037] SA2 passes the processed text information through the trained BERT deep learning model. The BERT model inserts a [CLS] symbol at the beginning of the input text. The output vector of this symbol can represent the semantic information of the entire sentence for subsequent classification tasks. In the classification process, a classification threshold is set, and the raw score output by the model is converted into a probability distribution through the softmax function. When the probability of a category exceeds the set threshold, the text is classified into that category. The classification covers multiple major sensitive information categories.
[0038] SA3 filters and detects the recognition results. By adjusting the structure of the BERT model, a false positive filtering layer is added after its output layer, thereby filtering the preliminary results of the deep model’s sensitive information detection.
[0039] Specifically, due to objective factors such as the scale and quality of model training data, the BERT model may have a certain degree of misdetection, misjudging sentences that do not contain sensitive information as sensitive. Figure 3 As shown, first, by collecting a certain amount of deep model misdetection data, a deep model miscorrection corpus vector library is created according to the misdetected text and the misjudged sensitive category, and each misdetection data is represented as a text vector. Then, based on the existing BERT model, a linear layer is added after the model output layer. The linear layer is connected to the deep model miscorrection corpus vector library. After obtaining the preliminary sensitive review result of the BERT model, it is input into the linear filtering layer. The linear filtering layer uses the cosine similarity calculation for the input preliminary sensitive review result sentence by calling the text vector in the deep model miscorrection corpus vector library. The deep model sensitive detection sentence has a similarity of more than 95% with the collected deep model misdetection data, and has no less than four identical characters, which is misdetection information. The output of filtering out the misdetection information is the final sensitive detection result of the BERT model. The linear filtering layer only outputs sentences with a text length greater than 5, one is to avoid conflicts with the sensitive knowledge base, and the other is to reduce the probability of misdetection.
[0040] Due to the use of deep models, a lot of training is required for the models, which makes it difficult to adapt to the recognition of specific vocabulary and corpus. However, the detection method that only uses the vocabulary library cannot effectively detect the overall semantic content of the sentence. Therefore, the present invention combines the deep model with the knowledge base, inputs the processed text information into the constructed knowledge base, and outputs sensitive information through vocabulary rule retrieval and similar corpus detection. Rule retrieval is based on the sensitive words in the knowledge base and combines the variant conversion of sensitive words. The input text is scanned and matched according to the set rules. When sensitive information features that meet the rule definition appear in the text, the text will be marked as containing sensitive information; similar corpus detection is performed by performing vector and variant conversion on the input text, calculating the similarity based on the long and short sentence corpus information stored in the knowledge base, and judging whether it is sensitive information based on the weighted similarity result. Figure 4 As shown, it specifically includes the following steps, wherein SB2_1X and SB2_2x are performed simultaneously, and x is 1 or 2.
[0041] SB1 First, build a knowledge base, based on professional knowledge and experience, including sensitive word library and sensitive corpus. Different from professional word library, sensitive corpus is a complete sentence ending with Chinese period, question mark, and exclamation mark. Secondly, perform word library rule retrieval and corpus detection retrieval on the input test text, including:
[0042] SB2_11 Lexicon rule retrieval: Lexicon rule retrieval is based on sensitive lexicon, and uses rules summarized from professional field knowledge or experience, including specific phrases, specific languages, and specific grammatical structures, to match and retrieve the content in the sensitive lexicon that appears in the input text, as well as the content variants, including pinyin, glyphs, fonts, and other expressions. When sensitive information features that meet the rules appear in the text, the text will be marked as containing sensitive information. Different from traditional sensitive lexicon detection, the present invention adds variant detection of known sensitive words, which can not only detect content that exists in the sensitive lexicon, but also detect newly appeared unknown sensitive words that are not included in the sensitive lexicon, thereby greatly improving the ability to detect sensitive words.
[0043] For example, "You are really an AB", where "AB" refers to insulting sensitive words. Since the word is stored in the sensitive word library, it can be easily detected. However, in some news comments, in order to avoid being unable to comment due to conventional sensitive detection, users will output sensitive words in variants, such as "A-B", "A#B", etc. There are many kinds of symbols, and the sensitive words generated by the combination of sensitive words are countless. It is impossible to exhaustively include all words in the sensitive word library. Therefore, the pypinyin toolkit in python is used to convert sensitive words into pinyin with tones; opencc is used to convert traditional and simplified Chinese characters; at the same time, based on pinyin conversion, the Chinese character stroke library hanziconv is used to extract the stroke information of Chinese characters, including the number of strokes of each Chinese character, the stroke order, etc., and the character shape database can be used to further analyze the structural information of Chinese characters, including radicals, upper and lower structures, left and right structures. The stroke similarity between words with the same pinyin as "AB" and the word "AB" is calculated based on factors such as the number of strokes, stroke order, and stroke structure of Chinese characters. When the similarity is greater than the threshold, it meets the sensitive information characteristics of the rule, and the text will be marked as containing sensitive information. The need for the same pinyin is a supplement to the pinyin conversion above. If the same pinyin setting is not added, it will greatly increase unnecessary calculations, thereby reducing the efficiency of sensitive detection.
[0044] SB2_12 To avoid false detection of sensitive information due to rigid word segmentation and direct retrieval of characters from the text, the detected sensitive word results are marked and recorded. Then, for each sensitive word, the BERT deep model trained by SA1 is used to analyze the deep semantics of the sentence in which the word is located to determine whether it is an actual sensitive word, thereby reducing false positives and improving the accuracy and stability of sensitive information detection.
[0045] In the traditional sensitive detection method, the sentence "You have to understand your mother's hard work" will detect words consisting of the fifth to seventh characters, which involve insults, according to the direct original word matching of the vocabulary. In fact, this part does not involve sensitive content. This is caused by the traditional rigid vocabulary matching. The sensitive vocabulary false detection filtering of this patent can effectively avoid this problem. By using the BERT deep model combined with the context information and vocabulary collocation of the suspected sensitive words for analysis, it is found that the sentence where the words consisting of the fifth to seventh characters are located is "You have to understand your mother's hard work", and the words before and after are "understand" and "hard work". Combined with the position information and deep semantic analysis, the semantic score of the word in this sentence is 0, which is lower than the set semantic score threshold. Therefore, the word is judged as a non-sensitive word in this scenario, and it is filtered out from the review results and not output, thereby avoiding false positives.
[0046] SB2_21 Similar corpus detection: Based on the long text corpus information stored in the corpus, combined with the variants of the corpus information, including pinyin, glyphs, fonts, etc., each word is converted into a vector through word embedding technology (Word2Vec, GloVe), and then the vectors of all words in the sentence are averaged or weighted averaged to obtain the vector representation of the sentence. The same vector representation processing is performed on the text entered by the user. The input text information is combined with the text in the corpus through four methods: sentence, pinyin conversion, traditional and simplified conversion, and stroke similarity calculation. The similarity values calculated by different methods are weighted to perform a comprehensive similarity score. According to the comprehensive similarity score, sentences with a similarity to the input text greater than the set similarity threshold are identified and marked as sensitive content.
[0047] When using pinyin conversion for variant transformation, it is not necessary to include tones. The reason is that when performing pinyin variant conversion for sensitive words, the tones are included in order to narrow the detection range. However, for long text corpora, pinyin tones are not required because the probability of two long sentences having exactly the same pinyin is almost 0. For example, "X bird" refers to a sensitive word. For the pinyin conversion of long text corpora, the pinyin of "you are really a bird" without tones is "nizhenshigeshaniao", which is the same as the pinyin of the sentence "you are really a X bird" stored in the sensitive information text corpus, and can be preliminarily determined to be sensitive.
[0048] When filtering the corpus detection results, we cannot simply use the meaning of the sentence itself for analysis. For example, the term "breast pain" appears in a medical article, which is actually a case analysis. The traditional sensitive detection method directly detects the term "breast" as sensitive information based on the sensitive word library matching, which involves sensitive words and is actually a false detection.
[0049] SB2_22 Therefore, in order to prevent the above false detection situations, the Latent Dirichlet Allocation (LDA) algorithm is used to extract topics from the input text and infer the hidden topic structure by analyzing the word distribution in the text. The purpose of topic analysis of the text is to analyze what the text mainly talks about and what fields it involves. According to the specific field in which the text has been determined to be, the output sensitive detection results are filtered. For different fields, open source industry thesaurus of hundreds of different industries is used. If the detected sensitive words belong to the words in a certain industry thesaurus, and the text is judged to belong to a certain industry field, the sensitive detection results are filtered out to ensure that the text can be screened according to the actual context during review. Therefore, for the "breast pain" in the medical article, the full text was subjected to topic analysis (LDA) to extract the article topics as "Breast Pain Case Analysis" and "Breast Pain Relief and Treatment Research", thus determining that the article was a medical and healthcare article. The word "breast" appears in the medical and healthcare industry vocabulary. In the input, "breast" only appears frequently in the article as a professional term. This is a case analysis, so the word "breast" in the article is not sensitive.
[0050] S3 merges and outputs the filtered sensitive information
[0051] The sensitive information detection results are obtained from the BERT deep model and the knowledge base respectively. If both the deep model and the knowledge base detect that a sentence in the text contains sensitive information, these results are compared and matched to find the same sensitive content or similar sensitive issues. For the detection results with the same content, duplicates are removed and only one result is retained.
[0052] For example, in a certain news article, the sentence "This man is really an AB." appears, and AB is a sensitive word. This sentence can be detected as sensitive information by both S2 deep model detection and S3 sensitive knowledge base detection, where the sensitive detection result output by the deep model detection is the complete sentence "This man is really an AB." and the location information of the sentence, while the knowledge base detection result is the word "AB" and the location of the word. The present invention makes a judgment based on the location and content of the output results of the two methods of detection. If a sentence in the detected sensitive information is simultaneously determined to be a sensitive sentence and the sentence contains sensitive words, only the sensitive sentence is output. For example, in order to reduce the redundancy of the output results, "This man is really an AB." and the location of the sentence in the text will be output as sensitive information, and the word "AB" will no longer be repeatedly output as sensitive information.
[0053] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A sensitive information detection method based on deep model and knowledge base, characterized in that: The following steps are involved: S1. Preprocessing the text information input by the user; S2. Detect sensitive information in text information through BERT deep model and knowledge base; S3. Filtering of sensitive information detection results includes: filtering of sensitive information detection results of the BERT deep model by calling the deep model miscorrection corpus vector library through the linear filtering layer to calculate the similarity with the current sensitive information results. When the similarity between the deep model sensitive detection sentence and the collected deep model misdetection data is higher than 95%, and there are no less than four identical characters, it is a misdetection result; filtering of the corpus detection results by the LDA algorithm, performing topic analysis on sensitive sentences to determine whether it is a misidentification; S4. Merge and output the filtered sensitive information.
2. According to claim 1, a sensitive information detection method based on a deep model and a knowledge base is characterized in that: In step S2: The BERT deep model is trained through the collected sensitive information dataset.
3. According to claim 2, a sensitive information detection method based on a deep model and a knowledge base is characterized in that: In step S2: Input text information into the constructed knowledge base, and perform rule retrieval and similar corpus detection.
4. According to claim 3, the method for detecting sensitive information based on a deep model and a knowledge base is characterized in that: Rule retrieval is based on sensitive words in the knowledge base and combined with sensitive word variant conversions. It matches the input text according to the set specific phrases, specific languages, and specific grammatical structures. When sensitive information features that meet the rule definition appear in the text, the text will be marked as containing sensitive information.
5. According to claim 3, a sensitive information detection method based on a deep model and a knowledge base is characterized in that: Similar corpus detection calculates the similarity between the input text and the vectors and variants of the long and short sentence corpus information stored in the knowledge base, and determines whether it is sensitive information based on the weighted similarity result.
6. A sensitive information detection method based on deep model and knowledge base according to claim 5, characterized in that: When similar corpus detection converts sensitive corpus into pinyin variants, it does not include tones.
7. The sensitive information detection method based on deep model and knowledge base according to claim 1 is characterized in that: In step S3: The rule retrieval detection result filtering uses the BERT deep model to perform semantic analysis on the sentence containing the sensitive word to determine whether it is an actual sensitive word.
8. The sensitive information detection method based on deep model and knowledge base according to claim 1 is characterized in that: In step S4: If a sentence contains both sensitive words and sensitive sentences, the sensitive sentences will be kept first and the sensitive words will not be output.
Citation Information
Patent Citations
Short text auditing method and device fusing variant word recognition
CN112287684A
Sensitive information knowledge graph construction method and device and sensitive information determination method
CN115062158A