A method, apparatus, device, and storage medium for text content review

By obtaining character risk type scores, connecting related characters, and merging friendly risk segments, the target risk segments are corrected, solving the problem that existing technologies cannot detect deliberately separated words or segments, and improving the accuracy of text content review.

CN115129867BActive Publication Date: 2026-04-03GUANGZHOU QUWAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing text content moderation methods can only review words or fragments composed of continuous characters, and cannot detect words or fragments that are deliberately separated, resulting in low accuracy.

Method used

By obtaining the risk type score of each character in the text to be reviewed, the target risk factor is determined, related characters are connected to form risk segments, friendly risk segments are merged into risk segments, and finally the target risk segments are corrected to ensure that the review results conform to the language logic.

Benefits of technology

It improves the accuracy of text content review, can detect deliberately separated words or fragments, and enhances the effectiveness of the review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129867B_ABST
    Figure CN115129867B_ABST
Patent Text Reader

Abstract

This application discloses a text content review method, apparatus, device, and storage medium. The method involves obtaining the score for each risk type corresponding to each character in the text to be reviewed, determining the target risk factor for each character based on the risk type score, identifying the associated characters corresponding to each character based on the target risk factor, connecting the character with its associated characters to obtain the risk segment corresponding to the character, identifying the friendly risk segments within each risk segment, merging each risk segment with its friendly risk segments to obtain the target risk segment for each risk segment, and finally correcting each target risk segment to conform to linguistic logic. The final risk segment is the deliberately separated words or segments extracted using this method, thereby improving the accuracy of text content review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information security technology, specifically to a text content review method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of information technology, computer networks have become an essential tool for people's daily communication and exchange. People usually communicate and exchange information by transmitting text data to each other on computer networks. Computer network terminals or servers will conduct security audits on the content of the text data to be transmitted, determine whether the text content is sensitive or poses a security risk, and thus decide whether to transmit, intercept, or process the text data.

[0003] Existing text content moderation methods can only review words or fragments composed of consecutive characters, and cannot review words or fragments that have been deliberately separated, resulting in low accuracy. Summary of the Invention

[0004] In view of this, this application provides a text content review method, apparatus, device, and storage medium to address the shortcomings of existing text content review methods, which can only review words or segments composed of continuous characters and cannot review words or segments that are deliberately separated, resulting in low review accuracy.

[0005] To achieve the above objectives, the following solution is proposed:

[0006] Firstly, a text content review method includes:

[0007] The process involves: obtaining the score for each risk type corresponding to each character in the text to be reviewed; determining the target risk factor for each character based on its score; identifying the associated characters for each character based on their target risk factors, and connecting the character with its associated characters to obtain the risk segment corresponding to the character; identifying the friendly risk segments for each risk segment, and merging each risk segment with its friendly risk segments to obtain the target risk segment for each risk segment; and correcting errors in each target risk segment to obtain the final risk segment corresponding to each target risk segment, thereby completing the review of the text to be reviewed.

[0008] Preferably, obtaining the score of each risk type corresponding to each character in the text to be reviewed includes: processing the text to be reviewed using a pre-trained risk type correspondence model to obtain the score of each risk type corresponding to each character in the text to be reviewed; the risk type correspondence model is trained by using text samples as training samples and using the score of each risk type corresponding to each character in the text samples as sample labels.

[0009] Preferably, determining the target risk factor for each character based on the score of each risk type corresponding to each character in the text to be reviewed includes: determining the risk factor corresponding to each character in each risk type based on the score of each character in the text to be reviewed; and taking the risk factor with the largest value corresponding to each character in each risk type as the target risk factor for that character.

[0010] Preferably, determining the associated characters corresponding to each character based on the target risk factor of each character includes: obtaining each adjacent step length of the character; determining the risk factor threshold corresponding to each adjacent step length of the character based on each adjacent step length of the character; comparing the risk factor threshold corresponding to each adjacent step length of the character with the target risk factor of the character and obtaining the comparison result; and determining the associated characters corresponding to the character based on the comparison result.

