Sensitive information detection method, device, electronic device and storage medium

Through semantic feature extraction and similarity matching, the problem of missing detection of similar content in sensitive information detection is solved, more comprehensive and accurate detection results are achieved, and detection efficiency is improved.

CN112307770BActive Publication Date: 2025-01-10WEBANK (CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011091612.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-13
Publication Date
2025-01-10
Estimated Expiration
2040-10-13

AI Technical Summary

Technical Problem

The prior art easily misses similar contents of sensitive information in the detection of sensitive information, resulting in insufficient comprehensive and accurate detection.

Method used

By extracting semantic features of sensitive information, the semantic similarity with the reference information in the information database is determined, multiple reference information whose similarity reaches the threshold value are selected as target sensitive information, and match it with the information to be detected to generate detection results.

Benefits of technology

It improves the comprehensiveness and accuracy of sensitive information detection, overcomes the shortcomings of incomplete and accurate detection in the prior art, and improves the detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112307770B_ABST
    Figure CN112307770B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and computer-readable storage medium for detecting sensitive information; the method comprises: extracting semantic features of sensitive information to obtain semantic features of sensitive information; determining semantic similarities between sensitive information and reference information in an information library based on the semantic features of sensitive information; selecting at least two reference information whose semantic similarities with the sensitive information reach a similarity threshold from the information library, and using the selected reference information as target sensitive information; matching at least two target sensitive information with information to be detected, and generating sensitive information detection results of the information to be detected based on the matching results. Through the present application, the comprehensiveness and accuracy of sensitive information detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to information technology, and in particular to a method, device, electronic device and storage medium for detecting sensitive information. Background Art

[0002] In today's information age, all kinds of information have penetrated into every aspect of human society, and informatization has brought great convenience to people's lives. In some scenarios, it is usually necessary to detect some information to avoid violations or other sensitive information that has a negative impact.

[0003] In the related art, the detection of sensitive information usually adopts the hard matching method, that is, judging whether there is content in the information to be detected that is exactly the same as the given sensitive information. However, in actual scenarios, the information to be detected often contains content similar to the given sensitive information, and these similar contents also belong to sensitive information. The detection method in the related art is likely to cause the leakage of sensitive information. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for detecting sensitive information, which can improve the comprehensiveness and accuracy of sensitive information detection.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides a method for detecting sensitive information, including:

[0007] Extracting semantic features of sensitive information to obtain semantic features of the sensitive information;

[0008] Based on the semantic features of the sensitive information, the semantic similarity between the sensitive information and each reference information in the information database is determined respectively;

[0009] Selecting at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and using the selected reference information as the target sensitive information;

[0010] At least two target sensitive information are matched with the information to be detected respectively, and a sensitive information detection result of the information to be detected is generated based on the matching result.

[0011] The present application provides a sensitive information detection device, including:

[0012] A feature extraction module is used to extract semantic features of sensitive information to obtain semantic features of sensitive information;

[0013] A similarity determination module, used to determine the semantic similarity between the sensitive information and each reference information in the information database based on the semantic features of the sensitive information;

[0014] A selection module is used to select at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and use the selected reference information as the target sensitive information;

[0015] The matching module is used to match at least two target sensitive information with the information to be detected respectively, and generate a sensitive information detection result of the information to be detected based on the matching result.

[0016] In the above scheme, the feature extraction module is also used to extract features of sensitive information from at least two feature dimensions respectively to obtain at least two dimensional features of the sensitive information; and to perform feature splicing on the at least two dimensional features to obtain semantic features of the sensitive information.

[0017] In the above scheme, the feature extraction module is also used to extract features of sensitive information from at least two feature dimensions, respectively, to obtain at least two dimensional features of the sensitive information; obtain the feature weight of each dimensional feature; and perform weighted summation of at least two dimensional features to obtain the semantic features of the sensitive information.

[0018] In the above scheme, the feature extraction module is also used to extract keywords from sensitive information; perform feature extraction on the keywords to obtain semantic features of the keywords, and use the semantic features of the keywords as semantic features of the sensitive information.

[0019] In the above scheme, the matching module is also used to replace the keywords in the sensitive information with each target sensitive information respectively to obtain at least two corresponding information to be matched; and match each information to be matched with the information to be detected respectively.

[0020] In the above scheme, the matching module is further used to respectively determine the fluency of at least two pieces of information to be matched; select target information to be matched whose fluency meets the fluency condition from the at least two pieces of information to be matched; and match the target information to be matched with the information to be detected.

[0021] In the above scheme, the matching module is also used to, when the type of the information to be matched is a text type, respectively segment each piece of information to be matched to obtain a word sequence of each piece of information to be matched; extract features of the words in each word sequence through the first language model to obtain word features of each word sequence; perform conditional probability prediction on the word features of each word sequence through the first language model to obtain the conditional probability of the words in each piece of information to be matched appearing in the corresponding word sequence; and determine the fluency of each piece of information to be matched based on the predicted conditional probability.

[0022] In the above scheme, the sensitive information detection device also includes: a training model, used to obtain a sample word sequence corresponding to the information sample to be matched, the sample word sequence is marked with the target fluency of the information sample to be matched; through the first language model, feature extraction of words in the sample word sequence is performed to obtain word features of the sample word sequence; through the first language model, conditional probability prediction of the word features of the sample word sequence is performed to obtain predicted conditional probability; through the first language model, based on the predicted conditional probability, fluency prediction of the information sample to be matched is performed to obtain predicted fluency; the difference between the target fluency and the predicted fluency is obtained, and the model parameters of the first language model are updated based on the difference.

[0023] In the above scheme, the similarity determination module is also used to obtain the semantic features of each reference information in the information library; and respectively determine the similarity between the semantic features of the sensitive information and the semantic features of each reference information in the information library as the semantic similarity.

[0024] In the above scheme, the similarity determination module is also used to, when the type of reference information is a text type, respectively segment each reference information to obtain a word sequence of each reference information; through the second language model, respectively extract features of the words in each word sequence to obtain word features of each word sequence; based on the word features of each word sequence, determine the semantic features of the corresponding reference information.

[0025] In the above scheme, the sensitive information detection device also includes: a collection module, which is used to collect voice data of customer service; and perform voice recognition on the voice data to obtain text-type information to be detected.

[0026] In the above scheme, the sensitive information detection device also includes: an output module, which is used to output at least one of the following information when the matching result indicates that there is at least one target sensitive information that successfully matches the information to be detected: the target sensitive information that successfully matches the information to be detected, the sentence or paragraph where the target sensitive information that successfully matches the information to be detected is located, and the position indication information of the target sensitive information that successfully matches the information to be detected in the information to be detected.

[0027] An embodiment of the present application provides an electronic device, including:

[0028] A memory for storing executable instructions;

[0029] The processor is used to implement the sensitive information detection method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0030] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for implementing the sensitive information detection method provided in the embodiment of the present application when executed by a processor.

[0031] The embodiments of the present application have the following beneficial effects:

[0032] Compared with the method in the related art of realizing sensitive information detection by hard matching given sensitive information with the information to be detected, the embodiment of the present application extracts the semantic features of the sensitive information, determines the semantic similarity between the sensitive information and each reference information in the information library based on the semantic features, and searches for multiple target sensitive information with similar semantics to the sensitive information, thereby realizing generalized processing of the sensitive information, making the detection results of sensitive information detection based on the target sensitive information on the information to be detected more comprehensive and accurate, and overcoming the defects of the incomplete and inaccurate detection method adopted in the related art; at the same time, due to the generalization of sensitive information and the automatic detection of sensitive information based on the generalized target sensitive information, the efficiency of sensitive information detection is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is an optional architecture diagram of a sensitive information detection system provided in an embodiment of the present application;

[0034] Figure 2 is an optional schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0035] Figure 3 This is an optional flowchart of the sensitive information detection method provided in the embodiment of the present application;

[0036] Figure 4 is an optional schematic diagram of word features extracted based on at least two feature dimensions provided in an embodiment of the present application;

