Illegal text recognition method, device and equipment and readable storage medium
By obtaining and segmenting the target sensitive words, extracting and correcting the fragments to be corrected, performing fluency verification, and combining the preset violation discrimination model to identify the violation text, the problem of low accuracy of the deep learning network in identifying the violation text is solved. Personalize the hidden information, reduce the missed detection rate, and improve the recognition accuracy.
Patent Information
- Application Number
- CN202410964439.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-09-03
AI Technical Summary
In the existing technology, deep learning networks require pre-training when identifying illegal texts, resulting in low recognition accuracy. Especially when faced with implicit illegal information and variant texts, the missed detection rate is high.
By obtaining the preset target sensitive words, perform character segmentation and semantic vector matching, extract the fragments to be corrected, perform text correction and fluency verification, form sensitive text, and use the preset violation discrimination model to identify, reducing the missed detection rate and improve accuracy.
It effectively reduces the text miss detection rate, improves the accuracy of illegal text identification, makes implicit illegal information explicit, and enhances the reliability of identification results.
Smart Images

Figure CN118586387A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and more specifically, to a method, device, equipment and readable storage medium for identifying illegal text. Background Art
[0003] In the existing technology, various deep learning networks are usually used to identify and intercept text information, but deep learning networks need to be trained with various illegal texts in advance. However, some people try to use text splicing and other methods to generate various text contents with implicit illegal information to hide illegal information, resulting in low recognition accuracy of deep learning networks. Summary of the invention
[0004] In view of this, the present application provides a method, device, equipment and readable storage medium for identifying illegal texts, which are used to solve the shortcomings of low text recognition accuracy in the prior art.
[0005] In order to achieve the above objectives, the proposed solution is as follows:
[0006] A method for identifying illegal texts, comprising:
[0007] Obtaining a preset target sensitive word, and performing character segmentation on the target sensitive word to obtain multiple sensitive words;
[0008] Find the text to be detected that matches the target sensitive word;
[0009] Locating each sensitive word in the text to be detected, and extracting the error-correcting segments containing each sensitive word from the text to be detected;
[0010] Performing text correction on the segment to be corrected to form a sensitive text, and performing a fluency check on the sensitive text;
[0011] Identify violations of sensitive text that has passed verification.
[0012] Optionally, searching for the text to be detected that matches the target sensitive word includes:
[0013] Calculating a word count threshold based on the number of sensitive words in the target sensitive word and a preset ratio threshold;
[0014] Recall text content containing more than one sensitive word;
[0015] The number of sensitive words in each text content is determined, and when the number of sensitive words exceeds the word count threshold, the corresponding text content is used as the text to be detected.
[0016] Optionally, searching for the text to be detected that matches the target sensitive word includes:
[0017] Obtaining a semantic vector of the target sensitive word;
[0018] For each published text, the published text is segmented to form multiple published segments; the semantic vector of each published segment is matched with the semantic vector of the target sensitive word. When the semantic vector of any published segment successfully matches the semantic vector of the target sensitive word, the published text is used as the text to be detected.
[0019] Optionally, performing text correction on the to-be-corrected error segment to form a sensitive text includes:
[0020] Sorting and combining the characters in the to-be-corrected segment multiple times to obtain multiple sorting results;
[0021] Use the n-gram algorithm to calculate the joint probability of each sorting result;
[0022] Based on the sorting result with the highest joint probability among the sorting results, the text to be detected is updated to obtain the sensitive text after the update.
[0023] Optionally, performing a fluency check on the sensitive text includes:
[0024] Segmenting the sensitive text to obtain multiple sensitive segments;
[0025] Determine the coherence score for each sensitive segment;
[0026] The product of each coherence score is calculated to obtain the total coherence score of the sensitive text, and the total coherence score is used to indicate whether the sensitive text passes the fluency check.
[0027] Optionally, determining the coherence score of each sensitive segment includes:
[0028] For each sensitive fragment, the sensitive fragment is segmented based on the preset character combination length to obtain multiple character combinations; each character combination is converted into a semantic vector, the semantic vectors are cascaded, and the cascaded semantic vectors are nonlinearly transformed to obtain the hidden layer semantic representation of the sensitive fragment; the hidden layer semantic representation is binary classified based on the fully connected layer to obtain a coherence score.
[0029] Optionally, the step of identifying violations of the verified sensitive text includes:
[0030] Based on a preset violation discrimination model, violations are identified for the verified sensitive text to obtain an identification result, which includes a violation score. When the violation score indicates that the corresponding sensitive text is a violation text, the identification result also includes the hit sensitive word and violation category.
[0031] A device for identifying illegal texts, comprising:
[0032] An acquisition module is used to acquire a preset target sensitive word and perform character segmentation on the target sensitive word to obtain multiple sensitive words;
[0033] A search module, used to search for text to be detected that matches the target sensitive word;
[0034] An extraction module, used to locate each sensitive word in the text to be detected, and extract the error-corrected segments containing each sensitive word from the text to be detected;
[0035] A correction module, used for performing text correction on the to-be-corrected segment to form a sensitive text, and performing a fluency check on the sensitive text;
[0036] The identification module is used to identify violations of sensitive text that has passed the verification.
[0037] A device for identifying illegal texts, comprising a memory and a processor;
[0038] The memory is used to store programs;
[0039] The processor is used to execute the program to implement each step of the above-mentioned illegal text recognition method.
[0040] A readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, each step of the above-mentioned illegal text recognition method is implemented.
[0041] It can be seen from the above technical solutions that the illegal text recognition method provided by the present application can obtain preset target sensitive words and search for texts to be detected that match the target sensitive words; based on this, the present application can recall the text content that needs to be detected in massive data through the target sensitive words, thereby reducing the missed detection rate; considering that the text containing various illegal contents may contain various variants and spliced texts, the target sensitive words can be segmented into characters to obtain multiple sensitive words, each sensitive word can be located in the text to be detected, and the error-corrected fragments containing each sensitive word can be extracted from the text to be detected; The to-be-corrected fragment is subjected to text correction to form a sensitive text, and the fluency of the sensitive text is checked; based on this, the true semantics of the to-be-corrected text can be obtained by performing text correction and fluency check on the to-be-corrected fragment in the text to be detected. At the same time, the corrected text needs to undergo a fluency check to further ensure the accuracy of the generated sensitive text, further ensure the reliability of the acquired semantics, make the implicit violation information explicit, and improve the subsequent recognition accuracy; then, the sensitive text that has passed the check can be identified for violations; it can be seen that the present application can reduce the text missed detection rate and improve the accuracy of illegal text recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0043] Figure 1 A flow chart of a method for identifying illegal texts disclosed in an embodiment of the present application;
[0044] Figure 2 A structural block diagram of a device for identifying illegal texts disclosed in an embodiment of the present application;
[0045] Figure 3 This is a hardware structure block diagram of a device for identifying illegal texts disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] The illegal text identification method of the present application can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or equipment, etc.
[0048] Next, combine Figure 1 The illegal text identification method of this application is introduced in detail, including the following steps:
[0049] Step S1: Obtain a preset target sensitive word, and perform character segmentation on the target sensitive word to obtain a plurality of sensitive words.
[0050] Specifically, a sensitive word library containing various violation types may be constructed, and sensitive words may be selected from the sensitive word library as target sensitive words.
[0051] The target sensitive word can be segmented according to a preset character length, and multiple sensitive words are obtained after segmentation, and the combination of various sensitive words constitutes the target sensitive word.
[0052] Step S2: searching for text to be detected that matches the target sensitive word.
[0053] Specifically, the text to be detected that matches the target sensitive word can be found in a variety of ways. For example, the text with the same characters as the target sensitive word can be used as the text to be detected, or the text with the same semantic vector as the target sensitive word can be used as the text to be detected.
[0054] Step S3: locate each sensitive word in the text to be detected, and extract the error-correcting segments containing each sensitive word from the text to be detected.
[0055] Specifically, the position of each sensitive word in the text to be detected can be determined, and the two sensitive words with the farthest position distance are used as the starting point and the end point of the segment. The text to be detected is cleaned, and the segment to be corrected is obtained after cleaning. For example, the text to be detected is "one two three four five eight seven six items", where the sensitive words are "three", "six", and "items" respectively. Then, the sensitive words are located in the text to be detected, and "three" in the text to be detected is used as the starting point of the segment, and "items" is used as the end point of the segment. At this time, the text to be detected is cleaned, and the segment to be corrected is "three four five eight seven six items".
[0056] Step S4: performing text correction on the to-be-corrected segment to form a sensitive text.
[0057] Specifically, text correction can be performed on the error-corrected segment to obtain a corrected segment, and the corrected segment can be used to replace the error-corrected segment in the text to be detected, and the sensitive text can be obtained after the replacement.
[0058] Among them, the text correction of the error correction segment can be performed in a variety of ways to obtain the corrected segment; for example, a pre-trained error correction model can be obtained to perform text correction on the error correction segment, or dependency syntactic analysis or word frequency statistics methods can be used to perform text correction on the error correction segment.
[0059] Step S5: performing a fluency check on the sensitive text.
[0060] Specifically, the fluency of sensitive text can be checked in a variety of ways; for example, the fluency of sensitive text can be checked by a preset coherence check model; or the fluency of sensitive text can be checked by a preset fluency check algorithm.
[0061] Step S6: Identify violations of the sensitive text that has passed the verification.
[0062] Specifically, violations of sensitive text that has passed verification can be identified in a variety of ways.
[0063] For example, machine algorithms can be used to identify violations of sensitive text that has passed verification; or violation identification models can be used to identify violations of sensitive text that has passed verification.
[0064] It can be seen from the above technical solutions that the illegal text recognition method provided by the present application can obtain preset target sensitive words and search for texts to be detected that match the target sensitive words; based on this, the present application can recall the text content that needs to be detected in massive data through the target sensitive words, thereby reducing the missed detection rate; considering that the text containing various illegal contents may contain various variants and spliced texts, the target sensitive words can be segmented into characters to obtain multiple sensitive words, each sensitive word can be located in the text to be detected, and the error-corrected fragments containing each sensitive word can be extracted from the text to be detected; The to-be-corrected fragment is subjected to text correction to form a sensitive text, and the fluency of the sensitive text is checked; based on this, the true semantics of the to-be-corrected text can be obtained by performing text correction and fluency check on the to-be-corrected fragment in the text to be detected. At the same time, the corrected text needs to undergo a fluency check to further ensure the accuracy of the generated sensitive text, further ensure the reliability of the acquired semantics, make the implicit violation information explicit, and improve the subsequent recognition accuracy; then, the sensitive text that has passed the check can be identified for violations; it can be seen that the present application can reduce the text missed detection rate and improve the accuracy of illegal text recognition.
[0065] In some embodiments of the present application, considering that the text to be detected can be recalled in a variety of ways, the following will introduce a variety of recall methods in detail, that is, the process of step S2, searching for the text to be detected that matches the target sensitive word, is described in detail, the steps are as follows:
[0066] First, considering that it is difficult to implicitly contain various types of illegal content when it is impossible to completely avoid sensitive words in the text, therefore, this application attempts to recall the text to be detected through sensitive words, and the specific steps are as follows:
[0067] S20. Calculate the word count threshold based on the number of sensitive words in the target sensitive word and a preset ratio threshold.
[0068] Specifically, the number of sensitive words included in the target sensitive word can be determined;
[0069] Calculate the product of the number of sensitive words and the preset ratio threshold, and round the product. After rounding, the word count threshold is obtained.
[0070] S21. Recall the text content that contains more than one sensitive word.
[0071] Specifically, from all the published texts, the published texts that contain more than one sensitive word can be searched as the text content for recall.
[0072] S22. Determine the number of sensitive words in each text content, and when the number of sensitive words exceeds the word count threshold, use the corresponding text content as the text to be detected.
[0073] Specifically, the number of sensitive words included in each text content can be calculated as the number of sensitive words, and the number of sensitive words is compared with the word count threshold; if the number of sensitive words exceeds the word count threshold, the text content corresponding to the number of sensitive words exceeding the word count threshold is used as the text to be detected.
[0074] For example, the target sensitive word can be "play without making noise", which has 3 characters, and the ratio threshold can be 60%. Then 2×60% = 1.8. After rounding 1.8, the word count threshold is 2. The published texts that contain any two sensitive words in "play without making noise" are used as the texts to be detected.
[0075] Second, considering that the semantic vectors of the implicit illegal content may be similar to the semantic vectors of the sensitive words, therefore, this application attempts to recall the text to be detected through semantic vectors, and the specific steps are as follows:
[0076] S23. Obtain the semantic vector of the target sensitive word.
[0077] Specifically, the Embedding algorithm (such as the word2vec algorithm) can be used to obtain the semantic vector of the target sensitive word.
[0078] S24. For each published text, the published text is segmented to form a plurality of published segments; the semantic vector of each published segment is matched with the semantic vector of the target sensitive word. When the semantic vector of any published segment successfully matches the semantic vector of the target sensitive word, the published text is used as the text to be detected.
[0079] Specifically, each published text can be divided into multiple published segments, and an Embedding algorithm, such as the word2vec algorithm, is used to obtain the semantic vector of each published segment; the semantic vector of each published segment is matched with the semantic vector of the target sensitive word in turn for similarity; if there is any published segment whose semantic vector similarity with the semantic vector of the target sensitive word exceeds a preset similarity threshold, the corresponding published text will be used as the text to be detected.
[0080] The similarity threshold may be 0.95.
[0081] The third method is to consider that the above two methods can recall each text to be detected as much as possible and improve the missed detection rate. Therefore, in some embodiments, the above two embodiments are combined to search for the text to be detected. The specific steps are as follows:
[0082] S25. Calculate a word count threshold based on the number of sensitive words of the target sensitive word and a preset ratio threshold.
[0083] S26. Recall text content containing one or more sensitive words.
[0084] S27, determining the number of sensitive words in each text content, and when the number of sensitive words exceeds the word count threshold, using the corresponding text content as the text to be detected.
[0085] The above steps S25-S27 correspond one-to-one to the above steps S20-S22. For details, please refer to the above introduction and will not be repeated here.
[0086] S28. Obtain the semantic vector of the target sensitive word.
[0087] S29. For each published text, the published text is segmented to form a plurality of published segments; the semantic vector of each published segment is matched with the semantic vector of the target sensitive word. When the semantic vector of any published segment successfully matches the semantic vector of the target sensitive word, the published text is used as the text to be detected.
[0088] The above steps S28-S29 correspond one-to-one to the above steps S23-S24. For details, please refer to the above introduction and will not be repeated here.
[0089] It can be seen from the above technical solutions that this embodiment provides three optional methods for recalling the text to be detected. Through the above methods, the present application can recall the text to be detected through sensitive words and semantic vectors, thereby reducing the missed detection rate. At the same time, multiple usage methods improve the wide application of the present application.
[0090] In some embodiments of the present application, step S4, the process of performing text correction on the error-corrected segment to form a sensitive text is described in detail, and the steps are as follows:
[0091] S40, performing multiple sorting and combination on each character in the to-be-corrected error segment to obtain multiple sorting results.
[0092] Specifically, the segment to be corrected can be segmented into characters to obtain multiple characters to be corrected, and each character to be corrected can be combined multiple times to obtain multiple sorting results, among which there is a sorting result whose character sorting method is consistent with the segment to be corrected.
[0093] S41. Use the n-gram algorithm to calculate the joint probability of each sorting result.
[0094] Specifically, the calculation expression of the joint probability formed by the n-gram algorithm can be used to calculate the joint probability of each sorting result.
[0095] The calculation expression of joint probability is as follows:
[0096] P(S) = p(W1W2...Wn-1Wn)=p(W1)p(W2|W1)...p(Wn|W1W2...Wn-1)
[0097] P(Wn|Wn-1)=C(Wn-1Wn) / C(Wn-1)
[0098] Where Wn is the nth character in the sorting result; C(Wn-1Wn) represents the probability that Wn-1Wn appears together in the article.
[0099] S42: Based on the sorting result with the highest joint probability among the sorting results, the text to be detected is updated to obtain the sensitive text after the update.
[0100] Specifically, the various joint probabilities can be compared, and the sorting result with the highest joint probability among the various sorting results is the result of text correction. Therefore, the sorting result with the highest joint probability among the various sorting results can be used as the correction text, and the correction text can be used to replace the to-be-corrected segment in the to-be-detected text, so as to complete the update of the to-be-detected text and obtain the sensitive text.
[0101] It can be seen from the above technical solution that this embodiment provides an optional method for performing text correction on the error-corrected fragments and generating sensitive text. Through the above method, the disordered text fragments can be corrected to avoid the unrecognizable disordered text content and improve the accuracy of violation identification.
[0102] In some embodiments of the present application, step S5, the process of performing fluency check on the sensitive text is described in detail, and the steps are as follows:
[0103] S50: Segment the sensitive text to obtain a plurality of sensitive segments.
[0104] Specifically, the sensitive text may be segmented according to a preset segmentation length to obtain a plurality of sensitive segments, wherein the segmentation length is less than the character length of the sensitive text.
[0105] S51. Determine the coherence score of each sensitive segment.
[0106] Specifically, the coherence score can be performed on each sensitive segment in turn.
[0107] S52: Calculate the product of each coherence score to obtain a total coherence score of the sensitive text, where the total coherence score is used to indicate whether the sensitive text passes the fluency check.
[0108] Specifically, the individual coherence scores can be multiplied to obtain the total coherence score of the sensitive text;
[0109] The total consistency score is compared with the preset scoring threshold. When the total consistency score exceeds the scoring threshold, the sensitive text passes the verification; when the total consistency score does not exceed the scoring threshold, the sensitive text fails the verification.
[0110] It can be seen from the above technical solution that this embodiment provides an optional method for fluency verification of sensitive text. The above method can be used to verify the coherence of sensitive text segments. The above method can ensure that each sensitive segment in the verified sensitive text has coherence, and each sensitive segment has coherence, thereby further ensuring the reliability of the sensitive text.
[0111] In some embodiments of the present application, the process of determining the coherence score of each sensitive segment in step S51 is described in detail, and the steps are as follows:
[0112] S510. For each sensitive segment, segment the sensitive segment based on a preset character combination length to obtain a plurality of character combinations; convert each character combination into a semantic vector, concatenate the semantic vectors, and perform a non-linear transformation on the concatenated semantic vectors to obtain the hidden layer semantic representation of the sensitive segment; perform binary classification on the hidden layer semantic representation based on a fully connected layer to obtain a coherence score.
[0113] Specifically, the sensitive segment can be segmented based on a preset character combination length to obtain a plurality of character combinations, where the character length of the sensitive segment is greater than the character combination length.
[0114] For example, the sensitive segment can be "one two three four", and the segmentation length can be 3, then the obtained character combinations can be as follows: "one two three", "two three four".
[0115] The Embedding algorithm, such as the word2vec algorithm, can be used to convert each character combination into a target semantic vector;
[0116] The target semantic vectors can be concatenated, and the concatenated target semantic vectors are non-linearly transformed. After the non-linear transformation, the hidden layer semantic representation of the sensitive segment is obtained.
[0117] The hidden layer semantic representation can be input into a fully connected layer for binary classification, that is, p(y_c == 1) = sigmoid(U^T × q_c + b), where y_c == 1 indicates that the segment in the window is coherent, and equal to 0 indicates that the segment is incoherent.
[0118] It can be seen from the above technical solutions that this embodiment provides an optional way to generate the coherence score of the sensitive segment. Through the above method, the fluency of the sensitive segment can be better scored, and the reliability of this application can be improved.
[0119] In some embodiments of this application, the process of step S6 of performing violation recognition on the sensitive text that passes the verification is described in detail as follows:
[0120] S60. Based on a preset violation discrimination model, perform violation recognition on the sensitive text that passes the verification to obtain an identification result, where the identification result includes a violation score; when the violation score indicates that the corresponding sensitive text belongs to a violation text, the identification result also includes the sensitive words and violation categories that are hit.
[0121] Specifically, a plurality of training texts containing annotation labels can be obtained, and each annotation label indicates whether the corresponding training text is a violation. When the corresponding training text is a violation, the annotation label also includes the training sensitive words and training violation categories that are hit.
[0122] The training text may be a common published text without any variation or concatenation.
[0123] Each training text can be used to train the initial discriminant model, and the trained initial discriminant model can be used as a violation discriminant model;
[0124] The verified sensitive text is input into the violation discrimination model and the recognition result is output.
[0125] The identification result includes a violation score for characterizing the possibility of violation of the sensitive text, and when the violation score characterizes that the corresponding sensitive text is a violation text, the identification result also includes the hit sensitive word and violation category.
[0126] It can be seen from the above technical solution that this embodiment provides an optional method for identifying sensitive text in violation of regulations. Through the above method, the trained model can be used for violation identification, further improving the reliability of violation identification. At the same time, the violation discrimination model can be trained using ordinary published text without variants and splicing, and the difficulty of collecting training samples is relatively low, reducing the cost of manual annotation.
[0127] Next, we will combine Figure 2 The illegal text recognition device provided in the present application is introduced in detail. The illegal text recognition device provided below can be compared with the illegal text recognition method provided above.
[0128] See also Figure 2 It can be found that the illegal text identification device may include:
[0129] The acquisition module 10 is used to acquire a preset target sensitive word and perform character segmentation on the target sensitive word to obtain a plurality of sensitive words;
[0130] A search module 20 is used to search for a text to be detected that matches the target sensitive word;
[0131] An extraction module 30, used to locate each sensitive word in the text to be detected, and extract the error-correcting segments containing each sensitive word from the text to be detected;
[0132] A correction module 40 is used to perform text correction on the error-corrected segment to form a sensitive text, and perform a fluency check on the sensitive text;
[0133] The identification module 50 is used to identify violations of the sensitive text that has passed the verification.
[0134] Further, the search module may include:
[0135] A word count threshold calculation unit, used to calculate the word count threshold based on the number of sensitive words in the target sensitive word and a preset ratio threshold;
[0136] A text content recall unit, used to recall text content containing one or more sensitive words;
[0137] The sensitive word count determination unit is used to determine the sensitive word count of each text content, and when the sensitive word count exceeds the word count threshold, the corresponding text content is used as the text to be detected.
[0138] Furthermore, the search module may also include:
[0139] A semantic vector acquisition unit, used to acquire the semantic vector of the target sensitive word;
[0140] The published text segmentation unit is used to segment each published text into multiple published segments; match the semantic vector of each published segment with the semantic vector of the target sensitive word, and when the semantic vector of any published segment successfully matches the semantic vector of the target sensitive word, the published text is used as the text to be detected.
[0141] Furthermore, the correction module may include:
[0142] A character sorting and combining unit, used for performing multiple sorting and combining of the characters in the to-be-corrected segment to obtain multiple sorting results;
[0143] A joint probability calculation unit, used to calculate the joint probability of each sorting result using an n-gram algorithm;
[0144] The text to be corrected updating unit is used to update the text to be detected based on the sorting result with the highest joint probability among the sorting results, and obtain the sensitive text after the update.
[0145] Furthermore, the correction module may also include:
[0146] A sensitive text segmentation unit, used to segment the sensitive text to obtain multiple sensitive segments after segmentation;
[0147] a score determination unit, for determining a coherence score of each sensitive segment;
[0148] The product calculation unit is used to calculate the product of each coherence score to obtain the total coherence score of the sensitive text, and the total coherence score is used to indicate whether the sensitive text passes the fluency check.
[0149] Furthermore, the score determination unit may include:
[0150] The sensitive segment segmentation unit is used to segment each sensitive segment based on a preset character combination length to obtain multiple character combinations; convert each character combination into a semantic vector, cascade the semantic vectors, and perform nonlinear transformation on the cascaded semantic vectors to obtain a hidden layer semantic representation of the sensitive segment; and perform binary classification on the hidden layer semantic representation based on a fully connected layer to obtain a coherence score.
[0151] Furthermore, the identification module may include:
[0152] The recognition result acquisition unit is used to perform violation recognition on the sensitive text that has passed the verification based on a preset violation discrimination model to obtain a recognition result, wherein the recognition result includes a violation score; when the violation score indicates that the corresponding sensitive text is a violation text, the recognition result also includes the hit sensitive word and violation category.
[0153] The illegal text recognition device provided in the embodiment of the present application can be applied to illegal text recognition devices, such as PC terminals, cloud platforms, servers and server clusters. Figure 3 The hardware structure diagram of the illegal text recognition device is shown in FIG. Figure 3 ,The hardware structure of the illegal text recognition device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0154] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0155] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0156] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0157] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0158] Obtaining a preset target sensitive word, and performing character segmentation on the target sensitive word to obtain multiple sensitive words;
[0159] Find the text to be detected that matches the target sensitive word;
[0160] Locating each sensitive word in the text to be detected, and extracting the error-correcting segments containing each sensitive word from the text to be detected;
[0161] Performing text correction on the segment to be corrected to form a sensitive text, and performing a fluency check on the sensitive text;
[0162] Identify violations of sensitive text that has passed verification.
[0163] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0164] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0165] Obtaining a preset target sensitive word, and performing character segmentation on the target sensitive word to obtain multiple sensitive words;
[0166] Find the text to be detected that matches the target sensitive word;
[0167] Locating each sensitive word in the text to be detected, and extracting the error-correcting segments containing each sensitive word from the text to be detected;
[0168] Performing text correction on the segment to be corrected to form a sensitive text, and performing a fluency check on the sensitive text;
[0169] Identify violations of sensitive text that has passed verification.
[0170] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0171] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0172] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0173] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application can be combined with each other. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for identifying illegal texts, It is characterized in that include: Obtaining a preset target sensitive word, and performing character segmentation on the target sensitive word to obtain multiple sensitive words; Find the text to be detected that matches the target sensitive word; Locating each sensitive word in the text to be detected, and extracting the error-correcting segments containing each sensitive word from the text to be detected; Performing text correction on the segment to be corrected to form a sensitive text, and performing a fluency check on the sensitive text; Identify violations of sensitive text that has passed verification.
2. The method for identifying illegal text according to claim 1, It is characterized in that The step of searching for the text to be detected that matches the target sensitive word includes: Calculating a word count threshold based on the number of sensitive words in the target sensitive word and a preset ratio threshold; Recall text content containing more than one sensitive word; The number of sensitive words in each text content is determined, and when the number of sensitive words exceeds the word count threshold, the corresponding text content is used as the text to be detected.
3. The method for identifying illegal text according to claim 1, It is characterized in that The step of searching for the text to be detected that matches the target sensitive word includes: Obtaining a semantic vector of the target sensitive word; For each published text, the published text is segmented to form multiple published segments; the semantic vector of each published segment is matched with the semantic vector of the target sensitive word. When the semantic vector of any published segment successfully matches the semantic vector of the target sensitive word, the published text is used as the text to be detected.
4. The method for identifying illegal text according to claim 1, It is characterized in that Performing text correction on the error-corrected segment to form a sensitive text includes: Sorting and combining the characters in the to-be-corrected segment multiple times to obtain multiple sorting results; Use the n-gram algorithm to calculate the joint probability of each sorting result; Based on the sorting result with the highest joint probability among the sorting results, the text to be detected is updated to obtain the sensitive text after the update.
5. The method for identifying illegal text according to claim 1, It is characterized in that Performing a fluency check on the sensitive text includes: Segmenting the sensitive text to obtain multiple sensitive segments; Determine the coherence score for each sensitive segment; The product of each coherence score is calculated to obtain the total coherence score of the sensitive text, and the total coherence score is used to indicate whether the sensitive text passes the fluency check.
6. The method for identifying illegal text according to claim 5, It is characterized in that Determining the coherence score of each sensitive segment includes: For each sensitive fragment, the sensitive fragment is segmented based on the preset character combination length to obtain multiple character combinations; each character combination is converted into a semantic vector, the semantic vectors are cascaded, and the cascaded semantic vectors are nonlinearly transformed to obtain the hidden layer semantic representation of the sensitive fragment; the hidden layer semantic representation is binary classified based on the fully connected layer to obtain a coherence score.
7. The method for identifying illegal text according to claim 1, It is characterized in that The violation identification of the sensitive text that has passed the verification includes: Based on a preset violation discrimination model, violations are identified for the verified sensitive text to obtain an identification result, which includes a violation score. When the violation score indicates that the corresponding sensitive text is a violation text, the identification result also includes the hit sensitive word and violation category.
8. A device for identifying illegal texts, It is characterized in that include: An acquisition module is used to acquire a preset target sensitive word and perform character segmentation on the target sensitive word to obtain multiple sensitive words; A search module, used to search for text to be detected that matches the target sensitive word; An extraction module, used to locate each sensitive word in the text to be detected, and extract the error-corrected segments containing each sensitive word from the text to be detected; A correction module, used for performing text correction on the to-be-corrected segment to form a sensitive text, and performing a fluency check on the sensitive text; The identification module is used to identify violations of sensitive text that has passed the verification.
9. A device for identifying illegal texts, It is characterized in that including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the illegal text recognition method as described in any one of claims 1-7.
10. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, each step of the illegal text recognition method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Illegal gang account identification method and device, computer equipment and readable storage medium
CN120106866A