[0011] Preferably, determining the friendly risk segments corresponding to each risk segment includes: for each risk segment, determining the smoothing step size of the risk segment; smoothing all risk segments according to the smoothing step size of the risk segment; and among all smoothed risk segments, identifying the risk segments that overlap with the smoothed risk segment as the friendly risk segments corresponding to that risk segment.

[0012] Preferably, the step of correcting each target risk segment to obtain the final risk segment corresponding to each target risk segment includes: for each target risk segment, determining the target risk segment as the current segment to be operated on, and determining the total number of characters in the current segment to be operated on; determining the number of correction characters corresponding to the total number of characters, and determining a first character segment and a second character segment in the current segment to be operated on based on the number of correction characters; calculating the statement reasonableness probability of the first character segment and the statement reasonableness probability of the second character segment; determining whether the current segment to be operated on meets a first condition, wherein the first condition is: the statement reasonableness probability of the first character segment and the statement reasonableness probability of the second character segment are both not less than a preset statement reasonableness probability threshold; if the If the current segment to be operated on meets the first condition, then the current segment to be operated on is determined as the final risk segment; if the current segment to be operated on does not meet the first condition, then a new current segment to be operated on is determined until the new current segment to be operated on meets the first condition, and then the new current segment to be operated on is determined as the final risk segment; determining the new current segment to be operated on includes: if the reasonable probability of the statement in the first character segment is less than the reasonable probability threshold of the statement, then the first character of the string corresponding to the current segment to be operated on is deleted; if the reasonable probability of the statement in the second character segment is less than the reasonable probability threshold of the statement, then the last character of the string corresponding to the current segment to be operated on is deleted, thereby obtaining the new current segment to be operated on.

[0013] Secondly, a text content review device includes:

[0014] The system comprises the following modules: a score acquisition module for acquiring the score of each risk type corresponding to each character in the text to be reviewed; a target risk factor determination module for determining the target risk factor of each character based on the score of each risk type; a risk segment determination module for determining the associated characters corresponding to each character based on the target risk factor of each character, and connecting the character with its associated characters to obtain the risk segment corresponding to the character; a target risk segment determination module for determining the friendly risk segments corresponding to each risk segment, and merging each risk segment with its friendly risk segments to obtain the target risk segment corresponding to each risk segment; and an error correction module for correcting each target risk segment to obtain the final risk segment corresponding to each target risk segment, thereby completing the review of the text to be reviewed.

[0015] Preferably, the risk segment determination module includes: an adjacent step length acquisition module, used to acquire each adjacent step length of the character; a risk factor threshold determination module, used to determine the risk factor threshold corresponding to each adjacent step length of the character based on each adjacent step length of the character; a comparison module, used to compare the risk factor threshold corresponding to each adjacent step length of the character with the target risk factor of the character, and obtain a comparison result; and an associated character determination module, used to determine each associated character corresponding to the character based on the comparison result.

[0016] Thirdly, a text content moderation device includes a memory and a processor;

[0017] The memory is used to store a program; the processor is used to execute the program to implement the various steps of the text content review method as described in the first aspect.

[0018] Fourthly, a storage medium having a computer program stored thereon, which, when executed by a processor, implements the various steps of the text content review method as described in the first aspect.

[0019] As can be seen from the above technical solution, this application obtains the score of each risk type corresponding to each character in the text to be reviewed, determines the target risk factor of each character based on the score of each risk type, determines the corresponding related characters of each character based on the target risk factor of each character, and then connects the character with its corresponding related characters to obtain the risk segment corresponding to the character. In each risk segment, the corresponding friendly risk segments are determined, and each risk segment is merged with its corresponding friendly risk segments to obtain the target risk segment corresponding to each risk segment. Finally, each target risk segment is corrected to conform to the language logic, and the final risk segment is obtained. The final risk segment is the deliberately separated words or segments mined by this solution, thereby improving the accuracy of text content review. Attached Figure Description