[0037] Figure 5 is an optional schematic diagram of a language model provided in an embodiment of the present application;

[0038] Figure 6 is an optional schematic diagram of an input word vector of a language model provided in an embodiment of the present application;

[0039] Figure 7 This is an optional flowchart of the sensitive information detection method provided in the embodiment of the present application;

[0040] Figure 8 This is an optional flowchart of the sensitive information detection method provided in the embodiment of the present application;

[0041] Fig. 9 This is an optional flowchart of the sensitive information detection method provided in the embodiment of the present application;

[0042] Fig.10 is an optional schematic diagram of a second language model provided in an embodiment of the present application;

[0043] Fig.11 It is an optional flow chart of the sensitive information detection method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0045] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0046] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0048] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0049] 1) Language model: A language model is an abstract mathematical model of a language based on objective language facts. The relationship between a language model and objective language facts is like the relationship between an abstract straight line and a concrete straight line in mathematics. A language model can predict the fluency of a text. The fluency of a specific text is represented by the probability output by the language model. The higher the probability, the more fluent the text. For example, if a text consists of m words w1, w2, w3, ..., wm, the joint probability of the text can be calculated using the following formula:

[0050] P(w1,w2,w3,...,wm)=P(w2|w1)P(w3|w1,w2)...P(wm|w1,w2,...,wm-1);

[0051] This joint probability can represent the fluency of the text.

[0052] 2) Term frequency-inverse document frequency (TF-IDF): It is a statistical method and a commonly used weighted technique for information retrieval data mining to evaluate the importance of a word to a document set or one of the documents in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but at the same time it decreases in inverse proportion to the frequency of its appearance in the corpus.

[0053] In the related art, in order to detect sensitive information of the information to be detected, the sensitive information related to the sensitive semantics is usually manually determined, and then the manually determined sensitive information is matched with the information to be detected to find out whether the sensitive information exists in the information to be detected to complete the detection. For example, in order to detect sensitive information related to "alarm", it is usually the user who manually determines multiple sensitive information with similar semantics to "alarm", such as "call 110", "police", etc., and then hard matches are performed based on these sensitive information to achieve sensitive detection. This method of sensitive information detection is not comprehensive and accurate enough and requires a large amount of manual work.

[0054] Based on this, the embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for detecting sensitive information, which can improve the overall accuracy of detection results and reduce manual workload.

[0055] First, the sensitive information detection system provided in the embodiment of the present application is described. Figure 1 , Figure 1 It is an optional architecture diagram of the detection system 100 of sensitive information provided in the embodiment of the present application, and the terminal 400 is connected to the server 200 through the network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless link is used to realize data transmission. In some embodiments, the terminal 400 can be a laptop, a tablet computer, a desktop computer, a smart phone, a dedicated message device, a portable game device, an intelligent speaker, a smart watch, etc., but is not limited to this. The server 200 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The network 300 can be a wide area network or a local area network, or a combination of the two. The terminal 400 and the server 200 can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.

[0056] The terminal 400 is used to collect voice data of customer service, perform voice recognition on the voice data, obtain text type information to be detected, and send a detection request for the information to be detected to the server 200.

[0057] The server 200 is used to parse the received detection request to obtain the information to be detected carried in the detection request; extract semantic features of the sensitive information to obtain the semantic features of the sensitive information; based on the semantic features of the sensitive information, determine the semantic similarity between the sensitive information and each reference information in the information library; select at least two reference information from the information library whose semantic similarity with the sensitive information reaches a similarity threshold, and use the selected reference information as target sensitive information; match at least two target sensitive information with the information to be detected, and generate a sensitive information detection result of the information to be detected based on the matching result, and return the sensitive information detection result to the terminal 400.

[0058] Terminal 400 is also used to output the received sensitive information detection result.

[0059] Next, the electronic device provided in the embodiment of the present application for implementing the above-mentioned sensitive information detection method is described, see Figure 2 , Figure 2 is an optional schematic diagram of the structure of the electronic device 500 provided in the embodiment of the present application. In practical applications, the electronic device 500 can be implemented as Figure 1 The terminal 400 or the server 200 in the embodiment of the present invention is an electronic device. Figure 1 Taking the server 200 shown as an example, an electronic device for implementing the sensitive information detection method of the embodiment of the present application is described. Figure 2 The electronic device 500 shown includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 540 is not described in detail. Figure 2 Various buses are labeled as bus system 540 .

[0060] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0061] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0062] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices that are physically remote from the processor 510.

[0063] The memory 550 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0064] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0065] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0066] A network communication module 552, for reaching other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB);

[0067] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., display screen, speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripherals and displaying content and information);

[0068] The input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions.

[0069] In some embodiments, the sensitive information detection device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 The sensitive information detection device 555 stored in the memory 550 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a feature extraction module 5551, a similarity determination module 5552, a selection module 5553 and a matching module 5554. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0070] In other embodiments, the sensitive information detection device provided in the embodiments of the present application can be implemented in hardware. As an example, the sensitive information detection device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the sensitive information detection method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0071] Based on the above description of the sensitive information detection system and electronic device of the embodiment of the present application, the sensitive information detection method provided by the embodiment of the present application is described below. In some embodiments, the sensitive information detection method provided by the embodiment of the present application can be implemented by the terminal alone, or by the server alone, or by the server and the terminal in collaboration.

[0072] The following takes terminal implementation as an example, combined with the exemplary application and implementation of the terminal provided in the embodiment of the present application, to illustrate the method for detecting sensitive information provided in the embodiment of the present application.

[0073] See also Figure 3 , Figure 3 is an optional flow chart of the sensitive information detection method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.

[0074] Step 101: The terminal extracts semantic features of sensitive information to obtain semantic features of the sensitive information;

[0075] It should be noted that sensitive information is user-defined, and its type can be text, image, audio and video, etc. In actual implementation, for audio-type information to be detected, sensitive information detection is performed on the text obtained by voice recognition of the information to be detected, and for video-type information to be detected, sensitive information detection is performed on the text and image-type video frames obtained after voice recognition and video frame extraction of the information to be detected. Therefore, for convenience and speed, the type of sensitive information here can be set to text, image, or a combination of the two.

[0076] In actual implementation, the sensitive information may be pre-set, and when the process of detecting the information to be detected is triggered, the terminal obtains the pre-set sensitive information to detect the information to be detected based on the sensitive information. The sensitive information may also be that after the process of detecting the information to be detected is triggered, the terminal presents a function item for inputting sensitive information on the display interface, and after the user inputs the sensitive information based on the function item, the terminal obtains the sensitive information input by the user, and then detects the information to be detected based on the sensitive information input by the user.

[0077] Here, there may be multiple sensitive information, and the semantics of different sensitive information may be quite different, such as "alarm" and "my phone number". In actual implementation, a sensitive information list may be pre-set, in which multiple sensitive information with different semantics are stored. Then, the method of the embodiment of the present application is used to search for multiple target sensitive information with similar semantics for these sensitive information.

[0078] After the terminal obtains the sensitive information, it extracts semantic features of the sensitive information. For example, if the type of the sensitive information is text, the terminal segments the sentences of the sensitive information, performs feature encoding on the sensitive information according to the semantics of each word contained in the sensitive information, obtains the word features of each word of the encoded type, and then obtains the semantic features of the sensitive information based on the word features of each word.

[0079] In some embodiments, Figure 3 The illustrated step 101 may be implemented in the following manner, which will be described in conjunction with each step.

[0080] The terminal extracts features of the sensitive information from at least two feature dimensions respectively to obtain at least two dimensional features of the sensitive information; and performs feature splicing on the at least two dimensional features to obtain semantic features of the sensitive information.

[0081] It should be noted that sensitive information may have multiple dimensions of semantic features. In this embodiment, at least two feature dimensions are set to represent the semantic features of sensitive information, so that different sensitive information can be represented based on the same feature dimensions, thereby distinguishing the semantic differences between different sensitive information.

