Sensitive word recognition method, device and computer equipment based on artificial intelligence
Through the artificial intelligence recognition method, the problem of insufficient recognition accuracy of traditional filtering methods is solved, and efficient recognition and processing of sensitive words in text is achieved.
Patent Information
- Application Number
- CN202010927419.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-07
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-09-07
AI Technical Summary
The traditional sensitive word filtering method has insufficient recognition accuracy, and it is impossible to effectively identify sensitive words after adding symbols or spaces to the text, affecting the recognition effect.
Using a sensitive word recognition method based on artificial intelligence, we can obtain the target word slot combination and intermediate word information in text information to determine whether sensitive words are included, and perform corresponding processing to improve the recognition accuracy and processing efficiency.
Even if symbols or spaces are added to the text, sensitive words can be accurately identified and automated restriction processing can be realized, improving the efficiency of sensitive words recognition and processing.
Smart Images

Figure CN112016317B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a sensitive word recognition method, device and computer equipment based on artificial intelligence. Background Art
[0002] With the development of social software, the communication methods between users have become more and more diverse. However, this has also brought an unavoidable problem: the content of the transmitted information cannot be effectively controlled. Bad information containing sensitive words may be sent to users through various channels, causing certain adverse effects. Therefore, the need for sensitive word filtering has emerged. Effective sensitive word quality inspection is carried out when users publish content to ensure that the quality of the output content meets the standards.
[0003] At present, traditional sensitive word filtering usually uses one-to-one filtering, uses relatively simple regular expressions to match sensitive words, or maintains a sensitive word library and searches in the corresponding table when the text is input. For example, if sensitive word A needs to be filtered out, all contents matching the given regular expression are searched in the string, or the corresponding words or contents are searched in the sensitive word library, and if they exist, the corresponding results are returned.
[0004] However, the inventors of the present invention found in their research that the traditional sensitive word filtering method has great limitations. It can only match specific content and is easy to be exploited and skip matching rules, such as adding symbols or spaces in the middle of sensitive words. As a result, it cannot achieve the desired sensitive word recognition effect, affecting the accuracy of sensitive word recognition. Summary of the invention
[0005] In view of this, the present application provides a sensitive word recognition method, device and computer equipment based on artificial intelligence, the main purpose of which is to improve the technical problem that the current traditional sensitive word filtering method causes low accuracy in sensitive word recognition.
[0006] According to one aspect of the present application, a sensitive word recognition method based on artificial intelligence is provided, the method comprising:
[0007] Obtain text information to be recognized;
[0008] Identifying a target word slot combination contained in the text information, wherein the target word slot combination consists of at least one preset word slot;
[0009] Determining whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information;
[0010] If it is determined that the text information contains sensitive words, restriction processing is performed on the text information.
[0011] According to another aspect of the present application, a sensitive word recognition device based on artificial intelligence is provided, the device comprising:
[0012] An acquisition module, used for acquiring text information to be recognized;
[0013] A recognition module, configured to recognize a target word slot combination contained in the text information, wherein the target word slot combination is composed of at least one preset word slot;
[0014] A judging module, configured to judge whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information;
[0015] The processing module is used to filter the text information if it is determined that the text information contains sensitive words.
[0016] According to another aspect of the present application, a non-volatile readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the above-mentioned sensitive word recognition method based on artificial intelligence is implemented.
[0017] According to another aspect of the present application, a computer device is provided, comprising a non-volatile readable storage medium, a processor, and computer-readable instructions stored on the non-volatile readable storage medium and executable on the processor, wherein the processor implements the above-mentioned artificial intelligence-based sensitive word recognition method when executing the computer-readable instructions.
[0018] By means of the above technical scheme, the present application provides a method, device and computer equipment for sensitive word recognition based on artificial intelligence, which can identify the target word slot combination contained in the text information, which is composed of at least one preset word slot, and then judge whether the text information contains sensitive words according to the target word slot combination and the intermediate word information of the target word slot combination in the text information. Compared with the existing traditional sensitive word filtering method, the present application uses the word slot combination + the intermediate word judgment method between the word slot combinations, even if symbols or spaces are added in the middle of the text sensitive words, or some words are added, or the same semantics are rewritten through other texts, etc., it can accurately identify whether the text information contains sensitive words, which can improve the accuracy of sensitive word recognition. If it is determined that the text information contains sensitive words, the text information can also be restricted in time, and the entire sensitive word recognition + restriction processing process can be realized automatically, which improves the efficiency of sensitive word processing.
[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, which can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the local application. In the drawings:
[0021] Figure 1 A schematic diagram of a process of a sensitive word recognition method based on artificial intelligence provided in an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram of a process of another sensitive word recognition method based on artificial intelligence provided in an embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram of the structure of a sensitive word recognition device based on artificial intelligence provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0025] In order to improve the technical problem that the current traditional sensitive word filtering method will cause low accuracy in sensitive word recognition, this embodiment provides a sensitive word recognition method based on artificial intelligence, such as Figure 1 As shown, the method includes:
[0026] 101. Obtain text information to be recognized.
[0027] The text information to be identified can be the text information of communication messages to be published, such as the text of messages sent in instant messaging software, the online communication text between platform customer service personnel and users, the text of messages published on public platforms (such as the text published in web page comments, the text of product reviews, the text sent in video bullet screens, etc.). In addition, the text information to be identified can also be text within a specified range (such as the specified range of text in publicly published electronic books, the specified range of text in publicly issued notification messages, etc.).
[0028] The execution subject of this embodiment may be a device or apparatus for sensitive word recognition and processing, which may be deployed on a client or server, etc., and may improve the accuracy of sensitive word recognition.
[0029] 102. Identify the target word slot combination included in the text information.
[0030] Among them, the target word slot combination consists of at least one preset word slot. In this embodiment, word slots can be preset in advance. These word slots can be determined according to different sensitive words, and specifically can include word slots for sensitive words (such as "principal reduction", "rent reduction", "personal loan", etc., and word slots for a series of digital symbols that conform to the formats of bank card numbers, ID card numbers, account passwords, etc.), word slots for non-sensitive words (such as word slots for words like "won't", "must", etc., and word slots for single digits, single characters, etc.), word slots for synonyms of sensitive words (such as word slots that are substantially synonymous with sensitive words but do not belong to the scope of sensitive words), and can also include each word segment obtained by splitting sensitive words (such as the three word slots of "go to you", "unit", and "investigate" obtained by splitting the sensitive word "go to your unit for investigation"). Then, these word slots are combined and matched according to the corresponding sensitive word recognition to obtain a word slot combination.
[0031] For this embodiment, the pre-statistical word slot combination can be saved in a predetermined storage location (such as a database, mapping table, etc.). Subsequently, when identifying the word slot combination included in the text information, each word segment in the text information can be matched with each word slot combination in the predetermined storage location to find the matching word slot combination, which is used as the target word slot combination included in the text information.
[0032] 103. Determine whether the text information contains sensitive words based on the target word slot combination included in the text information and the intermediate word information of the target word slot combination in the text information.
[0033] The intermediate word information can be the word information that appears between each word slot included in the word slot combination in the text information. For example, the text information is "XX finds someone to go to your unit and conduct a background investigation on you and then discovers XX", where XX represents the words omitted and not shown in the text information. The target word slot combination included in this text information is "go to you" + "unit" + "investigate", and the "de" between "go to you" and "unit" and the ", conduct a background investigation on you" between "unit" and "investigate" are the intermediate words.
[0034] In this embodiment, the word slot combination corresponding to the sensitive word has the same meaning as the sensitive word to a certain extent, and can be a word slot combination composed of the sensitive word itself; or a word slot combination that is not a sensitive word when viewed alone, but has the meaning of a sensitive word when combined together. In specific application scenarios, sometimes the text that actually contains sensitive words is mixed with spaces, symbols, or some words are added, or the same semantics are rewritten through other texts, etc., which affects the accuracy of determining whether there are sensitive words in the text information. However, this embodiment can not only determine whether the text information contains sensitive words in these cases through the determination of the word slot combination, but also the determination of the intermediate word information of the word slot combination in the text information, and can improve the accuracy of sensitive word recognition.
[0035] 104. If it is determined that the text information contains sensitive words, restrictive processing is performed on the text information.
[0036] For example, when it is determined that text information contains sensitive words, the text information can be marked as a reminder to inform the existence of sensitive word information, such as highlighting the text part containing the target word slot combination in the text information (such as highlighting, bolding, underlining, etc.), or restricting the sending of communication messages containing the text information, etc.
[0037] Through the sensitive word identification method based on artificial intelligence in this embodiment, the target word slot combination contained in the text information can be identified, and the word slot combination is composed of at least one preset word slot, and then the text information is judged whether it contains sensitive words according to the target word slot combination and the intermediate word information of the target word slot combination in the text information. Compared with the existing traditional sensitive word filtering method, this embodiment uses the word slot combination + the intermediate word judgment method between the word slot combinations. Even if symbols or spaces are added in the middle of the text sensitive words, or some words are added, or the same semantics are rewritten through other texts, etc., it can accurately identify whether the text information contains sensitive words, which can improve the accuracy of sensitive word identification. If it is determined that the text information contains sensitive words, the text information can also be restricted in a timely manner. The entire sensitive word identification + restriction processing process can be automatically realized, which improves the efficiency of sensitive word processing.
[0038] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another sensitive word recognition method based on artificial intelligence is provided, such as Figure 2 As shown, the method includes:
[0039] 201. Obtain text information to be recognized.
[0040] Before the text information to be identified is subjected to sensitive word identification, in order to ensure the security and privacy of the text information, the text information may be optionally stored in the blockchain in advance. Accordingly, step 201 may specifically include: obtaining the text information to be identified from the blockchain. For example, the text information to be identified may be obtained from the target node of the blockchain, and then the text information is subjected to sensitive word identification. It should be noted that the blockchain referred to in this embodiment is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0041] 202. Clear character spaces and preset special symbols in the text information.
[0042] The preset special symbols may be symbols such as "@", "#", "¥", "\", " / ", "*", etc. For this embodiment, before the word slot combination recognition is performed on the text information, the character spaces and preset special symbols in the text information are cleared, which can effectively reduce noise interference and improve the accurate matching of the word slot combination and the corresponding detection rules.
[0043] Furthermore, in addition to clearing character spaces and preset special symbols in the text information, it is also possible to remove continuously repeated words, continuously repeated symbols, etc. in the text information, and to remove uncommon characters in the text information that may cause matching interference, thereby further reducing noise interference.
[0044] 203. Identify the target word slot combination contained in the text information after removing character spaces and preset special symbols.
[0045] In this embodiment, the sensitive word recognition rules can be configured first, and the rule configuration can be divided into three layers: slots, rules, and models. The slots contain preset keywords such as sensitive words, non-sensitive words, and synonyms of sensitive words. The rules are a combination of slots (equivalent to a preset verification rule, that is, the text information meets the judgment criteria when sensitive words exist), and the model is a combination of rules (equivalent to the combination of multiple verification rules). After the slots are established, the rules and models can be freely combined to formulate sensitive word filtering strategies that meet the needs according to the business scenarios. For example, after the slots, rules, and models are established, each word segmentation in the text information after clearing the character spaces and preset special symbols is matched with the slot combination in the rule, and then the target slot combination contained therein is found.
[0046] It should be noted that after identification and matching, there may be at least one target word slot combination in the text information, that is, there are multiple groups of different target word slot combinations, and a comprehensive judgment is subsequently performed based on these target word slot combinations, specifically executing the process shown in steps 204 to 206a and 206b.
[0047] 204. Obtain a target verification rule combination according to at least one target verification rule corresponding to each target word slot combination.
[0048] In this embodiment, a single word slot combination may correspond to at least one target verification rule, and each verification rule is equivalent to presetting a judgment standard for containing sensitive words. When a single word slot combination corresponds to at least two verification rules, it is equivalent to corresponding to a verification rule combination. It should be noted that this embodiment can pre-define whether the word slot combination corresponds to a single verification rule or a verification rule combination containing at least two verification rules according to actual needs, that is, the word slot combination can be used in the rule layer or the model layer. In this way, the scope of occurrence of sensitive words can be limited, that is, the detected content, and the scope of action is the rule layer or the model layer. Detection is performed within the specified range, and then the verification rules can be flexibly used for sensitive word recognition. In the case of semantic puns, multiple verification rules can be used to make accurate judgments from different angles, which can improve the accuracy of sensitive word recognition.
[0049] In this embodiment, at least one target verification rule corresponding to each target word slot combination is combined to obtain a target verification rule combination, and the target verification rule combination includes at least one preset sensitive word determination standard.
[0050] 205. According to the word slot arrangement information of the target word slot combination in the text information and the intermediate word information between the word slots, determine whether the text information meets multiple preset sensitive word determination criteria in the target inspection rule combination.
[0051] In the specific judgment process, the preset sensitive word judgment criteria in the target verification rule combination are used to determine whether the text information meets one or more of these sensitive word judgment criteria based on the word slot arrangement information of the target word slot combination in the text information and the intermediate word information between the word slots.
[0052] Exemplarily, several examples of sensitive word determination criteria are given. Step 205 may specifically include: If the sensitive word determination criterion is that each word slot in the target word slot combination appears in the text information, and the number of intermediate words is within the limited range to meet the determination criterion, then when it is determined that the word slot arrangement information (such as the order in which the word slots appear in the text) conforms to the preset word slot order corresponding to the target word slot combination, and the number of intermediate words is less than or equal to the preset quantity threshold, it is determined that the text information contains sensitive words; If the sensitive word determination criterion is that each word slot in the target word slot combination appears in the text information, and the number of intermediate words is within the limited range to not meet the determination criterion, then when it is determined that the word slot arrangement information conforms to the preset word slot order corresponding to the target word slot combination, and the number of intermediate words is greater than or equal to the preset quantity threshold, it is determined that the text information contains sensitive words.
[0053] Among them, since sometimes the order of different word collocations is different, the obtained semantics will not be different. Therefore, each word slot combination has its own corresponding preset word slot order, which is used to determine whether it has the meaning of a sensitive word. A single word slot combination can correspond to at least one preset word slot order according to the actual situation. The intermediate word part is used to modify the semantics of the word slot combination, and the preset quantity threshold is used to determine whether the word slot combination after language modification still has the meaning of a sensitive word. The size of this threshold can be preset according to the actual situation.
[0054] For example, for the word slot combination composed of the word slots "go to you", "unit", and "investigate", after matching, the corresponding preset verification rule is the determination criterion of [AND]. The number of editable words allowed between the three word slots is 8. If the information sent by the user contains these three words at the same time and the number of intermediate words is less than 8, it is determined to meet the [AND] determination criterion, that is, it is determined that the information sent by the user contains sensitive words. If the number of words edited between these three sensitive words is greater than 8, it is determined not to meet the [AND] determination criterion at this time, that is, it is determined that the information sent by the user does not contain sensitive words. [AND] means that multiple word slots before and after this rule must appear to be hit, and the intermediate words can be set. For example, for the text information "Find someone to go to your unit and do a background investigation on you.", the intermediate words in this text for the word slot combination are "the" between "go to you" and "unit", and ", do a background on you" between "unit" and "investigate". The sum of the number of intermediate words is equal to 8, so it is considered to hit the corresponding verification rule standard, and then it is determined that this text contains sensitive words.
[0055] For another example, a word slot combination consisting of a sensitive word slot "reducing principal" and a non-sensitive word slot "will not" can be matched to obtain the corresponding preset verification rule as the judgment standard of [non], and the number of editable characters allowed between the two sensitive words is 3. If the information sent by the user contains both words and there are less than 3 intermediate words, it is judged to meet the judgment standard of [non], that is, it is determined that the information sent by the user does not contain sensitive words. The verification rule of [non] is to set a word slot for sensitive words and a word slot for non-sensitive words. If the two words appear together, they will not be hit, and the intermediate words can be set. For example, for the text information of "will not reduce the principal", the number of intermediate words between the two word slots "will not" and "reducing principal" is 0, which is considered to have not hit the corresponding verification rule standard, and then it is determined that this text does not contain sensitive words. For "No, don't worry, the principal will definitely be waived", if the number of the middle words "Yes, don't worry, it will definitely be" between the two word slots "No" and "Waste the principal" is greater than 3, it is considered that the corresponding verification rule standard is hit, and then it is determined that this text contains sensitive words.
[0056] In actual application, the verification rule combination may include at least two verification rules, which is equivalent to identifying sensitive words through the model in step 203. For example, the verification rule combination includes three verification rules, verification rule one is the verification of the ID card, verification rule two is the verification of sensitive words + and, and verification rule three is the verification of sensitive words + non. Among them, when using verification rule one to identify sensitive words, it can be identified whether the text information (after removing character spaces, preset special symbols, rare characters and other noise text) contains a string of word slots of digital type. If it contains this type of word slot, it can be determined whether the string of numbers corresponding to the word slot conforms to the ID card format. If it conforms to the ID card format, it is determined to comply with verification rule one, and it can be considered that sensitive words exist in the text information. When using verification rules two and three to identify sensitive words, the above two examples can be referred to, and they will not be repeated here.
[0057] In the actual verification process, the target verification rule combination may contain a large number of verification rules. If the verification judgment is performed one by one, it will affect the time efficiency. Therefore, in order to improve the efficiency of sensitive word recognition, optionally, step 205 may also specifically include: if the target verification rule combination contains at least one preset sensitive word judgment standard with different execution priorities, then the text information is judged in sequence according to the execution priority of each sensitive word judgment standard in the target verification rule combination from high to low; in the process of sequential judgment, if it is determined that there is a sensitive word judgment standard that the text information meets, then the subsequent judgment of the text information is stopped, and the current judgment result is used as the result of judging the text information using the target verification rule combination.
[0058] For example, the target inspection rule combination includes five verification rules, and these five verification rules are pre-set with execution priorities in the inspection rule combination (such as pre-setting priorities from high to low according to the success rate of sensitive word recognition), and are sorted from high to low according to the execution priority: Verification Rule 1> Verification Rule 3> Verification Rule 4> Verification Rule 5> Verification Rule 2. Subsequently, the corresponding verification rules are used in turn to judge the text information in this sorting order. If the text information is judged to contain sensitive words through Verification Rule 3, the subsequent verification process of Verification Rule 4, Verification Rule 5, and Verification Rule 2 is stopped. Through this optional method, there is no need to check sensitive words for each verification rule, and the judgment result can be obtained as quickly as possible, which can improve the efficiency of sensitive word recognition.
[0059] In the specific application implementation of this embodiment, the calculation priority range can be limited, similar to the four arithmetic operations, and the verification rules that appear in the priority range are executed first. If there are specific regular symbols in the verification rules to represent different meanings, the verification rules that match the priority range can be placed in brackets "()". When executing the verification rules, the rules in the brackets will be executed first, and then other verification rules will be executed.
[0060] 206a. If the text information meets at least one set of sensitive word determination criteria in the target inspection rule combination, it is determined that the text information contains sensitive words.
[0061] In this embodiment, a set of sensitive word determination criteria may include at least one sensitive word determination criterion, that is, one, two, or more sensitive word determination criteria, which may be determined according to actual sensitive word determination accuracy requirements.
[0062] In step 206b, which is parallel to step 206a, if the text information does not meet any sensitive word determination criteria in the target inspection rule combination, it is determined that the text information does not contain sensitive words.
[0063] In this embodiment, multiple preset sensitive word judgment criteria in the inspection rule combination can be used to perform sensitive word recognition judgment on the text information respectively. If it is judged that it meets at least one of the preset sensitive word judgment criteria, it can be determined that the text information contains sensitive words, thereby improving the accuracy of sensitive word recognition.
[0064] 207. If it is determined that the text information contains sensitive words, restricting processing is performed on the text information.
[0065] Optionally, restrictive processing may be applied to text information, which may include: preventing the posting of text information; or replacing the text portion of the text information containing the target word slot combination with preset characters (such as "*", "-", etc., to achieve a desensitizing effect) before posting; or sending the text information to the review module for review, and posting it if the review passes. For example, after determining that the text information contains sensitive words, the system will prevent users from posting sensitive words, or directly delete the content containing sensitive words sent by users. For some less sensitive words, they will not be deleted immediately after being sent, and reviewers will need to conduct a second manual review.
[0066] Further optionally, after step 207, the method of this embodiment may also include: recording the text portion containing the target word slot combination in the text information as sample data; then regularly analyzing the recorded sample data, counting the word combinations in each sample data that have a frequency greater than a preset frequency threshold and are different from the existing word slot combination; calculating the semantic similarity of the word combination obtained by statistics with the preset sensitive words and / or preset sensitive sentences; taking the target word combination with a semantic similarity greater than the preset similarity threshold as a new word slot combination, and updating the verification rules corresponding to the new word slot combination according to the sample data containing the new word slot combination; and subsequently using the new word slot combination and the corresponding verification rules to determine whether other text information contains sensitive words. By this method of regularly and automatically updating the word slot combination and the corresponding verification rules, the automatic update of the sensitive word recognition system can be realized, so as to further improve the subsequent sensitive word recognition accuracy. The entire sensitive word recognition system is equivalent to having the function of machine learning, which can realize the accurate recognition of sensitive words by artificial intelligence.
[0067] For example, for articles on sensitive topics, they usually contain not only a set of word slot combinations with sensitive word semantics, but also use a variety of different words to express sensitive topics. Therefore, using the existing word slot combinations and their corresponding verification rules, the text data that is judged to contain sensitive words sometimes also contains other word combinations with sensitive word meanings. This embodiment collects these text data as sample data; regularly analyzes these sample data to find word combinations with a frequency of occurrence greater than a certain threshold and different from the existing word slot combinations, and calculates the semantic similarity between them and the preset sensitive words and / or preset sensitive sentences, and then finds those new word slot combinations that have not been discovered before and also have the meaning of sensitive words, and formulates their corresponding verification rules. In this way, the new word slot combinations and the corresponding verification rules can be used to determine whether other text information contains sensitive words, so as to find more text data that actually have the meaning of sensitive words.
[0068] The method of this embodiment can also be applied to the system of intelligent sensitive word quality inspection. Algorithms can be used to match entries. By setting specific rules and strategies, noise interference can be reduced, and accurate sensitive word filtering can be performed across the text. After building the sensitive word library, the text is traversed by an algorithm and matched with the sensitive word tree, thereby achieving the function of identifying and filtering sensitive words. Intelligent strategies can be customized according to customer needs to efficiently filter multiple types of sensitive words and prohibited variants such as banned messages, malicious promotions, vulgar insults, and low-quality flooding. The content review and recognition accuracy of the intelligent quality inspection system is high, and the text can be processed quickly, which greatly reduces the workload of manual review, eliminates online risks, improves the quality of content output, purifies the network environment, and ensures a good user experience.
[0069] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the figure, this embodiment provides a sensitive word recognition device based on artificial intelligence, such as Figure 3 As shown, the device includes: an acquisition module 31, an identification module 32, a judgment module 33, and a processing module 34.
[0070] An acquisition module 31 is used to acquire text information to be recognized;
[0071] An identification module 32, configured to identify a target word slot combination contained in the text information, wherein the target word slot combination is composed of at least one preset word slot;
[0072] A judging module 33, configured to judge whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information;
[0073] The processing module 34 is used to filter the text information if it is determined that the text information contains sensitive words.
[0074] In a specific application scenario, the judgment module 33 is specifically used to obtain a target verification rule combination according to at least one target verification rule corresponding to each of the target word slot combinations; and to judge whether the text information meets multiple preset sensitive word judgment criteria in the target verification rule combination according to the word slot arrangement information of the target word slot combination in the text information and the intermediate word information between the word slots; if the text information meets at least one set of sensitive word judgment criteria in the target verification rule combination, the text information is judged to contain sensitive words; if the text information does not meet any of the sensitive word judgment criteria in the target verification rule combination, the text information is judged to not contain sensitive words.
[0075] In a specific application scenario, the judgment module 33 is also specifically used to determine that the text information contains sensitive words when it is determined that the word slot arrangement information conforms to the preset word slot order corresponding to the target word slot combination and the number of the middle words is less than or equal to the preset number threshold if the sensitive word judgment standard is that all word slots in the target word slot combination appear in the text information and the number of the middle words is within a limited range and does not meet the judgment standard; if the sensitive word judgment standard is that all word slots in the target word slot combination appear in the text information and the number of the middle words does not meet the judgment standard within a limited range, then when it is determined that the word slot arrangement information conforms to the preset word slot order corresponding to the target word slot combination and the number of the middle words is greater than or equal to the preset number threshold, it is determined that the text information contains sensitive words.
[0076] In a specific application scenario, the judgment module 33 is also specifically used to judge the text information in sequence according to the execution priority of each sensitive word judgment standard in the target inspection rule combination from high to low if the target inspection rule combination contains at least one preset sensitive word judgment standard with different execution priorities; in the process of sequential judgment, if it is determined that there is a sensitive word judgment standard that the text information meets, then stop the subsequent judgment of the text information, and use the currently obtained judgment result as the result of judging the text information using the target inspection rule combination.
[0077] In a specific application scenario, the device also includes: a recording module and an analysis module;
[0078] A recording module, configured to record, after the restriction processing is performed on the text information, a text portion of the text information containing the target word slot combination as sample data;
[0079] The analysis module is used to regularly analyze each recorded sample data, count the word combinations in each sample data that have an appearance frequency greater than a preset frequency threshold and are different from the existing word slot combinations; calculate the semantic similarity of the word combinations obtained by statistics with preset sensitive words and / or preset sensitive sentences; use the target word combination with a semantic similarity greater than a preset similarity threshold as a new word slot combination, and update the verification rule corresponding to the new word slot combination based on the sample data containing the new word slot combination; use the new word slot combination and the corresponding verification rule to determine whether other text information contains sensitive words.
[0080] In a specific application scenario, the processing module 34 is specifically used to prevent the text information from being published; or, replace the text portion of the text information containing the target word slot combination with preset characters before publishing; or, send the text information to the review module for review, and publish it if the review is passed.
[0081] In a specific application scenario, optionally, the text information is pre-stored in a blockchain; accordingly, the acquisition module 31 is specifically used to acquire the text information from the blockchain;
[0082] The recognition module 32 is specifically used to remove character spaces and preset special symbols in the text information; and recognize the target word slot combination contained in the text information after the character spaces and preset special symbols are removed.
[0083] It should be noted that for other corresponding descriptions of the functional units involved in the sensitive word recognition device based on artificial intelligence provided in this embodiment, please refer to Figure 1 and Figure 2 The corresponding description in will not be repeated here.
[0084] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a non-volatile readable storage medium, on which a computer readable instruction is stored. When the computer readable instruction is executed by a processor, the above-mentioned Figure 1 and Figure 2 The sensitive word recognition method based on artificial intelligence is shown.
[0085] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0086] Based on the above Figure 1 , Figure 2 The method shown, and Figure 3 In order to achieve the above-mentioned purpose, the present embodiment further provides a computer device, which can be a personal computer, a laptop computer, a server, a network device, etc. The physical device includes a storage medium and a processor; the storage medium is used to store computer-readable instructions; the processor is used to execute the computer-readable instructions to achieve the above-mentioned Figure 1 and Figure 2 The sensitive word recognition method based on artificial intelligence is shown.
[0087] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0088] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0089] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. By applying the technical solution of this embodiment, the target word slot combination contained in the text information can be identified, and the word slot combination is composed of at least one preset word slot, and then according to the target word slot combination and the intermediate word information of the target word slot combination in the text information, it is judged whether the text information contains sensitive words. Compared with the currently existing traditional sensitive word filtering method, this embodiment uses the word slot combination + the intermediate word discrimination method between the word slot combination, even if symbols or spaces are added in the middle of the text sensitive words, or some words are added, or the same semantics are rewritten through other texts, etc., it can accurately identify whether the text information contains sensitive words, which can improve the accuracy of sensitive word recognition. If it is determined that the text information contains sensitive words, the text information can also be timely restricted, and the entire sensitive word recognition + restriction process can be realized automatically, which improves the efficiency of sensitive word processing.
[0091] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0092] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A sensitive word recognition method based on artificial intelligence, characterized in that: include: Obtain text information to be recognized; Identifying a target word slot combination contained in the text information, wherein the target word slot combination consists of at least one preset word slot; Determining whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information; If it is determined that the text information contains sensitive words, the text information is restricted. The step of judging whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information specifically includes: Acquire a target verification rule combination according to at least one target verification rule corresponding to each of the target word slot combinations; According to the word slot arrangement information of the target word slot combination in the text information and the intermediate word information between the word slots, respectively judging whether the text information meets a plurality of preset sensitive word determination criteria in the target inspection rule combination; If the text information meets at least one set of sensitive word determination criteria in the target inspection rule combination, then determining that the text information contains sensitive words; If the text information does not meet any of the sensitive word determination criteria in the target inspection rule combination, it is determined that the text information does not contain sensitive words; The step of determining whether the text information meets a plurality of preset sensitive word determination criteria in the target inspection rule combination according to the word slot arrangement information and the intermediate word information between the word slots in the text information by the target word slot combination specifically includes: If the sensitive word determination criterion is that all word slots in the target word slot combination appear in the text information, and the number of middle words is within a limited range to meet the determination criterion, then when it is determined that the word slot arrangement information meets the preset word slot sequence corresponding to the target word slot combination, and the number of middle words is less than or equal to the preset number threshold, it is determined that the text information contains sensitive words; If the sensitive word determination criterion is that all word slots in the target word slot combination appear in the text information, and the number of intermediate words is within a limited range and does not meet the determination criterion, then when it is determined that the word slot arrangement information meets the preset word slot order corresponding to the target word slot combination, and the number of intermediate words is greater than or equal to the preset number threshold, it is determined that the text information contains sensitive words.
2. The method according to claim 1, characterized in that: If the target verification rule combination includes at least one preset sensitive word determination standard with different execution priorities, then judging whether the text information meets multiple preset sensitive word determination standards in the target verification rule combination according to the word slot arrangement information of the target word slot combination in the text information and the intermediate word information between the word slots, specifically includes: The text information is judged in sequence according to the execution priority of each sensitive word judgment standard in the target inspection rule combination from high to low; In the process of sequential judgment, if it is determined that the text information meets the sensitive word judgment standard, the subsequent judgment of the text information is stopped, and the currently obtained judgment result is used as the result of judging the text information using the target inspection rule combination.
3. The method according to claim 1, characterized in that After the text information is restricted, the method further includes: Recording the text portion of the text information that contains the target word slot combination as sample data; Regularly analyze each sample data recorded, and count the word combinations in each sample data that have a frequency greater than a preset frequency threshold and are different from the existing word slot combinations; Calculate the semantic similarity between the word combination obtained by statistics and the preset sensitive words and / or preset sensitive sentences; Taking the target word combination whose semantic similarity is greater than the preset similarity threshold as a new word slot combination, and updating the verification rule corresponding to the new word slot combination according to the sample data containing the new word slot combination; The new word slot combination and the corresponding inspection rules are used to determine whether other text information contains sensitive words.
4. The method according to claim 1, characterized in that: The restricting process of the text information specifically includes: prevent the publication of the text message; or, Replacing the text portion of the text information containing the target word slot combination with preset characters before publishing; or, The text information is sent to the review module for review, and is published if the review is passed.
5. The method according to claim 1, characterized in that The text information is pre-stored in the blockchain; The obtaining of the text information to be identified specifically includes: Obtaining the text information from the blockchain; The identifying the target word slot combination contained in the text information specifically includes: Clearing character spaces and preset special symbols in the text information; Identify the target word slot combination contained in the text information after removing character spaces and preset special symbols.
6. A sensitive word recognition device based on artificial intelligence, characterized in that: include: An acquisition module, used for acquiring text information to be recognized; A recognition module, configured to recognize a target word slot combination contained in the text information, wherein the target word slot combination is composed of at least one preset word slot; A judging module, configured to judge whether the text information contains sensitive words according to the target word slot combination and the middle word information of the target word slot combination in the text information; A processing module, configured to filter the text information if it is determined that the text information contains sensitive words; The judgment module is specifically used to obtain a target verification rule combination according to at least one target verification rule corresponding to each of the target word slot combinations; and to judge whether the text information meets multiple preset sensitive word determination criteria in the target verification rule combination according to the word slot arrangement information and the intermediate word information between the word slots of the target word slot combination in the text information; if the text information meets at least one set of sensitive word determination criteria in the target verification rule combination, then the text information is judged to contain sensitive words; if the text information does not meet any sensitive word determination criteria in the target verification rule combination, then the text information is judged not to contain sensitive words; The judgment module is further specifically used for, if the sensitive word judgment standard is that all word slots in the target word slot combination appear in the text information, and the number of intermediate words is within a limited range to meet the judgment standard, then when it is judged that the word slot arrangement information meets the preset word slot sequence corresponding to the target word slot combination, and the number of the intermediate words is less than or equal to the preset number threshold, determining that the text information contains sensitive words; if the sensitive word judgment standard is that all word slots in the target word slot combination appear in the text information, and the number of intermediate words is within a limited range to not meet the judgment standard, then when it is judged that the word slot arrangement information meets the preset word slot sequence corresponding to the target word slot combination, and the number of the intermediate words is greater than or equal to the preset number threshold, determining that the text information contains sensitive words.
7. A non-volatile readable storage medium having computer readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the sensitive word recognition method based on artificial intelligence described in any one of claims 1 to 5 is implemented.
8. A computer device comprising a non-volatile readable storage medium, a processor, and computer readable instructions stored on the non-volatile readable storage medium and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the sensitive word recognition method based on artificial intelligence described in any one of claims 1 to 5 is implemented.