[0020] Figure 1 An optional flowchart of a text content review method provided in an embodiment of this application;

[0021] Figure 2 A schematic diagram illustrating the principle of the risk type correspondence model provided in the embodiments of this application;

[0022] Figure 3 A schematic diagram illustrating the relationship between risk types and risk factors for a character, provided as an embodiment of this application;

[0023] Figure 4 and Figure 5A schematic diagram illustrating a smoothing process for a risk segment provided in an embodiment of this application;

[0024] Figure 6 A schematic diagram of a text content review device provided in an embodiment of this application;

[0025] Figure 7 This is a schematic diagram of the structure of the text content review device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] With the rapid development of information technology, computer networks have become an essential tool for people's daily communication and exchange. People usually communicate and exchange information by transmitting text data to each other on computer networks. Specifically, users upload, publish, or share text data on various social platforms, and computer network terminals or servers review the content of this text data, including security review of the text content, that is, detecting whether the text content involves illegal content such as pornography, terrorism, or malicious promotion, in order to maintain public order.

[0028] Existing text content moderation methods can only review words or fragments composed of consecutive characters, and cannot review words or fragments that are deliberately separated. If some users who maliciously disrupt public order deliberately separate sensitive words or fragments, the existing moderation methods cannot detect these words or fragments, resulting in low accuracy.

[0029] Based on the above-mentioned shortcomings, this application provides a text content review scheme, which will be implemented through the following steps. Figure 1 The text content review method of this application is explained, such as... Figure 1 As shown, the method includes:

[0030] S1: Obtain the score for each risk type corresponding to each character in the text to be reviewed.

[0031] Before proceeding with this step, you can pre-set various risk types corresponding to different characters. Each character can correspond to multiple risk types, and each character has its own score for each risk type.

[0032] For example, risk types can include: terrorism, pornography, insults, blacklists, prohibited items, advertising, etc. If there is a character "X2" in the text to be reviewed, we can first determine the risk type corresponding to that character, and then obtain the score of that character belonging to this risk type.

[0033] S2: Determine the target risk factor for each character based on the score of each risk type corresponding to each character in the text to be reviewed.

[0034] Specifically, in step S1, the scores for each risk type corresponding to each character have been obtained. Taking the character "X2" as an example, the risk types it corresponds to can be "insult", "advertisement", "prohibited", etc., with corresponding risk type scores of 0.4, 0.1, and 0.2, respectively. Then, the target risk factor corresponding to the character is determined based on the corresponding risk type scores.

[0035] S3: Based on the target risk factor of each character, determine the associated characters corresponding to that character, and connect the character with its associated characters to obtain the risk segment corresponding to that character.

[0036] In step S2, the target risk factor for each character is obtained. For a given character, based on the target risk factor, the associated characters corresponding to that character can be determined. That is, in the text to be reviewed, which characters can be connected with that character to form words or fragments. Each character that can be connected with that character to form words or fragments is taken as the associated characters of that character. The character is then connected with each of its associated characters to obtain the words or fragments corresponding to that character. These words or fragments are then taken as the risk fragments corresponding to that character.

[0037] S4: In each risk segment, identify the corresponding friendly risk segments for each risk segment, and merge each risk segment with its corresponding friendly risk segments to obtain the target risk segment for each risk segment.

[0038] Specifically, for each risk segment, we determine its corresponding friendly risk segments. A friendly risk segment is a risk segment that can be merged with the risk segment to form a longer segment. The merged segment is then used as the target risk segment of the risk segment.

[0039] S5: Correct each target risk segment to obtain the final risk segment corresponding to each target risk segment, thereby completing the review of the text to be reviewed.

[0040] The target risk segment corresponding to each risk segment obtained in step S4 may not conform to the language logic. Therefore, it is necessary to correct each target risk segment and take the corrected target risk segment as the final risk segment corresponding to each target risk segment, thereby completing the review of the text to be reviewed.

