Text sensitive word library extraction method, device and equipment based on neural network model

By using a text sensitive word database extraction method based on a neural network model, combined with various word segmentation algorithms and review tags, the high cost and misjudgment problems of manually maintaining sensitive word databases in the live streaming industry have been solved, achieving efficient and accurate sensitive word identification and filtering.

CN116541489BActive Publication Date: 2026-04-14HUNAN INKE INTERACTIVE ENTERTAINMENT NETWORK INFORMATION CO
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN INKE INTERACTIVE ENTERTAINMENT NETWORK INFORMATION CO
Filing Date
2023-06-26
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The current sensitive word database in the live streaming industry relies on manual review, which leads to high labor costs, delayed response times, subjective misjudgments, and difficulty in achieving comprehensive coverage, as well as the inability to update and identify new sensitive words in a timely manner.

Method used

A text sensitive word library extraction method based on a neural network model is adopted. This method involves constructing a training dataset, custom rule algorithms, character segmentation algorithms, Chinese word segmentation algorithms, and N-gram algorithms. It combines the tags of the review results to perform word segmentation extraction and word library quantitative analysis. The field structure is designed and iteratively trained. Sensitive words are extracted using word segmentation frequency, character quantity, and type filtering rules.

Benefits of technology

It improves the accuracy and efficiency of sensitive word extraction, reduces labor costs, lowers the false judgment rate, and can promptly identify and filter new sensitive words to ensure content compliance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541489B_ABST
    Figure CN116541489B_ABST
Patent Text Reader

Abstract

The application relates to a text sensitive word library extraction method, device and equipment based on a neural network model. The method comprises the following steps: constructing a sensitive word library extraction model; the sensitive word library extraction model comprises a self-defined rule algorithm, a character-by-character segmentation algorithm, a Chinese word segmentation algorithm and an N-gram algorithm; the sensitive word library extraction model is pre-trained according to a training data set; the pre-trained sensitive word library extraction model is used for word segmentation extraction and word library quantitative analysis on the text to be extracted; the full-amount word library is subjected to field structure design; the pre-trained sensitive word library extraction model is iteratively trained according to the designed word library; after the sensitive word extraction is carried out by using the trained sensitive word library extraction model, data analysis is carried out according to a word segmentation frequency filtering rule, a word segmentation character quantity filtering rule and a word segmentation type filtering rule, and a sensitive word library is obtained. The method can improve the sensitive word extraction accuracy and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and device for extracting a text sensitive word library based on a neural network model. Background Technology

[0002] Currently, the live streaming industry primarily uses a centralized approach to maintain sensitive word databases, including keyword filtering: live streaming platforms often maintain a keyword database containing sensitive words to filter and block text content containing these words. Keyword databases typically include words related to illegal activities, vulgarity, and specific events or socially sensitive topics. User reporting and manual review: live streaming platforms usually encourage users to actively report comments and bullet screen messages containing inappropriate content. Platforms establish dedicated review teams to manually review reported content and take appropriate measures based on the review results, such as deleting inappropriate content and banning violating users. Compliance requirements and regulation: The live streaming industry is regulated by relevant national and regional laws and regulations, which impose certain restrictions and requirements on the publication of content containing sensitive words and inappropriate content. Live streaming platforms must comply with these regulations and adopt corresponding technical and management measures to ensure content compliance.

[0003] However, current methods for maintaining sensitive word databases suffer from several drawbacks: high labor costs: maintaining a large and dynamic sensitive word database requires significant human resources for review and updates. Dedicated teams are needed to handle user-submitted comments and add new sensitive words promptly. Response time delays: due to the manual review process involving human judgment and processing, response times may be delayed. During this delay, sensitive words may have already negatively impacted other users. Subjective judgment and misjudgments: manual review of sensitive words is subjective; different reviewers may have different judgment criteria for the same word, leading to inconsistent results. Furthermore, reviewers may misjudge, misclassifying irrelevant content as sensitive words or overlooking genuinely sensitive words. Incomplete coverage: comments and bullet comments on live streaming platforms are generated in real time, are numerous and diverse, and the forms of sensitive words are constantly changing. Manual maintenance methods cannot cover all sensitive words in a timely manner, and some newly emerging sensitive words may be missed. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, and device for extracting sensitive words from a text sensitive word database based on a neural network model, which can improve the accuracy and efficiency of sensitive word extraction, in order to address the above-mentioned technical problems.

[0005] A method for extracting a text sensitive word database based on a neural network model, the method comprising:

[0006] Construct a training dataset; the training dataset includes pre-prepared text content of bullet comments and comments, as well as the review result tags of the text content;

[0007] Construct a sensitive word database extraction model; the sensitive word database extraction model includes a custom rule algorithm, a character-by-character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm;

[0008] The sensitive word extraction model is pre-trained based on the training dataset to obtain a pre-trained sensitive word extraction model.

[0009] The pre-trained sensitive word extraction model is used to segment and extract words from the text to be extracted, resulting in a merged word segmentation set; the words in the merged word segmentation set are subjected to lexicon quantitative analysis based on the review result tags to obtain the full lexicon;

[0010] The field structure of the full vocabulary is designed, including the word segmentation content and the occurrence, pass, deletion, blacklisting, score and probability of the word segmentation content, to obtain the designed vocabulary.

[0011] The pre-trained sensitive word extraction model is iteratively trained based on the designed vocabulary until the pre-set number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model.

[0012] Sensitive words are extracted using a trained sensitive word database extraction model. Based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type, the extracted word segmentation set is analyzed and merged for deduplication to obtain the sensitive word database.

[0013] In one embodiment, a pre-trained sensitive word extraction model is used to segment the text to be extracted, resulting in a merged segmented set, including:

[0014] The extracted text is segmented according to a custom rule algorithm. Regular expressions are set as the segmentation rules. The string is split into Chinese characters or consecutive letters by PHP code and the segmentation rules, resulting in a first array containing multiple words.

[0015] In one embodiment, the text to be extracted is segmented according to the character segmentation algorithm. The input string is traversed character by character, and the mb_substr function is used to extract characters one by one. Each character is stored in the first array to obtain the second array.