[0082] It should be understood that sensitive information can be a word, such as "police", or a phrase including multiple words, such as "I am a policeman". In this embodiment, before the terminal extracts features from the sensitive information, it also performs word segmentation on the sensitive information to obtain a word sequence of the sensitive information. For example, for the phrase "I am a policeman", the word sequence of "I"-"is"-"policeman" is obtained after word segmentation. In actual implementation, the terminal performs word segmentation on the sensitive information through a word segmenter, wherein the word segmenter can be an open source word segmentation tool, such as an Analyzer word segmentation tool. Then, the terminal extracts features from each word in the word sequence to obtain word features of each word. For example, in the above-mentioned phrase, the terminal extracts features from the three words "I", "is" and "policeman" respectively to obtain word features of each word.

[0083] Specifically, the terminal extracts features of each word in the word sequence corresponding to the sensitive information from at least two feature dimensions to obtain at least two dimensional features of each word. Figure 4 , Figure 4 It is an optional schematic diagram of word features extracted based on at least two feature dimensions provided in an embodiment of the present application. Figure 4 Six feature dimensions are shown, namely, public security, human identity, agency, object, number and gender. Through these five feature dimensions, the features of words such as "police", "public security", "police station", "public security bureau", "number", "mobile phone", "man" and "woman" are extracted. The dimension feature value range of each feature dimension is [-1,1]. Among them, for the keyword "police", its dimension features in the six feature dimensions are 0.95, 0.93, 0.03, 0.01, 0.01, and 0.01 respectively.

[0084] In this embodiment, after extracting the features of each feature dimension of the word in the word sequence corresponding to the sensitive information and obtaining the dimensional features of the word in each feature dimension, the terminal performs feature splicing on the dimensional features of each word to obtain the word features of the word. For example, for words such as "police", "public security" and "mobile phone", the terminal performs feature splicing on the dimensional features of the six feature dimensions, and the word features obtained are as follows.

[0085]

[0086] Among them, e 警察 is the word feature of "police", e 公安 is the word feature of "Public Security", e 手机 The word feature of “mobile phone”.

[0087] Here, through this feature extraction method, it is not difficult to see that the semantics of "police" and "public security" are closer, while the semantics of the two are quite different from that of "mobile phone". After obtaining the word features of each word in the word sequence, the terminal horizontally splices the word features to obtain the semantic features of the sensitive information. For example, if the sensitive information is the phrase "Public Security Bureau number", the terminal segmentes it to obtain a word sequence consisting of "Public Security Bureau"-"number", and the terminal extracts features from "Public Security Bureau" and "number" respectively to obtain the word features of "Public Security Bureau" and "number", and then horizontally splices the two word features to obtain the semantic features of "Public Security Bureau number". Refer to Figure 4 , the semantic features of "Public Security Bureau Number" 公安局号码 It can be as follows:

[0088]

[0089] Through the above-mentioned feature extraction method for sensitive information, the semantic differences of different sensitive information can be more conveniently compared based on the extracted semantic features, thereby facilitating the search for other information with similar semantics to the sensitive information.

[0090] In some embodiments, Figure 3 The illustrated step 101 may also be implemented in the following manner, which will be described in conjunction with each step.

[0091] The terminal extracts features of the sensitive information from at least two feature dimensions respectively to obtain at least two dimensional features of the sensitive information; obtains feature weights of the features of each dimension; and performs weighted summation of the features of at least two dimensions to obtain semantic features of the sensitive information.

[0092] Here, after the terminal performs word segmentation from the sensitive information, it extracts features from each word in the word sequence to obtain the dimensional features of each word in each feature dimension. Then the terminal obtains the feature weights of each dimensional feature, and performs weighted summation on at least two dimensional features of each word to obtain the word features of each word. Among them, the feature weights of each dimensional feature are set based on the importance of each dimension, which can be pre-set and stored in the terminal or an external device connected to the terminal. When applying different scenarios, users can also adjust the feature weights of each dimensional feature according to the specific scenario. For example, in the sensitive word detection scenario of voice calls for financial customer service, the user hopes to better detect the content of calls involving impersonation of public security, procuratorial and judicial organs, then the feature dimension of "public security, procuratorial and judicial organs" with a higher correlation can be set with a higher weight, and the feature dimensions with a lower correlation such as "gender" can be set with a lower weight.

[0093] For example Figure 4For the six feature dimensions shown, if the corresponding feature weights are 0.8, 0.1, 0.1, 0, 0, and 0 respectively, then the word feature of "police" is 0.8*0.95+0.1*0.93+0.1*0.03+0*0.01+0*0.01+0*0.01=1.72, the word feature of "public security" is 0.8*0.93+0.1*0.94+0.1*0.91+0*0.02+0*0.02+0*(-0.01)=2.594, and the word feature of "mobile phone" is 0.8*0.03+0.1*0.02+0.1*0.01+0*0.95+0*0.03+0*0.01=0.027. Based on this, it can be seen that the word features of "police" and "public security" are closer, while the two are far away from the word features of "mobile phone", which is consistent with the actual semantics. Moreover, since a higher weight is set for the feature dimension of "public security, procuratorial and judicial", words that are closer to it can also be screened out.

[0094] After obtaining the word features of each word in the word sequence, the terminal horizontally splices the word features to obtain the semantic features of the sensitive information. For example, if the sensitive information is the phrase "Public Security Bureau number", the terminal segments it to obtain a word sequence consisting of "Public Security Bureau"-"number", and the terminal extracts features of at least two feature dimensions for "Public Security Bureau" and "number" respectively, and performs weighted summation on the features of each dimension based on the above feature weights, and obtains the word feature of "Public Security Bureau" as 0.8*0.94+0.1*0.02+0.1*0.94+0*0.02+0*0.03+0*0.01=1.712, and the word feature of "Public Security Bureau" is 0.8*0.02+0.1*0.01+0.1*0.02+0*0.01+0*0.96+0*0.01=0.019. After horizontally splicing the two, the semantic feature of "Public Security Bureau number" is [1.712 0.019].

[0095] By setting weights for different feature dimensions to extract semantic features of sensitive information, it is easier to screen out the dimensional features that are more needed in the corresponding scenarios, avoiding the huge computational task of encoding sparse semantic features based on a large number of feature dimensions, and improving computational efficiency.

[0096] In some embodiments, Figure 3 The illustrated step 101 may also be implemented in the following manner, which will be described in conjunction with each step.

[0097] When the type of sensitive information is text type, the terminal segments the sensitive information to obtain a word sequence of the sensitive information; uses a language model to extract features of the words in the word sequence to obtain word features of the word sequence; and determines the semantic features of the sensitive information based on the word features of the word sequence.

[0098] It should be noted that the language model of this embodiment can adopt an N-Gram model, a converter (BERT, Bidirectional Encoder Representation from Transformers) model, etc. Exemplarily, this embodiment uses the BERT model to extract semantic features. Figure 5 , Figure 5 This is an optional schematic diagram of the language model provided in the embodiment of the present application. The training method for unsupervised text is to use the language model to maximize the likelihood function. The model structure is an encoder and a decoder composed of a multi-layer transformer (Transformer). The transformer here is Figure 5 Trm in indicates that the Transformer used here is implemented based on the multi-head attention mechanism. Figure 5 , the BERT model is bidirectional. Through this bidirectional structure, the model can comprehensively learn the contextual information of a single word in the sentence in which it is located, so as to learn the semantics of the word more accurately. The input of the BERT model is E (E1, E2, ..., EN), and the output is T (T1, T2, ..., TN). The input of the BERT model can be a single sentence or a sentence pair. The actual input values ​​are segment embedding and position embedding. The input word vector E of BERT is the sum of three vectors: token embedding vector, segment embedding vector and position embedding vector. Among them, token embedding is the word feature of the word, segment embedding indicates which sentence a word belongs to, and position embedding is the position of the word in the input sentence or sentence pair.