[0041] As can be seen from the above technical solution, this application obtains the score of each risk type corresponding to each character in the text to be reviewed, determines the target risk factor of each character based on the score of each risk type, determines the corresponding related characters of each character based on the target risk factor of each character, and then connects the character with its corresponding related characters to obtain the risk segment corresponding to the character. In each risk segment, the corresponding friendly risk segments are determined, and each risk segment is merged with its corresponding friendly risk segments to obtain the target risk segment corresponding to each risk segment. Finally, each target risk segment is corrected to conform to the language logic, and the final risk segment is obtained. The final risk segment is the deliberately separated words or segments mined by this solution, thereby improving the accuracy of text content review.

[0042] Optionally, in step S1, the method for obtaining the score of each risk type corresponding to each character in the text to be reviewed may include:

[0043] A pre-trained risk type mapping model is used to process the text to be reviewed, obtaining the score for each risk type corresponding to each character in the text. The risk type mapping model is trained using text samples as training samples and the score for each risk type corresponding to each character in the text samples as sample labels. The score can be calculated using the following formula:

[0044] logits = tf.matmul(X, W) + bias

[0045] Please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the principle of the risk type-corresponding model. Here, `tf.matmul` represents the product of matrices X and W, where W is the weight matrix composed of [w1, w2, w3, ...], X is the input vector matrix composed of [x1, x2, x3, ...], and `bias` represents the bias term constant. Figure 2 The "1" in the example. Figure 2As shown, input represents the text to be reviewed, logit represents the weighted sum, f(x) represents the activation function, and output is logits, which is the score of each risk type corresponding to each character in the text to be reviewed.

[0046] The logits output by the model corresponding to the above risk types can be represented as Z. ij Z ij This represents the score of the j-th risk type corresponding to the i-th character in the text to be reviewed.

[0047] In step S2, the target risk factor for each character is determined based on the score of each risk type corresponding to each character in the text to be reviewed. This process may include:

[0048] This process can utilize Z ij Formulas for calculating risk factors:

[0049]

[0050] For a single character, P ij This represents the risk factor corresponding to the j-th risk type of the i-th character in the text to be reviewed;

[0051] The values ​​of the risk factors corresponding to the character are compared, and the risk factor with the highest value is taken as the target risk factor. For example, the character "X2" mentioned above corresponds to the risk types "insult," "advertisement," and "prohibition," with corresponding risk type scores of 0.4, 0.1, and 0.2, respectively. Therefore, using the above formula, the risk factors for this character are calculated to be 0.59, 0.52, and 0.55. The highest value is 0.59, so the target risk factor for this character is 0.59. This can be understood as: the target risk factor for this character represents the risk type to which the character has the highest probability of belonging. The correspondence between the risk type and the risk factor for each character in the text to be reviewed can be shown as follows: Figure 3 As shown, Figure 3 The first column represents the risk type, and the last row represents a portion of the text to be reviewed.

[0052] After obtaining the target risk factor for each character in the text to be reviewed, for each character, the adjacent step lengths of the character can be obtained. Then, based on the adjacent step lengths of the character, the risk factor thresholds corresponding to the adjacent step lengths of the character are determined. The risk factor thresholds corresponding to the adjacent step lengths of the character are compared with the target risk factor of the character, and the comparison results are obtained. Finally, based on the comparison results, the associated characters corresponding to the character are determined.

[0053] For example, for the character "X2", we obtain its adjacent step lengths. First, we set the associated risk level of this character to N levels, assuming N=3. Then, the adjacent step lengths can be 0, 1, or 2, which can be understood as the number of characters between them. We represent the risk factor threshold corresponding to each adjacent step length as p_risk_thn, where n represents the risk level. We represent the target risk factor for this character as p_risk. Based on these three adjacent step lengths, we can determine the risk factor thresholds corresponding to each adjacent step length as p_risk_th0=0, p_risk_th1=0.6, and p_risk_th2=0.8. We then compare these three risk factor thresholds with the target risk factor for this character according to the following rules:

[0054] If p_risk_th1≥p_risk>p_risk_th0, then the character corresponding to the adjacent step size of 0 of the character is taken as the associated character of the character;

[0055] If p_risk_th2≥p_risk>p_risk_th1, then the character corresponding to the adjacent step size of 1 of the character is taken as the associated character of the character;

[0056] If p_risk > p_risk_th2, then the character corresponding to the adjacent step size of 2 of that character is taken as the associated character of that character.

[0057] In the above steps, the target risk factor of the character is 0.59. Therefore, according to the comparison rule, the comparison result is 0.6 > 0.59 > 0. Thus, the character with an adjacent step size of 0 is the associated character of the character, that is, there is no gap between the character and its adjacent characters. Therefore, "X1" and "X3" are both associated characters of "X2". "X2" can be connected with "X1" and "X3" respectively to obtain "X1X2X3".

[0058] In the same way, “X3” can be connected to “X5”, “X5” can be connected to “,”, and “X6” can be connected to “X7”, thus obtaining multiple risk segments: “X1X2X3”, “X5,” and “X6X7”.

[0059] Optionally, determine the corresponding friendly risk segments for each of the above risk segments. The specific steps are as follows:

[0060] Determine the smoothing step size for the risk segment; smooth all risk segments according to the smoothing step size; among all smoothed risk segments, identify the risk segments that overlap with the smoothed risk segment as the corresponding friendly risk segments.

[0061] Please refer to Figure 4 and Figure 5 , Figure 4 and Figure 5 This is a schematic diagram of the risk segment smoothing process, where, Figure 4 The two black boxes in the image represent "X1X2X3" and "X5," which are the positions of these two risk segments before smoothing. The smoothing step size for risk segment "X1X2X3" is determined to be 1. Figure 5 This indicates the smoothed positions of "X1X2X3" and "X5".

[0062] As shown in Figure 5, the risk segments “X1X2X3” and “X5” overlap. Therefore, for “X1X2X3”, the risk segment “X5” is a friendly risk segment of “X1X2X3”. The two can be merged, and the merged risk segment “X1X2X3X5” is the target risk segment corresponding to “X1X2X3”.

[0063] In step S5 above, the process of correcting errors for each target risk segment to obtain the final risk segment corresponding to each target risk segment may include:

[0064] For each target risk segment, the target risk segment is designated as the current segment to be operated on, and the total number of characters in the current segment to be operated on is determined. The number of error correction characters corresponding to the total number of characters is determined, and the first character segment and the second character segment are determined in the current segment to be operated on based on the number of error correction characters. The reasonable probability of the statement in the first character segment and the reasonable probability of the statement in the second character segment are calculated. It is determined whether the current segment to be operated on meets the first condition, which is that the reasonable probability of the statement in the first character segment and the reasonable probability of the statement in the second character segment are both not less than a preset reasonable probability threshold. If the current segment to be operated on meets the first condition, it is designated as the final risk segment. If the current segment to be operated on does not meet the first condition, a new current segment to be operated on is determined until the new current segment to be operated on meets the first condition, and the new current segment to be operated on is designated as the final risk segment. Determining the new current segment to be operated on includes: if the reasonable probability of the statement in the first character segment is less than the reasonable probability threshold, the first character of the string corresponding to the current segment to be operated on is deleted; if the reasonable probability of the statement in the second character segment is less than the reasonable probability threshold, the last character of the string corresponding to the current segment to be operated on is deleted, thereby obtaining a new current segment to be operated on.

[0065] Optionally, the process of calculating the reasonable probability of the statement in the first character segment may include:

[0066] Define the number of error correction characters as m. Based on the number of error correction characters m, obtain the number of error correction sub-characters m1, m2 and m3, where 1≤m1<m2<m3≤m, and m, m1, m2 and m3 are all positive integers.

