Sensitive word filtering method, device, storage medium and electronic device

Through the combination of the dictionary tree model and the sensitive word classification model, the problem of low accuracy of sensitive word filtering in the existing technology is solved, accurate filtering and dynamic library adaptation of sensitive words in text data are achieved, and filtering efficiency is improved.

CN114266247BActive Publication Date: 2024-10-01AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111562611.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2024-10-01
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

The existing technology has low accuracy in filtering sensitive words, and it is difficult to effectively identify and filter sensitive words in text.

Method used

Using the dictionary tree model combined with the pre-trained sensitive word classification model, the target sensitive words are found and filtered by matching the text data with the dictionary tree model, and the Bert model and classifier are used to improve the accuracy of sensitive word classification.

Benefits of technology

It achieves accurate filtering of sensitive words in text data, improves the accuracy and efficiency of filtering, and adapts to dynamically changing sensitive lexicon.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114266247B_ABST
    Figure CN114266247B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to artificial intelligence, and provides a sensitive word filtering method, device, storage medium and electronic device, the method comprising: obtaining text data to be processed; determining the sensitive word category contained in the text data; inputting the text data into a dictionary tree model corresponding to the sensitive word category, searching the text data for target sensitive words matching the dictionary tree model; filtering the target sensitive words in the text data. The scheme of the embodiment of the present invention can accurately and effectively filter the sensitive words in the text data to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to a sensitive word filtering method, device, storage medium and electronic device. Background Art

[0002] In recent years, with the rapid development of the Internet and artificial intelligence technology, the speed and scale of information generation, dissemination and collection have reached unprecedented levels. In these processes, sensitive words will inevitably appear and need to be filtered out. In related technologies, sensitive words in the text to be detected are mainly matched, searched and replaced based on the sensitive word library, but this method has low accuracy, and how to accurately filter sensitive words becomes crucial. Summary of the invention

[0003] The embodiments of the present invention provide a sensitive word filtering method, device, storage medium and electronic device, which can accurately filter sensitive words in text data.

[0004] In a first aspect, an embodiment of the present invention provides a sensitive word filtering method, comprising:

[0005] Get the text data to be processed;

[0006] Determining the category of sensitive words contained in the text data;

[0007] Inputting the text data into a dictionary tree model corresponding to the sensitive word category, and searching the text data for a target sensitive word that matches the dictionary tree model;

[0008] Filter target sensitive words in the text data.

[0009] In a second aspect, an embodiment of the present invention further provides a sensitive word filtering device, including:

[0010] A text data acquisition module, used to acquire text data to be processed;

[0011] A sensitive word category determination module, used to determine the sensitive word category contained in the text data;

[0012] A sensitive word search module, used for inputting the text data into a dictionary tree model corresponding to the sensitive word category, and searching the text data for a target sensitive word that matches the dictionary tree model;

[0013] The sensitive word filtering module is used to filter target sensitive words in the text data.

[0014] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a sensitive word filtering method as provided in an embodiment of the present invention.

[0015] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a sensitive word filtering method as provided in an embodiment of the present invention is implemented.

[0016] The sensitive word filtering solution provided by the embodiment of the present invention obtains text data to be processed; determines the category of sensitive words contained in the text data; inputs the text data into a dictionary tree model corresponding to the sensitive word category, searches for target sensitive words matching the dictionary tree model in the text data; and filters the target sensitive words in the text data. Through the technical solution provided by the embodiment of the present invention, sensitive words in the text data to be processed can be filtered accurately and effectively. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a sensitive word filtering method provided by an embodiment of the present invention;

[0018] Figure 2 is a structural diagram of a sensitive word classification model provided by an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of a dictionary tree model provided by an embodiment of the present invention;

[0020] Figure 4 is a schematic diagram of a sensitive word filtering system provided by an embodiment of the present invention;

[0021] Figure 5 is a structural schematic diagram of a sensitive word filtering device in another embodiment of the present invention;

[0022] Figure 6 It is a structural schematic diagram of an electronic device in another embodiment of the present invention. DETAILED DESCRIPTION