[0016] In one embodiment, the text to be extracted is divided into independent words using a prefix dictionary and a Chinese word frequency library according to the jieba-php Chinese word segmentation algorithm. Each word is stored as an element of an array in a second array, resulting in a third array.

[0017] In one embodiment, the text to be extracted is segmented into two consecutive words according to the N-gram algorithm, and the extractNGrams function is called to store the extraction results in a third array, thus obtaining a fourth array;

[0018] The fourth array is deduplicated to obtain the merged word segmentation set.

[0019] In one embodiment, the words in the merged word segmentation set are subjected to lexical quantitative analysis based on the review result tags to obtain a full lexical database, including:

[0020] If the review result label of the words in the merged word segmentation collection is "passed", then the score of the corresponding word is 0;

[0021] If the review result tag for the words in the merged word segmentation collection is "deleted", then the score for the corresponding word is 0.75;

[0022] If the review result tag of the words in the merged word segmentation collection is "blacklisted", then the score of the corresponding word is 1;

[0023] A full vocabulary is constructed based on the word segments carrying scores.

[0024] In one embodiment, the field structure of the full lexicon is designed, including the word segmentation content and the occurrence frequency, pass frequency, deletion frequency, blacklist frequency, score, and probability of the word segmentation content, resulting in the designed lexicon, including:

[0025] In the full vocabulary, the sensitivity score weight of a word is obtained by dividing the sum of the scores of words in each training result by the number of times the word appears. The sensitivity score weight is then converted into a percentage form to obtain the probability of the word.

[0026] In one embodiment, the word segmentation frequency filtering rule includes a filtering probability of no less than 100% for words ranked from lowest to highest frequency, no less than 90% for words ranked from lowest to highest frequency (10%-30%), no less than 75% for words ranked from lowest to highest frequency (30%-80%), no less than 90% for words ranked from lowest to highest frequency (80%-95%), and no less than 95% for words ranked from lowest to highest frequency (95%-100%). The word segmentation character count filtering rule includes a filtering probability of no less than 95% for words with a character count of 1, no less than 85% for words with a character count greater than 1 and less than or equal to 3, and a filtering probability of no less than 1% for words with a character count of 1. The filtering probability for words with a quantity greater than 3 and less than or equal to 10 is no less than 65%, and the filtering probability for words with a word segmentation character count greater than 10 is no less than 50%. Word segmentation type filtering rules include filtering Chinese, English words, and numbers based on the word segmentation type. If the word segmentation is Chinese, it is processed according to the word segmentation frequency filtering rule and the word segmentation character count filtering rule. If the word segmentation is a consecutive number with a length of 11 and conforms to the format of a telephone number, the filtering probability is set to 0%. Sensitive words are extracted using a trained sensitive word library extraction model. The extracted word segmentation set is then analyzed and merged for deduplication according to pre-set word segmentation frequency filtering rules, word segmentation character count filtering rules, and word segmentation type filtering rules to obtain a sensitive word library, including:

[0027] Sensitive words are extracted using a trained sensitive word extraction model to obtain the probability of each word. The probabilities of words are compared and filtered according to pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type. Words that meet the filtering conditions are filtered to obtain a filtered word segmentation set. The filtered word segmentation set is then deduplicated to obtain the sensitive word library.

[0028] A text sensitive word database extraction device based on a neural network model, the device comprising:

[0029] The model building module is used to build the training dataset; the training dataset includes pre-prepared text content of bullet comments and comments, as well as the review result tags of the text content; a sensitive word extraction model is built; the sensitive word extraction model includes a custom rule algorithm, a character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm;

[0030] The pre-trained model module is used to pre-train the sensitive word extraction model based on the training dataset to obtain a pre-trained sensitive word extraction model.

[0031] The lexicon quantization module is used to segment and extract words from the text to be extracted using a pre-trained sensitive word extraction model, resulting in a merged word segmentation set; based on the review result tags, the words in the merged word segmentation set are subjected to lexicon quantization analysis to obtain the full lexicon;

[0032] The structure design module is used to design the field structure of the entire lexicon, design the word segmentation content and the occurrence, pass, deletion, blacklisting, score and probability of the word segmentation content, and obtain the designed lexicon;

[0033] The model iterative training module is used to iteratively train the pre-trained sensitive word extraction model based on the designed vocabulary until the preset number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model.

[0034] The sensitive word extraction and filtering module is used to iteratively train the pre-trained sensitive word extraction model based on the designed word library until the preset number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model.

[0035] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0036] Construct a training dataset; the training dataset includes pre-prepared text content of bullet comments and comments, as well as the review result tags of the text content;

[0037] Construct a sensitive word database extraction model; the sensitive word database extraction model includes a custom rule algorithm, a character-by-character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm;

[0038] The sensitive word extraction model is pre-trained based on the training dataset to obtain a pre-trained sensitive word extraction model.

[0039] The pre-trained sensitive word extraction model is used to segment and extract words from the text to be extracted, resulting in a merged word segmentation set; the words in the merged word segmentation set are subjected to lexicon quantitative analysis based on the review result tags to obtain the full lexicon;

[0040] The field structure of the full vocabulary is designed, including the word segmentation content and the occurrence, pass, deletion, blacklisting, score and probability of the word segmentation content, to obtain the designed vocabulary.

[0041] The pre-trained sensitive word extraction model is iteratively trained based on the designed vocabulary until the pre-set number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model.

[0042] Sensitive words are extracted using a trained sensitive word database extraction model. Based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type, the extracted word segmentation set is analyzed and merged for deduplication to obtain the sensitive word database.