[0067] Based on the number of error-correcting sub-characters m1, m2, and m3, determine the first sub-character segment, the second sub-character segment, and the third sub-character segment corresponding to the first character segment;

[0068] Calculate the reasonable sub-probability of the statement for the first sub-character segment, p(m1), the reasonable sub-probability of the statement for the second sub-character segment, and the reasonable sub-probability of the statement for the third sub-character segment using the formula for calculating the reasonable sub-probability of the statement.

[0069] The formula for calculating the probability of a statement being reasonable is:

[0070] p=p(w1)*p(w2|w1)*p(w3|w1,w2)...p(w m |w1,...,w m-1 );

[0071] In this context, the first character of the string corresponding to the segment to be operated on is taken as the first character of the segment to be operated on. m This represents the m-th character of the segment to be operated on;

[0072] Based on p(m1), p(m2), and p(m3), the probability P of a statement in the first character segment is obtained. m The calculation formula is:

[0073] P m =alpha1*p(m1)+alpha2*p(m2)+alpha3*p(m3),

[0074] Here, alpha1, alpha2, and alpha3 represent weights, and alpha1 + alpha2 + alpha3 = 1.

[0075] Specifically, for one target risk segment, this target risk segment is designated as the current segment to be operated on. First, the total number of characters in the current segment to be operated on is determined. For example, if the total number of characters is 10, then the number of error correction characters corresponding to the total number of characters must be less than or equal to the total number of characters. The number of error correction characters can be determined as 8. Based on the number of error correction characters, the first character segment and the second character segment are determined. The first character segment can be the segment of 8 characters starting from the first character of the current segment to be operated on. For segments to be operated on from left to right, the first character segment can be the segment of characters from the first character on the left to the 8th character on the right. For segments to be operated on from top to bottom, the first character segment can be the segment of characters from the first character on top to the 8th character on bottom. The second character segment can be the segment of 8 characters starting from the last character of the current segment to be operated on. For segments to be operated on from left to right, the second character segment can be the segment of characters from the first character on the right to the 8th character on the left. For segments to be operated on from top to bottom, the second character segment can be the segment of characters from the first character on bottom to the 8th character on top.

[0076] After determining the first and second character segments, calculate their statement reasonableness probability thresholds. Since the risk segments were merged in the previous steps to obtain the target risk segment, it is necessary to correct the target risk segment, i.e., the segment to be operated on, to ensure that the segment to be operated on meets the statement reasonableness requirements. Specific steps include:

[0077] Based on the number of correction characters, we can determine the number of correction sub-characters. Taking 8 correction characters as an example, the number of correction sub-characters can be determined to be 2, 3, and 5.

[0078] For the first character segment, the determination of the first sub-character segment, the second sub-character segment, and the third sub-character segment can be done in the same way as the determination of the first character segment, and will not be elaborated here.

[0079] For the second character segment, the determination of the first, second, and third sub-character segments is similar to that of the first character segment, and will not be elaborated further here. For the second character segment, in the formula for calculating the probability of a statement's validity...

[0080] p=p(w1)*p(w2|w1)*p(w3|w1,w2)...p(w m |w1,...,w m-1 ), w m This indicates the m-th character of the segment to be operated on, counting from right to left or from bottom to top (i.e., from the bottom).

[0081] Optionally, when the number of error correction characters is less than 5, the value of alpha3 is proportionally transferred to alpha1 and alpha2, and alpha3 is set to 0; when the number of error correction characters is less than 3, alpha1 is set to 1 directly.

[0082] In another embodiment of this application, an n-gram model or an RNN-based LM algorithm can be used to correct errors in the target risk segment.

[0083] The text content review device provided in the embodiments of this application is described below. The text content review device described below can be referred to in correspondence with the text content review method described above.

[0084] Combination Figure 6 The text content review device is introduced, such as... Figure 6 As shown, the auditing device may include:

[0085] The score acquisition module 10 is used to acquire the score for each risk type corresponding to each character in the text to be reviewed.