[0023] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0024] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0025] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0027] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0028] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0029] Figure 1 This is a flow chart of a sensitive word filtering method provided by an embodiment of the present invention. The embodiment of the present invention is applicable to the case of filtering sensitive words. The method can be executed by a sensitive word filtering device, which can be composed of hardware and / or software and can generally be integrated in an electronic device. Figure 1 As shown, the method specifically comprises the following steps:

[0030] Step 110: Obtain text data to be processed.

[0031] The text data to be processed may be a target sentence to be filtered for sensitive words. The text data may include one or more characters. It should be noted that the embodiment of the present invention does not limit the length of the text data.

[0032] In an embodiment of the present invention, when a sensitive word filtering request is detected, text data to be processed is obtained according to the sensitive word filtering request. Exemplarily, the sentences input by the user can be used as the text data to be processed, the sentences transmitted by other electronic devices can be used as the text data to be processed, and the sentences to be published on the network by the user can be used as the text data to be processed. It should be noted that the embodiment of the present invention does not limit the method of obtaining the text data to be processed.

[0033] Optionally, the text data is the text data published when generating the growth profile. The growth profile can be understood as the dynamic data published during the user's growth process. The advantage of this setting is that sensitive words can be filtered in scenarios where users frequently use network terms such as publishing growth profiles or comments.

[0034] Step 120: Determine the category of sensitive words contained in the text data.

[0035] In an embodiment of the present invention, the text data to be processed may contain sensitive words or may not contain sensitive words. When the text data to be processed contains sensitive words, it may contain sensitive words of the same type or different types. In an embodiment of the present invention, the category of sensitive words contained in the text data is determined. It should be noted that the embodiment of the present invention does not limit the category of sensitive words.

[0036] Exemplarily, the sensitive word type contained in the text data can be determined based on the sensitive word type identifier input by the user, and the sensitive word type that may be contained in the text data can also be determined based on the context information of the text data. Optionally, determining the sensitive word category contained in the text data includes: inputting the text data into a pre-trained sensitive word classification model, and determining the sensitive word category contained in the text data based on the output result of the sensitive word classification model. It should be noted that the embodiment of the present invention does not limit the method for determining the sensitive word category in the text data.

[0037] Among them, the sensitive word classification model is a machine learning model that can quickly determine the sensitive word categories contained in the text data to be processed. Exemplarily, the text data is input into a pre-trained sensitive word classification model, and the sensitive word classification model can output the scores of each category corresponding to the sensitive words contained in the text data, and use the sensitive word category corresponding to the maximum score as the sensitive word category contained in the text data. In an embodiment of the present invention, the method for obtaining the sensitive word classification model may include: obtaining a sample text data set, wherein the sample text data set contains at least two sample text data, each sample text data contains sensitive words of different categories, and the sample text data is marked based on the sensitive word category contained in each sample text data to generate a training text data set; based on the training text data set, a preset machine learning model is trained to generate a sensitive word classification model.

[0038] Optionally, the sensitive word classification model includes a Bert model and a classifier, and the output end of the Bert model is connected to the input end of the classifier. The advantage of this setting is that the Bert model can be combined with context information to generate word vectors, which can effectively utilize context information, enrich the semantics of words, and reflect the complexity of words, thereby improving the accuracy of sensitive word classification model in classifying sensitive words.

[0039] For example, Figure 2 A structural diagram of a sensitive word classification model provided by an embodiment of the present invention. Figure 2 As shown, the classifier is a softmax function with multi-classification capabilities, and the output of the Bert model is input into the softmax function. The Bert model adopts a bidirectional transformer structure. The Transformer is essentially an encoder-decoder structure. A self-attention mechanism is added between each encoder and decoder. The context information is recorded by calculating the input and output weights, which solves the information loss problem caused by the long-term dependency of LSTM. In the attention mechanism, each word has three different vector representations, namely the Query vector (Q), the Key vector (K), and the Value vector (V). The attention mechanism is shown in the following formula:

[0040] Among them, Bert is a multi-task model. The pre-trained model is obtained by training two self-supervised tasks, Masked Language Model (MLM) and NextSentence Prediction (NSP). The MLM task is to predict missing words through context, and the NSP task is to determine whether two sentences are in a contextual relationship. Through these two tasks, a word vector model containing semantic relationship and context information can be trained. The input encoding vector of the Bert model is three word embedding feature vectors, namely character vector, segmentation vector and position vector, which contain the basic character information, context information and position information of a word. Based on the idea of ​​transfer learning, after the Bert model is trained on a specific task set, the pre-trained word vector model can be used as input migration to the sensitive word text classification task to reduce the training time of the neural network. According to the output information of the Bert model, fine-tuning of specific text tasks can be completed, that is, a classifier is added on the basis of the Bert model, and the prediction probability is output by the multi-classification softmax function to determine the type of text, so as to achieve the effect of sensitive word classification.

[0041] Step 130: input the text data into a dictionary tree model corresponding to the sensitive word category, and search the text data for a target sensitive word that matches the dictionary tree model.

[0042] The dictionary tree model is a dictionary tree constructed based on a set of similar sensitive words. In an embodiment of the present invention, the text data is matched with the dictionary tree model corresponding to the sensitive word category to determine whether a target sensitive word matching the sensitive word contained in the dictionary tree model can be found in the text data. If so, the target sensitive word is extracted from the text data. Otherwise, it means that the text data does not contain sensitive words of this category. The target sensitive word can be one or more, and the embodiment of the present invention does not limit the number of target sensitive words.

[0043] Optionally, before inputting the text data into the dictionary tree model corresponding to the sensitive word category, it also includes: obtaining sensitive word libraries of various types; for each type of sensitive word library, constructing a corresponding dictionary tree model based on the current type of sensitive word library; wherein the first character of each sensitive word in the current type of sensitive word library is used as the root node of the dictionary tree model, and the other characters of each sensitive word are used as leaf nodes of the dictionary tree model, wherein the other characters are the characters in each sensitive word except the first character; each character of each sensitive word in the current type of sensitive word library and the status information of each character constitute a key-value pair in the dictionary tree model, wherein the status information includes the beginning, middle and end of the word. The advantage of such a setting is that the dictionary tree model of each sensitive word category can be accurately constructed.

[0044] In an embodiment of the present invention, various types of sensitive word libraries are obtained, wherein a certain type of sensitive word library contains at least two sensitive words of this type. For each type of sensitive word library, the first character of each sensitive word in the current type of sensitive word library is used as the root node of the dictionary tree model, and the other characters of each sensitive word in the current type of sensitive word library are used as leaf nodes of the dictionary tree, wherein the other characters are the characters in the sensitive word except the first character. Each character of each sensitive word in the current type of sensitive word library is used as the key value in the dictionary tree model, and the status information of each character of each sensitive word is used as the value value in the dictionary tree model, wherein the status information includes the beginning, middle and end of the word, that is, the status information of each character is determined according to the position of each character in the sensitive word. The key value and the value value are used as a key-value pair in the dictionary tree model. Exemplarily, Figure 3 A schematic diagram of a dictionary tree model provided in an embodiment of the present invention.

[0045] In the process of matching text data with the dictionary tree model, the root node of the dictionary tree model is the node where the matching starts, and the leaf node whose status information is the end of the word is the node where the matching ends. In order from front to back, the characters in the text data are matched with the root nodes in the dictionary tree model in turn. When a character in the text data matches a root node in the dictionary tree model, the next character of the character is matched with the leaf node of the root node, until there is a character in the text data that matches the last leaf node of the root node (the leaf node whose status information is the end of the word), the word composed of the characters matching the root node and all nodes between the root node and the last leaf node (including the root node and the last leaf node) is used as the target sensitive word in the text data.

[0046] Step 140: Filter target sensitive words in the text data.

[0047] In an embodiment of the present invention, target sensitive words in text data are filtered out, and the filtered text data is published on the network.

