Text detection method, computer device and storage medium
Patent Information
- Application Number
- CN202310598077.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-05-24
AI Technical Summary
然而,针对关键词特征不明显或者存在歧义的文本,基于关键词匹配的文本检测方法,容易导致文本检测的准确率较低
[0056]上述文本检测方法、计算机设备、存储介质和计算机程序产品,首先对待检测文本与样本关键词进行匹配处理;样本关键词为样本异常文本中的异常词汇;然后在待检测文本与样本关键词匹配失败的情况下,将待检测文本与样本异常文本进行匹配处理;接着又在待检测文本与样本异常文本匹配失败的情况下,获取待检测文本与预设异常类别之间的相关性信息;预设异常类别通过对样本异常文本进行分类得到;最后在相关性信息满足预设相关性条件的情况下,将待检测文本确定为异常文本。这样,通过关键词匹配,能够初步筛选出明显含有异常词汇的文本;接着又通过文本匹配,能够进一步筛选出含有异常内容的文本;最后再通过类别匹配,能够对关键词匹配与文本匹配均未匹配成功的文本再次进行检测,从而筛选出关键词特征不明显或内容特征不明显的文本。通过以上三种匹配方式的结合,能够将关键词异常、内容异常以及特征不明显的异常文本尽可能地识别出来,从而提高了文本检测的准确率。
Smart Images