[0043] The aforementioned method, apparatus, and device for extracting sensitive words from a text based on a neural network model first constructs a sensitive word extraction model. This model is built by setting custom rule algorithms, character-by-character segmentation algorithms, Chinese word segmentation algorithms, and N-gram algorithms. These algorithms segment the input text layer by layer, providing more comprehensive, accurate, and adaptable segmentation results. The model can handle complex text, improve error and noise reduction, and can be customized to meet specific needs, thereby improving the quality and effectiveness of word segmentation. This facilitates subsequent calculation and training of sensitive words in the input text. The sensitive word extraction model is then pre-trained using a training dataset to obtain a pre-trained model. The pre-trained model is then used to segment the text to be extracted, resulting in a merged segmented word set. Finally, the words in the merged segmented word set are quantized based on the tags from the review results. The process involves analyzing and obtaining a full vocabulary. The vocabulary is then structured with specific fields, including word segmentation content and metrics such as frequency of occurrence, number of passes, number of deletions, number of blacklistings, scores, and probabilities. Words are filtered and sorted based on their probability fields to determine which words need to be filtered or marked as sensitive. A pre-trained sensitive word extraction model is iteratively trained using the designed vocabulary until a pre-set number of training rounds is reached or training stops. This results in a well-trained sensitive word extraction model. This model is then used to extract sensitive words. Based on pre-set filtering rules for word segmentation frequency and character count, and through statistical data analysis, the frequency, character count, and type of words are filtered and analyzed. Different probability processing rules and thresholds are set to extract sensitive words with a certain degree of credibility and relevance, while excluding common non-sensitive words, thus improving the accuracy and effectiveness of filtering and resulting in a more accurate sensitive word database. Attached Figure Description

[0044] Figure 1 This is a flowchart illustrating a method for extracting sensitive words from a text database based on a neural network model, as shown in one embodiment.

[0045] Figure 2 This is a structural block diagram of a text sensitive word database extraction device based on a neural network model in one embodiment;

[0046] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] In one embodiment, such as Figure 1 As shown, a method for extracting sensitive words from a text database based on a neural network model is provided, including the following steps:

[0049] Step 102: Construct a training dataset; the training dataset includes pre-prepared text content of bullet comments and comments, and the review result tags of the text content; construct a sensitive word database extraction model; the sensitive word database extraction model includes a custom rule algorithm, a character-by-character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm.

[0050] The training dataset was constructed based on existing text content such as live stream comments and bullet comments, and was reviewed in accordance with relevant laws and regulations. Each sample data contains text content and a corresponding review result label, including "agree," "delete," and "block," representing different categories of review results.

[0051] Below are some sample input data, showing the text content and corresponding labels:

[0052] 1. Text marked as "blocked": ['content'=>'Go to the city CBD for dinner','tag'=>'2']

[0053] 2. Text marked as "Delete": ['content'=>'Go to the CBD to eat noodles','tag'=>'1']