[0099] For example, the parameter Figure 6 , Figure 6 It is an optional schematic diagram of the input word vector of the language model provided in the embodiment of the present application. Figure 6 The model input is a sentence pair consisting of sentence A "my dog ​​is cute" and sentence B "he likes play". The input word vector consists of word embeddings and the corresponding segmentation embeddings and position embeddings of each word. For example, for "my dog ​​is cute", the segmentation embeddings of each word are E A For the word "dog", its word vector is E dog +E A +E1.

[0100] In actual implementation, the BERT model used is a pre-trained model, and the downstream task can be implemented by fine-tuning training (changing the model parameters of the pre-trained model) or feature extraction (without changing the model parameters of the pre-trained model, but using the output of the pre-trained model as a feature input to the downstream task). In this embodiment, the terminal better adapts to the application scenario of this embodiment by fine-tuning the model. Specifically, the terminal collects a large amount of large-scale text in the required field and inputs it into the BERT model, so that the BERT model learns the text characteristics in the field, and generates word embedding vectors for all words contained in the large-scale text, and stores the word embedding vectors in the form of a list to obtain a word embedding table, which is equivalent to a dictionary in the field, which contains the mapping relationship between the words in the field and their corresponding word embedding vectors. Here, the word embedding vector is a representation of the word feature of the word.

[0101] In actual implementation, the terminal can input the sensitive information after word segmentation into the language model provided in the embodiment of the present application, encode the sensitive information through the word embedding layer of the language model, and obtain the word embedding vector of the sensitive information. It should be noted that the BERT model of this embodiment also includes a word segmenter, and the terminal can directly input the sensitive information into the language model for word segmentation, and then encode the word sequence obtained based on the word segmentation. By extracting features of sensitive information through the language model, the semantic features of sensitive information can be obtained more accurately and quickly.

[0102] Step 102, based on the semantic features of the sensitive information, respectively determine the semantic similarity between the sensitive information and each reference information in the information database;

[0103] It should be noted that the reference information is a large amount of information in the field, which also contains sensitive information. Figure 3 The illustrated step 102 may be implemented in the following manner: the terminal obtains the semantic features of each reference information in the information library; and determines the similarity between the semantic features of the sensitive information and the semantic features of each reference information in the information library as the semantic similarity.

[0104] It should be noted that the information library can be stored locally in the terminal, or in an external device that is connected to the terminal in communication, such as a database server. The information library stores multiple reference information and corresponding semantic features, and each reference information is stored in a manner mapped to its corresponding semantic feature. In actual implementation, the terminal obtains the information library from the corresponding storage address, and obtains the semantic features of each reference information in the information library, and then calculates the similarity between the semantic features of the sensitive information and the semantic features of each reference information, and obtains the similarity between the semantic features of the sensitive information and the semantic features of each reference information in the information library as the semantic similarity.

[0105] In this embodiment, the terminal calculates the semantic similarity between the semantic features of the reference information and the semantic features of the reference information by using a cosine similarity algorithm, and uses the cosine similarity between the semantic features of the reference information and the semantic features of the reference information as the semantic similarity between the two. The cosine distance is the cosine value of the angle between the semantic features of the reference information and the semantic features of the reference information, and the cosine similarity is the difference between 1 and the cosine distance. It can be understood that when two features are closer, the cosine value of the angle between the two is closer to 1.

[0106] In some embodiments, the terminal obtains the semantic features of each reference information in the information library in the following manner: when the type of the reference information is a text type, the terminal performs word segmentation on each reference information to obtain a word sequence of each reference information; through a second language model, features are extracted from the words in each word sequence to obtain word features of each word sequence; based on the word features of each word sequence, the semantic features of the corresponding reference information are determined.

[0107] In actual implementation, the terminal uses a word segmenter to segment the sensitive information to obtain a word sequence of the sensitive information. The word segmenter can be an open source word segmentation tool, such as an Analyzer word segmentation tool. After word segmentation, the sensitive information is divided into a word sequence composed of words. For example, for the phrase "I am a policeman", the word sequence "I am a policeman" is obtained after word segmentation. Then, the terminal extracts features from each word in the word sequence to obtain word features of each word. For example, in the above phrase, the terminal extracts features from the three words "I", "I am" and "policeman" respectively to obtain word features of each word. After obtaining the word features of each word in the word sequence, the terminal splices the word features to obtain the semantic features of the sensitive information. Here, the second language model can use the above-mentioned BERT model, and the terminal can input each reference information into the BERT model, segment the reference information through the BERT model, and then extract features from each word after segmentation.

[0108] In some embodiments, the terminal performs word segmentation on each reference information, extracts features from each word obtained by the word segmentation to obtain word features of each word, and then stores the word features so that when subsequently searching for approximate words based on the semantic features of the sensitive information, the similarity of the semantic features of the sensitive information is calculated directly based on the stored word features. Here, for ease of explanation, the words obtained after word segmentation of the reference information are recorded as reference words, and the word features corresponding to the reference words are recorded as reference word features. In this embodiment, the terminal stores the reference words and the corresponding reference word features in a mapped manner, and the stored reference words and reference word features are equivalent to a dictionary. When it is necessary to search for approximate information of the sensitive information, the search can be performed based on the stored reference words and reference word features. In the above manner, the semantic similarity between the sensitive information and each reference information in the information library can be determined more accurately and quickly.

[0109] Step 103, selecting at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and using the selected reference information as target sensitive information;

[0110] In actual implementation, after obtaining the semantic similarity between the sensitive information and each reference information in the information library, the terminal determines whether each semantic similarity reaches the similarity threshold, and uses at least two reference information that reach the similarity threshold as the target sensitive information. Here, the similarity threshold can be a specific similarity value or a similarity ranking value. For example, if the semantic similarity is cosine similarity, its value range is [0,1], and the similarity threshold can be set to 0.8, that is, all reference information with a semantic similarity of 0.8 with the sensitive information can be used as the target sensitive information.

[0111] In some embodiments, the similarity threshold is a similarity ranking value. In actual implementation, after obtaining the semantic similarities between all reference information and sensitive information, the terminal sorts the semantic similarities and uses the reference information that satisfies the similarity ranking value as the target sensitive information. For example, the similarity ranking value may be 10, and after sorting all semantic similarities, the terminal selects the reference information with the top 10 semantic similarity rankings as the target sensitive information.

[0112] Step 104: Match at least two target sensitive information with the information to be detected respectively, and generate a sensitive information detection result of the information to be detected based on the matching result.

[0113] It should be noted that the type of the information to be detected may be text, image, audio and video, etc. If the type of the information to be detected is audio, the terminal further performs voice recognition on the information to be detected before executing step 104, and obtains the information to be detected of text type. If the type of the information to be detected is video, the terminal further performs voice recognition and video frame extraction on the information to be detected before executing step 104, obtains text information, and extracts multiple video frames, and uses the text information of text type and the multiple video frames of image type as the information to be detected.

[0114] In some embodiments, based on Figure 3 Before step 104, the following may also be performed: the terminal collects voice data of the customer service; and performs voice recognition on the voice data to obtain text-type information to be detected.

[0115] Here, customer service can be a person who provides manual consulting services to customers on any industry platform, such as shopping platforms, financial platforms (such as banks), game platforms, etc. In order to improve the service quality of customer service, sensitive information can be detected on the voice data of customer service and customer calls based on the solution of the embodiment of the present application to prevent customer service from saying sensitive information that affects the service quality during the service.

[0116] In actual implementation, the terminal can collect the customer service's voice data in real time during the customer service call, perform voice recognition based on the voice data, and then detect sensitive information on the text-type information to be detected obtained by recognition. In addition, the customer service call can be recorded using a recording tool to obtain voice data. The terminal performs voice recognition based on the recorded voice data to obtain the text-type information to be detected, and then detects sensitive information on the information to be detected.