[0048] The sensitive word filtering method provided by the embodiment of the present invention obtains text data to be processed; determines the sensitive word category contained in the text data; inputs the text data into a dictionary tree model corresponding to the sensitive word category, searches for target sensitive words matching the dictionary tree model in the text data; and filters the target sensitive words in the text data. Through the technical solution provided by the embodiment of the present invention, sensitive words in the text data to be processed can be filtered accurately and effectively.

[0049] In some embodiments, before inputting the text data into the dictionary tree model corresponding to the sensitive word category and searching the text data for the target sensitive word matching the dictionary tree model, it also includes: in response to the triggering of the update event of each type of sensitive word library, obtaining the updated sensitive word library of each type; for each type of sensitive word library, updating the corresponding dictionary tree model based on the updated sensitive word library of the current type; inputting the text data into the dictionary tree model corresponding to the sensitive word category and searching the text data for the target sensitive word matching the dictionary tree model, including: inputting the text data into the updated dictionary tree model corresponding to the sensitive word category, and determining the target sensitive word matching the updated dictionary tree model in the text data. The advantage of such a setting is that it can effectively improve the accuracy of sensitive word filtering.

[0050] In an embodiment of the present invention, as time goes by, the sensitive words contained in the sensitive word library are constantly changing dynamically. Exemplarily, when the update operation of each type of sensitive word library is received, it is determined that the update event of the sensitive word library is triggered, wherein the update operation of the sensitive word library may include adding, deleting, modifying, and checking the sensitive word library, wherein adding can be understood as adding new sensitive words to the sensitive word library, deleting can be understood as deleting one or several original sensitive words in the sensitive word library, modifying can be understood as modifying the sensitive words in the sensitive word library, and checking can be understood as querying sensitive words in the sensitive word library. In response to the triggering of the update event of each type of sensitive word library, the updated sensitive word library of each type is obtained. Based on the updated sensitive word library, the corresponding dictionary tree model is updated, so that the text data is matched with the updated dictionary tree model corresponding to the sensitive word category to determine the target sensitive words contained in the text data.

[0051] In some embodiments, before determining the category of sensitive words contained in the text data, it also includes: performing preprocessing operations on the text data. Among them, data preprocessing refers to some processing of data before the main processing. Real data is generally incomplete, inconsistent and dirty data, and data mining cannot be performed directly, so data preprocessing technology is generated. Data preprocessing methods include: data cleaning, data integration, data transformation, etc. In an embodiment of the present invention, the text data to be processed may contain various network terms and unconventional terms. The data to be processed can be preprocessed (such as performing data cleaning and conversion and other related operations) to obtain standardized text data.

[0052] Figure 4 A schematic diagram of a sensitive word filtering system provided by an embodiment of the present invention is shown in FIG. Figure 4As shown, the sensitive word filtering system includes a data preprocessing module, a sensitive word classification model, a sensitive word filtering module, a message transmission module, an application end and a management end. Among them, the text data is input into the preprocessing module to perform preprocessing operations on the text data. The sensitive word classification module is used to determine the sensitive word category contained in the preprocessed text data. The sensitive word filtering module is a dictionary tree model corresponding to the sensitive word category, which is used to determine the target sensitive word contained in the text data and filter the target sensitive word. The message transmission module is used for message transmission between the application end and the management end. The message transmission module can adopt a message queue architecture, and the main components include: message producer, message consumer, message queue, and can use an asynchronous call architecture. The management end is the producer of the message. After publishing the updated sensitive word library to the message queue, the application end consumes the sensitive word library message in the message queue, and then the application end constructs and updates the sensitive word filtering model (dictionary tree model). The publish-subscribe model of asynchronous architecture is used for message transmission. In the publish-subscribe model, messages can be used by multiple application systems. After the management system sends a message to the topic, each application system can clone the subscribed message to its own private queue, and there will be no competition for messages between applications. The advantage of this setting is that the sensitive word library can be maintained on the management side. While updating the sensitive word library, the sensitive word data information can be passed to the application side to build and update the dictionary tree model, and the dynamic sensitive word library can be built and applied.