[0054] 3. Text marked as "Passed": ['content'=>'Go to work in the city's CBD','tag'=>'0']

[0055] 4. Text marked as "blocked": ['content'=>'Go to town CBD for dinner','tag'=>'2']

[0056] 5. Text marked as "Delete": ['content'=>'Go to town CBD to eat noodles','tag'=>'1']

[0057] 6. Text marked as "Passed": ['content'=>'Go to work in town CBD','tag'=>'0']

[0058] In the example above, "content" represents the text content, and "tag" represents the tag of the review result. The tag value is 0 for "agree", 1 for "delete", and 2 for "block".

[0059] This paper constructs a sensitive word database extraction model by setting custom rule algorithms, character-by-character segmentation algorithms, Chinese word segmentation algorithms, and N-gram algorithms. Different word segmentation methods have different characteristics and applicable scenarios. By using multiple methods, a wider range of text types and language features can be covered, improving the accuracy and adaptability of word segmentation. Each method has its advantages and limitations; combining multiple methods can yield more comprehensive and diverse word segmentation results. Some texts may contain complex language structures, proper nouns, neologisms, etc. A single word segmentation method may not handle these complex situations well, while a combination of multiple methods can provide better adaptability and robustness, improving the ability to process complex texts. Each word segmentation method may have certain errors and noise; for example, regular expression algorithms may not be able to handle certain special cases, and Chinese word segmentation algorithms may have ambiguity issues. By using multiple methods, errors can be complemented and corrected, improving the accuracy and stability of word segmentation. Integrating and fusing the results of multiple word segmentation methods can yield more accurate and complete word segmentation results. For example, the word segmentation results of different methods can be merged, deduplicated, or weighted, thereby improving the overall word segmentation quality and effect. Different application scenarios and tasks may have different requirements for word segmentation. By selecting and combining appropriate word segmentation methods, the needs of specific tasks can be met, providing more accurate and effective word segmentation results.

[0060] By utilizing custom rule algorithms, character-by-character segmentation algorithms, Chinese word segmentation algorithms, and N-gram algorithms to segment the input text layer by layer, it can provide more comprehensive, accurate, and adaptable word segmentation results. It can handle complex text, improve errors and noise, and can be customized according to specific needs, thereby improving the quality and effect of word segmentation and facilitating subsequent calculation and training of sensitive elements in the input text.

[0061] Step 104: Pre-train the sensitive word extraction model based on the training dataset to obtain the pre-trained sensitive word extraction model.

[0062] By using these training data to train a neural network model, it can accurately extract initial sensitive words from the text, thereby improving the efficiency and accuracy of the review process.

[0063] Step 106: Use the pre-trained sensitive word extraction model to segment and extract words from the text to be extracted, and obtain a merged word segmentation set; perform lexicon quantitative analysis on the words in the merged word segmentation set according to the review result tags to obtain the full lexicon.

[0064] Merging word segments has many functions, including:

[0065] Reducing the number of words: Merging the deduplicated word segmentation results can significantly reduce the number of words. By merging identical words into one word, the vocabulary size of the text can be reduced, thus decreasing storage and computational overhead.

[0066] Improving model efficiency: Merging the deduplicated word segmentation results can improve the model's computational efficiency. Fewer words mean fewer dimensions need to be processed during feature representation and computation, thus reducing the model's complexity and computational burden.

[0067] Preserving Important Information: Merging deduplicated word segmentation results can retain key information in the text. By merging identical words, important semantic features can be represented more accurately, avoiding information loss due to subtle differences in word segmentation results.

[0068] Improving Feature Representation: Merging deduplicated word segmentation results can improve the expressive power of features. Merging identical words can enhance their weight and importance, making the features more accurately reflect the meaning and characteristics of the text.

[0069] Improving model generalization ability: Merging deduplicated word segmentation results reduces the model's sensitivity to subtle changes in the data, thereby improving its generalization ability. Merging identical words reduces noise and interference in the data, allowing the model to focus more on the core information of the text.

[0070] The review result labels include: 1. "Pass" label: Indicates text that has passed the review, with a score of 0. This means that the text is considered non-sensitive and does not require special handling. 2. "Delete" label: Indicates text that needs to be deleted, with a score of 0.75. This text may contain some sensitive information, but does not need to be blocked immediately. Giving this text a lower score allows it to be included in the processing flow for further review and deletion. 3. "Block" label: Indicates text that needs to be blocked, with a score of 1. This text is considered highly sensitive and needs to be blocked immediately to prevent its further dissemination or use.

[0071] By performing lexical analysis on the words in the merged word segmentation set, the corresponding sensitive word scores can be determined based on the text's tags. These scores can be used to assess the severity and priority of sensitive words for subsequent processing and filtering. Specific score calculations and applications can be further adjusted and implemented based on actual conditions and specific algorithms.

[0072] Step 108: Design the field structure of the full vocabulary, including the word segmentation content and the occurrence, pass, deletion, blacklisting, score and probability of the word segmentation content, to obtain the designed vocabulary.

[0073] In the full vocabulary database, the field structure is designed as follows: First, for each segmented word, the full vocabulary database is queried to determine if a corresponding record exists. If the segmented word does not exist in the full vocabulary database, it indicates a new sensitive word. A new record is added to the full vocabulary database, with the following field values: Segmented word content (word) is the current segmented word content; Occurrence count (num) is initialized to 1; Success count (success_num) is determined based on the label of the input neuron: 1 if "pass", 0 otherwise; Deletion count (delete_num) is determined based on the label of the input neuron: 1 if "delete", 0 otherwise; Blacklist count (black_num) is determined based on the label of the input neuron: 1 if "blacklist", 0 otherwise. Score (point) is calculated based on the association relationship of label scoring rules. Probability (rate) is calculated based on the score and probability calculation rules. If the word segment exists in the full vocabulary, it indicates that it is an existing sensitive word. Update the corresponding field values ​​of the word segment record: the occurrence count (num) is incremented by 1; the number of passes (success_num) is determined based on the label of the input neuron, and if it is "pass", it is incremented by 1; the number of deletions (delete_num) is determined based on the label of the input neuron, and if it is "delete", it is incremented by 1; the number of blacklists (black_num) is determined based on the label of the input neuron, and if it is "blacklist", it is incremented by 1; the score (point) is updated according to the label scoring rule association relationship; the probability (rate) is updated according to the score and probability calculation rules; the probability field is calculated by dividing the sum of the word scores in each training result by the number of times the word appears, thereby obtaining the sensitivity score weight percentage of the word, and converting the sensitivity score weight into a percentage form to obtain the probability field of the word.

[0074] The probability field calculated in this way reflects the sensitivity and importance of words. In subsequent data analysis and filtering steps, words can be filtered and sorted based on their probability field to determine which words need to be filtered or marked as sensitive words. By calculating the sensitivity weights and probability fields of words and setting sensitive word filtering rules, sensitive words can be identified and processed more accurately, improving the precision and effectiveness of filtering. At the same time, the probability field also provides important reference parameters for subsequent data analysis and processing, facilitating further analysis and optimization.

[0075] Step 110: Iteratively train the pre-trained sensitive word extraction model based on the designed word library until the pre-set number of training rounds is reached or the conditions for stopping training are met, and obtain the trained sensitive word extraction model.

[0076] The pre-trained sensitive word extraction model is iteratively trained based on the designed lexicon. This iterative training utilizes the frequency of occurrence, access frequency, deletion frequency, blacklisting frequency, score, and probability of pre-designed segmented content to ensure that the records in the full lexicon remain synchronized with the sensitive words in the input set. Corresponding scores and probabilities are calculated, and the scores and probabilities of sensitive words in the full lexicon are continuously adjusted to more accurately reflect their sensitivity and priority. In this way, the system gradually learns the characteristics and contextual relationships of different textual sensitive words, improving the accuracy and effectiveness of filtering.

[0077] Step 112: Use the trained sensitive word extraction model to extract sensitive words. Based on the pre-set filtering rules for word segmentation frequency, word segmentation character quantity, and word segmentation type, perform data analysis and merge deduplication on the extracted word segmentation set to obtain the sensitive word library.

[0078] Words are categorized into different levels based on their frequency, and a corresponding processing probability is assigned to each level. The full vocabulary is sorted according to the number of times words appear and filtered according to the following rules:

[0079] 1. Extremely low probability of occurrence: Set an extremely high processing probability. This indicates that these words are very rare in the text and may have special or important characteristics.

[0080] 2. Low probability of occurrence: Set a higher processing probability. This means that these words appear relatively infrequently in the text, but still have a certain degree of prevalence.

[0081] 3. Moderate frequency of occurrence: Set a moderate processing probability. This means that these words appear relatively frequently in the text, but are not considered very common words.

[0082] 4. High probability of occurrence: Set a high processing probability. This indicates that these words are very common in the text and have universality.

[0083] 5. Extremely high probability of occurrence: Set an extremely high processing probability. These words are very common and may be frequently used words or keywords.

[0084] The advantage of this setup is that high-frequency words are usually common vocabulary and may contain a large amount of non-sensitive content, so the probability of them being treated as sensitive words can be appropriately reduced to avoid over-filtering. For rarer words, they are more likely to be treated as sensitive words and processed to improve the accuracy of sensitive content filtering.

[0085] Therefore, the word frequency filtering rules set in this application are word segmentation frequency filtering rules, which include a filtering probability of no less than 100% for words ranked from low to high frequency, a filtering probability of no less than 90% for words ranked from low to high frequency (10%-30%), a filtering probability of no less than 75% for words ranked from low to high frequency (30%-80%), a filtering probability of no less than 90% for words ranked from low to high frequency (80%-95%), and a filtering probability of no less than 95% for words ranked from low to high frequency (95%-100%).

[0086] The filtering is based on the number of characters in the word segment, and different length thresholds are set for processing. The thresholds are defined as follows: If the number of characters in the word segment is equal to 1 (i.e., a word with one character), it is considered a short word. If the number of characters in the word segment is greater than 1 and less than or equal to 3 (i.e., a word with two or three characters), it is considered a short word. If the number of characters in the word segment is greater than 3 and less than or equal to 10 (i.e., a word with four to ten characters), it is considered a medium-length word. If the number of characters in the word segment is greater than 10 (i.e., a word with more than ten characters), it is considered a long word. The advantages of this setting include: 1. Fine control of word length: By setting different character number thresholds, the length of words can be precisely controlled. 2. Improved processing efficiency: Filtering based on the number of characters in words reduces the number of words that need to be processed, thereby improving processing efficiency. Shorter words usually appear more frequently in the text; by filtering out single characters or short words, the amount of computation in subsequent processing can be reduced.

[0087] Therefore, the word frequency filtering rules and word segmentation character number filtering rules set in this application include the following: the filtering probability of words with a word segmentation character number of 1 is not less than 95%; the filtering probability of words with a word segmentation character number greater than 1 and less than or equal to 3 is not less than 85%; the filtering probability of words with a word segmentation character number greater than 3 and less than or equal to 10 is not less than 65%; and the filtering probability of words with a word segmentation character number greater than 10 is not less than 50%.

[0088] The word segmentation is filtered based on the segmentation type, including Chinese words, English words, and numbers, and different probabilities are applied to each type. In this invention, the segmentation type filtering rules are as follows:

[0089] 1. Chinese: Processed according to the word frequency and character count filtering rules mentioned above.

[0090] 2. English words: processed according to word frequency filtering rules.

[0091] 3. If the length of consecutive digits is 11 and conforms to the format of a telephone number, its probability can be set to 0%.

[0092] 4. Other consecutive numbers, with a probability of 50%.

[0093] After the above steps are completed, the final output is a list of sensitive words obtained through data statistical analysis, filtering, and sensitive word extraction. This output is filtered based on word segmentation frequency, number of characters in each segment, and word segmentation type to ensure the reliability and relevance of the output sensitive words. These sensitive words can be used for sensitive information filtering, monitoring of illegal content, and other text security-related applications. The final output list of sensitive words helps users identify and process potentially sensitive information, improving text security and compliance.

[0094] By using statistical data analysis to filter and analyze word frequency, character count, and type, and setting different probability processing rules and thresholds, this invention can extract sensitive words with a certain degree of credibility and relevance, while excluding common non-sensitive words, thus improving the extraction effect of sensitive words. To meet users' personalized needs, this invention trains and incorporates users' word segmentation results into the database, allowing the model to filter based on users' usage habits and preferences. By including users' word segmentation results in the training data, the model can provide more personalized sensitive word filtering effects, improving user satisfaction and the model's applicability.

[0095] The aforementioned method for extracting sensitive words from a text based on a neural network model first constructs a sensitive word extraction model. This model is built by setting custom rule algorithms, character-by-character segmentation algorithms, Chinese word segmentation algorithms, and N-gram algorithms. These algorithms segment the input text layer by layer, providing more comprehensive, accurate, and adaptable segmentation results. The model can handle complex text, improve error and noise reduction, and can be customized to meet specific needs, thereby improving the quality and effectiveness of word segmentation. This facilitates subsequent calculation and training of sensitive words in the input text. The sensitive word extraction model is then pre-trained using a training dataset to obtain a pre-trained model. The pre-trained model is then used to segment the text to be extracted, resulting in a merged segmented word set. Based on the review result tags, the words in the merged segmented word set undergo lexical quantitative analysis to obtain a full lexical database. Finally, the full lexical database is structured with specific fields and features. The frequency, pass count, deletion count, blacklist count, score, and probability of word content and word segmentation are used to filter and sort words based on their probability fields to determine which words need to be filtered or marked as sensitive words. A pre-trained sensitive word extraction model is iteratively trained based on the designed word library until a pre-set number of training rounds is reached or a stopping condition is met, resulting in a trained sensitive word extraction model. This model is then used to extract sensitive words. The extracted word segmentation set is analyzed and merged for deduplication based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type. By calculating the sensitivity weights and probability fields of words and through statistical data analysis, the frequency, character count, and type of words are filtered and analyzed. Different probability processing rules and thresholds are set to extract sensitive words with a certain degree of credibility and relevance, excluding common non-sensitive words, improving the accuracy and effectiveness of filtering, and ultimately obtaining a more accurate sensitive word library.

[0096] In one embodiment, a pre-trained sensitive word extraction model is used to segment the text to be extracted, resulting in a merged segmented set, including:

[0097] The extracted text is segmented according to a custom rule algorithm. Regular expressions are set as the segmentation rules. The string is split into Chinese characters or consecutive letters by PHP code and the segmentation rules, resulting in a first array containing multiple words.

[0098] In one embodiment, the text to be extracted is segmented according to the character segmentation algorithm. The input string is traversed character by character, and the mb_substr function is used to extract characters one by one. Each character is stored in the first array to obtain the second array.

[0099] In one embodiment, the text to be extracted is divided into independent words using a prefix dictionary and a Chinese word frequency library according to the jieba-php Chinese word segmentation algorithm. Each word is stored as an element of an array in a second array, resulting in a third array.

[0100] In one embodiment, the text to be extracted is segmented into two consecutive words according to the N-gram algorithm, and the extractNGrams function is called to store the extraction results in a third array, thus obtaining a fourth array;

[0101] The fourth array is deduplicated to obtain the merged word segmentation set.

[0102] In a specific embodiment, the input text is segmented into words to divide the text content into independent words. To this end, this application first employs a custom rule algorithm based on regular expressions. The regular expression ' / ([a-zA-Z0-9]+)|([\x{4e00}-\x{9fa5}]) / u' defines the segmentation rule, which divides the string into Chinese characters or consecutive letters. The word segmentation operation is implemented using PHP code. By applying regular expressions, the Chinese and English words in the text are segmented into arrays. This allows for segmentation according to custom rules, providing flexibility and enabling different methods of text segmentation as needed. Regular expressions segment all parts that meet the rules at once, eliminating the need for iteration and character-by-character processing, thus improving processing efficiency. It also supports various pattern matching functions, such as character sets, quantifiers, and boundary matching, enabling complex and precise segmentation operations.

[0103] Below is an example result showing the output of the input text "go to the city CBD to work" after word segmentation:

[0104] Input: "Go to work in the city's CBD"

[0105] Output:

[0106] Array ( [0] => Go to [1] => City [2] => City [3] => CBD [4] => Work [5] => Job)

[0107] The above results show that the input text has been segmented into individual words, with each word being an element of an array.

[0108] In the hidden neuron stage of model definition, a character-by-character segmentation algorithm was also employed to segment the input text. This algorithm traverses the input string character by character, extracting each character using the mb_substr function and storing each character in a result array, thus achieving character-by-character segmentation. The character-by-character segmentation algorithm cuts the string into the smallest possible character units, making it suitable for character-level text processing and analysis. It does not rely on any language model or rules, can adapt to different languages ​​and text types, and does not merge consecutive characters into words, thereby preserving the original features of the text.

[0109] Below is an example result showing the output of the input text "go to work in the city's CBD" after being processed by a character-by-character segmentation algorithm:

[0110] Input: "Go to work in the city's CBD"

[0111] Output:

[0112] Array ( [0] => Go to [1] => City [2] => City [3] => c [4] => b [5] => d [6] => Work [7] => Job)

[0113] The character-by-character segmentation algorithm divides the input text into individual characters, with each character serving as an element of an array. This character-by-character segmentation result can be applied to tasks requiring character-level processing and analysis.

[0114] It also employs the Chinese word segmentation algorithm - jieba-php, which uses a prefix dictionary and a Chinese word frequency library during the segmentation process. This enables it to effectively segment Chinese text, providing efficient and accurate Chinese word segmentation and supporting user-defined dictionaries.

[0115] Below is the output of this example, showing the word segmentation result of the input text after processing by the jieba-php Chinese word segmentation algorithm:

[0116] Input: "Go to work in the city's CBD"

[0117] Output:

[0118] Array ( [0] => Go to [1] => City [2] => CBD [3] => Work)

[0119] Using the jieba-php Chinese word segmentation algorithm, the input text is accurately segmented into individual words, with each word serving as an element of an array. jieba-php boasts high segmentation accuracy and performance, making it suitable for various Chinese text processing and analysis tasks.

[0120] The N-gram algorithm was also employed to extract N consecutive words (or characters) as the basic unit of the language model. In word segmentation tasks, the N-gram algorithm can be used to segment text into consecutive word combinations. The value of n (word group length) of N-gram can be adjusted according to the text characteristics and analysis objectives, and different strategies can be used to handle boundary cases (such as the beginning and end of sentences). This customizability allows for optimization of the algorithm's performance and results based on actual conditions.

[0121] The following is sample code for text segmentation using the N-gram algorithm:

[0122] The example code above defines a function called `extractNGrams`, which takes a text array and an n value as parameters, extracts n consecutive words, and stores the results in an array. Then, by setting the input text "go to work in the city CBD" and the n value to 2 (to extract two consecutive words, i.e., bigrams), the extraction results are finally printed.

[0123] The following is the output of this example, showing the extraction result after the input text has been processed by the N-gram algorithm:

[0124] Example N-gram length: 2

[0125] Input: "Go to work in the city's CBD"

[0126] Output:

[0127] Array ( [0] => Go to city [1] => City [2] => City CBD [3] => CBD to work [4] => Work)

[0128] The N-gram algorithm segments the input text into two consecutive bigrams and stores them in an array. The N-gram algorithm can extract word groups of different lengths as needed, making it suitable for various text analysis tasks.

[0129] The results of the merged word segmentation are as follows:

[0130] enter:

[0131] Array ( [0] => Go to [1] => City [2] => City [3] => CBD [4] => Work [5] => Work [9] => C

[10] => B

[11] => D

[15] => City

[16] => Work

[17] => Go to City

[19] => City CBD

[20] => CBD Work)

[0132] Output:

[0133] Array ( [0] => Go to [1] => City [2] => City [3] => cbd [4] => Work [5] => Work [9] => c

[10] => b

[11] => d

[15] => City

[16] .

[0134] In one embodiment, the words in the merged word segmentation set are subjected to lexical quantitative analysis based on the review result tags to obtain a full lexical database, including:

[0135] If the review result label of the words in the merged word segmentation collection is "passed", then the score of the corresponding word is 0;

[0136] If the review result tag for the words in the merged word segmentation collection is "deleted", then the score for the corresponding word is 0.75;

[0137] If the review result tag of the words in the merged word segmentation collection is "blacklisted", then the score of the corresponding word is 1;

[0138] A full vocabulary is constructed based on the word segments carrying scores.

[0139] In one embodiment, the field structure of the full lexicon is designed, including the word segmentation content and the occurrence frequency, pass frequency, deletion frequency, blacklist frequency, score, and probability of the word segmentation content, resulting in the designed lexicon, including:

[0140] In the full vocabulary, the sensitivity score weight of a word is obtained by dividing the sum of the scores of words in each training result by the number of times the word appears. The sensitivity score weight is then converted into a percentage form to obtain the probability of the word.

[0141] In one embodiment, the word segmentation frequency filtering rule includes a filtering probability of no less than 100% for words ranked from lowest to highest frequency, no less than 90% for words ranked from lowest to highest frequency (10%-30%), no less than 75% for words ranked from lowest to highest frequency (30%-80%), no less than 90% for words ranked from lowest to highest frequency (80%-95%), and no less than 95% for words ranked from lowest to highest frequency (95%-100%). The word segmentation character count filtering rule includes a filtering probability of no less than 95% for words with a character count of 1, no less than 85% for words with a character count greater than 1 and less than or equal to 3, and a filtering probability of no less than 1% for words with a character count of 1. The filtering probability for words with a quantity greater than 3 and less than or equal to 10 is no less than 65%, and the filtering probability for words with a word segmentation character count greater than 10 is no less than 50%. Word segmentation type filtering rules include filtering Chinese, English words, and numbers based on the word segmentation type. If the word segmentation is Chinese, it is processed according to the word segmentation frequency filtering rule and the word segmentation character count filtering rule. If the word segmentation is a consecutive number with a length of 11 and conforms to the format of a telephone number, the filtering probability is set to 0%. Sensitive words are extracted using a trained sensitive word library extraction model. The extracted word segmentation set is then analyzed and merged for deduplication according to pre-set word segmentation frequency filtering rules, word segmentation character count filtering rules, and word segmentation type filtering rules to obtain a sensitive word library, including:

[0142] Sensitive words are extracted using a trained sensitive word extraction model to obtain the probability of each word. The probabilities of words are compared and filtered according to pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type. Words that meet the filtering conditions are filtered to obtain a filtered word segmentation set. The filtered word segmentation set is then deduplicated to obtain the sensitive word library.

[0143] In a specific embodiment, a trained sensitive word extraction model is used to extract sensitive words and obtain their probabilities. Then, words are filtered according to pre-set filtering rules based on word segmentation frequency, word segmentation character count, and word segmentation type. If the probability of a word does not meet the requirements of these three rules, it is not filtered and is determined to be a sensitive word. Conversely, words that meet the requirements of these three rules are filtered out and determined to be non-sensitive words. An example is shown below:

[0144] [{"name":"Content 1","num":10,"rate":"100%"},

[0145] {"name":"Content 2","num":20,"rate":"90%"},

[0146] {"name":"Content 3","num":30,"rate":"80%"},

[0147] {"name":"apple","num":40,"rate":"60%"},

[0148] {"name":"13011111111","num":50,"rate":"60%"}]

[0149] Assume the above content is the full vocabulary data (the example only includes the content, frequency of occurrence, and probability fields).

[0150] According to the word segmentation frequency filtering rules, we know that:

[0151] Content 1: It appears in the top 10% of cases and has a probability of not less than 100%;

[0152] Content 2: The frequency of occurrence is in the top 10% to 30%, and the probability of fulfilling the condition is not less than 90%;

[0153] Content 3: The frequency of occurrence is in the top 30% to 80%, and the probability of fulfilling the condition is not less than 75%;

[0154] Content 4: The frequency of occurrence is in the top 80% to 95%, and the probability of not meeting this requirement is not less than 90%;

[0155] Content 5: The frequency of occurrence is in the top 95% to 100%, and the probability of not meeting this requirement is not less than 95%;

[0156] Output: Content 1, Content 2, and Content 3 meet the filtering criteria and are included in the sensitive word database;

[0157] According to the word segmentation quantity filtering rules, we know that:

[0158] Content 1: The number of segmented characters is 3, and the probability is not less than 85%;

[0159] Content 2: The number of segmented characters is 3, and the probability is not less than 85%;

[0160] Content 3: The number of segmented characters is 3, and the probability of not meeting this requirement is not less than 85%.

[0161] Content 4: The number of segmented characters is 5, and the probability of not meeting this requirement is not less than 65%.

[0162] Content 5: The number of segmented characters is 10, and the probability is not less than 65%;

[0163] Output: Content 1, Content 2, 13011111111 meet the filtering criteria and are included in the sensitive word database;

[0164] According to the filtering rules based on word segmentation type:

[0165] Content 1: Chinese text type, filtered according to the above rules of word frequency and character count;

[0166] Content 2: Chinese text type, filtered according to the above word frequency and character count rules;

[0167] Content 3: Chinese text type, filtered according to the above word frequency and character count rules;

[0168] Content 4: English word types, filtered according to the above word frequency rules;

[0169] Content 5: Phone number type, directly matched;

[0170] Output: 13011111111;

[0171] Based on the above output: the phrases included in the sensitive word list are: content1, content2, content3, and 13011111111.

[0172] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0173] In one embodiment, such as Figure 2 As shown, a text sensitive word database extraction device based on a neural network model is provided, including: a model building module 202, a pre-trained model module 204, a lexicon quantization module 206, a structure design module 208, a model iterative training module 210, and a sensitive word extraction and filtering module 212, wherein:

[0174] The model building module is used to build the training dataset; the training dataset includes pre-prepared text content of bullet comments and comments, as well as the review result tags of the text content; a sensitive word extraction model is built; the sensitive word extraction model includes a custom rule algorithm, a character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm;

[0175] The pre-trained model module is used to pre-train the sensitive word extraction model based on the training dataset to obtain a pre-trained sensitive word extraction model.

[0176] The lexicon quantization module is used to segment and extract words from the text to be extracted using a pre-trained sensitive word extraction model, resulting in a merged word segmentation set; based on the review result tags, the words in the merged word segmentation set are subjected to lexicon quantization analysis to obtain the full lexicon;

[0177] The structure design module is used to design the field structure of the entire lexicon, design the word segmentation content and the occurrence, pass, deletion, blacklisting, score and probability of the word segmentation content, and obtain the designed lexicon;

[0178] The model iterative training module is used to iteratively train the pre-trained sensitive word extraction model based on the designed vocabulary until the preset number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model.

[0179] The sensitive word extraction and filtering module is used to extract sensitive words using a trained sensitive word library extraction model. Based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type, the extracted word segmentation set is analyzed and merged to remove duplicates, thus obtaining the sensitive word library.

[0180] Specific limitations regarding the text sensitive word extraction device based on neural network models can be found in the limitations of the text sensitive word extraction method based on neural network models mentioned above, and will not be repeated here. Each module in the aforementioned text sensitive word extraction device based on neural network models can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0181] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for extracting a text-sensitive word database based on a neural network model. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0182] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0183] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0184] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for extracting a text sensitive word database based on a neural network model, characterized in that, The method includes: Construct a training dataset; the training dataset includes pre-prepared text content of bullet comments and reviews, as well as tags representing the review results of the text content; A sensitive word extraction model is constructed; the sensitive word extraction model includes a custom rule algorithm, a character-by-character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm; The sensitive word extraction model is pre-trained based on the training dataset to obtain a pre-trained sensitive word extraction model. The text to be extracted is segmented using a pre-trained sensitive word extraction model to obtain a merged segmented word set; the words in the merged segmented word set are subjected to lexical quantitative analysis based on the review result tags to obtain the full lexical set; The full vocabulary is structured by designing the field structure, including the word segmentation content and the occurrence count, pass count, deletion count, blacklist count, score, and probability of the word segmentation content, resulting in the designed vocabulary; the score is the mapping score of the text review result tag corresponding to the word segmentation. The pre-trained sensitive word extraction model is iteratively trained based on the designed vocabulary until the pre-set number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model. Sensitive words are extracted using a trained sensitive word extraction model. The extracted word segmentation sets are then analyzed and merged for deduplication based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type, resulting in a sensitive word database. Based on the tags from the audit results, a lexical quantitative analysis of the words in the merged word segmentation set is performed to obtain a full lexical database, including: If the review result tag of the words in the merged word segmentation collection is "passed", then the score of the corresponding word is 0; If the review result tag for the words in the merged word segmentation collection is "deleted", then the score for the corresponding word is 0.75; If the review result tag of the words in the merged word segmentation collection is "blacklisted", then the score of the corresponding word is 1; Construct a full vocabulary based on the word segmentation with carried scores; The full lexicon is structured with specific fields, including word segmentation content and the frequency, pass count, deletion count, blacklist count, score, and probability of each segmented word. This results in the designed lexicon, which includes: In the full vocabulary, the sensitivity score weight of a word is obtained by dividing the sum of the scores of words in each training result by the number of times the word appears. The sensitivity score weight is then converted into a percentage to obtain the probability of the word.