[0117] In step 104, after matching at least two target sensitive information with the information to be detected, the terminal will obtain a matching result of whether the target sensitive information exists in the information to be detected. If the target sensitive information exists in the information to be detected, the matching result may also include the target sensitive information contained in the information to be detected. It should be understood that the target sensitive information matched with the information to be detected contains the original sensitive information. Here, the terminal hard matches at least two target sensitive information with the information to be detected to identify whether the target sensitive information is contained in the information to be detected, and generates a sensitive information detection result of the information to be detected based on the matching result.

[0118] In some embodiments, when the matching result indicates that at least one target sensitive information successfully matches the information to be detected, the terminal generates and outputs an alarm message to prompt the user that sensitive information exists in the information to be detected. In addition, the terminal can also generate a quality inspection report based on the amount of target sensitive information contained in the information to be detected to indicate the cleanliness of the information to be detected. When the matching result indicates that all target sensitive information fails to match the information to be detected, the sensitive information detection result output by the terminal may be that no sensitive information is detected.

[0119] In some embodiments, based on Figure 3 , after step 104, the following may also be performed: when the matching result indicates that there is at least one target sensitive information that successfully matches the information to be detected, the terminal outputs at least one of the following information: the target sensitive information that successfully matches the information to be detected, the sentence or paragraph in which the target sensitive information that successfully matches the information to be detected is located, and the location indication information of the target sensitive information that successfully matches the information to be detected in the information to be detected.

[0120] In actual implementation, the terminal can generate a more complete quality inspection report based on the above information to provide a clearer and more complete description of sensitive information detection for the information to be detected.

[0121] The above-mentioned sensitive information detection method embodiment extracts semantic features of the sensitive information, and determines the semantic similarity with the reference information based on the extracted semantic features, thereby selecting target sensitive information that is similar to the sensitive information from the reference information, and then matching the target sensitive information with the information to be detected to complete the detection of the sensitive information of the information to be detected, thereby realizing fuzzy detection of sensitive information and making the detection result more comprehensive.

[0122] In the above embodiment, the semantic features of the sensitive information are extracted as a whole, and the semantic similarity with the reference information is determined based on the extracted semantic features, thereby obtaining multiple target sensitive information similar to the sensitive information. The following will provide a solution for extracting semantic features based on partial content in the sensitive information, and finally obtaining multiple target sensitive information similar to the sensitive information based on the semantic features of the partial content.

[0123] In some embodiments, reference Figure 7 , Figure 7 is an optional flow chart of a method for detecting sensitive information provided in an embodiment of the present application. Figure 3 The illustrated step 101 can be implemented as follows:

[0124] Step 201, the terminal extracts keywords from sensitive information;

[0125] Step 202: extract features from the keywords to obtain semantic features of the keywords, and use the semantic features of the keywords as semantic features of sensitive information.

[0126] It should be noted that keywords, also known as reserved words, can indicate more important information points in a piece of information. For example, in the phrase "I am a policeman", "policeman" is its keyword. In this embodiment, before the terminal extracts features from the sensitive information, it first identifies keywords from the sensitive information, and then extracts features from the keywords. Here, the terminal extracts keywords from the sensitive information through the TF-IDF algorithm. Then, the terminal extracts features from the extracted keywords, obtains semantic features of the keywords, and uses the keywords as semantic features of the sensitive information.

[0127] Among them, step 202 can be implemented in the following manner: the terminal extracts features of the keyword from at least two feature dimensions respectively to obtain at least two dimensional features of the keyword; and performs feature splicing on the at least two dimensional features to obtain the semantic features of the keyword.

[0128] In addition, step 202 can also be implemented in the following manner: the terminal extracts features of the keyword from at least two feature dimensions respectively to obtain at least two dimensional features of the keyword; obtains the feature weight of each dimensional feature; and performs weighted summation of at least two dimensional features to obtain the semantic features of the keyword.

[0129] Here, the terminal extracts the semantic features of keywords in a manner similar to the word feature extraction method provided in the above embodiment, and uses the extracted word features of keywords as their semantic features.

[0130] In some embodiments, the terminal inputs the keyword into a language model, extracts features of the keyword through the language model, and obtains word features of the keyword. The terminal then calculates the similarity between the word features of the keyword and the word features of reference words in the information library to obtain the semantic similarity between the keyword and each reference word in the information library. Based on the semantic similarity, at least two reference words whose semantic similarity with the keyword reaches a similarity threshold are selected from the information library, and the selected reference words are used as target sensitive information.

[0131] In some embodiments, reference Figure 8 , Figure 8 is an optional flow chart of a method for detecting sensitive information provided in an embodiment of the present application. Figure 3 The illustrated step 104 may be implemented as follows:

[0132] Step 301: The terminal replaces the keywords in the information to be detected with each target sensitive information to obtain at least two corresponding information to be matched;

[0133] Step 302: Match each piece of information to be matched with the information to be detected respectively.

[0134] In actual implementation, the terminal replaces the keywords in the sensitive information with each target sensitive information to obtain information to be matched corresponding to each target sensitive information, and then matches each information to be matched with the information to be detected. Specifically, the terminal splices each target sensitive information with the content other than the keywords in the sensitive information to obtain at least two corresponding information to be matched. The matching process refers to the process of matching the target sensitive information with the information to be detected in the above embodiment, and will not be repeated here.

[0135] Exemplarily, if the sensitive information is "I am a policeman", after obtaining the sensitive information "I am a policeman", the terminal extracts the keyword "policeman" through the TF-IDF algorithm, and then extracts the features of "policeman" through the BERT model to obtain the word embedding vector of "policeman" as its semantic feature. In some embodiments, the terminal searches the information base, such as the word embedding table, and respectively calculates the similarity between the semantic features of "policeman" and the reference word features corresponding to each reference word in the word embedding table to obtain the semantic similarity between "policeman" and each reference word, and then selects at least two reference words whose semantic similarity meets the similarity threshold, and uses the selected reference words as the target sensitive information, which may include "policeman", "public security", "police station", "public security bureau" and "110". In some embodiments, the terminal replaces the keywords in the sensitive information with each target sensitive information to obtain "I am a policeman", "I am public security", "I am a police station", "I am a public security bureau" and "I am 110" waiting for matching information, and then matches the above-mentioned information to be matched with the information to be detected, and uses the matching result as the matching result of the corresponding target sensitive information and the information to be detected.

[0136] The above-mentioned method of obtaining the information to be matched is to extract keywords from the sensitive information, then find reference words similar to the keywords as the target sensitive information, replace the keywords in the sensitive information with the target sensitive information, and obtain the information to be matched that is similar to the sensitive information. This method can more simply, efficiently and accurately find similar information to the sensitive information.

[0137] In some embodiments, reference Fig. 9 , Fig. 9 is an optional flow chart of a method for detecting sensitive information provided in an embodiment of the present application. Figure 8 The illustrated step 302 may be implemented as follows:

[0138] Step 401, the terminal determines the fluency of at least two pieces of information to be matched respectively;

[0139] Step 402, selecting target information to be matched whose fluency satisfies a fluency condition from at least two pieces of information to be matched;

[0140] Step 403: Match the target information to be matched with the information to be detected.

[0141] In actual implementation, by extracting keywords from sensitive information and replacing the keywords of sensitive information with reference words with the same semantics as the keywords to obtain matching information similar to the sensitive information, the final concatenated matching information may not conform to language logic. For example, the above-mentioned "I am a police station" and "I am a public security bureau" do not conform to conventional language logic and rarely appear in actual scenarios, so they need to be filtered.

[0142] In this embodiment, the terminal determines the fluency of each piece of information to be matched, and selects target information to be matched whose fluency meets the fluency condition from at least two pieces of information to be matched. The terminal may calculate the fluency of the information to be matched through a language model. Specifically, the terminal performs word segmentation on the information to be matched to obtain a word sequence of the information to be matched, and then performs feature extraction on each word in the word sequence to obtain word features of each word. In some embodiments, the terminal calculates the conditional probability of each word appearing in the information to be matched based on the word features of each word in the information to be matched, and finally calculates the fluency of the information to be matched based on the conditional probability of each word. After obtaining the fluency of each piece of information to be matched, the terminal selects the target information to be matched whose fluency meets the fluency condition from all the information to be matched based on the fluency of each piece of information to be matched, so as to match the target information to be matched with the information to be detected.