Figure CN116738988B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a text detection method, computer device, storage medium, and computer program product. Background Technology
[0002] With the popularization of internet technology, more and more people are publishing information online. However, much of this information contains abnormal or sensitive content, thus necessitating text detection of online information.
[0003] Existing text detection technologies typically perform keyword matching on the text. If the text contains words from a keyword database, it indicates that the text contains sensitive content and requires appropriate processing. However, for texts with unclear or ambiguous keyword features, keyword matching-based text detection methods tend to have low accuracy. Summary of the Invention
[0004] Therefore, it is necessary to provide a text detection method, computer device, computer-readable storage medium, and computer program product that can improve accuracy in addressing the aforementioned technical problems.
[0005] Firstly, this application provides a text detection method. The method includes:
[0006] The text to be detected is matched with sample keywords; the sample keywords are abnormal words in the abnormal sample text.
[0007] If the text to be detected fails to match the sample keywords, the text to be detected is matched with the abnormal sample text.
[0008] If the text to be detected fails to match the sample abnormal text, the correlation information between the text to be detected and the preset abnormal category is obtained; the preset abnormal category is obtained by classifying the sample abnormal text.
[0009] If the correlation information meets the preset correlation conditions, the text to be detected is identified as abnormal text.
[0010] In one embodiment, the matching process between the text to be detected and the sample abnormal text includes:
[0011] Obtain the target text feature vector of the text to be detected;
[0012] Based on the target text feature vector of the text to be detected, query sample abnormal texts that are similar to the text to be detected in the sample abnormal texts;
[0013] If no similar sample abnormal text is found in the sample abnormal text, it is determined that the text to be detected fails to match the sample abnormal text.
[0014] In one embodiment, the step of querying sample abnormal texts similar to the text to be detected in the sample abnormal texts based on the target text feature vector of the text to be detected includes:
[0015] The target text feature vector of the text to be detected is divided to obtain multiple sub-feature vectors;
[0016] From the candidate abnormal text set, determine the abnormal text set corresponding to each sub-feature vector; the candidate abnormal text set is obtained by clustering the sample abnormal texts;
[0017] Based on the abnormal text sets corresponding to each of the sub-feature vectors, sample abnormal texts similar to the text to be detected are obtained.
[0018] In one embodiment, obtaining the target text feature vector of the text to be detected includes:
[0019] Obtain the initial text feature vector of the text to be detected, and perform multiple randomization processes on the initial text feature vector;
[0020] Obtain the minimum hash value of the initial text feature vector after each disordering process;
[0021] Based on the minimum hash values of the text to be detected, the hash signature vector of the text to be detected is obtained;
[0022] The hash signature vector of the text to be detected is subjected to hash mapping processing to obtain the target text feature vector of the text to be detected.
[0023] In one embodiment, the matching process between the text to be detected and the sample keywords includes:
[0024] In at least one substring corresponding to the text to be detected, a substring identical to the sample keyword is queried; the at least one substring corresponding to the text to be detected is obtained by dividing the string of the text to be detected.
[0025] If no substring in at least one substring corresponding to the text to be detected is identical to the sample keyword, it is determined that the text to be detected fails to match the sample keyword.
[0026] In one embodiment, after querying at least one substring corresponding to the text to be detected that is the same as the sample keyword, the method further includes:
[0027] If, in at least one substring corresponding to the text to be detected, there exists a substring that is identical to the sample keyword, it is determined that the text to be detected is successfully matched with the sample keyword, and the sample keyword that is identical to the substring is determined as the target keyword;
[0028] Based on the type of the target keyword, the text to be detected is processed accordingly to handle abnormal text.
[0029] In one embodiment, after matching the text to be detected with the sample keywords and then performing matching processing on the text to be detected and the sample abnormal text, the method further includes:
[0030] If the text to be detected fails to match the abnormal sample text, the similarity between the text to be detected and the candidate text cluster is obtained; the candidate text cluster is obtained by clustering the detected text.
[0031] Based on the similarity, the associated text clusters of the text to be detected are determined from the candidate text clusters;
[0032] The text to be detected is added to the associated text cluster to obtain the target text cluster;
[0033] If there is text of a preset type in the target text cluster, update the abnormal text library corresponding to the abnormal sample text according to the target text cluster, identify abnormal keywords from the target text cluster, and update the keyword library corresponding to the abnormal sample keywords according to the abnormal keywords.
[0034] In one embodiment, before matching the text to be detected with sample keywords, the method further includes:
[0035] Identify the target text region from the image to be detected;
[0036] The target text region is preprocessed; the preprocessing includes at least combination processing and sorting processing.
[0037] The text to be detected is identified from the preprocessed target text region.
[0038] In one embodiment, regions containing text in the image to be detected are identified as initial text regions;
[0039] Determine the recognition confidence level of the initial text region;
[0040] The initial text region whose recognition confidence level meets the preset confidence threshold is determined as the target text region.
[0041] Secondly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0042] The text to be detected is matched with sample keywords; the sample keywords are abnormal words in the abnormal sample text.
[0043] If the text to be detected fails to match the sample keywords, the text to be detected is matched with the abnormal sample text.
[0044] If the text to be detected fails to match the sample abnormal text, the correlation information between the text to be detected and the preset abnormal category is obtained; the preset abnormal category is obtained by classifying the sample abnormal text.
[0045] If the correlation information meets the preset correlation conditions, the text to be detected is identified as abnormal text.
[0046] Thirdly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0047] The text to be detected is matched with sample keywords; the sample keywords are abnormal words in the abnormal sample text.
[0048] If the text to be detected fails to match the sample keywords, the text to be detected is matched with the abnormal sample text.
[0049] If the text to be detected fails to match the sample abnormal text, the correlation information between the text to be detected and the preset abnormal category is obtained; the preset abnormal category is obtained by classifying the sample abnormal text.
[0050] If the correlation information meets the preset correlation conditions, the text to be detected is identified as abnormal text.
[0051] Fourthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0052] The text to be detected is matched with sample keywords; the sample keywords are abnormal words in the abnormal sample text.
[0053] If the text to be detected fails to match the sample keywords, the text to be detected is matched with the abnormal sample text.
[0054] If the text to be detected fails to match the sample abnormal text, the correlation information between the text to be detected and the preset abnormal category is obtained; the preset abnormal category is obtained by classifying the sample abnormal text.
[0055] If the correlation information meets the preset correlation conditions, the text to be detected is identified as abnormal text.
[0056] The aforementioned text detection method, computer equipment, storage medium, and computer program product first match the text to be detected with sample keywords; the sample keywords are anomalous words in the sample anomalous text. Then, if the text to be detected fails to match the sample keywords, it matches the text to be detected with the sample anomalous text. Next, if the text to be detected fails to match the sample anomalous text again, it obtains the correlation information between the text to be detected and a preset anomalous category; the preset anomalous category is obtained by classifying the sample anomalous text. Finally, if the correlation information meets the preset correlation conditions, the text to be detected is identified as anomalous text. In this way, keyword matching can initially filter out texts that clearly contain anomalous words; then, text matching can further filter out texts containing anomalous content; finally, category matching can re-detect texts that fail to match either keyword or text, thereby filtering out texts with unclear keyword or content features. By combining these three matching methods, anomalous texts with keyword anomality, content anomality, and unclear features can be identified as much as possible, thus improving the accuracy of text detection. Attached Figure Description
[0057] Figure 1 This is a flowchart illustrating a text detection method in one embodiment;
[0058] Figure 2 This is a schematic diagram of a keyword tree in one embodiment;
[0059] Figure 3 This is a flowchart illustrating the steps of updating the abnormal text database and the keyword database in one embodiment;
[0060] Figure 4 This is a flowchart illustrating the steps for obtaining the target text cluster of the text to be detected in one embodiment;
[0061] Figure 5 This is a schematic diagram of the image to be detected in one embodiment;
[0062] Figure 6 This is a flowchart illustrating the text detection method in another embodiment;
[0063] Figure 7 This is a flowchart illustrating a method for identifying and blocking images containing sensitive text in one embodiment;
[0064] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0066] In one exemplary embodiment, such as Figure 1 As shown, a text detection method is provided. This embodiment illustrates the application of this method to a server; it is understood that this method can also be applied to a terminal, and further to a system including both a server and a terminal, and is implemented through interaction between the server and the terminal. The server can be a standalone server or a server cluster composed of multiple servers; the terminal can be, but is not limited to, various personal computers, laptops, smartphones, and tablets. In this embodiment, the method includes the following steps:
[0067] Step S102: Match the text to be detected with the sample keywords.
[0068] Among them, the sample keywords are abnormal words in the abnormal sample text, such as fundraising.
[0069] Among them, the matching of the text to be detected with the sample keywords is called keyword matching; the purpose of keyword matching is to filter out text containing abnormal words from the text to be detected.
[0070] Specifically, the server performs keyword matching between the text to be detected and the sample keywords. If the sample keywords are not present in the text to be detected, the text to be detected is determined to have failed to match the sample keywords. If the sample keywords are present in the text to be detected, the text to be detected is determined to have successfully matched the sample keywords, and the text to be detected is identified as abnormal text. Then, abnormal text processing is performed on the text to be detected.
[0071] For example, keyword matching algorithms can employ string search algorithms such as AC multi-pattern matching, the specific process of which is as follows:
[0072] The server first constructs a keyword tree based on sample keywords; assuming the sample keywords are "who is he", "he does not", "he does not like", and "does not like drinking water", the server obtains as Figure 2 shown the keyword tree, and in the path corresponding to each sample keyword, the node corresponding to the last character of the sample keyword is determined as the end node of the sample keyword. For example, in the sample keyword "he does not", node ④ "does not" is the end node. Meanwhile, the server constructs a failure node for each node; specifically, the string on the path corresponding to the failure node is the longest suffix of the string on the path corresponding to the current node. For example, referring to Figure 2 , for node ④ "does not", the string on its corresponding path is "he does not", and the corresponding longest suffix is "does not", therefore node ⑦ "does not" is the failure node of node ④; for another example, for node ⑤ "like", the string on its corresponding path is "he does not like", and the corresponding longest suffix is "does not like", therefore node ⑧ "like" is the failure node of node ⑤ (the string on the path corresponding to node ⑧ is "does not like"); the failure node of a node for which the longest suffix cannot be found in the keyword tree is set as the root node.
[0073] Taking "he does not like drinking water" as the text to be detected for keyword matching, the server first starts from the root node, searches for a node identical to the character "he" among the child nodes of the root node, and the search result is node ①; then the server searches for a node identical to the character "does not" among the child nodes of node ①, the search result is node ④, and node ④ is the end node of the sample keyword "he does not", indicating that the text to be detected contains the sample keyword "he does not", that is, the matching between the text to be detected and the sample keyword "he does not" is successful; next the server searches for a node identical to the character "like" among the child nodes of node ④, and the search result is node ⑤; then the server searches for a node identical to the character "drink" among the child nodes of node ⑤, the search fails, so the server jumps to the failure node of node ⑤ — node ⑧, searches for a node identical to the character "drink" among the child nodes of node ⑧, the search result is node ⑨; then the server searches for a node identical to the character "water" among the child nodes of node ⑨, the search result is node ⑩, and node ⑩ is the end node of the sample keyword "does not like drinking water", indicating that the text to be detected contains the sample keyword "does not like drinking water", that is, the matching between the text to be detected and the sample keyword "does not like drinking water" is successful, and at this time the last character "water" of the text to be detected has been matched, so the matching ends.
[0074] Understandably, if node ⑩ is not the character "water" (meaning no node with the same character "water" is found among the child nodes of node ⑨), and the jump node of node ⑨ is the root node, the server will also end the matching. Through the above process, the server can filter out text containing abnormal words from the text to be detected and identify it as abnormal text. Then, it performs corresponding abnormal text processing on these identified abnormal texts, such as directly blocking abnormal text to prevent it from appearing on web pages or applications, or recalling abnormal texts for manual review to determine whether the text can be published.
[0075] Step S104: If the text to be detected fails to match the sample keywords, the text to be detected will be matched with the abnormal sample text.
[0076] Among them, the matching of the text to be detected with the sample keywords is content-based text matching; the purpose of text matching is to filter out texts that, although they do not contain abnormal words, contain content that, in combination with the context, is pre-defined abnormal content.
[0077] The sample abnormal text contains pre-defined abnormal content.
[0078] Specifically, when the text to be detected fails to match the sample keywords, the server performs content-based text matching between the text to be detected and the sample abnormal text. From the text to be detected, it filters out the text to be detected that is similar in content to the sample abnormal text and identifies it as abnormal text. Then, it performs corresponding abnormal text processing on the text to be detected.
[0079] For example, assuming that through the matching process between the text to be detected and the sample abnormal text, the server can determine that the text to be detected 1 is similar in content to sample abnormal text 1, sample abnormal text 8, and sample abnormal text 29, then it means that the text to be detected 1 has been successfully matched with the sample abnormal text, the text to be detected 1 is abnormal text, and the server needs to perform corresponding abnormal text processing on the text to be detected 1.
[0080] Step S106: If the text to be detected fails to match the sample abnormal text, obtain the correlation information between the text to be detected and the preset abnormal category.
[0081] Among them, the preset anomaly category refers to the preset category used for NLP (Natural Language Processing) classification. The preset anomaly category is obtained by classifying the sample anomaly text.
[0082] The purpose of obtaining the correlation information between the text to be detected and the preset anomaly category is to filter out texts with unclear keyword features or unclear content features.
[0083] Among them, the correlation information between the text to be detected and the preset anomaly categories is the recognition probability of the text to be detected for each preset anomaly category. The recognition probability is used to characterize the possibility that the text to be detected belongs to a certain preset anomaly category.
[0084] Specifically, when the text to be detected fails to match the sample abnormal text, the server uses an NLP classification model to determine the correlation information between the text to be detected and each preset abnormal category.
[0085] Step S108: If the relevance information meets the preset relevance conditions, the text to be detected is identified as abnormal text.
[0086] The preset relevance condition is a threshold condition for the recognition probability. If the recognition probability is greater than this threshold condition, it means that the text to be detected has matched the corresponding preset anomaly category. For example, if the preset relevance condition for the preset anomaly category is 0.75, and the recognition probability between the text to be detected and the preset anomaly category A is 0.8, then the server can determine that the text to be detected has matched the preset anomaly category A, that is, the text to be detected is an anomaly text.
[0087] Specifically, the server determines the correlation information between the text to be detected and each preset anomaly category, and compares the correlation information with the corresponding preset correlation conditions. If the correlation information is greater than the corresponding preset correlation conditions, it means that the text to be detected has hit the corresponding preset anomaly category. Therefore, the text to be detected is identified as an anomaly text, and the corresponding anomaly text processing is performed on the text to be detected.
[0088] In the aforementioned text detection method, the server first matches the text to be detected with sample keywords; the sample keywords are anomalous words in the sample anomalous text. Then, if the text to be detected fails to match the sample keywords, it matches the text to be detected with the sample anomalous text. Next, if the text to be detected fails to match the sample anomalous text again, it obtains the correlation information between the text to be detected and a preset anomalous category; the preset anomalous category is obtained by classifying the sample anomalous text. Finally, if the correlation information meets the preset correlation conditions, the text to be detected is identified as anomalous text. In this way, the server can initially filter out texts that clearly contain anomalous words through keyword matching; then, through text matching, it can further filter out texts containing anomalous content; finally, through category matching, it can re-detect texts that fail to match either keyword or text, thereby filtering out texts with unclear keyword or content features. By combining these three matching methods, it can identify anomalous texts with keywords, content, and unclear features as much as possible, thus improving the accuracy of text detection. In addition, the server detects the text in the order of keyword matching, text matching, and category matching step by step, which can narrow down the detection scope hierarchically, reduce the amount of data processing in the text detection process, and improve the efficiency of text detection.
[0089] In an exemplary embodiment, step S104 above, which performs matching processing between the text to be detected and the sample abnormal text, specifically includes the following: obtaining the target text feature vector of the text to be detected; based on the target text feature vector of the text to be detected, querying sample abnormal texts similar to the text to be detected in the sample abnormal texts; if no sample abnormal text similar to the text to be detected is found in the sample abnormal texts, determining that the text to be detected and the sample abnormal texts have failed to match.
[0090] The target text feature vector of the text to be detected is obtained by hash mapping the hash signature vector of the text to be detected.
[0091] Among them, sample abnormal texts similar to the text to be detected are obtained by clustering sample abnormal texts. For example, by hashing and binning the sample abnormal texts, sample abnormal texts that are similar in content to the text to be detected can be found among several sample abnormal texts; sample abnormal texts similar to the text to be detected have similar content.
[0092] Specifically, the server first performs a hash mapping on the hash signature vector of the text to be detected to obtain the target text feature vector of the text to be detected; then, based on the target text feature vector, the text to be detected is hash-bucketed, and sample abnormal texts that are similar in content to the text to be detected are queried in the sample abnormal texts; if there are no sample abnormal texts that are similar in content to the text to be detected in the sample abnormal texts, the server determines that the text to be detected and the sample abnormal texts have failed to match.
[0093] Taking the clustering method of minhash (minimum hashing principle) + LSH (locality sensitivity hashing) as an example, let's illustrate the matching process between the text to be detected and the sample abnormal text. Assume that the multiple candidate abnormal text sets obtained by hashing the sample abnormal text are {S1}, {S2}, {S3}, {S1, S2}, {S2, S3}, and {S1, S2, S3}. The server obtains the following bucketing results by hashing the feature vector of the target text Q1: the text to be detected Q1 is in one bucket with the sample abnormal texts S1 and S2, and the text to be detected Q1 is in another bucket with the sample abnormal texts S2 and S3. Then the similar text sets of the text to be detected Q1 are {S1, S2} and {S2, S3}. If the similar text set of the text to be detected Q1 is empty, that is, there is no similar text set corresponding to the text to be detected Q1 in the candidate abnormal text set, then the server determines that the text matching between the text to be detected and the sample abnormal text has failed.
[0094] In this embodiment, the server can query sample abnormal texts similar to the text to be detected from the sample abnormal texts by hash binning the text to be detected, thereby realizing the matching processing between the text to be detected and the sample abnormal texts, and thus improving the accuracy of text detection.
[0095] In an exemplary embodiment, the step of querying sample abnormal texts similar to the text to be detected in the sample abnormal texts based on the target text feature vector of the text to be detected specifically includes the following: dividing the target text feature vector of the text to be detected into multiple sub-feature vectors; determining the abnormal text set corresponding to each sub-feature vector from the candidate abnormal text set; and obtaining sample abnormal texts similar to the text to be detected based on the abnormal text set corresponding to each sub-feature vector.
[0096] The candidate abnormal text set is obtained by clustering the sample abnormal texts, and the clustering can be hash bucketing.
[0097] Specifically, the server first divides the target text feature vector of the text to be detected into several segments, and performs hash bucketing on the sub-feature vectors of each segment to obtain the abnormal text set corresponding to the sub-feature vectors of each segment. Then, the abnormal text set corresponding to the sub-feature vectors of each segment is used as the abnormal text set corresponding to the text to be detected, and the sample abnormal texts in the abnormal text set are identified as sample abnormal texts similar to the text to be detected.
[0098] For example, suppose the server divides the target text feature vector of the text to be detected, Q1, into 3 segments, and the binning results of each segment (i.e., the abnormal text set corresponding to the sub-feature vector of each segment) are as follows: In the first segment, the text to be detected, Q1, is in the same bin as the sample abnormal texts S1 and S2; in the second segment, the text to be detected, Q1, is in the same bin as the sample abnormal texts S2 and S3; in the third segment, the text to be detected, Q1, is in a separate bin; then, the abnormal text set corresponding to the sub-feature vector of each segment of the text to be detected, Q1, is {S1, S2} and {S2, S3}, and thus the similar text sets {S1, S2} and {S2, S3} corresponding to the text to be detected are obtained.
[0099] It is understandable that when performing hash bucketing on sample abnormal text, similar to hash bucketing on the text to be detected, the target text feature vector of the sample abnormal text is divided into several segments, and the sample abnormal text is hash bucketed on the same k-th segment.
[0100] In this embodiment, the server can cluster the sample abnormal text based on content by segmenting and hashing the sample abnormal text into buckets, thereby obtaining multiple candidate abnormal text sets. Then, based on the segmented hashing and bucketing of the text to be detected, the server can identify sample abnormal texts that are as similar as possible to each segment of the text to be detected from the candidate abnormal text sets, thereby achieving matching processing between the text to be detected and the sample abnormal texts, and thus improving the accuracy of text detection.
[0101] In an exemplary embodiment, the step of obtaining the target text feature vector of the text to be detected specifically includes the following: obtaining the initial text feature vector of the text to be detected, and performing multiple scrambling processes on the initial text feature vector; obtaining the minimum hash value of the initial text feature vector after each scrambling process; obtaining the hash signature vector of the text to be detected based on each minimum hash value of the text to be detected; and performing hash mapping processing on the hash signature vector of the text to be detected to obtain the target text feature vector of the text to be detected.
[0102] The initial text feature vector of the text to be detected is used to characterize the presence of feature words in the text to be detected.
[0103] The hash function used to perform hash mapping on the hash signature vector of the text to be detected must satisfy the following conditions:
[0104]
[0105] Where X and Y are any two points in the high-dimensional space; R1 and R2 are the distances; p1 and p2 are the probability values; that is, the hash function used for hash mapping should make it more likely that the hash mapping values of two points that are close to each other (similar hash signature vectors) are equal, and make it less likely that the hash mapping values of two points that are far apart (dissimilar hash signature vectors) are equal.
[0106] Specifically, the server first obtains the initial text feature vector of the text to be detected, then performs multiple scrambling operations on the initial text feature vector, and obtains the minimum hash value of the initial text feature vector after each scrambling operation; then the server combines the minimum hash values to obtain the hash signature vector of the text to be detected; finally, the server performs hash mapping processing on the hash signature vector of the text to be detected using a hash function that satisfies Formula 1, to obtain the target text feature vector of the text to be detected.
[0107] For example, suppose we have three comments to be detected, namely Q1{Word1, Word2, Word3, Word4}, Q2{Word2, Word3, Word4}, and Q3, S3{Word1, Word4}, where Word1, Word2, Word3, and Word4 are feature words; then, the initial text feature vectors of the three comments to be detected can be represented by the binary feature matrix shown in Table 1:
[0108] Table 1 Initial text feature vectors of the comments to be detected
[0109] Word1 1 0 1 Word2 1 1 0 Word3 1 1 0 Word4 1 1 1
[0110] Next, the server performs multiple random shuffling operations on the initial text feature vectors, randomly shuffling the rows in Table 1 to obtain the initial text feature vectors after the first shuffling operation, as shown in Table 2:
[0111] Table 2 Initial text feature vectors after the first disordering process.
[0112] Word2 1 1 0 Word1 1 0 1 Word4 1 1 1 Word3 1 1 0
[0113] According to Table 2, the server records the minimum hash value (i.e. the row number where the first 1 is located) of each comment to be detected after the first disordering process. For example, hash(S1) = 0, hash(S2) = 0, hash(S3) = 1.
[0114] Then, the server repeatedly shuffles the initial text feature vectors of the three comments to be detected according to the set hash size N until the number of shuffling operations is N, obtaining multiple minimum hash values of the three comments to be detected, and determining the corresponding hash signature vector of the comment to be detected based on the multiple minimum hash values. Then, the hash signature vector of the text to be detected is hash mapped using the hash function that satisfies Formula 1 to obtain the target text feature vector of the text to be detected.
[0115] In this embodiment, the server can obtain the hash signature vector of the text to be detected by repeatedly shuffling the initial feature vector of the text to be detected. Then, by performing hash mapping on the hash signature vector using a hash function that meets the requirements, the server can obtain the target text feature vector that reflects the similarity of the text to be detected, thereby providing a matching basis for the subsequent matching of the text to be detected with the sample abnormal text.
[0116] In an exemplary embodiment, step S102, which involves matching the text to be detected with the sample keywords, specifically includes the following: querying at least one substring corresponding to the text to be detected that is the same as the sample keywords; and determining that the text to be detected fails to match the sample keywords if no substring corresponding to the text to be detected is found in at least one substring.
[0117] The at least one substring corresponding to the text to be detected is obtained by dividing the text to be detected into substrings; assuming the text to be detected is {a, b, c, d}, then the at least one substring corresponding to it is {a, b, c, d}, {a, b, c}, {a, b}, {a}, {b, c, d}, {b, c}, {b}, {c, d}, {c}, and {d}.
[0118] Specifically, the server queries at least one substring of the text to be detected that is the same as the sample keyword. If there is no substring of the text to be detected that is the same as the sample keyword, the server determines that the text to be detected fails to match the sample keyword.
[0119] For example, suppose the string of the text to be detected is {herase} and the sample keyword is {ser}. Obviously, the server cannot find a substring in the string of the text to be detected that is the same as the sample keyword, indicating that the text to be detected does not contain the sample keyword. Therefore, the server determines that the text to be detected fails to match the sample keyword.
[0120] In this embodiment, the server can match the text to be detected with the sample keywords by querying the substrings corresponding to the sample keywords in the string of the text to be detected, thereby filtering out the text containing abnormal words.
[0121] In an exemplary embodiment, after the step of querying the substring that is the same as the sample keyword in at least one substring corresponding to the text to be detected, the following is further included: if there is a substring that is the same as the sample keyword in at least one substring corresponding to the text to be detected, it is determined that the text to be detected matches the sample keyword successfully, and the sample keyword that is the same as the substring is determined as the target keyword; according to the type of the target keyword, the text to be detected is subjected to corresponding abnormal text processing.
[0122] The target keywords include at least three types: prohibited keywords, sensitive keywords, and combined keywords. Prohibited keywords are those that cannot appear regardless of the context. Sensitive keywords are those that are ambiguous but require contextual judgment to determine whether they involve abnormal content. Combined keywords are those that require contextual judgment to determine whether they involve abnormal content and may be linked to other phrases, such as "QR code" and "watch," or "fans" and "yuan."
[0123] The corresponding handling of abnormal text includes at least interception and recall review. Interception refers to directly blocking abnormal text to prevent it from appearing on web pages or applications; recall review refers to recalling abnormal text and manually reviewing it to determine whether it can be published. For violating keywords, the server takes interception action; for sensitive keywords and combined keywords, the server takes recall review action.
[0124] Specifically, if the server finds a substring that is the same as the sample keyword in at least one substring corresponding to the text to be detected, then the server determines that the text to be detected has successfully matched the sample keyword and identifies the sample keyword as the target keyword. Then, the server determines whether the target keyword is a violation keyword, a sensitive keyword, or a combination keyword, and takes corresponding abnormal text processing measures according to the type of the target keyword. For example, it blocks violation keywords and recalls and reviews sensitive keywords and combination keywords.
[0125] For example, in the process of abnormal text processing, the processing priority of violating keywords is the highest, followed by sensitive keywords, and finally combined keywords. For example, taking the text to be detected as {herase}, assuming there are violating keywords {erase}, sensitive keywords {her}, and combined keywords {he, se}, the server can determine that among the target keywords that are successfully matched in the text to be detected, {erase} has the highest processing priority. Therefore, the text to be detected is processed as abnormal text according to the interception processing corresponding to violating keywords.
[0126] In this embodiment, the server can flexibly process abnormal texts in the text to be detected based on the type of sample keywords that successfully match the text to be detected, thus avoiding the problem of hitting too much normal content caused by traditional keyword matching, thereby improving the accuracy of text detection.
[0127] like Figure 3 As shown, in an exemplary embodiment, step S104, after matching the text to be detected with the sample abnormal text in the case where the matching between the text to be detected and the sample keywords fails, further includes the following steps:
[0128] Step S302: If the text to be detected fails to match the abnormal sample text, obtain the similarity between the text to be detected and the candidate text cluster.
[0129] Step S304: Based on similarity, determine the associated text clusters of the text to be detected from the candidate text clusters.
[0130] Step S306: Add the text to be detected to the associated text cluster to obtain the target text cluster.
[0131] Step S308: If there is text of a preset type in the target text cluster, update the abnormal text library corresponding to the abnormal sample text according to the target text cluster, and identify abnormal keywords from the target text cluster, and update the keyword library corresponding to the sample keywords according to the abnormal keywords.
[0132] Among them, candidate text clusters are obtained by clustering detected texts; detected texts refer to texts that have completed keyword matching and text matching before the text to be detected, and have entered the clustering model to complete clustering.
[0133] Among them, text with the preset text type is abnormal text, that is, text containing abnormal content.
[0134] Specifically, when the text to be detected fails to match the abnormal sample text, the server needs to perform clustering processing on the text to be detected. The specific process is as follows: First, the server obtains candidate text clusters similar to the text to be detected through hash bucketing, forming a candidate text cluster set for the text to be detected. Then, the server obtains the similarity between the text to be detected and each candidate text cluster in the candidate text cluster set. The candidate text cluster set is obtained based on the clustering processing of the detected text. Next, the server identifies the corresponding related text clusters from the candidate text cluster set whose similarity meets the preset similarity requirements, such as the candidate text cluster with the highest similarity, or the candidate text cluster with a similarity that meets a certain threshold. Then, the server adds the text to be detected to the related text clusters to obtain the target text cluster. Finally, if the target text cluster contains text with abnormal content, the server adds the target text cluster to the abnormal text library corresponding to the abnormal sample text, updates the abnormal text library, and identifies abnormal keywords from the target text cluster, adds the abnormal keywords to the keyword library corresponding to the sample keywords, updates the sample keyword library.
[0135] It is understandable that, since candidate text clusters are obtained by clustering the detected texts, when the first text to be detected enters the text cluster, a new candidate text cluster needs to be established with the first text to be detected as the center text. Similarly, when a text to be detected has no similar text clusters, a new candidate text cluster also needs to be established with the text to be detected as the center text.
[0136] For example, such as Figure 4 As shown, the process of clustering the text to be detected that fails to match the abnormal text of the sample to obtain the target text cluster can be as follows: When the text to be detected enters the clustering model, the server first obtains multiple candidate text clusters similar to the text to be detected through hash bucketing, forming the candidate text cluster set corresponding to the text to be detected. For example, the candidate text cluster set corresponding to the text to be detected Q13 is {{Q1, Q3}, {Q1, Q2}, {Q4, Q6}, {Q8, Q10, Q12}}. Then, the server calculates the Jaccard similarity between the text to be detected and the center text of each candidate text cluster in turn, and determines the candidate text cluster that is most similar to the text to be detected Q13 (the one with the highest Jaccard similarity) from the candidate text cluster set based on the Jaccard similarity, for example, the candidate text cluster {Q8, Q10, Q12}. Then, the server adds the text to be detected Q13 to the candidate text cluster {Q8, Q10, Q12} to obtain the target text cluster.
[0137] In this embodiment, the server clusters the texts to be detected that fail to match the sample abnormal texts, and reviews the target text clusters obtained by manual review. The review results can be fed back to the abnormal text library and the keyword library, thereby enriching the abnormal text library and the keyword library and making subsequent text detection more accurate.
[0138] In an exemplary embodiment, step S102, before matching the text to be detected with the sample keywords, further includes the following: identifying the target text region from the image to be detected; preprocessing the target text region; the preprocessing includes at least combination processing and sorting processing; and identifying the text to be detected from the preprocessed target text region.
[0139] The images to be detected include comments, profile pictures, artwork images, album images, and chat images from web pages or applications.
[0140] The following requirements are followed for the combination processing and sorting processing: (1) Distinguish the direction of the target text region (such as vertical text and horizontal text); (2) There is a connection between adjacent target text regions; (3) There is a connection between target text regions with similar heights; (4) The target text regions at the top and left of the image to be detected are sorted first.
[0141] Specifically, the server uses an OCR (Optical Character Recognition) algorithm to identify each target text region from the image to be detected, and performs combination and sorting processing on each target text region according to certain requirements to obtain preprocessed target text regions; then, the server identifies the text to be detected from the preprocessed target text regions.
[0142] For example, such as Figure 5 The image shown is used by the server, which, based on the OCR algorithm, identifies the text as "Feeling sad and wanting to cry, I need to listen to a cheerful song to heal."
[0143] In this embodiment, the server uses an OCR algorithm to identify each target text region from the image to be detected. Based on combination and sorting processing, it can accurately extract the text to be detected from the target text regions, thereby providing detection data for subsequent text detection.
[0144] In an exemplary embodiment, the step of identifying a target text region from an image to be detected specifically includes the following: identifying a region in the image to be detected that contains text as an initial text region; determining the recognition confidence of the initial text region; and determining the initial text region whose recognition confidence satisfies a preset confidence threshold as the target text region.
[0145] Among them, recognition confidence refers to the confidence level that the OCR algorithm can accurately recognize the text.
[0146] Specifically, the server first uses an OCR algorithm to identify regions containing text in the image to be detected, which are then used as initial text regions. The OCR algorithm then determines the confidence level that each initial text region can accurately identify the text. Next, the server identifies the initial text regions whose recognition confidence level is greater than a preset confidence threshold as target text regions.
[0147] In this embodiment, the server filters out some text with low recognition accuracy (such as blurry text, handwriting, artistic fonts, etc.) by identifying confidence level and pre-set confidence threshold, thereby avoiding the impact of these texts with low recognition accuracy on subsequent text detection and thus improving the accuracy of text detection.
[0148] In one exemplary embodiment, such as Figure 6 As shown, another text detection method is provided. Taking the application of this method to a server as an example, the method includes the following steps:
[0149] Step S601: Identify the regions containing text in the image to be detected, and use them as the initial text regions.
[0150] Step S602: Determine the recognition confidence of the initial text region, and determine the initial text region whose recognition confidence meets the preset confidence threshold as the target text region.
[0151] Step S603: Preprocess the target text region and identify the text to be detected from the preprocessed target text region.
[0152] Step S604: In at least one substring corresponding to the text to be detected, query the substring that is the same as the sample keyword.
[0153] Step S605: If there is no substring in at least one substring corresponding to the text to be detected that is the same as the sample keyword, it is determined that the text to be detected fails to match the sample keyword.
[0154] Step S606: If the text to be detected fails to match the sample keywords, obtain the target text feature vector of the text to be detected.
[0155] Step S607: Based on the target text feature vector of the text to be detected, query sample abnormal texts that are similar to the text to be detected in the sample abnormal texts.
[0156] Step S608: If no sample abnormal text similar to the text to be detected is found in the sample abnormal text, it is determined that the text to be detected and the sample abnormal text have failed to match.
[0157] Step S609: If the text to be detected fails to match the sample abnormal text, obtain the correlation information between the text to be detected and the preset abnormal category.
[0158] Step S610: If the relevance information meets the preset relevance conditions, the text to be detected is identified as abnormal text. Following step S604, the following steps are also included:
[0159] Step S611: If there is a substring in at least one substring corresponding to the text to be detected that is the same as the sample keyword, it is determined that the text to be detected and the sample keyword are successfully matched, and the sample keyword that is the same as the substring is determined as the target keyword.
[0160] Step S612: Determine the type of the target keyword, and perform corresponding abnormal text processing on the text to be detected based on the type of the target keyword.
[0161] Following step S607, the following steps are also included:
[0162] Step S613: If there is a sample abnormal text in the sample abnormal text that is similar to the text to be detected, determine that the text to be detected and the sample abnormal text are successfully matched, and determine the text to be detected as abnormal text.
[0163] Following step S609, the following steps are also included:
[0164] Step S614: If the text to be detected fails to match the abnormal sample text, obtain the similarity between the text to be detected and the candidate text cluster.
[0165] Step S615: Based on similarity, determine the associated text clusters of the text to be detected from the candidate text clusters, and add the text to be detected to the associated text clusters to obtain the target text cluster.
[0166] Step S616: If there is text of the preset type in the target text cluster, update the abnormal text library corresponding to the abnormal sample text and the keyword library corresponding to the sample keywords according to the target text cluster.
[0167] In this embodiment, firstly, the server matches the text to be detected with sample keywords by querying the substrings corresponding to sample keywords within the string corresponding to the text to be detected, thereby filtering out text containing anomalous words. Simultaneously, based on the type of sample keywords that successfully match the text to be detected, the server can flexibly process the text to be detected as anomalous text, avoiding the problem of hitting too much normal content caused by traditional keyword matching. Next, the server uses hash binning of the text to be detected to determine a set of similar texts corresponding to the text to be detected from the sample anomalous texts, thus achieving matching processing between the text to be detected and the sample anomalous texts. Furthermore, the server clusters the texts to be detected that fail to match the sample anomalous texts, and based on manual review of the clustered target text clusters, the review results can be fed back into the anomalous text database and keyword database, thereby enriching the anomalous text database and making subsequent text detection more accurate. In this way, by combining keyword matching, text matching, and category matching, the server can identify anomalous keywords, anomalous content, and anomalous text with indistinct features as much as possible, thereby improving the accuracy of text detection. It should also be noted that the server performs text detection step by step in the order of keyword matching, text matching, and category matching. It can also narrow down the detection scope hierarchically, reduce the amount of data processing in the text detection process, and improve the efficiency of text detection.
[0168] To more clearly illustrate the text detection method provided in the embodiments of this application, the following specific embodiment will be used to describe the text detection method in detail. For example... Figure 7 As shown in an exemplary embodiment, this application also provides a method for identifying and intercepting images containing sensitive text, specifically including the following steps:
[0169] Step 1: Image text recognition.
[0170] The server uses an OCR algorithm to identify one or more text regions from an image containing text; based on the OCR recognition results, the text regions are combined, sorted, and filtered to obtain the text to be detected.
[0171] Step 2: Keyword matching based on the keyword thesaurus.
[0172] The server uses an algorithm to match pre-built keyword databases, directly and accurately filtering out texts containing keywords from the database, and then automatically blocking or recalling texts for review based on the attributes of the matched keywords.
[0173] Step 3: Text similarity matching based on a blacklist of text content.
[0174] If the keyword match fails, the server searches the text content blacklist using a text similarity matching algorithm and matches the sample text in the blacklist that is most similar to the text to be detected. If the similarity is greater than a certain threshold, it can be considered a match. In the case of a match, the server chooses to automatically block or recall the text for review.
[0175] Step 4: If a text similarity match fails, the server performs real-time content-based clustering of the text to be detected, grouping texts with similar or identical content into clusters. Each text cluster can be considered a template, with highly similar content, order, and length. Through regular manual review, frequently occurring keywords and templates can be extracted and added back to the keyword database and the text content blacklist. Furthermore, anomalous clustered texts can be manually processed in batches.
[0176] Step 5: If the text similarity match fails, the server performs natural language processing (NLP) on the text, using a multi-classification model to determine which type of anomalous content it belongs to. It's important to note that OCR-recognized text may contain occasional typos, logically disordered layouts, or irrelevant content. To improve the performance of the multi-classification model, targeted preprocessing, such as data augmentation, is necessary to address these specific issues. Finally, the server performs corresponding anomalous text processing on the text identified by the multi-classification model. The high-frequency anomalous text identified in Step 4 can also be used as training data for the multi-classification model to improve its recognition performance.
[0177] In this embodiment, the server comprehensively addresses the problem of abnormal content in images by leveraging the complementary strengths of various technologies, including keyword matching, text similarity matching, NLP multi-classification, and text content clustering. Specifically, keyword matching enables efficient identification of unambiguous keywords; text content similarity matching accurately identifies text with potential ambiguity or without obvious violations, overcoming the limitations of keyword matching; and text content clustering addresses the pain point of blacklist registration in keyword matching and text similarity matching. Furthermore, based on the clustering results, the training data for the NLP multi-classification model is optimized, enabling the rapid accumulation of large amounts of data closely related to business scenarios and improving the semantic recognition performance of the NLP multi-classification model in image-text scenarios. Based on the above process, the text detection method solves the problems of text recognition, text detection, and text interception under different conditions, improving the recognition effect of abnormal text in images.
[0178] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0179] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data such as a keyword database and anomaly text database. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a text detection method.
[0180] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0181] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0182] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0183] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0184] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0185] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0186] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0187] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A text detection method, characterized in that, The method includes: The text to be detected is matched with sample keywords; the sample keywords are abnormal words in the abnormal sample text. If the text to be detected fails to match the sample keywords, the text to be detected is matched with the sample abnormal text; the number of sample abnormal texts is at least one; further including: dividing the target text feature vector of the text to be detected to obtain multiple sub-feature vectors of the text to be detected; performing segmented hashing and bucketing on each sub-feature vector of the text to be detected to determine the abnormal text set corresponding to each sub-feature vector of the text to be detected from the candidate abnormal text set; the candidate abnormal text set is obtained based on the segmented hashing and bucketing of each sub-feature vector of each sample abnormal text, and each sub-feature vector of each sample abnormal text is obtained based on the division of the target text feature vector of the sample abnormal text; the sample abnormal texts in the abnormal text set corresponding to each sub-feature vector of the text to be detected are determined to be sample abnormal texts similar to the text to be detected; if there are no sample abnormal texts in the sample abnormal texts that are similar to the text to be detected in content, it is determined that the text matching between the text to be detected and the sample abnormal text has failed; If the text to be detected fails to match the sample abnormal text, the correlation information between the text to be detected and the preset abnormal category is obtained; the preset abnormal category is obtained by classifying the sample abnormal text. If the correlation information meets the preset correlation conditions, the text to be detected is identified as abnormal text.
2. The method according to claim 1, characterized in that, Before segmenting the target text feature vector of the text to be detected, the method further includes: Obtain the target text feature vector of the text to be detected.
3. The method according to claim 2, characterized in that, The step of obtaining the target text feature vector of the text to be detected includes: Obtain the initial text feature vector of the text to be detected, and perform multiple randomization processes on the initial text feature vector; Obtain the minimum hash value of the initial text feature vector after each disordering process; Based on the minimum hash values of the text to be detected, the hash signature vector of the text to be detected is obtained; The hash signature vector of the text to be detected is subjected to hash mapping processing to obtain the target text feature vector of the text to be detected.
4. The method according to claim 1, characterized in that, The matching process between the text to be detected and the sample keywords includes: In at least one substring corresponding to the text to be detected, a substring identical to the sample keyword is queried; the at least one substring corresponding to the text to be detected is obtained by dividing the string of the text to be detected. If no substring in at least one substring corresponding to the text to be detected is identical to the sample keyword, it is determined that the text to be detected fails to match the sample keyword.
5. The method according to claim 4, characterized in that, After querying at least one substring corresponding to the text to be detected that is the same as the sample keyword, the method further includes: If, in at least one substring corresponding to the text to be detected, there exists a substring that is identical to the sample keyword, it is determined that the text to be detected is successfully matched with the sample keyword, and the sample keyword that is identical to the substring is determined as the target keyword; Based on the type of the target keyword, the text to be detected is processed accordingly to handle abnormal text.
6. The method according to claim 1, characterized in that, If the text to be detected fails to match the sample keywords, after matching the text to be detected with the abnormal sample text, the process further includes: If the text to be detected fails to match the abnormal sample text, the similarity between the text to be detected and the candidate text cluster is obtained; the candidate text cluster is obtained by clustering the detected text. Based on the similarity, the associated text clusters of the text to be detected are determined from the candidate text clusters; The text to be detected is added to the associated text cluster to obtain the target text cluster; If there is text of a preset type in the target text cluster, update the abnormal text library corresponding to the abnormal sample text according to the target text cluster, identify abnormal keywords from the target text cluster, and update the keyword library corresponding to the abnormal sample keywords according to the abnormal keywords.
7. The method according to any one of claims 1 to 6, characterized in that, Before matching the text to be detected with sample keywords, the process also includes: Identify the target text region from the image to be detected; The target text region is preprocessed; the preprocessing includes at least combination processing and sorting processing. The text to be detected is identified from the preprocessed target text region.
8. The method according to claim 7, characterized in that, The process of identifying the target text region from the image to be detected includes: Identify regions in the image to be detected that contain text, and use these regions as initial text regions; Determine the recognition confidence level of the initial text region; The initial text region whose recognition confidence level meets the preset confidence threshold is determined as the target text region.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Text content auditing method and device
CN110674255A
Text processing method and device, electronic equipment and medium
CN114969349A