2. The method according to claim 1, characterized in that, The pre-trained sensitive word extraction model is used to segment and extract words from the text to be extracted, resulting in a merged word segmentation set, including: The text to be extracted is segmented according to a custom rule algorithm. A regular expression is set as the segmentation rule. The string is split into Chinese characters or consecutive letters by PHP code and the segmentation rule to obtain the first array containing multiple words.

3. The method according to claim 2, characterized in that, The method further includes: The text to be extracted is segmented according to the character segmentation algorithm. The input string is traversed character by character, and the mb_substr function is used to extract characters one by one. Each character is stored in the first array to obtain the second array.

4. The method according to claim 3, characterized in that, The method further includes: Based on the jieba-php Chinese word segmentation algorithm, the text to be extracted is divided into independent words using a prefix dictionary and a Chinese word frequency library. Each word is stored as an element in a second array, resulting in a third array.

5. The method according to claim 3, characterized in that, The method further includes: The N-gram algorithm is used to segment the text to be extracted into two consecutive words, and the extractNGrams function is called to store the extraction results in the third array, resulting in the fourth array. The fourth array is deduplicated to obtain a merged word segmentation set.

6. The method according to claim 1, characterized in that, The word segmentation character count filtering rules include a filtering probability of no less than 95% for words with 1 character count, no less than 85% for words with 1 character count and no more than 3 character count, no less than 65% for words with 3 character count and no more than 10 character count, and no less than 50% for words with more than 10 character count. The word segmentation type filtering rules include filtering Chinese, English words, and numbers based on the word segmentation type. If the word segmentation is Chinese, it is processed according to the word segmentation frequency filtering rules and the word segmentation character count filtering rules. If the word segmentation is English, it is processed according to the word segmentation frequency filtering rules. If the consecutive digits in the word segmentation have a length of 11 and conform to the format of a telephone number, the filtering probability is set to 0%. Sensitive words are extracted using a trained sensitive word library extraction model. The extracted word segmentation set is analyzed and merged for deduplication according to the pre-set word segmentation frequency filtering rules, word segmentation character count filtering rules, and word segmentation type filtering rules to obtain a sensitive word library, including: The trained sensitive word extraction model is used to extract sensitive words and obtain the probability of each word. The probabilities of the words are compared and filtered according to the pre-set filtering rules of word segmentation frequency, word segmentation character quantity, and word segmentation type. After filtering the words that meet the filtering conditions, the filtered word segmentation set is obtained. The filtered word segmentation set is deduplicated to obtain a sensitive word library.