[0143] In some embodiments, respectively determining the fluency of at least two pieces of information to be matched can be achieved in the following manner: when the type of the information to be matched is a text type, the terminal respectively performs word segmentation on each piece of information to be matched to obtain a word sequence of each piece of information to be matched; using a first language model, respectively performs feature extraction on the words in each word sequence to obtain word features of each word sequence; using the first language model, conditional probability prediction is performed on the word features of each word sequence to obtain a conditional probability that a word in each piece of information to be matched appears in a corresponding word sequence; based on the predicted conditional probability, the fluency of each piece of information to be matched is determined.

[0144] It should be noted that the first language model may be the same language model as the second language model provided in the above embodiment, or may be two different language models. In this embodiment, the first language model may also be implemented using a BERT model. Fig.10 , Fig.10 is an optional schematic diagram of the second language model provided in the embodiment of the present application. It can be understood that Fig.10The first language model shown is a model that can classify sentences after fine-tuning. In this embodiment, the first language model is used to classify the fluency of sentences.

[0145] In actual implementation, the terminal inputs the sentence into the first language model in the format of [CLS] + sentence. The sentence consists of words such as Tok1, ..., TokN, E1, ..., EN are the word embedding vectors of Tok1, ..., TokN, and T1, ..., TN are the model outputs of Tok1, ..., TokN, that is, the word features of Tok1, ..., TokN. For example, in this embodiment, the word features output by the model include the word embedding vector, the segmentation embedding vector, and the position embedding vector of the word. The input of [CLS] is E[CLS], and the feature representation of [CLS] is C. Here, the feature representation C of [CLS] will pass through a fully connected layer to predict which category it belongs to, and in this embodiment, it belongs to which fluency. Fig.10 The classification label output by the first language model shown is the fluency of the input sentence.

[0146] Specifically, the process of the first language model predicting the fluency of a sentence is as follows: the input sentence is encoded using the encoding layer to obtain the word features of each word in the sentence, and then based on the word features, the conditional probability of the word appearing in the sentence is calculated under the premise that other words have already appeared. The terminal calculates the conditional probability of each word in the sentence. For example, for the phrase "I am a police station", the terminal uses the first language model to segment the phrase to obtain the word sequence of "I"-"is"-"police station", and then extracts features of the three words respectively to obtain the word features T of the three words "I", "is" and "police station". 我 、T 是 and T 警察局 In some embodiments, the terminal predicts the conditional probability of each word based on the word features of each word through the first language model. Since the probability of the first word in a sentence is random, and there are no other words as the occurrence condition to predict the probability of the first word, the conditional probability of the first word is set to 1 by default. For example, for the phrase "I am a police station", the conditional probability of "I" P(T 我 ) can be set to 1. Then predict the conditional probability of each word after the first word in the sentence, among which the conditional probability of "yes" is P(T 是 |T 我 ), the conditional probability of "Police Station" is P(T 警察局 |T 我 ,T 是). In some embodiments, the terminal predicts the fluency of the information to be matched based on the conditional probability of each word in the information to be matched through the first language model. Here, the product of the conditional probability of each word in the information to be matched is used as the fluency of the information to be matched. For example, the fluency P of the phrase "I am a police station" can be determined by the following calculation formula: P = P (T 我 )P(T 是 |T 我 )P(T 警察局是 |T 我 ,T 是 ).

[0147] In some embodiments, the terminal selects target information to be matched whose fluency satisfies the fluency condition from each information to be matched according to the fluency of each information to be matched predicted by the first language model. The fluency condition may be that the specific fluency reaches the fluency threshold, for example, the fluency threshold is 80%, and the fluency condition may also be a fluency ranking range, for example, the fluency ranking is in the top 10. The terminal may rank the fluency of each information to be matched, and then select the information to be matched whose fluency ranks in the top 10 as the target information to be matched.

[0148] Through the above method, the information to be matched obtained by matching can be screened for fluency, thereby filtering out information that does not conform to language logic, and can more accurately extract the target information to be matched, so as to more efficiently detect sensitive information of the information to be detected.

[0149] In some embodiments, the terminal may further execute: the terminal obtains a sample word sequence corresponding to the information sample to be matched, and the sample word sequence is marked with a target fluency of the information sample to be matched; through the first language model, features of the words in the sample word sequence are extracted to obtain word features of the sample word sequence; through the first language model, conditional probability prediction is performed on the word features of the sample word sequence to obtain predicted conditional probability; through the first language model, based on the predicted conditional probability, fluency prediction is performed on the information sample to be matched to obtain predicted fluency; the difference between the target fluency and the predicted fluency is obtained, and the model parameters of the first language model are updated based on the difference.

[0150] In actual implementation, the information samples to be matched are large-scale corpora in the field, and the fluency of each information sample to be matched can be pre-marked. After obtaining the information samples to be matched, the terminal performs word segmentation processing on each information sample to be matched to obtain a sample word sequence of the information sample to be matched, and then inputs the sample word sequence into the first language model, and extracts features of each word in the sample word sequence through the first language model to obtain word features. In some embodiments, the predicted conditional probability of each word is determined based on the word features by the first language model, and the fluency of the information sample to be matched is predicted based on the predicted conditional probability to obtain the predicted fluency. The process of obtaining the predicted fluency of the information sample to be matched refers to the process of obtaining the fluency of the information to be matched in the above embodiment, and will not be repeated here.

[0151] In some embodiments, the first language model uses a BERT model, which itself carries a word segmenter, so the terminal directly inputs the information sample to be matched into the first language model, and uses the first language model to segment the information sample to be matched, and predicts the fluency based on the sample word sequence after segmentation, obtains the predicted fluency and outputs it. Among them, the information sample to be matched can be a large-scale corpus in the field, and the fluency of each information sample to be matched is 100% by default, so there is no need to mark the fluency of the information sample to be matched before training, but directly input it into the first language model so that the model learns the language logic of the information sample to be matched.

[0152] Next, the terminal obtains the difference between the pre-annotated target fluency and the predicted fluency output by the first language model, and then updates the model parameters of the first language model based on the difference. Specifically, when the value of the difference reaches a threshold, the terminal determines a corresponding error signal; starting from the output layer of the first language model, the error signal is back-propagated in the first language model, and the model parameters of the first language model are updated during the propagation process.

[0153] Here we explain back propagation. The training samples are input into the input layer of the neural network model, pass through the hidden layer, and finally reach the output layer and output the result. This is the forward propagation process of the neural network model. Since there is an error between the output result of the neural network model and the actual result, the error between the output result and the actual value is calculated, and the error is back propagated from the output layer to the hidden layer until it propagates to the input layer. During the back propagation process, the value of the model parameter is adjusted according to the error; the above process is continuously iterated until convergence.

[0154] Through the above-mentioned training process of the first language model, the first language model can learn conventional language logic and have the ability to predict the fluency of input information.

[0155] Next, we will continue to introduce the sensitive information detection method provided by the embodiment of the present application. Fig.11 is an optional flow chart of the sensitive information detection method provided in the embodiment of the present application, see Fig.11 The sensitive information detection method provided in the embodiment of the present application is implemented collaboratively by the terminal and the server.

[0156] Step 501, the terminal collects the voice data of the customer service;

[0157] Step 502, the terminal performs speech recognition on the speech data to obtain text type information to be detected;

[0158] Step 503, the terminal generates a detection request for the information to be detected in response to a trigger operation on the text to be detected;

[0159] Here, the detection request is generated by the terminal after the user issues a trigger operation to the terminal. In some embodiments, it can also be automatically generated by the terminal. For example, when the terminal monitors a customer service call, it automatically collects the call voice to obtain the voice data of the call voice, performs voice recognition on the voice data to obtain the text type of information to be detected, and then generates a detection request and sends it to the server. The detection request carries the information to be detected.