[0086] The target risk factor determination module 20 is used to determine the target risk factor for each character based on the score of each risk type corresponding to each character in the text to be reviewed.

[0087] The risk segment determination module 30 is used to determine the associated characters corresponding to each character based on the target risk factor of each character, and to connect the character with its associated characters to obtain the risk segment corresponding to the character.

[0088] The target risk segment determination module 40 is used to determine each friendly risk segment corresponding to each risk segment in each risk segment, and merge each risk segment with its corresponding friendly risk segments to obtain the target risk segment corresponding to each risk segment.

[0089] The error correction module 50 is used to correct each target risk segment to obtain the final risk segment corresponding to each target risk segment, so as to complete the review of the text to be reviewed.

[0090] Preferably, the risk segment determination module includes:

[0091] The adjacent step size acquisition module is used to acquire the adjacent step sizes of the character.

[0092] The risk factor threshold determination module is used to determine the risk factor threshold corresponding to each adjacent step length of the character based on each adjacent step length of the character.

[0093] The comparison module is used to compare the risk factor thresholds corresponding to each adjacent step of the character with the target risk factor of the character and obtain the comparison results.

[0094] The associated character determination module is used to determine the associated characters corresponding to the given character based on the comparison results.

[0095] Furthermore, embodiments of this application provide a text content review device. Optionally, Figure 7 The hardware structure block diagram of the text content moderation device is shown below. Figure 7 The hardware structure of a text content review device may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0096] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0097] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0098] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0099] The memory stores a program, and the processor can call the program stored in the memory. The program is used to execute the text content review method described in the method embodiment.

[0100] Optionally, the refined and extended functions of the program can be found in the description of the text content review method in the method embodiments.

[0101] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used to execute the text content review method described in the method embodiment.

[0102] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.

[0103] Optionally, the refined and extended functions of the program can be found in the description of the text content review method in the method embodiments.

[0104] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.

[0105] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0106] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0107] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for reviewing text content, characterized in that, include: Obtain the score for each risk type corresponding to each character in the text to be reviewed; Based on the scores of each risk type corresponding to each character in the text to be reviewed, determine the target risk factor for each character; Based on the target risk factor of each character, determine the associated characters corresponding to that character, where the associated characters are characters connected to the character to form words or segments, and connect the character with its associated characters to obtain the risk segment corresponding to the character; including: obtaining the adjacent step lengths of the character; determining the risk factor thresholds corresponding to each adjacent step length of the character based on the adjacent step lengths of the character; comparing the risk factor thresholds corresponding to each adjacent step length of the character with the target risk factor of the character and obtaining the comparison result; and determining the associated characters corresponding to the character based on the comparison result. In each of the aforementioned risk segments, each corresponding friendly risk segment is identified, and each risk segment is merged with its corresponding friendly risk segments to obtain a target risk segment for each risk segment. For each risk segment, its corresponding friendly risk segment is a risk segment that is merged with that risk segment to form a longer segment. This includes: for each risk segment, determining the smoothing step size for that risk segment; smoothing all risk segments according to the smoothing step size; and among all the smoothed risk segments, identifying the risk segments that overlap with the smoothed risk segment as the corresponding friendly risk segments. Each target risk segment is corrected to obtain the final risk segment corresponding to each target risk segment, thereby completing the review of the text to be reviewed.

2. The method according to claim 1, characterized in that, The process of obtaining the score for each risk type corresponding to each character in the text to be reviewed includes: The text to be reviewed is processed using a pre-trained risk type correspondence model to obtain the score of each risk type corresponding to each character in the text to be reviewed. The risk type correspondence model is trained by using text samples as training samples and using the score of each risk type corresponding to each character in the text samples as sample labels.

3. The method according to claim 1, characterized in that, The step of determining the target risk factor for each character based on the score of each risk type corresponding to each character in the text to be reviewed includes: Based on the score of each risk type corresponding to each character in the text to be reviewed, determine the risk factor corresponding to each character in each risk type; The risk factor with the highest value for each character across all risk types is taken as the target risk factor for that character.

