Content detection method and device, equipment and storage medium
By performing word expansion and keyword extraction on the original banned words, and calculating the association weight based on the contextual information of the content segment, the problem of low multimedia content detection accuracy is solved and the detection accuracy and semantic expression ability are improved.
Patent Information
- Application Number
- CN202310361800.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2024-10-15
AI Technical Summary
Existing technologies have low detection accuracy when detecting banned words in multimedia content. Especially in the era of big data, traditional banned words are difficult to cover a large amount of multimedia content, and deep learning models have poor semantic expression capabilities due to fewer training samples of banned words. , resulting in low detection accuracy.
Use the preset word expansion method to expand the original banned words, generate extended banned words, and improve the coverage of the banned word set. By extracting keywords that represent product information, combined with the contextual information of the content segment, the association weight is calculated to obtain local Content characteristics, thereby improving detection accuracy.
It improves the detection accuracy, enhances the semantic expression ability of the model, eliminates interference factors, improves the expressiveness of anomaly detection, ensures that the model focuses on content segments that are closely related to keywords, and improves detection accuracy.
Smart Images

Figure CN118779477A_ABST
Abstract
Description
Background Art
[0002] With the development and progress of Internet technology, producers use the publicity advantages of the Internet to put multimedia content on the Internet to promote their products. However, in order to gain an advantage in resource competition and attract more attention from consumers, some producers add banned words such as "best" and "highest" to multimedia content, engage in false publicity, induce consumers to rush to buy, and other unfair competition. Therefore, content detection of multimedia content has become one of the important ways to discover unfair competition methods.
[0003] Currently, the following two detection methods are commonly used:
[0004] Method 1: Match the content to be detected with a blacklist built based on text rules to determine whether the content to be detected contains banned words.
[0005] However, in the era of big data, the amount of multimedia content is increasing day by day. The traditional banned words stored in the blacklist can hardly cover the huge amount of multimedia content, which affects the accuracy of detection.
[0006] Method 2: Use deep learning models to detect multimedia content.
[0007] However, due to the small number of training samples containing banned words, the model cannot fully learn the effective features of banned words, and the semantic expression ability of the model trained in this way is also poor. Therefore, when using this model to detect multimedia content, the detection accuracy of the model is not high.
[0008] In view of this, the present application proposes a new content detection method. Summary of the invention
[0009] The embodiments of the present application provide a content detection method, apparatus, device and storage medium to solve the problem of low detection accuracy.
[0010] In a first aspect, an embodiment of the present application provides a content detection method, including:
[0011] Based on a preset word expansion method, at least one word in the original banned words is expanded to obtain a corresponding expanded banned word;
[0012] Based on the banned word set including the original banned words and the extended banned words, content detection is performed on the content to be detected, and when it is determined that at least one banned word is contained, keywords representing product information are extracted from the content to be detected;
[0013] For each content segment in the content to be detected, the following operations are performed respectively to obtain respective local content features, and based on the obtained local content features, the detection result of the content to be detected is obtained: based on the context information of each content segment and the keyword, an association weight characterizing the degree of association between the content segment and the keyword is obtained, and based on the context information and the association weight of the content segment, the local content feature of the content segment is obtained.
[0014] In a second aspect, an embodiment of the present application further provides a content detection device, including:
[0015] A character expansion unit, used for expanding at least one character in the original prohibited words based on a preset character expansion method to obtain a corresponding extended prohibited word;
[0016] A first detection unit is configured to perform content detection on the content to be detected based on a banned word set including the original banned words and the extended banned words, and extract keywords representing product information from the content to be detected when it is determined that the content contains at least one banned word;
[0017] The second detection unit is used to perform the following operations for each content segment in the content to be detected, respectively, to obtain respective local content features, and obtain the detection result of the content to be detected based on the obtained local content features: based on the context information of each content segment and the keyword, obtain an association weight characterizing the degree of association between the content segment and the keyword, and based on the context information of the content segment and the association weight, obtain the local content feature of the content segment.
[0018] Optionally, the word expansion unit is used for:
[0019] According to the text structure of each of the at least one character in the original banned words, the corresponding character is decomposed into a plurality of variant characters, wherein the variant characters are generated based on a part of the text structure of the corresponding character.
[0020] Optionally, the second detection unit is used for:
[0021] Extracting context information of the content segment and the keyword respectively to obtain initial embedding features of the respective ones;
[0022] Based on the two obtained initial embedding features, an association weight representing the degree of association between the one content segment and the keyword is obtained.
[0023] Optionally, the second detection unit is used for:
[0024] Extracting context information of the one content segment to obtain corresponding initial embedding features;
[0025] Based on the association weight of the one content segment, weighting the initial embedding feature of the one content segment to obtain a corresponding weighted embedding feature;
[0026] The weighted embedded features are normalized to obtain local content features of the one content segment.
[0027] Optionally, the second detection unit is used for:
[0028] Splicing the obtained local content features to obtain the global content features of the content to be detected;
[0029] The global content feature is subjected to dimensionality reduction processing to obtain an abnormality prediction probability that the content to be detected is predicted to be abnormal content, and the abnormality prediction probability is used as the corresponding detection result.
[0030] In a third aspect, an embodiment of the present application further provides a computer device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the above-mentioned content detection methods.
[0031] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of any one of the above-mentioned content detection methods.
[0032] In a fifth aspect, an embodiment of the present application further provides a computer program product, including computer instructions, which are executed by a processor to perform the steps of any one of the above-mentioned content detection methods.
[0033] The beneficial effects of this application are as follows:
[0034] The embodiments of the present application provide a content detection method, apparatus, device and storage medium, the method comprising: based on a preset word expansion method, expanding at least one word in the original banned words to obtain corresponding extended banned words, and then performing content detection based on the original banned words and the extended banned words, and when it is determined that at least one banned word is contained, extracting keywords representing product information from the content to be detected; for each content segment in the content to be detected, performing the following operations respectively to obtain respective local content features, and obtaining a detection result of the content to be detected based on the obtained local content features: based on the context information of a content segment and a keyword respectively, obtaining an association weight between the content segment and the keyword, and obtaining a corresponding local content feature based on the context information and the association weight of the content segment.
[0035] This application uses a preset word expansion method to expand the original banned words that have been collected, and obtains multiple extended banned words, which improves the coverage of the banned word set, and thus improves the detection accuracy of the system. Moreover, by introducing noun keywords, the semantic expression ability of the model is enhanced, helping the model to determine which content segments are more closely related to keywords and which content segments are more sparsely related to keywords, eliminating interference factors that may affect the detection effect, and facilitating the model to focus on content segments that are closely related to keywords, and try to extract banned words that violate regulations from these content segments, thereby improving the model's expressiveness in anomaly detection and improving the model's detection accuracy.
[0036] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 This is an optional schematic diagram of an application scenario in an embodiment of the present application;
[0039] Figure 2A A schematic diagram of a process for performing content detection on content to be detected provided in an embodiment of the present application;
[0040] Figure 2B A logical diagram of performing content detection on content to be detected provided in an embodiment of the present application;
[0041] Figure 2C A schematic diagram of the result of expanding banned words based on the flipping deformation method provided in an embodiment of the present application;
[0042] Figure 2D A schematic diagram of the structure of a content detection model provided in an embodiment of the present application;
[0043] Figure 2E A schematic diagram of initial embedding features provided in an embodiment of the present application;
[0044] Figure 2F A logical diagram of generating K, Q, and V matrices provided in an embodiment of the present application;
[0045] Figure 2G A logical schematic diagram of obtaining the association weights between each content segment and a keyword provided in an embodiment of the present application;
[0046] Figure 2H A schematic diagram of a process for obtaining local content features of a content segment provided in an embodiment of the present application;
[0047] Fig.2I A logical schematic diagram of obtaining weighted embedding features of each content segment provided in an embodiment of the present application;
[0048] Figure 3A A schematic diagram of a process for content detection of advertising slogans provided in an embodiment of the present application;
[0049] Figure 3B A logical diagram of content detection for advertising slogans provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the structure of a content detection device provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a hardware structure of a computer device to which an embodiment of the present application is applied;
[0052] Figure 6 A schematic diagram of the hardware composition structure of another computer device to which the embodiment of the present application is applied. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0054] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0055] 1. Artificial Intelligence (AI):
[0056] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0057] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies; artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0058] With the research and advancement of artificial intelligence technology, artificial intelligence has been studied and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, robots, smart medical care, etc. I believe that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.
[0059] 2. Machine Learning:
[0060] Machine learning is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.
[0061] Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence, including deep learning, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0062] 3. Bidirectional Encoder Representation from Transformers (BERT) is a pre-trained language representation model. It emphasizes that it no longer uses the traditional unidirectional language model or the shallow concatenation of two unidirectional language models for pre-training as in the past, but instead uses a new masked language model (MLM) to generate deep bidirectional language representation.
[0063] Among them, the BERT model has the following advantages:
[0064] (1) As a pre-trained model, BERT does not need to be trained with a large amount of corpus when used in specific scenarios, which saves model training time and improves model training efficiency and generalization ability;
[0065] (2) BERT is an end-to-end model. It does not require adjusting the network structure. It only needs to add an output layer for specific downstream tasks at the end.
[0066] (3) BERT is based on the internal Transformer module, which can achieve fast parallelism, increase network depth, fully explore the characteristics of the DNN model, and improve the model accuracy;
[0067] (4) Compared with other pre-trained models such as ELMO and GPT, BERT is a bidirectional model that combines context for training and has better performance.
[0068] 4. The attention mechanism originates from the study of human vision. Different parts of the human retina have different degrees of information processing capabilities, namely acuity, and only the fovea of the retina has the strongest acuity. In order to make rational use of limited visual information processing resources, humans need to select a specific part of the visual area and then focus on it. For example, when people read, usually only a small number of words to be read will be paid attention to and processed.
[0069] In cognitive science, due to the bottleneck of information processing, humans selectively focus on part of all information while ignoring other visible information. The above mechanism is usually called the attention mechanism. In summary, the attention mechanism has two main aspects: deciding which part of the input needs to be paid attention to; allocating limited information processing resources to the important part.
[0070] However, when using the self-attention mechanism to encode the text information of the current content segment, it will overly focus on its own position. Therefore, the multi-head attention mechanism is proposed to solve this problem. The multi-head attention mechanism is to establish different projection information in multiple different projection spaces, project the input matrix differently, obtain many output matrices, and then splice them together.
[0071] The following is a brief introduction to the design concept of the embodiment of the present application:
[0072] With the development and progress of Internet technology, producers use the publicity advantages of the Internet to put multimedia content on the Internet to promote their products. However, in order to gain an advantage in resource competition and attract more attention from consumers, some producers add banned words such as "best" and "highest" to multimedia content, engage in false publicity, induce consumers to rush to buy, and other unfair competition. Therefore, content detection of multimedia content has become one of the important ways to discover unfair competition methods.
[0073] Currently, the following two detection methods are commonly used:
[0074] Method 1: Match the content to be detected with a blacklist built based on text rules to determine whether the content to be detected contains banned words.
[0075] However, as we enter the era of big data, the amount of multimedia content is increasing day by day. The traditional banned words stored in the blacklist are difficult to cover the huge amount of multimedia content, affecting the accuracy of detection.
[0076] Method 2: Use deep learning models to detect multimedia content.
[0077] However, due to the small number of training samples containing banned words, the model cannot fully learn the effective features of banned words, and the semantic expression ability of the model trained in this way is also poor. Therefore, when using this model to detect anomalies in multimedia content, its detection accuracy is not high.
[0078] In view of this, the present application proposes a new content detection method. The method includes:
[0079] First, a banned word set including original banned words and extended banned words is used to perform anomaly detection on the content to be detected. When at least one banned word is hit, keywords used to characterize product information are extracted from the content to be detected. Then, based on the embedded features of the keywords and the embedded features of each content segment in the content to be detected, the association weights between each content segment and the keywords are determined respectively. Based on each association weight and the embedded features of each content segment, the context features of each content segment are obtained respectively. Based on each obtained context feature, the anomaly detection result of the content to be detected is obtained.
[0080] This application uses a preset word expansion method to expand the original banned words that have been collected, and obtains multiple extended banned words, which improves the coverage of the banned word set, and thus improves the detection accuracy of the system. Moreover, by introducing the embedded features of keywords, the semantic expression ability of the model is enhanced, helping the model to determine which content segments are more closely related to keywords and which content segments are more sparsely related to keywords, eliminating interference factors that may affect the detection effect, and facilitating the model to focus on content segments that are closely related to keywords, and try to extract banned words that violate regulations from these content segments, thereby improving the model's expressiveness in anomaly detection and improving the model's detection accuracy.
[0081] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0082] The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0083] Figure 1 One application scenario is shown, including two terminal devices 110 and a server 130. A content detection system is deployed on the server 130. Each terminal device 110 establishes a communication connection with the server 130 through a wired network or a wireless network.
[0084] Among them, the terminal device 110 of the embodiment of the present application includes but is not limited to: mobile phones, computers (such as tablets, laptops, desktop computers, etc.), smart home appliances, intelligent voice interaction devices (such as smart speakers, smart watches, etc.), vehicle-mounted terminals, aircraft, etc.
[0085] The server 130 of the embodiment of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. This application does not make any restrictions here.
[0086] The terminal device 110 with data collection authority uses network packet capture tools to collect the webpage content browsed by the target object within a period of time, the application programs used, etc., and generates multimedia content that does not involve any individual information through data cleaning, data desensitization and other processing methods. Alternatively, through sensors, cameras and other collection modules, multimedia content placed in physical forms such as promotional pages and billboards is collected.
[0087] Then, the terminal device 110, in a networked state, uploads the collected multimedia contents to the server 130 through the communication channel established between the terminal device 110 and the server 130. Alternatively, a data cable is used to connect the data interface of the terminal device 110 and the server 130, so that the server 130 can access the data interface and obtain the multimedia contents collected by the terminal device 110.
[0088] The content detection system deployed on the server 130 performs content detection on the multiple multimedia contents uploaded by the terminal device 110 to determine whether they contain inappropriate promotional content. The process of the system detecting a multimedia content is as follows:
[0089] Based on a preset word expansion method, at least one word in the original banned words is expanded to obtain corresponding extended banned words, and then based on the banned word set including the original banned words and the extended banned words, content detection is performed on the content to be detected, and when it is determined that at least one banned word is contained, keywords representing product information are extracted from the content to be detected; for each content segment in the content to be detected, the following operations are performed respectively to obtain respective local content features, and based on the obtained local content features, a detection result of the content to be detected is obtained: based on the context information of a content segment and a keyword, an association weight representing the degree of association between the content segment and the keyword is obtained, and based on the context information of the content segment and the association weight, the local content feature of the content segment is obtained.
[0090] It should be noted that in the specific implementation of this application, it involves object data related to the collection of multimedia content, etc. When the following embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0091] Next, see Figure 2A-2B As shown in the schematic diagram, the process of the content detection system detecting the content to be detected is as follows:
[0092] S201: Based on a preset word expansion method, at least one word in the original banned words is expanded to obtain a corresponding expanded banned word.
[0093] The banned words set in this application includes: original banned words and extended banned words. The original banned words are extracted from at least one of the pre-built content samples and the historically collected multimedia content. Table 1 shows a part of the original banned words:
[0094] Table 1
[0095]
[0096]
[0097] However, as we enter the era of big data, the amount of multimedia content has exploded, and some producers have replaced the original banned words in multimedia content with homophones or pinyins of the corresponding characters in order to avoid banned words, making it difficult for the traditional banned words originally stored in the blacklist to detect such situations. If you want to improve the detection coverage of the blacklist, you need to update the original banned word database in real time based on the multimedia content collected within a set period, but doing so will increase the maintenance cost of the database and is not suitable for use in big data scenarios.
[0098] Therefore, the embodiment of the present application uses a preset word expansion method to expand at least one word contained in the original banned word to obtain a corresponding extended banned word. The extended banned word is introduced into the banned word set, which improves the detection coverage of the banned word set and thus improves the detection accuracy of the system.
[0099] Moreover, compared with the traditional word library update method, the embodiment of the present application expands the original banned words that have been extracted, and there is no need to deploy additional data collectors to collect new multimedia content. This not only avoids the data collector occupying too many resources and affecting the processing efficiency of other functional modules in the system, but also saves memory space in the system database. There is no need to extract banned words from new multimedia content, but it reduces the maintenance cost of the word library and is more in line with the detection needs in big data scenarios.
[0100] Optionally, the present application provides the following extension methods, and corresponding extended banned words are generated by adopting one or a combination of the extension methods.
[0101] Mode 1: Based on the obfuscated character set of at least one character in the original banned word, the corresponding character of the original banned word is replaced to obtain at least one extended banned word.
[0102] Using method 1, the process of generating corresponding extended banned words is: based on the confusing word set of at least one character in the original banned words, the original banned words are replaced multiple times to generate corresponding extended banned words; wherein, each time a confusing word is generated, a confusing word is selected from the confusing word set of at least one character to replace the corresponding character of the original banned word to obtain an extended banned word.
[0103] The following operations are performed for each character of the original banned words to generate their own confused character sets: according to the text structure of a character, homonyms with the same or similar structure are obtained, and according to the pronunciation of this character, homophones with the same or similar pronunciation are obtained; and then at least one homonym and at least one homophone are combined to form the confused character set of this character.
[0104] For example, Table 2 shows the confusion word set for each character in the original banned word "most professional", and the original banned words are treated by method 1 to generate multiple extended banned words; wherein, Table 3 shows some of the extended banned words.
[0105] Table 2
[0106] One of the original banned words Confusion word set most drunk, chew, chase Specialize Brick, turn, transmit, turn Industry Ye, Ye, Ye, Ye
[0107] Table 3
[0108]
[0109] Mode 2: Based on the phonetic identification of at least one character in the original banned word, the corresponding character of the original banned word is replaced to obtain at least one extended banned word.
[0110] For example, the original banned word "most professional" is treated by method 2 to generate multiple extended banned words as shown in Table 4.
[0111] Table 4
[0112]
[0113]
[0114] Method 3: Flip and deform at least one character in the original banned words to obtain at least one extended banned word.
[0115] At least one character in the original banned word is flipped and deformed to obtain a corresponding deformed character, and then the deformed character is used to replace the character in the original banned word to obtain at least one extended banned word. For example, the original banned word "most professional" is generated by using method 3. Figure 2C Multiple extended stopwords shown.
[0116] Method 4: Decompose at least one character of the original banned word to obtain corresponding variant characters, and use at least two variant characters to replace the corresponding characters of the original banned word to obtain at least one extended banned word.
[0117] The specific decomposition process is: according to the text structure of at least one character in the original banned words, the corresponding character is decomposed into multiple variant characters; wherein the variant characters are generated based on the partial text structure of the corresponding character.
[0118] For example, the character "最" in the original prohibited term "最专业" is in a top-bottom structure. According to its character structure, the character "最" can be disassembled into two variant characters, "日" and "取". Then, use these two variant characters to replace the original "最" character to generate the extended prohibited term "日取专业".
[0119] S202: Based on the set of prohibited terms that includes the original prohibited term and the extended prohibited term, perform content detection on the content to be detected. When it is determined that the content contains at least one prohibited term, extract the keywords characterizing the product information from the content to be detected.
[0120] By executing step 201, a set of prohibited terms that includes the original prohibited term and the extended prohibited term is constructed. Based on the set of prohibited terms, perform content detection on the content to be detected. When a match is successful with at least one prohibited term in the set of prohibited terms, it can only be determined that the content to be detected contains the corresponding prohibited term, and it cannot be directly determined that the content to be detected is abnormal content such as false publicity or inducing consumers to rush to purchase.
[0121] For example, if the content to be detected contains viewpoints or suggestions of "最专业", although the prohibited term "最专业" is hit, in most scenarios, this content will not be determined to be abnormal content.
[0122] Another example is that although the content to be detected "Product a is the product with the highest sales volume in this store" contains the prohibited term "销量第一", since product a is indeed the product with the highest sales volume in the store and there is no behavior of deceiving consumers, therefore, this content will not be determined to be abnormal content either.
[0123] Therefore, to solve the problem of false detection caused by the prohibited term set detection method, when it is determined that the content to be detected contains at least one prohibited term, this application will extract the keywords characterizing the product information from it, use the keywords as strong features of content detection, and input them together with the content to be detected into the content detection model of the system to continue the in-depth content detection of the content to be detected.
[0124] Since prohibited terms are generally used to describe a certain product or service, this application enhances the semantic expression ability of the model by introducing noun keywords, which helps to improve the performance of the model in content detection.
[0125] For example, based on the Jieba word segmentation library, the keywords "产品" and "专业" are extracted from the content to be detected "最专业的产品服务".
[0126] S203: For each content segment in the content to be detected, the following operations are performed respectively to obtain respective local content features, and based on the obtained local content features, the detection result of the content to be detected is obtained: based on the context information of a content segment and a keyword, an association weight representing the degree of association between the content segment and the keyword is obtained, and based on the context information of the content segment and the association weight, the local content feature of the content segment is obtained.
[0127] The content detection model is built based on machine learning technologies such as BERT and Long Short-Term Memory (LSTM). Figure 2D The model structure of the BERT-based content detection model is shown, which includes: an input layer, an output layer, a feature extraction layer for extracting context information, and a BERT layer. The BERT layer is composed of at least one Transformer encoder, and the Transformer layer is mainly composed of a multi-head attention mechanism and a feedforward neural network, which are used to obtain the local content features of each content segment and the global content features of the content to be detected.
[0128] The extracted keywords and the content to be detected are input into the content detection model together. For each content segment in the content to be detected, the following operations are performed: the feature extraction layer extracts the context information of a content segment and a keyword respectively to obtain their respective initial embedding features; the BERT layer obtains the association weight that characterizes the degree of association between the content segment and the keyword based on the two obtained initial embedding features.
[0129] The context information of this application is not the information obtained directly from the appearance of the target, but refers to the semantic text information and spatial location information of the content segment or keyword. Figure 2E As shown, the extracted initial embedding features include: word vector, position vector and paragraph segmentation vector.
[0130] Among them, the word vector is the feature vector of each word in the content segment or keyword. It should be noted that "each word" here includes at least one character, such as "ah" and "ha" can also be an interjection. Content segments distributed in different positions in the content to be detected and individual words distributed in different positions in each content segment will have different degrees of influence on content detection. Therefore, the position vector can help the model obtain the spatial position information of each word in the content segment or keyword, and the paragraph segmentation vector can help the model distinguish the various content segments in the content to be detected and obtain the spatial position information of each content segment.
[0131] In order to learn expressions with multiple meanings, the attention mechanism assigns three weights, namely, query weight W Q , key weight W K With value weight W V .like Figure 2F As shown in the figure, the initial embedding features of each content segment (each line is the initial embedding features of a content segment) are respectively combined with the query weight W Q , value weight W V Multiply them together to generate the query matrix (Query, referred to as Q) and the value matrix (Value, referred to as V), and combine the initial embedding features of the keywords with the key weights W K Multiply them together to generate the key matrix (Key, abbreviated as K).
[0132] like Figure 2G As shown, matrix Q is multiplied by matrix K to obtain the attention matrix W, each row of which represents the association weight between a content segment and a keyword. The specific implementation method is shown in Formula 1, K T is the transposed matrix of matrix K, and the vector dimension of Q and K is d k , It is a transformation operation that transforms the attention matrix into a standard normal distribution.
[0133]
[0134] See also Figure 2H The process of obtaining the local content features of a content segment is as follows:
[0135] S2031: Extract the context information of the content segment to obtain the corresponding initial embedding features.
[0136] S2032: Based on the association weight of the content segment, weight the initial embedding feature of the content segment to obtain a corresponding weighted embedding feature.
[0137] As mentioned above, the correlation weight represents the degree of correlation between a content segment and a keyword. Fig.2I The weighted method shown in FIG. 1 assigns associated weights to the initial embedded features of the corresponding content segments, which can effectively help the model determine which content segments are closely related to keywords and which content segments are sparsely related to keywords, eliminate interference factors that may affect the detection effect, and facilitate the model to focus on content segments that are closely related to keywords, and try to extract banned words that violate regulations from these content segments, thereby improving the model's expressiveness in anomaly detection and improving the model's detection accuracy.
[0138] Among them, Fig.2I In the attention matrix shown, each row represents the associated weight of a content segment; Figure 2FIn the matrix V shown, each row represents the embedding feature of a content segment. By performing a weighted operation on the feature vectors in the same row of the two matrices, the weighted embedding features of each content segment can be obtained.
[0139] S2033: Normalize the weighted embedded features to obtain local content features of the content segment.
[0140] The obtained weighted embedded features are input into a feedforward neural network for normalization to obtain the local content features of each content segment.
[0141] Afterwards, the local content features obtained are concatenated to obtain the global content features of the content to be detected, and then the global content features are subjected to dimensionality reduction processing to obtain the abnormal prediction probability that the content to be detected is abnormal content, and the abnormal prediction probability is used as the corresponding detection result.
[0142] Among them, the anomaly detection probability represents: the probability value predicted by the model that the content to be detected is abnormal content. For example, when the anomaly detection probability is greater than or equal to the set anomaly threshold, the anomaly detection result output by the model shows that the content to be detected is abnormal content; when the anomaly detection probability is less than the set anomaly threshold, the anomaly detection result output by the model shows that the content to be detected is normal content.
[0143] The content detection method provided in the embodiment of the present application can be applied to multiple scenarios such as advertising language detection and text detection. When it is determined that the content to be detected is abnormal content, an alarm can be issued to the publisher of the content to urge the other party to modify it as soon as possible, and the content can be marked on the web page to inform the viewer that the content contains exaggerated virtual promotional behavior and ask the other party to read it with caution.
[0144] in, Figure 3A-3B The figure shows the process of detecting abnormal content for the advertising slogan "providing you with the most professional product services" in the advertising slogan detection scenario:
[0145] S301: Based on the banned word set including the original banned words and the extended banned words, the advertising slogan "Since its establishment in 1998, xx company has developed a variety of cleaning products and is committed to providing you with the most professional product services" is initially tested;
[0146] S302: Determine whether at least one banned word in the banned word set is hit, if so, execute step 303; otherwise, end the detection;
[0147] S303: extracting the keywords “product” and “professional” from the advertisement based on the Jieba word segmentation database;
[0148] S304: Based on the feature extraction layer of the content detection model, context information is extracted from the input keywords "product", "professional", and content segment 1 "XX company has been established since 1998", content segment 2 "developing a variety of cleaning products", and content segment 3 "committed to providing you with the most professional product services", to obtain their respective initial embedding features;
[0149] S305: Based on the BERT layer of the content detection model, perform the following operations for each content segment: based on the initial embedding features of a content segment and a keyword, obtain the association weight between the content segment and the keyword, assign the association weight to the initial embedding feature of the content segment, obtain the corresponding weighted embedding feature, normalize the weighted embedding feature, and obtain the local content feature of the content segment;
[0150] S306: splicing the local content features of each content segment into the global content features of the advertising slogan, and performing dimensionality reduction processing on the global content features to obtain an abnormal prediction probability of the advertising slogan of 0.78;
[0151] S307: Since the abnormal prediction probability is much higher than the set abnormal threshold, the advertising slogan is determined to be abnormal content, and an alert is sent to the publisher of the content, urging the other party to modify it as soon as possible, and marking it on the web page to inform viewers that the content contains exaggerated virtual promotional behavior, and asks the other party to read it with caution.
[0152] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a content detection device. Figure 4 As shown, the content detection device 400 may include:
[0153] A character expansion unit 401 is used to expand at least one character in the original banned word based on a preset character expansion method to obtain a corresponding expanded banned word;
[0154] The first detection unit 402 is used to perform content detection on the content to be detected based on the banned word set including the original banned words and the extended banned words, and extract keywords representing product information from the content to be detected when it is determined that at least one banned word is contained;
[0155] The second detection unit 403 is used to perform the following operations for each content segment in the content to be detected, respectively, to obtain respective local content features, and obtain the detection result of the content to be detected based on the obtained local content features: based on the context information of each content segment and the keyword, obtain the association weight representing the degree of association between the content segment and the keyword, and based on the context information of the content segment and the association weight, obtain the local content feature of the content segment.
[0156] Optionally, the word expansion unit 401 is used to:
[0157] Based on the obfuscated character set of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain at least one extended banned word;
[0158] Based on the phonetic identification of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain at least one extended banned word;
[0159] Flip and deform at least one character in the original banned words to obtain at least one extended banned word;
[0160] At least one character of the original banned word is decomposed to obtain corresponding variant characters, and at least two variant characters are used to replace the corresponding characters of the original banned word to obtain at least one extended banned word.
[0161] Optionally, the word expansion unit 401 is used to:
[0162] Based on the obfuscated word set of at least one character in the original prohibited word, the original prohibited word is replaced multiple times to generate corresponding extended prohibited words; wherein, each time the prohibited word is generated, a obfuscated word is selected from the obfuscated word set of at least one character to replace the corresponding character of the original prohibited word to obtain an extended prohibited word.
[0163] Optionally, the character expansion unit 401 performs the following operations on a character to generate a corresponding obfuscated character set:
[0164] According to the text structure of a character, obtain homonymous characters with the same or similar structure;
[0165] and, according to the pronunciation of a word, obtaining homophones with the same or similar pronunciation;
[0166] The obtained at least one homonymous character and at least one homophone character are used to form a confusing character set of a character.
[0167] Optionally, the word expansion unit 401 is used to:
[0168] According to the text structure of at least one character in the original banned words, the corresponding character is decomposed into a plurality of variant characters, and the variant characters are generated based on a part of the text structure of the corresponding character.
[0169] Optionally, the second detection unit 403 is used for:
[0170] Extract the context information of a content segment and a keyword respectively to obtain their respective initial embedding features;
[0171] Based on the two initial embedded features obtained, an association weight representing the degree of association between a content segment and a keyword is obtained.
[0172] Optionally, the second detection unit 403 is used for:
[0173] Extract the context information of a content segment and obtain the corresponding initial embedding features;
[0174] Based on the association weight of a content segment, the initial embedding feature of a content segment is weighted to obtain a corresponding weighted embedding feature;
[0175] The weighted embedded features are normalized to obtain the local content features of a content segment.
[0176] Optionally, the second detection unit 403 is used for:
[0177] The local content features obtained are combined to obtain the global content features of the content to be detected;
[0178] The global content features are subjected to dimensionality reduction processing to obtain the abnormal prediction probability that the content to be detected is abnormal content, and the abnormal prediction probability is used as the corresponding detection result.
[0179] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0180] After introducing the content detection method and apparatus according to the exemplary embodiment of the present application, next, a computer device according to another exemplary embodiment of the present application is introduced.
[0181] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0182] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a computer device. In one embodiment, the computer device may be a server, such as Figure 1 In this embodiment, the structure of the computer device is as follows: Figure 5 As shown, it may include at least a memory 501 , a communication module 503 , and at least one processor 502 .
[0183] The memory 501 is used to store computer programs executed by the processor 502. The memory 501 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0184] The memory 501 may be a volatile memory, such as a random-access memory (RAM); the memory 501 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 501 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 501 may be a combination of the above memories.
[0185] The processor 502 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 502 is used to implement the above content detection method when calling the computer program stored in the memory 501 .
[0186] The communication module 503 is used to communicate with terminal devices and other servers.
[0187] The specific connection medium between the memory 501, the communication module 503 and the processor 502 is not limited in the embodiment of the present application. Figure 5 In the embodiment, the memory 501 and the processor 502 are connected via a bus 504. The bus 504 is connected to the processor 502 via a bus 504. Figure 5 The connections between the other components are only for illustration and are not intended to be limiting. The bus 504 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 5 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.
[0188] The memory 501 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the content detection method of the embodiment of the present application. The processor 502 is used to execute the above-mentioned content detection method, such as Figure 2A shown.
[0189] In another embodiment, the computer device may also be other computer devices, such as Figure 1 The terminal device 110 shown in FIG. 1 is a terminal device 110 shown in FIG. 1 . In this embodiment, the structure of the computer device can be as follows: Figure 6As shown, it includes: a communication component 610, a memory 620, a display unit 630, a camera 640, a sensor 650, an audio circuit 660, a Bluetooth module 670, a processor 680 and other components.
[0190] The communication component 610 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the object to send and receive information through the WiFi module.
[0191] The memory 620 can be used to store software programs and data. The processor 680 executes various functions and data processing of the terminal device 110 by running the software programs or data stored in the memory 620. The memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory 620 stores an operating system that enables the terminal device 110 to run. In the present application, the memory 620 can store an operating system and various application programs, and can also store a computer program for executing the content detection method of the embodiment of the present application.
[0192] The display unit 630 can also be used to display information input by the object or information provided to the object and a graphical user interface (GUI) of various menus of the terminal device 110. Specifically, the display unit 630 may include a display screen 632 disposed on the front of the terminal device 110. The display screen 632 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 630 may be used to display a defect detection interface, a model training interface, etc. in the embodiment of the present application.
[0193] The display unit 630 can also be used to receive input digital or character information and generate signal input related to the object setting and function control of the terminal device 110. Specifically, the display unit 630 may include a touch screen 631 arranged on the front of the terminal device 110, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.
[0194] The touch screen 631 can be covered on the display screen 632, or the touch screen 631 and the display screen 632 can be integrated to realize the input and output functions of the terminal device 110, and the integrated display screen can be referred to as a touch display screen. In this application, the display unit 630 can display the application and the corresponding operation steps.
[0195] The camera 640 can be used to capture static images, and the object can publish the images taken by the camera 640 through the application. The camera 640 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 680 to convert it into a digital image signal.
[0196] The terminal device may further include at least one sensor 650, such as an acceleration sensor 651, a distance sensor 652, a fingerprint sensor 653, and a temperature sensor 654. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0197] The audio circuit 660, the speaker 661, and the microphone 662 can provide an audio interface between the object and the terminal device 110. The audio circuit 660 can transmit the electrical signal converted from the received audio data to the speaker 661, which is converted into a sound signal for output. The terminal device 110 can also be equipped with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, and then the audio data is output to the communication component 610 to be sent to, for example, another terminal device 110, or the audio data is output to the memory 620 for further processing.
[0198] The Bluetooth module 670 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 670 to exchange data.
[0199] The processor 680 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 620 and calling data stored in the memory 620. In some embodiments, the processor 680 may include one or more processing units; the processor 680 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 680. In the present application, the processor 680 can run the operating system, application programs, user interface display and touch response, as well as the content detection method of the embodiment of the present application. In addition, the processor 680 is coupled to the display unit 630.
[0200] In some possible implementations, various aspects of the content detection method provided by the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on a computer device, the computer program is used to enable the computer device to execute the steps of the content detection method according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2A Follow the steps shown in .
[0201] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0202] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.
[0203] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0204] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0205] The computer program for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The computer program may be executed entirely on the user's computer device, partially on the user's computer device, as a separate software package, partially on the user's computer device and partially on a remote computer device, or entirely on the remote computer device. In the case of a remote computer device, the remote computer device may be connected to the user's computer device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer device (e.g., via the Internet using an Internet service provider).
[0206] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0207] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0208] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0209] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0210] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0211] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0212] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0213] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A content detection method, characterized in that: include: Based on a preset word expansion method, at least one word in the original banned words is expanded to obtain a corresponding expanded banned word; Based on the banned word set including the original banned words and the extended banned words, content detection is performed on the content to be detected, and when it is determined that at least one banned word is contained, keywords representing product information are extracted from the content to be detected; For each content segment in the content to be detected, the following operations are performed respectively to obtain respective local content features, and based on the obtained local content features, the detection result of the content to be detected is obtained: based on the context information of each content segment and the keyword, an association weight characterizing the degree of association between the content segment and the keyword is obtained, and based on the context information and the association weight of the content segment, the local content feature of the content segment is obtained.
2. The method according to claim 1, characterized in that The method of expanding at least one character in the original banned words based on a preset character expansion method to obtain a corresponding expanded banned word includes: Based on the obfuscated character set of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain at least one extended banned word; Based on the phonetic identification of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain the at least one extended banned word; Flip and deform the at least one character in the original banned words to obtain the at least one extended banned word; At least one character of the original banned word is decomposed to obtain corresponding variant characters, and at least two variant characters are used to replace the corresponding characters of the original banned word to obtain the at least one extended banned word.
3. The method according to claim 2, characterized in that The step of using the obfuscated character set of at least one character in the original banned word to replace the corresponding character of the original banned word to obtain at least one extended banned word comprises: Based on the obfuscated word set of at least one character in the original prohibited words, the original prohibited words are replaced multiple times to generate corresponding extended prohibited words; wherein, each time the prohibited words are generated, a obfuscated word is selected from the obfuscated word set of at least one character to replace the corresponding character of the original prohibited words to obtain an extended prohibited word.
4. The method according to claim 3, characterized in that Perform the following operations on a character to generate the corresponding obfuscated character set: According to the text structure of the character, obtaining a homonymous character with the same or similar structure; And, according to the pronunciation of the one word, obtaining homophones with the same or similar pronunciation; The obtained at least one homonymous character and at least one homophone character are used to form a confusing character set of the character.
5. The method according to claim 2, characterized in that The step of disassembling at least one character of the original banned word to obtain a corresponding variant character comprises: According to the text structure of each of the at least one character in the original banned words, the corresponding character is decomposed into a plurality of variant characters, wherein the variant characters are generated based on a part of the text structure of the corresponding character.
6. The method according to any one of claims 1 to 5, characterized in that: The obtaining, based on the context information of each of the content segment and the keyword, a correlation weight representing the correlation degree between the content segment and the keyword includes: Extracting context information of the content segment and the keyword respectively to obtain initial embedding features of the respective ones; Based on the two obtained initial embedding features, an association weight representing the degree of association between the one content segment and the keyword is obtained.
7. The method according to claim 6, characterized in that The obtaining of the local content feature of the content segment based on the context information and the associated weight of the content segment includes: Extracting context information of the one content segment to obtain corresponding initial embedding features; Based on the association weight of the one content segment, weighting the initial embedding feature of the one content segment to obtain a corresponding weighted embedding feature; The weighted embedded features are normalized to obtain local content features of the one content segment.
8. The method according to any one of claims 1 to 5, characterized in that: The obtaining of the detection result of the content to be detected based on the obtained local content features includes: Splicing the obtained local content features to obtain the global content features of the content to be detected; The global content feature is subjected to dimensionality reduction processing to obtain an abnormality prediction probability that the content to be detected is predicted to be abnormal content, and the abnormality prediction probability is used as the corresponding detection result.
9. A content detection device, characterized in that: include: A character expansion unit, used for expanding at least one character in the original prohibited words based on a preset character expansion method to obtain a corresponding extended prohibited word; A first detection unit is configured to perform content detection on the content to be detected based on a banned word set including the original banned words and the extended banned words, and extract keywords representing product information from the content to be detected when it is determined that the content contains at least one banned word; The second detection unit is used to perform the following operations for each content segment in the content to be detected, respectively, to obtain respective local content features, and obtain the detection result of the content to be detected based on the obtained local content features: based on the context information of each content segment and the keyword, obtain an association weight characterizing the degree of association between the content segment and the keyword, and based on the context information of the content segment and the association weight, obtain the local content feature of the content segment.
10. The device according to claim 9, characterized in that The word expansion unit is used for: Based on the obfuscated character set of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain at least one extended banned word; Based on the phonetic identification of at least one character in the original banned word, replace the corresponding character of the original banned word to obtain the at least one extended banned word; Flip and deform the at least one character in the original banned words to obtain the at least one extended banned word; At least one character of the original banned word is decomposed to obtain corresponding variant characters, and at least two variant characters are used to replace the corresponding characters of the original banned word to obtain the at least one extended banned word.
11. The device according to claim 10, characterized in that The word expansion unit is used for: Based on the obfuscated word set of at least one character in the original prohibited words, the original prohibited words are replaced multiple times to generate corresponding extended prohibited words; wherein, each time the prohibited words are generated, a obfuscated word is selected from the obfuscated word set of at least one character to replace the corresponding character of the original prohibited words to obtain an extended prohibited word.
12. The device according to claim 11, characterized in that The character expansion unit performs the following operations on a character to generate a corresponding obfuscated character set: According to the text structure of the character, obtaining a homonymous character with the same or similar structure; And, according to the pronunciation of the one word, obtaining homophones with the same or similar pronunciation; The obtained at least one homonymous character and at least one homophone character are used to form a confusing character set of the character.
13. A computer device, characterized in that: It comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.
14. A computer-readable storage medium, characterized in that: It includes program codes. When the program codes are run on a computer device, the program codes are used to make the computer device execute the steps of the method according to any one of claims 1 to 8.
15. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Electronic device, text information detection method and storage medium
CN109614608A
Sensitive word detection rule generation method and device and electronic equipment
CN115422923A
Method and system for responding to malicious comments
US20220114679A1