[0053] Figure 5 This is a schematic diagram of a sensitive word filtering device provided by another embodiment of the present invention. Figure 5 As shown, the device includes: a text data acquisition module 510, a sensitive word category determination module 520, a sensitive word search module 530 and a sensitive word filtering module 540. Among them,

[0054] A text data acquisition module 510, used to acquire text data to be processed;

[0055] A sensitive word category determination module 520, used to determine the category of sensitive words contained in the text data;

[0056] A sensitive word search module 530 is used to input the text data into a dictionary tree model corresponding to the sensitive word category, and search the text data for a target sensitive word that matches the dictionary tree model;

[0057] The sensitive word filtering module 540 is used to filter target sensitive words in the text data.

[0058] The sensitive word filtering device provided by the embodiment of the present invention,

[0059] Acquire text data to be processed; determine the category of sensitive words contained in the text data; input the text data into a dictionary tree model corresponding to the sensitive word category, search for target sensitive words matching the dictionary tree model in the text data; filter the target sensitive words in the text data. Through the technical solution provided by the embodiment of the present invention, sensitive words in the text data to be processed can be filtered accurately and effectively.

[0060] Optionally, the device further comprises:

[0061] A sensitive word library acquisition module, used for acquiring sensitive word libraries of various types before inputting the text data into the dictionary tree model corresponding to the sensitive word category;

[0062] A dictionary tree model construction module is used to construct a corresponding dictionary tree model for each type of sensitive word library based on the current type of sensitive word library; wherein the first character of each sensitive word in the current type of sensitive word library is used as the root node of the dictionary tree model, and the other characters of each sensitive word are used as leaf nodes of the dictionary tree model, wherein the other characters are the characters in each sensitive word except the first character; each character of each sensitive word in the current type of sensitive word library and the status information of each character constitute a key-value pair in the dictionary tree model, wherein the status information includes the beginning, middle and end of the word.

[0063] Optionally, also include:

[0064] An updated sensitive word library acquisition module is used to input the text data into a dictionary tree model corresponding to the sensitive word category, and before searching the text data for a target sensitive word matching the dictionary tree model, in response to an update event of each type of sensitive word library being triggered, acquire each type of updated sensitive word library;

[0065] The dictionary tree model update module is used to update the corresponding dictionary tree model for each type of sensitive word library based on the updated sensitive word library of the current type;

[0066] The sensitive word search module is used to:

[0067] The text data is input into an updated dictionary tree model corresponding to the sensitive word category, and a target sensitive word matching the updated dictionary tree model is determined in the text data.

[0068] Optionally, the sensitive word category determination module is used to:

[0069] The text data is input into a pre-trained sensitive word classification model, and the sensitive word category contained in the text data is determined according to the output result of the sensitive word classification model.

[0070] Optionally, the sensitive word classification model includes a Bert model and a classifier, and the output end of the Bert model is connected to the input end of the classifier.

[0071] Optionally, the device further comprises:

[0072] The preprocessing module is used to perform a preprocessing operation on the text data before determining the category of sensitive words contained in the text data.

[0073] Optionally, the text data is text data published when generating a growth profile.

[0074] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.

[0075] An embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the sensitive word filtering method provided by the embodiment of the present invention.

[0076] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0077] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present invention are not limited to the sensitive word filtering operations described above, and can also execute related operations in the sensitive word filtering method provided in any embodiment of the present invention.

[0078] An embodiment of the present invention provides an electronic device, in which the sensitive word filtering device provided by the embodiment of the present invention can be integrated. Figure 6 The electronic device 600 may include a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor. When the processor 602 executes the computer program, the sensitive word filtering method described in the embodiment of the present invention is implemented.