7. A text sensitive word database extraction device based on a neural network model, characterized in that, The device includes: The model building module is used to build a training dataset, which includes pre-prepared text content of bullet comments and comments, as well as the review result tags of the text content; and to build a sensitive word extraction model, which includes a custom rule algorithm, a character segmentation algorithm, a Chinese word segmentation algorithm, and an N-gram algorithm. The pre-trained model module is used to pre-train the sensitive word extraction model based on the training dataset to obtain a pre-trained sensitive word extraction model. The lexicon quantization module is used to segment and extract words from the text to be extracted using a pre-trained sensitive word extraction model, resulting in a merged word segmentation set. Based on the review result tags, the modules then perform lexicon quantization analysis on the words in the merged word segmentation set to obtain a full lexicon, including: If the review result tag of the words in the merged word segmentation collection is "passed", then the score of the corresponding word is 0; If the review result tag for the words in the merged word segmentation collection is "deleted", then the score for the corresponding word is 0.75; If the review result tag of the words in the merged word segmentation collection is "blacklisted", then the score of the corresponding word is 1; Construct a full vocabulary based on the word segmentation with carried scores; The structure design module is used to design the field structure of the full lexicon, designing the word segmentation content and the occurrence frequency, pass frequency, deletion frequency, blacklist frequency, score, and probability of the word segmentation content, resulting in the designed lexicon, including: In the full vocabulary, the sensitivity weight of a word is obtained by dividing the sum of the scores of words in each training result by the number of times the word appears. The sensitivity weight is then converted into a percentage to obtain the probability of the word. The score is the mapping score of the text review result tag corresponding to the word segmentation. The model iterative training module is used to iteratively train the pre-trained sensitive word extraction model based on the designed vocabulary until the preset number of training rounds is reached or the conditions for stopping training are met, thus obtaining the trained sensitive word extraction model. The sensitive word extraction and filtering module is used to extract sensitive words using a trained sensitive word library extraction model. Based on pre-set filtering rules for word segmentation frequency, word segmentation character count, and word segmentation type, the extracted word segmentation set is analyzed and merged to remove duplicates, thus obtaining the sensitive word library.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Classification model training method and device, abnormal comment detection method and device and equipment

    CN110162621A

  • Sensitive word recognition method based on big data

    CN114385775A