[0160] Step 504, the terminal sends a detection request for the information to be detected to the server;

[0161] Step 505, the server parses the received detection request to obtain the information to be detected;

[0162] Step 506, the server extracts keywords from the sensitive information;

[0163] Step 507: The server extracts features of the keyword from at least two feature dimensions to obtain at least two dimensional features of the keyword;

[0164] Step 508: The server obtains semantic features of the keyword based on at least two dimensional features of the keyword, and uses the semantic features of the keyword as semantic features of the sensitive information;

[0165] Here, the server may concatenate at least two dimensional features of the keyword to obtain the semantic features of the keyword, and may also obtain the feature weights of each dimensional feature respectively, perform weighted summation of the features of each dimensional feature, and obtain the semantic features of the keyword.

[0166] Step 509, the server determines the semantic similarity between the sensitive information and each reference information in the information database based on the semantic features of the sensitive information;

[0167] Step 510: The server selects at least two reference information from the information database whose semantic similarity with the sensitive information reaches a similarity threshold, and uses the selected reference information as the target sensitive information;

[0168] Step 511, the server replaces the keywords in the sensitive information with each target sensitive information respectively, and obtains at least two corresponding pieces of information to be matched;

[0169] Step 512, the server determines the fluency of at least two pieces of information to be matched respectively;

[0170] Step 513, the server selects target information to be matched whose fluency satisfies the fluency condition from at least two pieces of information to be matched;

[0171] Step 514, the server matches the target information to be matched with the information to be detected, and uses the matching result as the matching result of the corresponding information to be matched with the information to be detected;

[0172] Step 515, the server generates a sensitive information detection result of the information to be detected based on the matching result;

[0173] Step 516, the server sends the sensitive information detection result to the terminal;

[0174] Step 517: The terminal outputs the received sensitive information detection result.

[0175] In this embodiment, fuzzy detection of sensitive information can be achieved, the detection results have high overall accuracy, and a large amount of work in manually selecting sensitive information with similar semantics is reduced.

[0176] Below, an exemplary application of the embodiment of the present application in an actual application scenario will be described. In actual implementation, the sensitive information detection method provided by the embodiment of the present application may include the following operations:

[0177] Take the customer service quality inspection scenario of a bank as an example. In order to improve the service quality of customer service, it is necessary to check the content of customer service calls. Here, the customer service is monitored by detecting sensitive information in the customer service call content. Among them, sensitive information can be pre-set, and it can be any content. Users can customize the content that they want customer service to avoid based on actual scenario requirements, such as "I am a policeman" and other content that impersonates the public security, procuratorial and judicial organs, or "My phone number is" and other content that reveals the customer service's private contact information to customers.

[0178] In actual implementation, the terminal collects voice data of conversations between customer service and customers, performs voice recognition on the voice data, converts the voice data into text, and uses the converted text as information to be detected to detect sensitive information.

[0179] When starting to detect the information to be detected, the terminal first extracts keywords from the sensitive information through the TF-IDF algorithm. For example, the keyword for "I am a policeman" is "policeman". Then, feature extraction is performed on the extracted keywords. Here, the terminal uses the BERT model to extract the word features of the keywords. Specifically, the terminal inputs the keywords into the BERT model, and extracts the word features of the keywords through the word embedding layer of the BERT model. It should be noted that the BERT model is a trained model. It obtains the language logic in the field by learning large-scale corpora in the field and has the ability to predict the fluency of sentences. Among them, after learning large-scale corpora in the field, BERT also obtains reference word features corresponding to large-scale reference words in the field, that is, feature vectors including word embedding vectors, segmentation embedding vectors, and position embedding vectors. Large-scale reference words and corresponding reference word features are mapped to form a word embedding table, which is stored as a model parameter in the BERT model.

[0180] Next, the terminal determines multiple reference words with similar semantics to the keyword as approximate words based on the word embedding table and the word features of the keyword. Specifically, the terminal determines the similarity between the word features of the keyword and the reference word features of each reference word through the cosine similarity algorithm, and determines the top K approximate words with the top K similarities based on the similarity.

[0181] After obtaining multiple approximate words of the keyword, the terminal respectively concatenates the multiple approximate words with the part of the sensitive information other than the keyword to obtain multiple approximate information with semantic similarity to the sensitive information, and then uses the sensitive information and the multiple approximate information as the information to be matched. For example, for the sensitive information "I am a policeman", its keyword is "policeman", and the part other than "policeman" is "I am". After searching for multiple approximate words of "policeman", "public security", "police station", "public security bureau" and "110", the terminal concatenates the approximate words with "I am" to obtain approximate information such as "I am public security", "I am police station", "I am public security bureau" and "I am 110".

[0182] Here, the terminal also judges the fluency of the approximate information and filters out the approximate information that is not logically smooth. The terminal inputs each approximate information into the BERT model respectively, and predicts the fluency of each approximate information through the BERT model to obtain the fluency of each approximate information. Specifically, the terminal performs word segmentation on each approximate information through the BERT model to obtain the word sequence of each approximate information, and extracts features of each word in the word sequence of the approximate information to obtain the word features of each word of the approximate information, and then determines the conditional probability of each word in the respective approximate information based on the word features of each word, and predicts the fluency of the approximate information based on the conditional probability. Then, the terminal selects the approximate information whose fluency meets the fluency condition as the target approximate information, such as the approximate information with a fluency of more than 80%. Exemplarily, the terminal can filter out the above-mentioned approximate information that does not conform to the language logic, such as "I am a police station" and "I am a public security bureau", by screening the fluency, and finally obtains the target approximate information such as "I am a public security" and "I am 110".

[0183] Next, the terminal uses the sensitive information and the target similar information that is semantically similar to the sensitive information and conforms to the language logic as the information to be matched, and performs a hard text match between the information to be matched and the information to be detected to detect whether the text to be detected includes the information to be matched, and obtains the corresponding matching result. Thereafter, the terminal generates and outputs the sensitive information detection result based on the matching result for the user to browse.

[0184] The following further describes the exemplary structure of the sensitive information detection device 555 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the sensitive information detection device 555 of the memory 550 may include:

[0185] The feature extraction module 5551 is used to extract semantic features of sensitive information to obtain semantic features of the sensitive information;

[0186] A similarity determination module 5552 is used to determine the semantic similarity between the sensitive information and each reference information in the information database based on the semantic features of the sensitive information;

[0187] A selection module 5553 is used to select at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and use the selected reference information as the target sensitive information;

[0188] The matching module 5554 is used to match at least two target sensitive information with the information to be detected respectively, and generate a sensitive information detection result of the information to be detected based on the matching result.

[0189] In some embodiments, the feature extraction module 5551 is further used to extract features of the sensitive information from at least two feature dimensions, respectively, to obtain at least two dimensional features of the sensitive information; and to perform feature splicing on the at least two dimensional features to obtain the semantic features of the sensitive information.

[0190] In some embodiments, the feature extraction module 5551 is further used to extract features of sensitive information from at least two feature dimensions, respectively, to obtain at least two dimensional features of sensitive information; obtain feature weights of the features of each dimension; perform weighted summation of the features of at least two dimensions, and obtain semantic features of the sensitive information.

[0191] In some embodiments, the feature extraction module 5551 is also used to extract keywords from sensitive information; perform feature extraction on the keywords to obtain semantic features of the keywords, and use the semantic features of the keywords as semantic features of the sensitive information.

[0192] In some embodiments, the matching module 5554 is further used to replace the keywords in the sensitive information with each target sensitive information to obtain at least two corresponding information to be matched; and to match each information to be matched with the information to be detected.

[0193] In some embodiments, the matching module 5554 is further used to respectively determine the fluency of at least two pieces of information to be matched; select target information to be matched whose fluency meets the fluency condition from the at least two pieces of information to be matched; and match the target information to be matched with the information to be detected.