[0079] The electronic device provided in the embodiment of the present invention obtains text data to be processed; determines the category of sensitive words contained in the text data; inputs the text data into a dictionary tree model corresponding to the sensitive word category, searches for target sensitive words matching the dictionary tree model in the text data; and filters the target sensitive words in the text data. The technical solution provided in the embodiment of the present invention can accurately and effectively filter the sensitive words in the text data to be processed.

[0080] The sensitive word filtering device, storage medium and electronic device provided in the above embodiments can execute the sensitive word filtering method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects of executing the method. For technical details not described in detail in the above embodiments, please refer to the sensitive word filtering method provided in any embodiment of the present invention.

[0081] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A sensitive word filtering method, characterized in that: include: Get the text data to be processed; Determining the category of sensitive words contained in the text data; Inputting the text data into a dictionary tree model corresponding to the sensitive word category, and searching the text data for a target sensitive word that matches the dictionary tree model; Filtering target sensitive words in the text data; Before inputting the text data into the dictionary tree model corresponding to the sensitive word category, the method further includes: Get sensitive word libraries of various types; For each type of sensitive word library, a corresponding dictionary tree model is constructed based on the current type of sensitive word library; wherein the first character of each sensitive word in the current type of sensitive word library is used as the root node of the dictionary tree model, and the other characters of each sensitive word are used as leaf nodes of the dictionary tree model, wherein the other characters are the characters in each sensitive word except the first character; each character of each sensitive word in the current type of sensitive word library and the status information of each character constitute a key-value pair in the dictionary tree model, wherein the status information includes the beginning, middle and end of the word.

2. The method according to claim 1, characterized in that Before inputting the text data into a dictionary tree model corresponding to the sensitive word category and searching the text data for a target sensitive word matching the dictionary tree model, the method further includes: In response to the triggering of an update event of each type of sensitive word library, obtaining each type of updated sensitive word library; For each type of sensitive word library, the corresponding dictionary tree model is updated based on the updated sensitive word library of the current type; Inputting the text data into a dictionary tree model corresponding to the sensitive word category, and searching the text data for a target sensitive word that matches the dictionary tree model, including: The text data is input into an updated dictionary tree model corresponding to the sensitive word category, and a target sensitive word matching the updated dictionary tree model is determined in the text data.

3. The method according to claim 1, characterized in that: Determining the category of sensitive words contained in the text data includes: The text data is input into a pre-trained sensitive word classification model, and the sensitive word category contained in the text data is determined according to the output result of the sensitive word classification model.

4. The method according to claim 3, characterized in that The sensitive word classification model includes a Bert model and a classifier, and the output end of the Bert model is connected to the input end of the classifier.

5. The method according to claim 1, characterized in that Before determining the category of sensitive words contained in the text data, the method further includes: A preprocessing operation is performed on the text data.

6. The method according to any one of claims 1 to 5, characterized in that: The text data is the text data published when generating the growth file.

7. A sensitive word filtering device, characterized in that: include: A text data acquisition module, used to acquire text data to be processed; A sensitive word category determination module, used to determine the sensitive word category contained in the text data; A sensitive word search module, used for inputting the text data into a dictionary tree model corresponding to the sensitive word category, and searching the text data for a target sensitive word that matches the dictionary tree model; A sensitive word filtering module, used to filter target sensitive words in the text data; A sensitive word library acquisition module, used for acquiring sensitive word libraries of various types before inputting the text data into the dictionary tree model corresponding to the sensitive word category; A dictionary tree model construction module is used to construct a corresponding dictionary tree model for each type of sensitive word library based on the current type of sensitive word library; wherein the first character of each sensitive word in the current type of sensitive word library is used as the root node of the dictionary tree model, and the other characters of each sensitive word are used as leaf nodes of the dictionary tree model, wherein the other characters are the characters in each sensitive word except the first character; each character of each sensitive word in the current type of sensitive word library and the status information of each character constitute a key-value pair in the dictionary tree model, wherein the status information includes the beginning, middle and end of the word.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the sensitive word filtering method as described in any one of claims 1 to 6 is implemented.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the sensitive word filtering method as described in any one of claims 1 to 6 is implemented.