4. The method according to claim 1, characterized in that, The step of correcting errors in each target risk segment to obtain the final risk segment corresponding to each target risk segment includes: For each of the target risk segments, the target risk segment is determined as the current segment to be operated on, and the total number of characters of the current segment to be operated on is determined; Determine the number of error correction characters corresponding to the total number of characters, and determine the first character segment and the second character segment in the current segment to be operated based on the number of error correction characters; Calculate the probability of a statement being reasonable in the first character segment and the probability of a statement being reasonable in the second character segment; statement reasonable probability The calculation formula is: ; in, To correct the number of characters, , and All are the number of correction sub-characters. ,and , , and All are positive integers. , and Indicates weight, and , , and These are the probabilities of a statement being valid in the first sub-segment, second sub-segment, and third sub-segment, respectively, corresponding to either the first or second character segment. The formula for calculating the probability of a statement being valid in the third sub-segment is as follows: ; For the first character segment, the first character of the string corresponding to the segment to be operated on is taken as the first character of the segment to be operated on. Indicates the first segment to be operated on. One character; for the second character segment Indicates the last segment in the sequence to be operated on. One character; Determine whether the current segment to be operated on meets the first condition, wherein the first condition is: the reasonable probability of the statement in the first character segment and the reasonable probability of the statement in the second character segment are both not less than a preset reasonable probability threshold. If the current segment to be operated on meets the first condition, then the current segment to be operated on is determined as the final risk segment; If the current segment to be operated does not meet the first condition, a new current segment to be operated is determined until the new current segment to be operated meets the first condition, and the new current segment to be operated is determined as the final risk segment. The process of determining the new segment to be operated on includes: If the reasonable probability of the statement in the first character segment is less than the reasonable probability threshold of the statement, then delete the first character of the string corresponding to the current segment to be operated on; If the reasonable probability of the statement in the second character segment is less than the reasonable probability threshold of the statement, then the last character of the string corresponding to the current segment to be operated on is deleted, thereby obtaining the new current segment to be operated on.

5. A text content review device, characterized in that, include: The score acquisition module is used to obtain the score for each risk type corresponding to each character in the text to be reviewed; The target risk factor determination module is used to determine the target risk factor for each character based on the score of each risk type corresponding to each character in the text to be reviewed. A risk segment determination module is used to determine the associated characters corresponding to each character based on the target risk factor of each character. The associated characters are characters that connect with the character to form words or segments. The module connects the character with its associated characters to obtain the risk segment corresponding to the character. The module includes: an adjacent step length acquisition module for acquiring the adjacent step lengths of the character; a risk factor threshold determination module for determining the risk factor threshold corresponding to each adjacent step length of the character; a comparison module for comparing the risk factor threshold corresponding to each adjacent step length of the character with the target risk factor of the character and obtaining the comparison result; and an associated character determination module for determining the associated characters corresponding to the character based on the comparison result. The target risk segment determination module is used to determine each friendly risk segment corresponding to each of the risk segments, merge each risk segment with its corresponding friendly risk segments to obtain the target risk segment corresponding to each risk segment; for each risk segment, its corresponding friendly risk segment is the risk segment that is merged with the risk segment to form a longer segment; including: for each risk segment, determining the smoothing step size of the risk segment; smoothing all risk segments according to the smoothing step size of the risk segment; among all the smoothed risk segments, identifying the risk segments that overlap with the smoothed risk segment as the corresponding friendly risk segments of the risk segment; The error correction module is used to correct each of the target risk segments to obtain the final risk segment corresponding to each target risk segment, so as to complete the review of the text to be reviewed.

6. A text content review device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the text content review method as described in any one of claims 1-4.

7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements each step of the text content review method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Sensitive text determination method and device

    CN109657228A

  • Risk text recognition method and device, computer equipment and storage medium

    CN112686036A