[0194] In some embodiments, the matching module 5554 is also used to, when the type of the information to be matched is a text type, respectively segment each piece of information to be matched to obtain a word sequence of each piece of information to be matched; perform feature extraction on the words in each word sequence through the first language model to obtain word features of each word sequence; perform conditional probability prediction on the word features of each word sequence through the first language model to obtain the conditional probability that the words in each piece of information to be matched appear in the corresponding word sequence; and determine the fluency of each piece of information to be matched based on the predicted conditional probability.

[0195] In some embodiments, the software module in the sensitive information detection device 555 stored in the memory 550 may also include: a training model for obtaining a sample word sequence corresponding to the information sample to be matched, the sample word sequence is annotated with the target fluency of the information sample to be matched; through the first language model, feature extraction of words in the sample word sequence to obtain word features of the sample word sequence; through the first language model, conditional probability prediction of the word features of the sample word sequence to obtain predicted conditional probability; through the first language model, based on the predicted conditional probability, fluency prediction of the information sample to be matched is performed to obtain predicted fluency; the difference between the target fluency and the predicted fluency is obtained, and the model parameters of the first language model are updated based on the difference.

[0196] In some embodiments, the similarity determination module 5552 is also used to obtain semantic features of each reference information in the information library; and respectively determine the similarity between the semantic features of the sensitive information and the semantic features of each reference information in the information library as the semantic similarity.

[0197] In some embodiments, the similarity determination module 5552 is also used to, when the type of reference information is a text type, respectively segment each reference information to obtain a word sequence of each reference information; extract features of the words in each word sequence through a second language model to obtain word features of each word sequence; and determine the semantic features of the corresponding reference information based on the word features of each word sequence.

[0198] In some embodiments, the software modules in the sensitive information detection device 555 stored in the memory 550 may also include: a collection module for collecting voice data of customer service; performing voice recognition on the voice data to obtain text-type information to be detected.

[0199] In some embodiments, the software module in the sensitive information detection device 555 stored in the memory 550 may also include: an output module, which is used to output at least one of the following information when the matching result indicates that there is at least one target sensitive information that successfully matches the information to be detected: the target sensitive information that successfully matches the information to be detected, the sentence or paragraph where the target sensitive information that successfully matches the information to be detected is located, and the location indication information of the target sensitive information that successfully matches the information to be detected in the information to be detected.

[0200] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above-mentioned method embodiment, and has similar beneficial effects as the method embodiment, so it will not be repeated.

[0201] An embodiment of the present application provides an electronic device, including: a memory for storing executable instructions; and a processor for implementing the sensitive information detection method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0202] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the sensitive information detection method provided in the embodiment of the present application.

[0203] The present application embodiment provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be caused to execute the method provided by the present application embodiment, for example, Figure 3 The detection method of sensitive information is shown.

[0204] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0205] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0206] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0207] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0208] In summary, the embodiments of the present application can improve the comprehensiveness and accuracy of sensitive information detection.

[0209] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for detecting sensitive information, characterized in that: include: Extracting semantic features of sensitive information to obtain semantic features of the sensitive information; Based on the semantic features of the sensitive information, respectively determine the semantic similarity between the sensitive information and each reference information in the information database; Selecting at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and using the selected reference information as target sensitive information; Matching at least two of the target sensitive information with the information to be detected respectively, and generating a sensitive information detection result of the information to be detected based on the matching result; The extracting semantic features of the sensitive information to obtain the semantic features of the sensitive information includes: extracting keywords from the sensitive information; Extracting features of the keywords to obtain semantic features of the keywords, and using the semantic features of the keywords as semantic features of the sensitive information; The matching of at least two of the target sensitive information with the information to be detected respectively includes: Replacing the keywords in the sensitive information with each of the target sensitive information respectively to obtain at least two corresponding pieces of information to be matched; Respectively matching each of the information to be matched with the information to be detected; The step of respectively matching each of the information to be matched with the information to be detected includes: respectively determining the fluency of the at least two pieces of information to be matched; Selecting target information to be matched whose fluency satisfies the fluency condition from the at least two information to be matched; Matching the target information to be matched with the information to be detected; The respectively determining the fluency of the at least two pieces of information to be matched comprises: when the type of the information to be matched is a text type, respectively performing word segmentation on each piece of information to be matched to obtain a word sequence of each piece of information to be matched; respectively performing feature extraction on words in each of the word sequences through a first language model to obtain word features of each of the word sequences; performing conditional probability prediction on the word features of each of the word sequences through the first language model to obtain a conditional probability that a word in each piece of information to be matched appears in a corresponding word sequence; and determining the fluency of each piece of information to be matched based on the predicted conditional probability.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a sample word sequence corresponding to the information sample to be matched, wherein the sample word sequence is annotated with a target fluency of the information sample to be matched; Extracting features of words in the sample word sequence through a first language model to obtain word features of the sample word sequence; Using the first language model, conditional probability prediction is performed on the word features of the sample word sequence to obtain a predicted conditional probability; Using the first language model, based on the prediction conditional probability, predicting the fluency of the information sample to be matched, to obtain a predicted fluency; A difference between the target fluency and the predicted fluency is obtained, and a model parameter of the first language model is updated based on the difference.

3. The method according to claim 1, characterized in that The determining, based on the semantic features of the sensitive information, respectively the semantic similarity between the sensitive information and each reference information in the information database includes: When the type of the reference information is a text type, each of the reference information is segmented to obtain a word sequence of each of the reference information; By using a second language model, feature extraction is performed on the words in each of the word sequences to obtain word features of each of the word sequences; Determining semantic features of corresponding reference information based on word features of each of the word sequences; The similarities between the semantic features of the sensitive information and the semantic features of each reference information in the information database are respectively determined as the semantic similarity.

4. The method according to claim 1, characterized in that After generating the sensitive information detection result of the information to be detected based on the matching result, the method further includes: When the matching result indicates that at least one of the target sensitive information successfully matches the information to be detected, at least one of the following information is output: Target sensitive information that successfully matches the information to be detected, and location indication information of the target sensitive information that successfully matches the information to be detected in the information to be detected.

5. A sensitive information detection device, characterized in that: include: A feature extraction module is used to extract semantic features of sensitive information to obtain semantic features of the sensitive information, wherein the feature extraction module is specifically used to extract keywords from the sensitive information; extract features of the keywords to obtain semantic features of the keywords, and use the semantic features of the keywords as semantic features of the sensitive information; A similarity determination module, used to determine the semantic similarity between the sensitive information and each reference information in the information database based on the semantic features of the sensitive information; A selection module, used to select at least two reference information whose semantic similarity with the sensitive information reaches a similarity threshold from the information database, and use the selected reference information as target sensitive information; A matching module, used to match at least two of the target sensitive information with the information to be detected, and generate a sensitive information detection result of the information to be detected based on the matching result, wherein the matching module is specifically used to replace the keywords in the sensitive information with each of the target sensitive information, to obtain at least two corresponding information to be matched; respectively match each of the information to be matched with the information to be detected; wherein the matching module is specifically used to respectively determine the fluency of the at least two information to be matched; select the target information to be matched whose fluency meets the fluency condition from the at least two information to be matched; match the target information to be matched with the information to be detected; Among them, the matching module is specifically used to, when the type of the information to be matched is a text type, respectively segment each of the information to be matched to obtain a word sequence of each of the information to be matched; through the first language model, respectively extract features of the words in each of the word sequences to obtain word features of each of the word sequences; through the first language model, perform conditional probability prediction on the word features of each of the word sequences to obtain the conditional probability that the words in each of the information to be matched appear in the corresponding word sequence; based on the predicted conditional probability, determine the fluency of each of the information to be matched.

6. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, used to implement the sensitive information detection method described in any one of claims 1 to 4 when executing executable instructions stored in the memory.

7. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to implement the sensitive information detection method described in any one of claims 1 to 4 when executed by a processor.

Citation Information

Patent Citations

  • Method for auditing internet sensitive contents and device thereof

    CN101764704A