A sensitive word detection rule generation method, a sensitive word detection rule generation device, and an electronic device
The target sensitive word is expanded through the preset sensitive word expansion rules selected by the user to generate a set of candidate expanded sensitive words, which solves the problem of incomplete sensitive word detection rules in the existing technology and realizes more comprehensive sensitive word detection.
Patent Information
- Application Number
- CN202211198788.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The sensitive word detection rules in the existing technology cannot fully detect sensitive words in chat texts, especially in the scenarios of homophones and synonyms, which leads to low detection comprehensiveness.
The target sensitive words are expanded through the preset sensitive word expansion rules selected by the user to generate sensitive word detection rules, including initial letters, pinyin, decomposition, simplified and traditional Chinese, Martian language, multilingual and synonym expansion rules, generate a set of candidate expanded sensitive words, and generate the final sensitive word detection rules based on the user's selection.
The comprehensiveness of sensitive word detection rules has been improved, which can more comprehensively detect sensitive words in chat texts and reduce omissions.
Smart Images

Figure CN115422923B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and more specifically, to a method, device, and electronic device for generating sensitive word detection rules. Background Art
[0002] With the development of internet technology, terminals (mobile phones, computers, tablets, etc.) have become widely used by the public. People can use various shopping apps on these terminals to inquire about products and order items. When managing customer service conversations, companies hope to control the language used by customer service staff to avoid language violations during communication with customers, which can lead to customer dissatisfaction.
[0003] Currently, company managers can identify sensitive content in customer service chats based on sensitive words and issue prompts or block them. However, this approach only supports absolute matching of sensitive words. The sensitive words entered by managers must completely match the words in the chat text to be effective. Furthermore, there is no auxiliary function to expand homophones or synonyms during the sensitive word entry process, which leads to many scenarios being missed. Furthermore, due to the diverse forms of sensitive words, the comprehensiveness of sensitive word detection is relatively low. Therefore, how to generate more comprehensive detection rules for sensitive words in chat text has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, a generating device and an electronic device for generating sensitive word detection rules, which expand the target sensitive words input by the user through the target sensitive word expansion rules selected by the user, obtain a target expanded sensitive word set corresponding to each target sensitive word, and use each target sensitive word and each target expanded sensitive word in each target expanded sensitive word set to generate sensitive word detection rules, thereby improving the comprehensiveness of the sensitive words in the generated sensitive word detection rules.
[0005] In a first aspect, an embodiment of the present application provides a method for generating sensitive word detection rules, the method comprising:
[0006] Obtaining at least one target sensitive word for representing a sensitive word detection requirement;
[0007] In response to a user selecting a preset sensitive word expansion rule, determining at least one target sensitive word expansion rule; wherein the preset sensitive word expansion rules include an initial letter expansion rule, a pinyin expansion rule, a character splitting expansion rule, a simplified and traditional Chinese expansion rule, a Martian script expansion rule, a multilingual expansion rule, and a synonym expansion rule;
[0008] For each target sensitive word expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word; wherein the set of candidate expanded sensitive words includes at least one candidate expanded sensitive word associated with the target sensitive word;
[0009] For each target sensitive word, in response to the user's selection operation of at least one candidate extended sensitive word set associated with the target sensitive word, obtaining at least one target extended sensitive word set corresponding to the target sensitive word;
[0010] Based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word, a sensitive word detection rule corresponding to the sensitive word detection requirement is generated.
[0011] Furthermore, when the target sensitive word expansion rule is the initial letter expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0012] For each target sensitive word, determine the first letter of the pinyin of each character in the target sensitive word;
[0013] Based on the first letter of the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in a preset vocabulary; wherein the first letter of the phonetic alphabet of each character in the candidate extended sensitive word is the same as the first letter of the phonetic alphabet of each character in the target sensitive word;
[0014] Summarizing the at least one candidate expanded sensitive word to determine a set of candidate expanded sensitive words associated with the target sensitive word;
[0015] When the target sensitive word expansion rule is the pinyin expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0016] For each target sensitive word, determine the pinyin letters of each character in the target sensitive word;
[0017] Based on the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in the preset vocabulary library; wherein the phonetic alphabet of each character in the candidate extended sensitive word is the same as the phonetic alphabet of each character in the target sensitive word;
[0018] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0019] Furthermore, when the target sensitive word expansion rule is the character splitting expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0020] For each character in each target sensitive word, determine whether the character is a Chinese character with a radical;
[0021] If so, split the character into its radicals to obtain the corresponding split characters;
[0022] Using the split character corresponding to the character to replace the character in the target sensitive word, and determining candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0023] When the target sensitive word expansion rule is the simplified and traditional Chinese expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0024] For each character in each target sensitive word, if the character is in simplified Chinese, convert the character into traditional Chinese to obtain the first target character;
[0025] If the text is in traditional Chinese, convert the text into simplified Chinese to obtain the first target text;
[0026] Combine each first target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0027] When the target sensitive word expansion rule is the Martian language expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0028] For each character in each target sensitive word, convert the character into Martian language to obtain a second target character;
[0029] Combine each second target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0030] When the target sensitive word expansion rule is the multilingual expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain at least one candidate expanded sensitive word set associated with each target sensitive word includes:
[0031] For each target sensitive word, convert the target sensitive word based on at least one preset language type to obtain at least one multilingual sensitive word corresponding to the target sensitive word;
[0032] In response to the user selecting at least one preset language type, determining at least one target language type, and determining the multilingual sensitive word in the at least one target language type as at least one candidate expanded sensitive word associated with the target sensitive word;
[0033] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0034] Furthermore, when the target sensitive word expansion rule is the synonym expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0035] Get at least one synonym source type;
[0036] For each target sensitive word, use each synonym source type to determine at least one synonymous sensitive word corresponding to the target sensitive word;
[0037] In response to a user selecting at least one synonymous sensitive word, determining at least one target synonymous sensitive word, and determining the at least one target synonymous sensitive word as at least one candidate expanded sensitive word associated with the target sensitive word;
[0038] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0039] Furthermore, before obtaining at least one target sensitive word for representing the sensitive word detection requirement, the generating method further includes:
[0040] Get the target detection rule name entered by the user.
[0041] Furthermore, after generating the sensitive word detection rule corresponding to the sensitive word detection requirement, the generating method further includes:
[0042] Determining the number of sensitive words of the target extended sensitive word that exist in the sensitive word detection rule;
[0043] Determining whether the number of sensitive words is greater than a preset number of sensitive words;
[0044] If so, splitting the sensitive word detection rule based on the number of sensitive words and the specified number of sensitive words to obtain a plurality of sensitive word detection sub-rules corresponding to the sensitive word detection rule;
[0045] The multiple sensitive word detection sub-rules and the rule names are displayed on the user interface in a subordinate relationship.
[0046] Furthermore, after generating the sensitive word detection rule corresponding to the sensitive word detection requirement, the generating method further includes:
[0047] Get at least one preset department name and at least one employee name in each department;
[0048] In response to the user's selection operation of at least one department name and / or at least one employee name, determining at least one target department and / or at least one target employee;
[0049] Each employee in at least one target department and / or at least one target employee is determined as an applicable person for the sensitive word detection rule, so as to perform sensitive word detection on the conversation text of the applicable person using the sensitive word detection rule.
[0050] In a second aspect, an embodiment of the present application further provides a device for generating sensitive word detection rules, the device comprising:
[0051] An acquisition module, configured to acquire at least one target sensitive word for representing a sensitive word detection requirement;
[0052] a target sensitive word expansion rule determination module, configured to determine at least one target sensitive word expansion rule in response to a user selecting a preset sensitive word expansion rule; wherein the preset sensitive word expansion rules include an initial letter expansion rule, a pinyin expansion rule, a character splitting expansion rule, a simplified and traditional Chinese expansion rule, a Martian script expansion rule, a multilingual expansion rule, and a synonym expansion rule;
[0053] a candidate expanded sensitive word set determination module, configured to perform sensitive word expansion on each target sensitive word based on each target sensitive word expansion rule to obtain a candidate expanded sensitive word set associated with each target sensitive word; wherein the candidate expanded sensitive word set includes at least one candidate expanded sensitive word associated with the target sensitive word;
[0054] a target extended sensitive word set determination module, configured to, for each target sensitive word, obtain, in response to the user's selection operation of at least one candidate extended sensitive word set associated with the target sensitive word, at least one target extended sensitive word set corresponding to the target sensitive word;
[0055] The sensitive word detection rule generation module is used to generate a sensitive word detection rule corresponding to the sensitive word detection requirement based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word.
[0056] In a third aspect, an embodiment of the present application also provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for generating sensitive word detection rules as described above are performed.
[0057] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the method for generating sensitive word detection rules as described above are executed.
[0058] The method for generating sensitive word detection rules provided in an embodiment of the present application first obtains at least one target sensitive word for characterizing a sensitive word detection requirement; then, in response to a user's selection operation for a preset sensitive word expansion rule, determines at least one target sensitive word expansion rule; for each target sensitive word expansion rule, performs sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a candidate expanded sensitive word set associated with each target sensitive word; for each target sensitive word, in response to the user's selection operation for at least one candidate expanded sensitive word set associated with the target sensitive word, obtains at least one target expanded sensitive word set corresponding to the target sensitive word; finally, based on each target sensitive word and each target expanded sensitive word in the at least one target expanded sensitive word set corresponding to each target sensitive word, generates a sensitive word detection rule corresponding to the sensitive word detection requirement.
[0059] Compared with the detection rule generation method in the prior art, the present application expands the target sensitive word input by the user through the target sensitive word expansion rule selected by the user, obtains the target expanded sensitive word set corresponding to each target sensitive word, and uses each target sensitive word and each target expanded sensitive word in each target expanded sensitive word set to generate a sensitive word detection rule, thereby improving the comprehensiveness of the sensitive words in the generated sensitive word detection rule and solving the problem of incompleteness of sensitive words in the sensitive word detection rule created in the prior art.
[0060] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0062] Figure 1 A flowchart of a method for generating sensitive word detection rules provided in an embodiment of the present application;
[0063] Figure 2 A schematic diagram of the structure of a device for generating sensitive word detection rules provided in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of the structure of another device for generating sensitive word detection rules provided in an embodiment of the present application;
[0065] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.
[0067] With the development of internet technology, terminals (mobile phones, computers, tablets, etc.) have become widely used by the public. People can use various shopping apps on these terminals to inquire about products and order items. When managing customer service conversations, companies hope to control the language used by customer service staff to avoid language violations during communication with customers, which can lead to customer dissatisfaction.
[0068] Currently, company managers can identify sensitive content in customer service chats based on sensitive words and issue prompts or block them. However, this approach only supports absolute matching of sensitive words. The sensitive words entered by managers must completely match the words in the chat text to be effective. Furthermore, there is no auxiliary function to expand homophones or synonyms during the sensitive word entry process, which leads to many scenarios being missed. Furthermore, due to the diverse forms of sensitive words, the comprehensiveness of sensitive word detection is relatively low. Therefore, how to generate more comprehensive detection rules for sensitive words in chat text has become an urgent problem to be solved.
[0069] Based on this, an embodiment of the present application provides a method for generating sensitive word detection rules, which solves the problem that sensitive words in sensitive word detection rules created in the prior art are not comprehensive.
[0070] See also Figure 1 , Figure 1 This is a flow chart of a method for generating sensitive word detection rules provided in an embodiment of the present application. Figure 1 As shown in , the method for generating sensitive word detection rules provided in the embodiment of the present application includes:
[0071] S101: Obtain at least one target sensitive word for representing a sensitive word detection requirement.
[0072] It should be noted that the sensitive word detection requirement refers to the user's demand for sensitive word detection in the conversation text. For example, the sensitive word detection requirement can be service attitude sensitive word detection, sales talk sensitive word detection, and revenue description sensitive word detection, etc. This application does not specifically limit this. The target sensitive word refers to the sensitive word entered by the user that you want to expand. For example, when the sensitive word detection requirement is service attitude detection, the target sensitive word can be any user-entered word such as "customer", "get out", or "no longer selling".
[0073] It should be noted here that the above examples of sensitive word detection requirements and target sensitive words are only examples. In practice, sensitive word detection requirements and target sensitive words are not limited to the above examples.
[0074] Regarding the above step S101, during specific implementation, at least one target sensitive word input by the user for representing a sensitive word detection requirement is obtained.
[0075] As an optional implementation manner, before obtaining at least one target sensitive word for representing a sensitive word detection requirement, the generation method further includes:
[0076] Get the target detection rule name entered by the user.
[0077] It should be noted that the target detection rule name refers to the name of the sensitive word detection rule finally generated by the user.
[0078] For this step, in the specific implementation, the target detection rule name input by the user is obtained. For example, continuing with the embodiment in step S101, when the sensitive detection requirement is service attitude detection, the target detection rule name input by the user can be "service attitude sensitive word detection rule".
[0079] S102: In response to a user's selection operation of a preset sensitive word expansion rule, determining at least one target sensitive word expansion rule.
[0080] It should be noted that the preset sensitive word expansion rules refer to pre-set rules for expanding the target sensitive word entered by the user. According to the embodiments provided in this application, the preset sensitive word expansion rules include initial letter expansion rules, pinyin expansion rules, character splitting expansion rules, simplified and traditional Chinese expansion rules, Martian script expansion rules, multilingual expansion rules, and synonym expansion rules. Here, the initial letter expansion rule refers to expanding the target sensitive word using the initial pinyin letter of the target sensitive word. The pinyin expansion rule refers to expanding the target sensitive word using the pinyin of the target sensitive word. The character splitting expansion rule refers to expanding the target sensitive word using the radical of the target sensitive word. The simplified and traditional Chinese expansion rule refers to converting the text in the target sensitive word into simplified and traditional Chinese to achieve expansion of the target sensitive word. The Martian script expansion rule refers to converting the text in the target sensitive word into Martian script to achieve expansion of the target sensitive word. The multilingual expansion rule refers to converting the target sensitive word into multiple languages to achieve expansion of the target sensitive word. The synonym expansion rule refers to expanding the target sensitive word using different synonym source types. The target sensitive word expansion rule refers to any one or more expansion rules selected by the user from the above-mentioned preset sensitive word expansion rules.
[0081] Regarding the above step S102, in a specific implementation, in response to the user's selection operation on the preset sensitive word expansion rule, at least one preset sensitive word expansion rule selected by the user is determined as at least one target sensitive word expansion rule.
[0082] S103 : For each target sensitive word expansion rule, perform sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word.
[0083] It should be noted that the candidate extended sensitive words refer to the words obtained by extending the target sensitive words according to the target sensitive word extension rules and having an associated relationship with the target sensitive words. The candidate extended sensitive word set refers to the set containing multiple candidate extended sensitive words obtained by extending the target sensitive words. Here, the candidate extended sensitive word set includes at least one candidate extended sensitive word having an associated relationship with the target sensitive word.
[0084] Regarding the above step S103, in specific implementation, after determining at least one target sensitive word extension rule in step S102, for each target sensitive word extension rule, based on this target sensitive word extension rule, perform sensitive word extension on each target sensitive word input by the user to obtain a candidate extended sensitive word set having an associated relationship with each target sensitive word. The candidate extended sensitive word set includes at least one candidate extended sensitive word having an associated relationship with the target sensitive word.
[0085] As an optional implementation manner, when the target sensitive word extension rule is the first letter extension rule, the performing sensitive word extension on each target sensitive word based on this target sensitive word extension rule to obtain a candidate extended sensitive word set having an associated relationship with each target sensitive word includes:
[0086] For each target sensitive word, determine the first letter in the pinyin letters of each character in this target sensitive word.
[0087] It should be noted that each character in the target sensitive word refers to each Chinese character included in the target sensitive word. For example, when the target sensitive word is "customer", each character in this target sensitive word is "gu" and "ke". The pinyin letters refer to the pinyin corresponding to each character in this target sensitive word. For example, when the character is "gu", the pinyin letters are "gu", and when the character is "ke", the pinyin letters are "ke". The first letter in the pinyin letters is the first letter in the pinyin corresponding to each character. For example, when the character is "gu", the first letter in the pinyin letters is "g", and when the character is "ke", the first letter in the pinyin letters is "k".
[0088] Regarding the above steps, in specific implementation, for each target sensitive word input by the user, determine the first letter in the pinyin letters of each character in this target sensitive word.
[0089] Based on the first letter in the pinyin letters of each character in this target sensitive word, determine at least one candidate extended sensitive word having an associated relationship with this target sensitive word in the preset vocabulary library.
[0090] Summarize the at least one candidate extended sensitive word to determine a candidate extended sensitive word set having an associated relationship with this target sensitive word.
[0091] It should be noted that the preset vocabulary library refers to a database used to store preset vocabulary, and preset vocabulary refers to vocabulary that exists in existing dictionaries. In the initial letter expansion rule, the first phonetic letter of each character in the candidate expanded sensitive word is the same as the first phonetic letter of each character in the target sensitive word.
[0092] For the above two steps, in the specific implementation, based on the first letter of the pinyin of each character in the target sensitive word, at least one candidate extended sensitive word with an associated relationship with the target sensitive word is determined in the preset vocabulary library. For example, continuing with the previous embodiment, when the target sensitive word is "customer", the first letter of the pinyin of each character in the target sensitive word is "gk", then at least one candidate extended sensitive word is obtained in the preset vocabulary library based on the first letter of the pinyin, so that the first letter of the pinyin of each character in the candidate extended sensitive word is the same as the first letter of the pinyin of each character in the target sensitive word, such as candidate extended sensitive words such as "public", "control", and "watch". After at least one candidate extended sensitive word is determined, the at least one determined candidate extended sensitive word is summarized to obtain a set of candidate extended sensitive words with an associated relationship with the target sensitive word.
[0093] As an optional implementation, when the target sensitive word expansion rule is the pinyin expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0094] For each target sensitive word, determine the pinyin letters of each character in the target sensitive word.
[0095] Regarding the above steps, in specific implementation, continuing with the previous embodiment, when the target sensitive word is "customer", the pinyin letters of each character in the target sensitive word are "guke".
[0096] Based on the pinyin letters of each character in the target sensitive word, at least one candidate expanded sensitive word associated with the target sensitive word is determined in the preset vocabulary library.
[0097] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0098] It should be noted that, in the pinyin expansion rule, the pinyin letters of each character in the candidate expanded sensitive word are the same as the pinyin letters of each character in the target sensitive word.
[0099] For the above two steps, in the specific implementation, based on the pinyin letters of each character in the target sensitive word, at least one candidate extended sensitive word associated with the target sensitive word is determined in the preset vocabulary library. For example, continuing with the previous embodiment, when the target sensitive word is "customer", the pinyin letters of each character in the target sensitive word are "guke", then at least one candidate extended sensitive word is obtained in the preset vocabulary library based on the pinyin letters, so that the pinyin letters of each character in the candidate extended sensitive word are the same as the pinyin letters of each character in the target sensitive word, such as candidate extended sensitive words such as "orthopedics", "husk", and "coca". After at least one candidate extended sensitive word is determined, the at least one determined candidate extended sensitive word is summarized to obtain a set of candidate extended sensitive words associated with the target sensitive word.
[0100] As an optional implementation, when the target sensitive word expansion rule is the character splitting expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0101] For each character in each target sensitive word, determine whether the character is a Chinese character with a radical.
[0102] If so, split the character into its radicals to obtain the corresponding split characters.
[0103] The character in the target sensitive word is replaced with the split character corresponding to the character, and a candidate extended sensitive word and a candidate extended sensitive word set associated with the target sensitive word are determined.
[0104] It should be noted that radical splitting refers to breaking a character into its components based on the radicals it carries. The corresponding split character is the character resulting from the radical splitting. In the character splitting expansion rule, a candidate expanded sensitive word is the expanded word resulting from the radical splitting of the target sensitive word. It is composed of the radicals and radicals of each character in the target sensitive word.
[0105] In the specific implementation of the above three steps, for each character in each target sensitive word, we first determine whether the character is a Chinese character with a radical. Then, we split each character in the target sensitive word into its radicals to obtain the corresponding split characters. The split characters are then used to replace the characters in the target sensitive word. Based on the determined candidate expanded sensitive words, we determine a set of candidate expanded sensitive words, which includes the candidate expanded sensitive words.
[0106] As an optional implementation, when the target sensitive word expansion rule is the simplified and traditional Chinese expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0107] For each character in each target sensitive word, if the character is in simplified Chinese, the character is converted into traditional Chinese to obtain the first target character.
[0108] If the text is in traditional Chinese, the text is converted into simplified Chinese to obtain the first target text.
[0109] Each first target word is combined to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word.
[0110] It should be noted that the first target character refers to the character obtained by converting each character in the target sensitive word into simplified Chinese and traditional Chinese. In the simplified Chinese and traditional Chinese expansion rule, the candidate expanded sensitive word is the word obtained by converting each character in the target sensitive word into simplified Chinese and traditional Chinese.
[0111] In the specific implementation of the above three steps, for each character in each target sensitive word, if the character is in simplified Chinese, the character is converted to traditional Chinese; if the character is in traditional Chinese, the character is converted to simplified Chinese, to obtain each first target character. Each first target character is combined to determine candidate expanded sensitive words associated with the target sensitive word. A candidate expanded sensitive word set is then determined based on the determined candidate expanded sensitive words.
[0112] As an optional implementation, when the target sensitive word expansion rule is the Martian language expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0113] For each character in each target sensitive word, convert the character into Martian language to obtain a second target character;
[0114] Each second target word is combined to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word.
[0115] It should be noted that the second target text refers to the text obtained by converting each text in the target sensitive word into Martian text. In the Martian text expansion rule, the candidate expanded sensitive word is the word obtained by converting each text in the target sensitive word into Martian text.
[0116] For the above two steps, in specific implementation, for each character in each target sensitive word, convert this character into Martian text to obtain a second target word. For example, when the target sensitive word is "JD.com", convert each character in this target sensitive word into Martian text to obtain the converted target words "倞" and "崬". Then combine each second target word to obtain a candidate extended sensitive word "倞崬" that has an associated relationship with this target sensitive word. And determine a candidate extended sensitive word set according to the determined candidate extended sensitive words. The candidate extended sensitive word set includes the candidate extended sensitive word "倞崬".
[0117] As an optional implementation manner, when the target sensitive word extension rule is the multilingual extension rule, performing sensitive word extension on each target sensitive word based on this target sensitive word extension rule to obtain at least one candidate extended sensitive word set that has an associated relationship with each target sensitive word includes:
[0118] For each target sensitive word, perform conversion on this target sensitive word based on at least one preset language type to obtain at least one multilingual sensitive word corresponding to this target sensitive word.
[0119] In response to the user's selection operation for at least one preset language type, determine at least one target language type, and determine the multilingual sensitive words under at least one target language type as at least one candidate extended sensitive word that has an associated relationship with this target sensitive word.
[0120] Summarize the at least one candidate extended sensitive word to determine a candidate extended sensitive word set that has an associated relationship with this target sensitive word.
[0121] It should be noted that the preset language type refers to a preset language type that can perform language conversion on the target sensitive word. According to the embodiments provided in the present application, for example, the preset language type may include English, Japanese, Korean, etc., and the present application does not make specific limitations thereto. The multilingual sensitive word refers to a word obtained by converting the target sensitive word according to the preset language type. The target language type refers to any one or more language types selected by the user from the preset language types. In the multilingual extension rule, the candidate extended sensitive word is a word obtained by converting the target sensitive word using the preset language type.
[0122] Regarding the above three steps, during specific implementation, for each target sensitive word, the target sensitive word is converted based on at least one preset language type to obtain at least one multilingual sensitive word corresponding to the target sensitive word. For example, when the target sensitive word is "customer" and the preset language type is English, the target sensitive word is converted to obtain the multilingual sensitive word "customer". In response to the user's selection of at least one preset language type, at least one target language type is determined, and the multilingual sensitive words under the at least one target language type are determined as at least one candidate extended sensitive word associated with the target sensitive word. For example, when the preset language types selected by the user are English and Japanese, the multilingual sensitive word "customer" in English and the multilingual sensitive words in Japanese are determined as at least one candidate extended sensitive word associated with the target sensitive word. The at least one candidate extended sensitive word is then aggregated to determine a set of candidate extended sensitive words associated with the target sensitive word.
[0123] As an optional implementation, when the target sensitive word expansion rule is the synonym expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes:
[0124] Gets at least one synonym source type.
[0125] For each target sensitive word, at least one synonymous sensitive word corresponding to the target sensitive word is determined using each synonym source type.
[0126] In response to a user's selection operation on at least one synonymous sensitive word, at least one target synonymous sensitive word is determined, and the at least one target synonymous sensitive word is determined as at least one candidate expanded sensitive word associated with the target sensitive word.
[0127] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0128] It should be noted that the synonym source type refers to the source of pre-set synonym sensitive words related to the target sensitive words. According to the embodiment provided in this application, the synonym source type may include the financial industry, insurance industry, learning vocabulary, etc., and this application does not make specific limitations on this. Synonymous sensitive words refer to sensitive words obtained by expanding the target sensitive words using the synonym source type. For example, when the target sensitive word is "guaranteed principal" and the synonym source type is the financial industry, the at least one synonym sensitive word corresponding to the target sensitive word may be "guaranteed income", "guaranteed profit without loss" and "100% safety of principal and interest" and so on; when the synonym source type is learning vocabulary, the at least one synonym sensitive word corresponding to the target sensitive word may be "absolute guaranteed income" and so on. The target synonym sensitive word refers to any one or more sensitive words among the synonym sensitive words selected by the user.
[0129] During the specific implementation of the above four steps, at least one preset synonym source type is obtained. For each target sensitive word input by the user, at least one synonym sensitive word corresponding to the target sensitive word is determined using each synonym source type. In response to the user selecting at least one synonym sensitive word, at least one target synonym sensitive word is determined, and the at least one target synonym sensitive word selected by the user is determined as at least one candidate expanded sensitive word associated with the target sensitive word. The at least one candidate expanded sensitive word is aggregated to obtain a set of candidate expanded sensitive words associated with the target sensitive word.
[0130] S104 : For each target sensitive word, in response to the user's selection operation of at least one candidate expanded sensitive word set associated with the target sensitive word, obtain at least one target expanded sensitive word set corresponding to the target sensitive word.
[0131] It should be noted that the target expanded sensitive word set refers to any one or more candidate expanded sensitive word sets selected by the user from at least one candidate expanded sensitive word set.
[0132] Regarding the above step S104, in specific implementation, for each target sensitive word, in response to the user's selection operation of at least one candidate extended sensitive word set associated with the target sensitive word, at least one target extended sensitive word set corresponding to the target sensitive word is determined.
[0133] S105 : Generate a sensitive word detection rule corresponding to the sensitive word detection requirement based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word.
[0134] It should be noted that the target extended sensitive word refers to each extended sensitive word in the target extended sensitive word set. The sensitive word detection rule refers to the final detection rule generated to detect whether the conversation text contains sensitive words.
[0135] Regarding step S105 above, in a specific implementation, after determining at least one target extended sensitive word set corresponding to each target sensitive word, each sensitive word input by the user and each target extended sensitive word in the at least one target extended sensitive word set corresponding to each target sensitive word are used to generate a sensitive word detection rule corresponding to the sensitive word detection requirement. Specifically, how to use sensitive words to generate corresponding sensitive word detection rules is described in detail in the prior art and will not be further elaborated here.
[0136] As an optional implementation manner, after generating the sensitive word detection rule corresponding to the sensitive word detection requirement, the generation method further includes:
[0137] A: Determine the number of sensitive words of the target expanded sensitive word existing in the sensitive word detection rule.
[0138] B: Determine whether the number of sensitive words is greater than a preset number of sensitive words.
[0139] C: If yes, split the sensitive word detection rule based on the number of sensitive words and the specified number of sensitive words to obtain multiple sensitive word detection sub-rules corresponding to the sensitive word detection rule.
[0140] D: Displaying the multiple sensitive word detection sub-rules and the rule names on the user interface in a subordinate relationship.
[0141] It should be noted that the number of sensitive words refers to the number of target extended sensitive words present in the generated sensitive word detection rules. The specified number of sensitive words refers to the maximum number of target extended sensitive words that can be carried in each sensitive word detection rule, which is predetermined. For example, the specified number of sensitive words can be set to 10, and this application does not make specific restrictions on this. Sensitive word detection sub-rules refer to the sub-rules obtained after splitting the sensitive word detection rules. The user interface refers to the interface where the user displays the sensitive word detection rules and rule names.
[0142] With respect to the above steps A to D, during specific implementation, after the sensitive word detection rule is generated, the number of sensitive words of the target extended sensitive words present in the sensitive word detection rule is determined. And it is judged whether the number of sensitive words is greater than the preset number of sensitive words. If so, the above step C is executed, and the sensitive word detection rule is split based on the number of sensitive words and the preset number of sensitive words to obtain a plurality of sensitive word detection sub-rules corresponding to the sensitive word detection rule. For example, when the number of sensitive words of the target extended sensitive words present in the sensitive word detection rule is 16, the preset number of sensitive words is 10. At this time, the generated sensitive word detection rule needs to be split so that the number of sensitive words in each sensitive word detection sub-rule obtained is less than or equal to the preset number of sensitive words. Specifically, the sensitive word detection rule can be split into two sensitive word detection sub-rules, each of which contains 8 sensitive words. Alternatively, the sensitive word detection rule can be split into two sensitive word detection sub-rules, with the first sensitive word detection sub-rule containing 10 sensitive words and the second sensitive word detection sub-rule containing 6 sensitive words. The specific splitting method is not specifically limited in this application. Multiple sensitive word detection sub-rules and rule names are then displayed on the user interface in a subordinate relationship, so that the user can view each sensitive word detection sub-rule according to the rule name.
[0143] As an optional implementation method, the method for generating sensitive word detection rules provided in this application also includes: determining whether the total number of sensitive words in multiple sensitive word detection sub-rules is greater than the interface limit for enterprise WeChat sensitive word management. If so, a prompt message needs to be displayed on the user interface to remind the user that the current number of sensitive words is too large.
[0144] If an editing operation is received from the user on any sensitive word detection rule or sensitive word detection sub-rule, all target extended sensitive words contained in the sensitive word detection rule or sensitive word detection sub-rule selected by the user will be displayed in the user interface, so that the user can modify or delete any target extended sensitive word.
[0145] As an optional implementation manner, after generating the sensitive word detection rule corresponding to the sensitive word detection requirement, the generation method further includes:
[0146] a: Get at least one preset department name and at least one employee name in each department.
[0147] b: In response to the user's selection operation of at least one department name and / or at least one employee name, at least one target department and / or at least one target employee is determined.
[0148] c: Determine each employee in at least one target department and / or at least one target employee as an applicable person for the sensitive word detection rule, and use the sensitive word detection rule to perform sensitive word detection on the conversation text of the applicable person.
[0149] It should be noted that the target department refers to any one or more departments in the enterprise selected by the user. The target employee refers to any one or more employees in the enterprise selected by the user. The applicable personnel refers to the personnel who need to be detected using the generated sensitive word detection rules. The conversation text refers to the conversation text generated by the applicable personnel when communicating using the terminal. Here, the conversation text can be a text communication conversation text or a voice communication conversation text, which is not specifically limited in this application.
[0150] With respect to steps a through c above, obtain at least one preset department name and at least one employee name within each department. In response to a user selecting the at least one department name and / or at least one employee name, determine at least one target department and / or at least one target employee selected by the user. Each employee within the at least one target department and / or at least one target employee is identified as an applicable person to the sensitive word detection rule, and sensitive word detection is performed on the conversation text of the applicable person using the sensitive word detection rule.
[0151] As an optional implementation, after generating the sensitive word detection rules corresponding to the sensitive word detection requirements, the generation method further includes: configuring a corresponding reminder method for the sensitive word detection requirements. According to the embodiment provided in this application, the reminder method may include sending an alarm prompt to the applicable person, and sending an alarm prompt to the applicable person and intercepting the conversation text sent by the applicable person that complies with the sensitive word detection rules. As an example, after the applicable person of the sensitive word detection rule is determined, when it is detected that the applicable person has sent a conversation text, the sensitive word detection rule is used to detect the conversation text sent by the applicable person. If it is detected that the conversation text contains any target sensitive word or target extended sensitive word in the sensitive word detection rule, the applicable person is prompted according to the preset reminder method.
[0152] The method for generating sensitive word detection rules provided in an embodiment of the present application first obtains at least one target sensitive word for characterizing a sensitive word detection requirement; then, in response to a user's selection operation for a preset sensitive word expansion rule, determines at least one target sensitive word expansion rule; for each target sensitive word expansion rule, performs sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a candidate expanded sensitive word set associated with each target sensitive word; for each target sensitive word, in response to the user's selection operation for at least one candidate expanded sensitive word set associated with the target sensitive word, obtains at least one target expanded sensitive word set corresponding to the target sensitive word; finally, based on each target sensitive word and each target expanded sensitive word in the at least one target expanded sensitive word set corresponding to each target sensitive word, generates a sensitive word detection rule corresponding to the sensitive word detection requirement.
[0153] Compared with the detection rule generation method in the prior art, the present application expands the target sensitive word input by the user through the target sensitive word expansion rule selected by the user, obtains the target expanded sensitive word set corresponding to each target sensitive word, and uses each target sensitive word and each target expanded sensitive word in each target expanded sensitive word set to generate a sensitive word detection rule, thereby improving the comprehensiveness of the sensitive words in the generated sensitive word detection rule and solving the problem of incompleteness of sensitive words in the sensitive word detection rule created in the prior art.
[0154] See also Figure 2 、 Figure 3 , Figure 2 This is a schematic diagram of the structure of a device for generating sensitive word detection rules provided in an embodiment of the present application. Figure 3 This is a schematic diagram of the structure of another device for generating sensitive word detection rules provided in an embodiment of the present application. Figure 2 As shown in , the generating device 200 includes:
[0155] An acquisition module 201 is configured to acquire at least one target sensitive word for representing a sensitive word detection requirement;
[0156] Target sensitive word expansion rule determination module 202, configured to determine at least one target sensitive word expansion rule in response to a user selecting a preset sensitive word expansion rule; wherein the preset sensitive word expansion rules include initial letter expansion rule, pinyin expansion rule, character splitting expansion rule, simplified and traditional Chinese expansion rule, Martian script expansion rule, multilingual expansion rule, and synonym expansion rule;
[0157] The candidate expanded sensitive word set determination module 203 is configured to perform sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a candidate expanded sensitive word set associated with each target sensitive word; wherein the candidate expanded sensitive word set includes at least one candidate expanded sensitive word associated with the target sensitive word;
[0158] a target expanded sensitive word set determination module 204 configured to, for each target sensitive word, obtain, in response to the user's selection of at least one candidate expanded sensitive word set associated with the target sensitive word, at least one target expanded sensitive word set corresponding to the target sensitive word;
[0159] The sensitive word detection rule generation module 205 is configured to generate a sensitive word detection rule corresponding to the sensitive word detection requirement based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word.
[0160] Furthermore, when the target sensitive word expansion rule is the initial letter expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0161] For each target sensitive word, determine the first letter of the pinyin of each character in the target sensitive word;
[0162] Based on the first letter of the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in a preset vocabulary; wherein the first letter of the phonetic alphabet of each character in the candidate extended sensitive word is the same as the first letter of the phonetic alphabet of each character in the target sensitive word;
[0163] Summarizing the at least one candidate expanded sensitive word to determine a set of candidate expanded sensitive words associated with the target sensitive word;
[0164] When the target sensitive word expansion rule is the pinyin expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0165] For each target sensitive word, determine the pinyin letters of each character in the target sensitive word;
[0166] Based on the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in the preset vocabulary library; wherein the phonetic alphabet of each character in the candidate extended sensitive word is the same as the phonetic alphabet of each character in the target sensitive word;
[0167] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0168] Furthermore, when the target sensitive word expansion rule is the character splitting expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0169] For each character in each target sensitive word, determine whether the character is a Chinese character with a radical;
[0170] If so, split the character into its radicals to obtain the corresponding split characters;
[0171] Using the split character corresponding to the character to replace the character in the target sensitive word, and determining candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0172] When the target sensitive word expansion rule is the simplified and traditional Chinese expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0173] For each character in each target sensitive word, if the character is in simplified Chinese, convert the character into traditional Chinese to obtain the first target character;
[0174] If the text is in traditional Chinese, convert the text into simplified Chinese to obtain the first target text;
[0175] Combine each first target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0176] When the target sensitive word expansion rule is the Martian language expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0177] For each character in each target sensitive word, convert the character into Martian language to obtain a second target character;
[0178] Combine each second target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word;
[0179] When the target sensitive word expansion rule is the multilingual expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0180] For each target sensitive word, convert the target sensitive word based on at least one preset language type to obtain at least one multilingual sensitive word corresponding to the target sensitive word;
[0181] In response to the user selecting at least one preset language type, determining at least one target language type, and determining the multilingual sensitive word in the at least one target language type as at least one candidate expanded sensitive word associated with the target sensitive word;
[0182] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0183] Furthermore, when the target sensitive word expansion rule is the synonym expansion rule, the candidate expanded sensitive word set determination module 203 is further configured to:
[0184] Get at least one synonym source type;
[0185] For each target sensitive word, use each synonym source type to determine at least one synonymous sensitive word corresponding to the target sensitive word;
[0186] In response to a user selecting at least one synonymous sensitive word, determining at least one target synonymous sensitive word, and determining the at least one target synonymous sensitive word as at least one candidate expanded sensitive word associated with the target sensitive word;
[0187] The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
[0188] Further, such as Figure 3 As shown, the generating device 200 further includes a target detection rule name determining module 206, and the target detection rule name determining module 206 is used to:
[0189] Get the target detection rule name entered by the user.
[0190] Further, such as Figure 3 As shown, the generating device 200 further includes a sensitive word detection rule splitting module 207. After generating the sensitive word detection rule corresponding to the sensitive word detection requirement, the sensitive word detection rule splitting module 207 is used to:
[0191] Determining the number of sensitive words of the target extended sensitive word that exist in the sensitive word detection rule;
[0192] Determining whether the number of sensitive words is greater than a preset number of sensitive words;
[0193] If so, splitting the sensitive word detection rule based on the number of sensitive words and the specified number of sensitive words to obtain a plurality of sensitive word detection sub-rules corresponding to the sensitive word detection rule;
[0194] The multiple sensitive word detection sub-rules and the rule names are displayed on the user interface in a subordinate relationship.
[0195] Further, such as Figure 3 As shown, the generating device 200 further includes an applicable personnel determination module 208. After generating the sensitive word detection rules corresponding to the sensitive word detection requirements, the applicable personnel determination module 208 is configured to:
[0196] Get at least one preset department name and at least one employee name in each department;
[0197] In response to the user's selection operation of at least one department name and / or at least one employee name, determining at least one target department and / or at least one target employee;
[0198] Each employee in at least one target department and / or at least one target employee is determined as an applicable person for the sensitive word detection rule, so as to perform sensitive word detection on the conversation text of the applicable person using the sensitive word detection rule.
[0199] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in FIG, the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0200] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of the method for generating sensitive word detection rules in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0201] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for generating sensitive word detection rules in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0202] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0204] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0205] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0206] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0207] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0208] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for generating sensitive word detection rules, characterized in that: The generation method comprises: Obtaining at least one target sensitive word for representing a sensitive word detection requirement; In response to a user selecting a preset sensitive word expansion rule, determining at least one target sensitive word expansion rule; wherein the preset sensitive word expansion rules include an initial letter expansion rule, a pinyin expansion rule, a character splitting expansion rule, a simplified and traditional Chinese expansion rule, a Martian script expansion rule, a multilingual expansion rule, and a synonym expansion rule; For each target sensitive word expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word; wherein the set of candidate expanded sensitive words includes at least one candidate expanded sensitive word associated with the target sensitive word; For each target sensitive word, in response to the user's selection operation of at least one candidate extended sensitive word set associated with the target sensitive word, obtaining at least one target extended sensitive word set corresponding to the target sensitive word; Based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word, a sensitive word detection rule corresponding to the sensitive word detection requirement is generated.
2. The generation method according to claim 1, characterized in that When the target sensitive word expansion rule is the initial letter expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: For each target sensitive word, determine the first letter of the pinyin of each character in the target sensitive word; Based on the first letter of the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in a preset vocabulary; wherein the first letter of the phonetic alphabet of each character in the candidate extended sensitive word is the same as the first letter of the phonetic alphabet of each character in the target sensitive word; Summarizing the at least one candidate expanded sensitive word to determine a set of candidate expanded sensitive words associated with the target sensitive word; When the target sensitive word expansion rule is the pinyin expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: For each target sensitive word, determine the pinyin letters of each character in the target sensitive word; Based on the phonetic alphabet of each character in the target sensitive word, determining at least one candidate extended sensitive word associated with the target sensitive word in the preset vocabulary library; wherein the phonetic alphabet of each character in the candidate extended sensitive word is the same as the phonetic alphabet of each character in the target sensitive word; The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
3. The generation method according to claim 1, characterized in that When the target sensitive word expansion rule is the character splitting expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: For each character in each target sensitive word, determine whether the character is a Chinese character with a radical; If so, split the character into its radicals to obtain the corresponding split characters; Using the split character corresponding to the character to replace the character in the target sensitive word, and determining candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word; When the target sensitive word expansion rule is the simplified and traditional Chinese expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: For each character in each target sensitive word, if the character is in simplified Chinese, convert the character into traditional Chinese to obtain the first target character; If the text is in traditional Chinese, convert the text into simplified Chinese to obtain the first target text; Combine each first target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word; When the target sensitive word expansion rule is the Martian language expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: For each character in each target sensitive word, convert the character into Martian language to obtain a second target character; Combine each second target word to determine candidate expanded sensitive words and a candidate expanded sensitive word set associated with the target sensitive word; When the target sensitive word expansion rule is the multilingual expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain at least one candidate expanded sensitive word set associated with each target sensitive word includes: For each target sensitive word, convert the target sensitive word based on at least one preset language type to obtain at least one multilingual sensitive word corresponding to the target sensitive word; In response to the user selecting at least one preset language type, determining at least one target language type, and determining the multilingual sensitive word in the at least one target language type as at least one candidate expanded sensitive word associated with the target sensitive word; The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
4. The generation method according to claim 1, characterized in that When the target sensitive word expansion rule is the synonym expansion rule, performing sensitive word expansion on each target sensitive word based on the target sensitive word expansion rule to obtain a set of candidate expanded sensitive words associated with each target sensitive word includes: Get at least one synonym source type; For each target sensitive word, use each synonym source type to determine at least one synonymous sensitive word corresponding to the target sensitive word; In response to a user selecting at least one synonymous sensitive word, determining at least one target synonymous sensitive word, and determining the at least one target synonymous sensitive word as at least one candidate expanded sensitive word associated with the target sensitive word; The at least one candidate expanded sensitive word is aggregated to determine a set of candidate expanded sensitive words associated with the target sensitive word.
5. The generation method according to claim 1, characterized in that Before obtaining at least one target sensitive word for representing a sensitive word detection requirement, the generating method further includes: Get the target detection rule name entered by the user.
6. The generation method according to claim 5, characterized in that After generating the sensitive word detection rules corresponding to the sensitive word detection requirements, the generating method further includes: Determining the number of sensitive words of the target extended sensitive word that exist in the sensitive word detection rule; Determining whether the number of sensitive words is greater than a preset number of sensitive words; If so, splitting the sensitive word detection rule based on the number of sensitive words and the specified number of sensitive words to obtain a plurality of sensitive word detection sub-rules corresponding to the sensitive word detection rule; The multiple sensitive word detection sub-rules and the rule names are displayed on the user interface in a subordinate relationship.
7. The generation method according to claim 1, characterized in that After generating the sensitive word detection rules corresponding to the sensitive word detection requirements, the generating method further includes: Get at least one preset department name and at least one employee name in each department; In response to the user's selection operation of at least one department name and / or at least one employee name, determining at least one target department and / or at least one target employee; Each employee in at least one target department and / or at least one target employee is determined as an applicable person for the sensitive word detection rule, so as to perform sensitive word detection on the conversation text of the applicable person using the sensitive word detection rule.
8. A device for generating sensitive word detection rules, characterized in that: The generating device comprises: An acquisition module, configured to acquire at least one target sensitive word for representing a sensitive word detection requirement; a target sensitive word expansion rule determination module, configured to determine at least one target sensitive word expansion rule in response to a user selecting a preset sensitive word expansion rule; wherein the preset sensitive word expansion rules include an initial letter expansion rule, a pinyin expansion rule, a character splitting expansion rule, a simplified and traditional Chinese expansion rule, a Martian script expansion rule, a multilingual expansion rule, and a synonym expansion rule; a candidate expanded sensitive word set determination module, configured to perform sensitive word expansion on each target sensitive word based on each target sensitive word expansion rule to obtain a candidate expanded sensitive word set associated with each target sensitive word; wherein the candidate expanded sensitive word set includes at least one candidate expanded sensitive word associated with the target sensitive word; a target extended sensitive word set determination module, configured to, for each target sensitive word, obtain, in response to the user's selection operation of at least one candidate extended sensitive word set associated with the target sensitive word, at least one target extended sensitive word set corresponding to the target sensitive word; The sensitive word detection rule generation module is used to generate a sensitive word detection rule corresponding to the sensitive word detection requirement based on each target sensitive word and each target extended sensitive word in at least one target extended sensitive word set corresponding to each target sensitive word.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus. When the processor is running, the machine-readable instructions execute the steps of the method for generating sensitive word detection rules as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for generating sensitive word detection rules according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Natural language text generation device and computer program
JP2012079161A
Sensitive word recognition method and apparatus based on artificial intelligence, and computer device
WO2021151333A1