A method and system for processing prohibited words in advertising corpora

By analyzing the Chinese character glyph disassembly matrix and special character distribution in the advertising corpus text, combined with the neural network model, the problem of low detection accuracy of prohibited words in the existing technology is solved, and higher detection accuracy and fewer false detections are achieved. Check.

CN118468858BActive Publication Date: 2024-09-17XIAMEN ZHONGLIAN CENTURY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410923978.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-09-17
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing banned word detection methods for advertising corpus have low detection accuracy in the case of odd-shaped characters and interfering characters, and the fuzzy matching effect is insufficient, resulting in frequent false detections and missed detections.

Method used

By obtaining the Chinese character glyph disassembly matrix in the advertising corpus text, analyzing the stroke information and special character distribution, calculating the hidden interference coefficient and divergence coefficient of prohibited words, combined with the neural network model to detect prohibited words, and improving the morphology, intention and semantic correlation of detection sex.

Benefits of technology

It improves the accuracy of banned word detection, reduces false detections and missed detections, and enhances the ability to recognize odd-shaped characters and interference characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468858B
    Figure CN118468858B
Patent Text Reader

Abstract

The present application relates to the technical field of text processing, and specifically to a method and system for processing banned words in advertising corpus, the method comprising: determining the Chinese character glyph decomposition matrix of each Chinese character based on the stroke information of each Chinese character in the advertising corpus text, analyzing the sparsity of the elements in the Chinese character glyph decomposition matrix of each Chinese character and the frequency of occurrence of each Chinese character in the advertising corpus text, obtaining the banned word hidden interference coefficient of each Chinese character in the advertising corpus text, analyzing the difference of the Chinese character glyph decomposition matrix of different Chinese characters in the Chinese character vocabulary, obtaining the front-back divergence coefficient of each Chinese character vocabulary, combining the front-back divergence coefficient and the banned word hidden interference coefficient of each Chinese character in the Chinese character vocabulary to obtain the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary, and using a neural network model to complete the processing of banned words in the advertising corpus. The accuracy of banned word detection in the advertising corpus is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text processing, and in particular to a method and system for processing banned words in advertising language. Background Art

[0002] At present, the detection of banned words in advertising corpus often relies on a banned word library, which directly matches or regularizes banned words in advertising corpus to detect banned words in advertising corpus. However, this banned word detection method can often detect a limited number of banned words, and the fuzzy matching ability of banned words is insufficient. If there are interference characters or special characters between banned words, the accuracy of banned word detection will be low. Summary of the invention

[0003] In order to solve the above technical problems, the purpose of this application is to provide a method and system for processing banned words in advertising corpus. The technical solutions adopted are as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for processing banned words in advertising material, the method comprising the following steps:

[0005] Acquire the advertisement corpus text, and determine the Chinese character glyph decomposition matrix of each Chinese character based on the stroke information of each Chinese character in the advertisement corpus text;

[0006] Analyze the sparsity of elements in the Chinese character glyph decomposition matrix of each Chinese character and the distribution of special characters, and combine the frequency of occurrence of each Chinese character in the advertising corpus text to obtain the banned word hidden interference coefficient of each Chinese character in the advertising corpus text;

[0007] The advertisement corpus text is segmented to obtain various Chinese character words, and the differences in the Chinese character shape decomposition matrices of different Chinese characters in the Chinese character words are analyzed to obtain the front-back divergence coefficient of each Chinese character word;

[0008] The word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is obtained by combining the preceding and following divergence coefficients and the banned word hidden interference coefficients of each Chinese character in the Chinese character vocabulary, and the processing of banned words in the advertising corpus is completed using a neural network model.

[0009] In the above scheme, a single Chinese character in the text data is decomposed to obtain a Chinese character glyph decomposition matrix, and the stroke information of each Chinese character is analyzed. Combined with the distribution of special characters and the frequency of occurrence of Chinese characters in the advertising corpus text, the banned word hidden interference coefficient of each Chinese character is obtained, which reflects the possibility that the Chinese character is a banned word in terms of stroke shape. The more complex the glyph and the more special characters before and after it, the greater the possibility that it is a banned word. The greater the frequency of occurrence of the Chinese character in the advertising corpus text, the more likely it is a normal character and the smaller the possibility that it is a banned word. The advertising corpus text is divided into each Chinese character vocabulary , the front-back divergence coefficient of each Chinese character vocabulary is calculated through the Chinese character shape decomposition matrix, which reflects the difference between each Chinese character vocabulary and the front and back adjacent Chinese character vocabulary, reflects the front-back semantic relationship of Chinese character vocabulary, and improves the semantic relevance of Chinese character vocabulary for banned word recognition; for the differences of Chinese characters in a single Chinese character vocabulary, combined with the front-back divergence coefficient and the banned word hidden interference coefficient of each Chinese character in the Chinese character vocabulary, the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is obtained, which reflects the intention possibility of the Chinese character vocabulary being a banned word. Finally, the neural network is used to obtain the possibility of each Chinese character vocabulary being a banned word. The defect of poor fuzzy matching effect for special-shaped characters and interference characters in traditional algorithms is solved. The banned words are detected from the overall morphology, intention and semantics of Chinese character vocabulary, which improves the detection accuracy of banned words and avoids false detection and missed detection.

[0010] Preferably, the construction of the Chinese character glyph decomposition matrix includes:

[0011] For each Chinese character, each element in the Chinese character glyph decomposition matrix is ​​the frequency of occurrence of each stroke in the corresponding Chinese character.

[0012] In the above scheme, by analyzing the stroke information of Chinese characters, each Chinese character is digitized in a unified standard, thereby more accurately extracting the morphological features of the Chinese characters.

[0013] Preferably, the determination of the banned word hiding interference coefficient of each Chinese character in the advertisement corpus text includes:

[0014] Determine the stroke dispersion coefficient of each Chinese character based on the dispersion of the strokes of each Chinese character in the advertisement corpus text;

[0015] Count the number of special characters before and after each Chinese character in the advertisement corpus text;

[0016] The number of special characters before and after each Chinese character is determined as the special character concentration;

[0017] The prohibited word concealment degree of each Chinese character is positively correlated with the special character concentration and the stroke dispersion coefficient of the corresponding Chinese character; the frequency of occurrence of each Chinese character in the advertising corpus text is counted, and the prohibited word concealment degree of each Chinese character is positively mapped and the frequency of occurrence is inversely mapped to obtain the prohibited word hiding interference coefficient of each Chinese character.

[0018] In the above scheme, by combining the stroke dispersion coefficient of each Chinese character, the distribution of special characters, and the frequency of occurrence of Chinese characters in the advertising corpus text, the banned word hidden interference coefficient of each Chinese character is obtained, and the possibility of each Chinese character belonging to a banned word is uniformly quantified, thereby improving the reliability of banned word analysis and recognition.

[0019] Preferably, the construction of the stroke dispersion coefficient of each Chinese character includes:

[0020] The L1 norm of the Chinese character shape decomposition matrix of each Chinese character is calculated, the maximum value of the elements in the Chinese character shape decomposition matrix of each Chinese character is counted, and the ratio of the L1 norm to the maximum value is determined as the stroke dispersion coefficient of each Chinese character.

[0021] In the above scheme, the L1 norm of the Chinese character glyph decomposition matrix reflects the importance of each stroke of the Chinese character, determines the stroke dispersion coefficient of each Chinese character, reflects the uniformity of the dispersion of each stroke in each Chinese character, and improves the accuracy of the morphological feature analysis of each Chinese character.

[0022] Preferably, the special characters include punctuation marks and all non-Chinese characters.

[0023] Preferably, the construction of the front-back divergence coefficient of each Chinese character vocabulary includes:

[0024] Determine the glyph disorder coefficient of each Chinese word in the advertisement corpus text based on the difference of the F norm of the Chinese word glyph decomposition matrix of different Chinese characters in each Chinese word;

[0025] Calculate the mean of the F-norm of the Chinese character glyph decomposition matrix of all Chinese characters in the Chinese character vocabulary, calculate the product of the mean and the glyph disorder coefficient of the Chinese character vocabulary, determine it as a prohibited assessment factor, obtain the maximum value of the glyph disorder coefficients of the previous Chinese character vocabulary and the next Chinese character vocabulary of each Chinese character vocabulary, map the prohibited assessment factor in direct proportion and the maximum value of the glyph disorder coefficient in inverse proportion, and obtain the front and back divergence coefficient of each Chinese character vocabulary.

[0026] In the above scheme, the front-back divergence coefficient of each Chinese character vocabulary is calculated through the Chinese character glyph decomposition matrix, which reflects the difference between each Chinese character vocabulary and the front and back adjacent Chinese character vocabulary, embodies the front-back semantic relationship of the Chinese character vocabulary, and improves the semantic relevance of Chinese character vocabulary for banned word recognition.

[0027] Preferably, the construction of the glyph disorder coefficient includes:

[0028] Calculate the variance of the F-norm of the Chinese character glyph decomposition matrix of all Chinese characters in the Chinese character vocabulary, calculate the absolute value of the difference between the F-norm of any Chinese character in the Chinese character vocabulary and the remaining Chinese characters, calculate the mean of all the absolute values ​​of the difference for all the Chinese characters in the Chinese character vocabulary, determine it as the glyph disorder measurement value, and determine the product of the variance and the glyph disorder measurement value as the glyph disorder coefficient of each Chinese character vocabulary.

[0029] In the above scheme, the glyph disorder coefficient of each Chinese word in the advertising corpus text is determined based on the difference in the F-norm of the Chinese character glyph decomposition matrix of different Chinese characters in each Chinese word, the possibility of each Chinese word belonging to an abnormal Chinese word is analyzed, and the accuracy of the recognition of banned words in Chinese words is improved.

[0030] Preferably, the construction of the word segmentation vocabulary embedding evaluation coefficient includes: determining the sum of the forbidden word hidden interference coefficients of each Chinese character in the Chinese character vocabulary and the previous Chinese character as a first forbidden interference sum value, counting the number of special characters between each Chinese character in the Chinese character vocabulary and the previous Chinese character, using the number as the exponent of an exponential function with a natural constant as the base, determining the sum of the products of the calculation results of the exponential function of all Chinese characters in the Chinese character vocabulary and the first forbidden interference sum value as a second forbidden interference sum value, and mapping the second forbidden interference sum value and the front and back divergence coefficients in direct proportion to obtain the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary.

[0031] In the above scheme, the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is obtained according to the difference of Chinese characters in a single Chinese character vocabulary, which reflects the possibility of the intention of the Chinese character vocabulary to be a banned word.

[0032] Preferably, the processing of banned words in advertising corpus using a neural network model includes:

[0033] Each Chinese word in the advertising corpus and the corresponding word segmentation word embedding evaluation coefficient are used as the input of the neural network model, and the output is the possibility that each Chinese word in the advertising corpus is a banned word.

[0034] In the above scheme, combined with the neural network model, banned words are detected from the morphology, intention and semantics of Chinese characters as a whole, which improves the detection accuracy of banned words and avoids false detection and missed detection.

[0035] In a second aspect, an embodiment of the present application further provides a system for processing banned words in advertising material, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.

[0036] This application has the following beneficial effects:

[0037] The present application uses OCR technology to extract the advertising corpus text data in the advertising video, decomposes the single Chinese character in the text data to obtain the Chinese character glyph decomposition matrix, and combines the distribution of special characters and the frequency of occurrence of Chinese characters in the advertising corpus text to obtain the banned word hidden interference coefficient of each Chinese character, which reflects the possibility that the Chinese character is a banned word in terms of morphology. The more complex the glyph and the more special characters before and after it, the greater the possibility that it is a banned word. The greater the frequency of occurrence of the Chinese character in the advertising corpus text, the more likely it is to be a normal character and the less likely it is to be a banned word. The advertising corpus text is divided into For each Chinese word, the front-back divergence coefficient of each Chinese word is calculated through the Chinese character shape decomposition matrix, which reflects the difference between each Chinese word and the front and back adjacent Chinese words, reflects the front-back semantic relationship of Chinese words, and improves the semantic relevance of Chinese words for banned word recognition; for the differences of Chinese characters in a single Chinese word, combined with the front-back divergence coefficient and the banned word hidden interference coefficient of each Chinese character in the Chinese word, the word segmentation vocabulary embedding evaluation coefficient of each Chinese word is obtained, which reflects the possibility of the intention of the Chinese word being a banned word. Finally, the neural network is used to obtain the possibility of each Chinese word being a banned word. The defect of poor fuzzy matching for special-shaped characters and interference characters in traditional algorithms is solved, and banned words are detected from the overall morphology, intention and semantics of Chinese words, which improves the detection accuracy of banned words and avoids false detection and missed detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A flowchart of a method for processing banned words in advertising material provided by one embodiment of the present application;

[0040] Figure 2 Flowchart for fine screening of banned words;

[0041] Figure 3 This is a schematic diagram of the matrix decomposition of Chinese character shapes;

[0042] Figure 4 Construct a flowchart for evaluating word embedding coefficients. DETAILED DESCRIPTION

[0043] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of a method and system for processing banned words in advertising language materials proposed by the present application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0044] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0045] The following is a detailed description of a method and system for processing banned words in advertising material provided by the present application in conjunction with the accompanying drawings.

[0046] See also Figure 1 , which shows a flowchart of a method for processing banned words in advertising material provided by an embodiment of the present application, the method comprising the following steps:

[0047] S1, obtain advertising corpus information and perform preprocessing.

[0048] This application mainly focuses on the detection and processing of banned words in the corpus of advertising videos on video platforms. The banned word screening flow chart is as follows: Figure 2 As shown, first, the advertising video data is obtained, the advertising video is framed, it is determined whether all the advertising video content has been framed, and the advertising text in each frame of the image to be detected is extracted, with the focus on analysis based on text structure features, and the advertising corpus text and analysis results are combined using a neural network to complete the fine screening of banned words in the advertising corpus text.

[0049] This application is mainly aimed at detecting banned words in the advertising corpus text of advertising videos. For advertising videos, firstly perform frame segmentation operation, and use OCR technology to extract text information in each frame of video image, specifically including advertising information and subtitle information. In this way, all advertising corpus in the advertising video is obtained, and then special characters and punctuation marks in the advertising corpus are eliminated through regular expressions, such as "@", "¥", "&", "*" and "," and other non-Chinese characters. OCR technology and regular expressions are both existing public technologies, and this application will not go into details here. Finally, the preprocessed advertising corpus text is obtained, and then the special characters and punctuation marks in the advertising corpus are removed through regular expressions. express, represents the i-th Chinese character in the advertising corpus text, Indicates the number of Chinese characters in the advertising corpus text.

[0050] S2, determining a Chinese character shape decomposition matrix of each Chinese character based on the stroke information of each Chinese character in the advertisement corpus text.

[0051] To avoid increasing the difficulty of fuzzy matching during the detection of advertising prohibited words by deliberately misspelling, using synonyms, adding interfering characters, using variant or traditional Chinese characters, which brings higher challenges to the detection of prohibited words.

[0052] To improve the detection accuracy of variant or traditional Chinese characters in advertising prohibited words, this application disassembles Chinese characters into each stroke, in turn: dot, horizontal, vertical, left-falling stroke, right-falling stroke, rising stroke, horizontal fold, horizontal left-falling stroke, horizontal hook, horizontal fold hook, horizontal fold rising stroke, horizontal bend, horizontal double fold, horizontal oblique hook, vertical hook, vertical hook with a hook at the end, vertical left-falling stroke, left-falling point, left-falling fold, oblique hook, vertical rising stroke, vertical bend, vertical double fold, lying hook, others, as Figure 3 shown in the schematic diagram of the Chinese character glyph disassembly matrix. This application constructs a Chinese character glyph disassembly matrix to disassemble Chinese characters into strokes. Each element in the Chinese character glyph disassembly matrix represents the number of times the corresponding stroke appears in the Chinese character. For example, for the single Chinese character "髪", the stroke order is "horizontal, vertical, horizontal, horizontal, horizontal, left-falling fold, dot, left-falling stroke, left-falling stroke, left-falling stroke, horizontal, left-falling stroke, horizontal left-falling stroke and right-falling stroke", so the Chinese character glyph disassembly matrix of the Chinese character "髪" .

[0053] It should be noted that the Chinese character glyph disassembly matrix constructed for each Chinese character in this embodiment only reflects the frequency information of each stroke in each Chinese character, and does not reflect the arrangement order information of the Chinese character strokes. Since the purpose of constructing the Chinese character glyph disassembly matrix is to analyze the impact of the replacement of variant or traditional Chinese characters in Chinese vocabulary on the detection of prohibited words, usually variant Chinese characters have a relatively complex Chinese character structure, that is, the Chinese character strokes are more and more abundant, resulting in larger element values in the Chinese character glyph disassembly matrix, and the difference from other Chinese character glyph disassembly matrices is more obvious. The possibility of variant Chinese characters having the same Chinese character glyph disassembly matrix as other Chinese characters is smaller, and for Chinese characters with the same Chinese character glyph disassembly matrix, the strokes are often relatively simple, which are relatively common Chinese characters and the possibility of being prohibited words is smaller, and thus the impact on subsequent prohibited word detection is smaller. Therefore, this application does not distinguish the situation where different Chinese characters have the same Chinese character glyph disassembly matrix.

[0054] S3. Analyze the sparsity of elements and the distribution of special characters in the Chinese character glyph disassembly matrix of each Chinese character, and combine the appearance frequency of each Chinese character in the advertising corpus text to obtain the prohibited word hiding interference coefficient of each Chinese character in the advertising corpus text.

[0055] Furthermore, as an example of this application, the construction process of the prohibited word hiding interference coefficient of each Chinese character is:

[0056] First, based on the dispersion of the strokes of each Chinese character in the advertising corpus text, the stroke dispersion coefficient of each Chinese character is determined, specifically: the L1 norm of the Chinese character glyph decomposition matrix of each Chinese character is calculated, the maximum value of the elements in the Chinese character glyph decomposition matrix of each Chinese character is counted, and the ratio of the L1 norm to the maximum value is determined as the stroke dispersion coefficient of each Chinese character. Among them, the calculation of the L1 norm of the matrix is ​​an existing well-known technology, and this application will not be described in detail here.

[0057] Then, the number of special characters before and after each Chinese character in the advertisement corpus text is counted respectively. Special characters are punctuation marks and all non-Chinese symbols, such as “@”, “¥”, “&”, “*”, etc.

[0058] Finally, according to the Chinese character glyph decomposition matrix corresponding to the Chinese character and the frequency of occurrence of the Chinese character in the advertising corpus, the prohibited word hiding interference coefficient of each Chinese character is calculated, including: the sum of the number of special characters before and after each Chinese character is determined as the special character concentration, and the special character concentration is used as the exponent of an exponential function with a natural constant as the base; the product of the calculation result of the exponential function and the stroke dispersion coefficient of the corresponding Chinese character is calculated to determine the prohibited word concealment degree of the Chinese character; the frequency of occurrence of each Chinese character in the advertising corpus text is counted, and the prohibited word concealment degree of each Chinese character is mapped in direct proportion and the occurrence frequency is mapped in inverse proportion to obtain the prohibited word hiding interference coefficient of each Chinese character.

[0059] It should be noted that a positive proportional mapping indicates a positive correlation between two variables, and an inverse proportional mapping indicates a negative correlation between two variables. The positive correlation may specifically be a multiplication relationship, an addition relationship, or the power of an exponential function; the negative correlation may be a subtraction relationship, a division relationship, etc., which is determined by actual application and is not limited in this application.

[0060] It should be understood that a positive correlation means that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. A negative correlation means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases.

[0061] As an embodiment of the present application, the banned word hiding interference coefficient of each Chinese character is the ratio of the banned word concealment degree of each Chinese character to the occurrence frequency of the Chinese character in the advertisement corpus text.

[0062] As another embodiment of the present application, the banned word hiding interference coefficient of each Chinese character is the difference between the banned word concealment degree of each Chinese character and the occurrence frequency of the Chinese character in the advertisement corpus text.

[0063] If the Chinese character shape is more complex, the L1 norm value of the Chinese character shape decomposition matrix corresponding to the Chinese character is larger, and the more evenly distributed on each stroke, the larger the value of the stroke dispersion coefficient. In addition, if there are more special characters before and after the Chinese character, it indicates that the Chinese character is more likely to be hidden, and the probability that the Chinese character is a banned word is greater. At the same time, banned words often appear less likely in advertising corpus, which ultimately makes the value of the banned word hiding interference coefficient larger. On the contrary, if the probability of a Chinese character appearing in the text is higher, and the shape is relatively simple, and there are no special characters before and after, it indicates that the Chinese character is less likely to be a banned word, and the banned word hiding interference coefficient is smaller.

[0064] S4, segmenting the advertisement corpus text to obtain various Chinese character words, analyzing the differences in the Chinese character shape decomposition matrices of different Chinese characters in the Chinese character words, and obtaining the front-back divergence coefficient of each Chinese character word.

[0065] The banned word hidden interference coefficient only analyzes the complexity of the shape of a single Chinese character, but banned words are often composed of multiple Chinese characters. In order to analyze the situation where Chinese characters form banned words, the advertising corpus text data As the input of the NLPIR word segmenter, the output is each Chinese word of the advertisement corpus text. The NLPIR word segmenter is a prior art known in the art, and this application will not elaborate on it here.

[0066] It should be understood that this embodiment only proposes a method of text segmentation, that is, using the NLPIR word segmenter to segment the advertising corpus text data. On the premise that the purpose of text segmentation can be achieved, as other implementation methods, the implementer can also use other feasible text segmentation algorithms in the prior art to segment the advertising corpus text data, and this application does not impose any restrictions on this.

[0067] Based on the difference in the F norm of the Chinese character glyph decomposition matrix of different Chinese characters in each Chinese character vocabulary, the glyph disorder coefficient of each Chinese character vocabulary in the advertising corpus text is determined, specifically: the F norm of the Chinese character glyph decomposition matrix of each Chinese character in the Chinese character vocabulary is calculated, the vocabulary glyph sequence of the Chinese character vocabulary is composed, the variance of the vocabulary glyph sequence is calculated, the absolute value of the difference between the F norm of any Chinese character in the Chinese character vocabulary and the remaining Chinese characters is calculated, the average of all the absolute values ​​of the difference of all the Chinese characters in the Chinese character vocabulary is calculated, and the glyph disorder coefficient of each Chinese character vocabulary is determined by multiplying the variance and the glyph disorder metric value. Among them, the calculation of the F norm of the matrix is ​​an existing well-known technology, and this application will not be described in detail here.

[0068] It should be understood that the purpose of calculating the F-norm of the Chinese character glyph decomposition matrix of a Chinese character is to quantify the size of the Chinese character glyph decomposition matrix of the Chinese character, so as to measure the complexity of the Chinese character, which is conducive to distinguishing between special-shaped characters and ordinary Chinese characters, and highlighting the recognition effect of embedding banned words with special-shaped characters. Under the premise that the size of the Chinese character glyph decomposition matrix of the Chinese character can be quantified to measure the complexity of the Chinese character, the implementer can choose other existing feasible methods to calculate the Chinese character glyph decomposition matrix according to the actual situation, and this application does not limit this. The glyph disorder coefficient of the Chinese character vocabulary reflects the complexity difference between different Chinese characters in a Chinese character vocabulary. If there are special-shaped characters in the Chinese character vocabulary, the corresponding complexity difference between different Chinese characters will be greater, and the glyph disorder coefficient will be greater, which objectively measures the possibility of the existence of banned words.

[0069] Furthermore, for each Chinese character vocabulary, the mean of the vocabulary glyph sequence is calculated, the product of the mean and the glyph disorder coefficient of the Chinese character vocabulary is calculated and determined as a prohibited assessment factor, the maximum value of the glyph disorder coefficients of the previous Chinese character vocabulary and the next Chinese character vocabulary of each Chinese character vocabulary is obtained, the prohibited assessment factor is mapped in direct proportion and the maximum value of the glyph disorder coefficient is mapped in inverse proportion to obtain the front and back divergence coefficients of each Chinese character vocabulary.

[0070] As an embodiment of the present application, the sum of the maximum value of the glyph disorder coefficients of the previous Chinese word and the next Chinese word of each Chinese word and the preset adjustment factor greater than 0 is calculated, recorded as the first sum, and the ratio of the prohibited assessment factor of each Chinese word to the first sum is used as the front and back divergence coefficient of each Chinese word. Among them, the purpose of presetting the adjustment factor greater than 0 is to avoid the denominator being 0, which is set manually. In this application, the preset adjustment factor greater than 0 is set to 1, and the implementer can set it according to the actual situation. This application does not limit it here.

[0071] If the Chinese character vocabulary is a banned word, the possibility that the Chinese character vocabulary is a variant character is greater, so the difference in the norm of the Chinese character shape decomposition matrix F between the Chinese characters in the Chinese character vocabulary is greater, and due to the influence of the variant characters, the variance and mean of the vocabulary shape sequence are larger, and the value of the shape disorder coefficient is larger. At the same time, since the possibility of multiple banned words appearing consecutively is low, if the Chinese character vocabulary before and after the Chinese character vocabulary corresponds to normal advertising vocabulary, the value of the shape disorder coefficient corresponding to the normal Chinese character vocabulary before and after the Chinese character vocabulary is smaller, and the corresponding value of the front and back divergence coefficient of the Chinese character vocabulary is larger.

[0072] S5, combining the previous and next divergence coefficients and the banned word hidden interference coefficients of each Chinese character in the Chinese character vocabulary to obtain the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary, and using the neural network model to complete the processing of banned words in the advertising corpus.

[0073] The specific calculation process of the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is as follows: calculate the sum of the forbidden word hidden interference coefficients of each Chinese character in the Chinese character vocabulary and the previous Chinese character, and determine it as the first forbidden interference sum value. For the first Chinese character in the Chinese character vocabulary, the corresponding forbidden word hidden interference coefficient is used as the first forbidden interference sum value. Count the number of special characters between each Chinese character in the Chinese character vocabulary and the previous Chinese character. For the first Chinese character in the Chinese character vocabulary, the number of special characters is recorded as 0. The number is used as the exponent of an exponential function with a natural constant as the base. The sum of the product of the calculation result of the exponential function of all Chinese characters in the Chinese character vocabulary and the first forbidden interference sum value is determined as the second forbidden interference sum value. The second forbidden interference sum value and the front and back divergence coefficients are respectively mapped in direct proportion to obtain the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary. The flowchart for constructing the word segmentation vocabulary embedding evaluation coefficient is shown below. Figure 4 As an embodiment of the present application, the word segmentation vocabulary embedding evaluation coefficient of each Chinese word is the product of the front-back divergence coefficient of each Chinese word and the second prohibited interference sum value.

[0074] As another embodiment of the present application, the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is the sum of the front-back divergence coefficient of each Chinese character vocabulary and the second prohibited interference sum value.

[0075] If a Chinese character vocabulary is a banned word, there are often variant characters in the Chinese character vocabulary, which makes the value of the banned word hidden interference coefficient corresponding to the variant characters larger, and if the number of special characters between two adjacent Chinese characters is larger, it indicates that the possibility that the Chinese character vocabulary is a banned word is greater, and finally the value of the word segmentation vocabulary embedding evaluation coefficient is larger.

[0076] At this point, the word segmentation vocabulary embedding evaluation coefficient of each Chinese word in the advertising corpus text is obtained, which reflects the possibility that the Chinese word is a banned word in terms of morphology and intention. The larger the word segmentation vocabulary embedding evaluation coefficient, the greater the possibility that the Chinese word is a banned word.

[0077] In order to complete the fine screening of banned words in the advertising corpus text, the present application adopts a neural network to perform fine screening of banned words based on word granularity, specifically: obtain the open source COLD data set, which contains text data with banned word labels, and in the training process of the LSTM neural network, use Adam as the optimizer, use the cross entropy function as the loss function, and use the same calculation method as the word segmentation vocabulary embedding evaluation coefficient to calculate the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary in the COLD data set, and use the COLD data set and the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary therein for the training of the LSTM neural network; it should be noted that the implementer can choose other existing open source banned word data sets according to actual conditions, or construct a banned word data set by himself for the training of the LSTM neural network, and the present application does not impose any restrictions on this;

[0078] During the training process, the input layer of the LSTM neural network is responsible for receiving data, converting each Chinese character word into a corresponding semantic vector, and then concatenating it with the word segmentation vocabulary embedding evaluation coefficient of the Chinese character word. The concatenation result is used as the input of the next layer to learn the semantic association features between Chinese character words. Finally, the fully connected layer and Softmax function are used to output the probability that each Chinese character word is a banned word.

[0079] After the training is completed, the model with the highest accuracy is selected for deployment testing. The Chinese characters and the corresponding word segmentation embedding evaluation coefficients in the advertising corpus text are used as the input of the trained LSTM neural network model. The output is the possibility that each Chinese character in the advertising corpus text belongs to a banned word. The greater the possibility, the more likely the Chinese character is a banned word.

[0080] As an embodiment of the present application, Chinese characters whose probability of being a banned word output by the LSTM neural network model is greater than a preset banned word recognition threshold are determined to be banned words. In this embodiment, the banned word recognition threshold is 0.75, and the implementer can set it according to the actual situation. This application does not impose any restrictions on this.

[0081] The banned words screened out in the advertising corpus text are highlighted, and the advertising corpus text in which the banned words are detected is marked as an illegal advertisement.

[0082] It should be noted that this embodiment only provides a neural network model for the recognition of banned words. There are many existing neural network models. As other implementation methods, implementers can also select other neural network models to recognize banned words for Chinese vocabulary. This application does not impose any special restrictions on this.

[0083] Based on the same inventive concept as the above method, an embodiment of the present application also provides a system for processing banned words in advertising materials, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned methods for processing banned words in advertising materials are implemented.

[0084] In summary, the present application uses OCR technology to extract advertising corpus text data from advertising videos, splits individual Chinese characters in the text data to obtain a Chinese character glyph decomposition matrix, and obtains the banned word hidden interference coefficient of each Chinese character in combination with the distribution of special characters, which reflects the possibility that the Chinese character is a banned word in terms of morphology. The more complex the glyph and the more special characters before and after it, the greater the possibility that it is a banned word; uses a word segmenter to divide the advertising corpus text into various Chinese character words, and calculates the front and back divergence coefficient of each Chinese character word through the Chinese character glyph decomposition matrix, which reflects the difference between each Chinese character word and the adjacent Chinese character words before and after, embodies the front and back semantic relationship of Chinese character words, and improves the semantic relevance of Chinese character words for banned word recognition; obtains the word segmentation vocabulary embedding evaluation coefficient of each Chinese character word based on the difference of Chinese characters in a single Chinese character word, which reflects the possibility that the Chinese character word is intended to be a banned word, and finally uses a neural network to obtain the possibility that each Chinese character word is a banned word. It solves the defect of poor fuzzy matching for special-shaped fonts in traditional algorithms, detects banned words from the overall form, intention and semantics of Chinese characters, improves the detection accuracy of banned words, and avoids false detection and missed detection.

[0085] It should be noted that the above sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0086] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0087] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for processing banned words in advertising language, characterized in that: The method comprises the following steps: Acquire the advertisement corpus text, and determine the Chinese character glyph decomposition matrix of each Chinese character based on the stroke information of each Chinese character in the advertisement corpus text; Analyze the sparsity of elements in the Chinese character glyph decomposition matrix of each Chinese character and the distribution of special characters, and combine the frequency of occurrence of each Chinese character in the advertising corpus text to obtain the banned word hidden interference coefficient of each Chinese character in the advertising corpus text; The advertisement corpus text is segmented to obtain various Chinese character words, and the differences in the Chinese character shape decomposition matrices of different Chinese characters in the Chinese character words are analyzed to obtain the front-back divergence coefficient of each Chinese character word; Combining the preceding and following divergence coefficients and the banned word hidden interference coefficients of each Chinese character in the Chinese character vocabulary, the word segmentation vocabulary embedding evaluation coefficients of each Chinese character vocabulary are obtained, and the processing of banned words in the advertising corpus is completed using a neural network model; The determination of the banned word hidden interference coefficient of each Chinese character in the advertisement corpus text includes: Determine the stroke dispersion coefficient of each Chinese character based on the dispersion of the strokes of each Chinese character in the advertisement corpus text; Count the number of special characters before and after each Chinese character in the advertisement corpus text; The number of special characters before and after each Chinese character is determined as the special character concentration; The concentration of the special characters is taken as the exponent of an exponential function with a natural constant as the base; the product of the calculation result of the exponential function and the stroke dispersion coefficient of the corresponding Chinese character is calculated to determine the Chinese character prohibited concealment degree of each Chinese character; the frequency of occurrence of each Chinese character in the advertising corpus text is counted, and the prohibited word hiding interference coefficient of each Chinese character is the ratio of the Chinese character prohibited concealment degree of each Chinese character to the frequency of occurrence of the Chinese character in the advertising corpus text; The construction of the stroke dispersion coefficient of each Chinese character includes: Calculating the L1 norm of the Chinese character shape decomposition matrix of each Chinese character, counting the maximum value of the elements in the Chinese character shape decomposition matrix of each Chinese character, and determining the ratio of the L1 norm to the maximum value as the stroke dispersion coefficient of each Chinese character; The special characters include punctuation marks and all non-Chinese characters; The construction of the front-back divergence coefficient of each Chinese character vocabulary includes: Determine the glyph disorder coefficient of each Chinese word in the advertisement corpus text based on the difference of the F norm of the Chinese word glyph decomposition matrix of different Chinese characters in each Chinese word; Calculate the mean of the F norm of the Chinese character glyph decomposition matrix of all Chinese characters in the Chinese character vocabulary, calculate the product of the mean and the glyph disorder coefficient of the Chinese character vocabulary, determine it as a prohibited assessment factor, obtain the maximum value of the glyph disorder coefficients of the previous Chinese character vocabulary and the next Chinese character vocabulary of each Chinese character vocabulary, calculate the sum of the maximum value of the glyph disorder coefficient and a preset adjustment factor greater than 0, record it as a first sum, and use the ratio of the prohibited assessment factor of each Chinese character vocabulary to the first sum as the front and back divergence coefficient of each Chinese character vocabulary; The construction of the glyph disorder coefficient includes: Calculating the variance of the F norm of the Chinese character glyph decomposition matrix of all Chinese characters in the Chinese character vocabulary, calculating the absolute value of the difference between any Chinese character in the Chinese character vocabulary and the remaining Chinese characters, calculating the mean of all the absolute values ​​of the difference for all Chinese characters in the Chinese character vocabulary, determining it as a glyph disorder measurement value, and determining the product of the variance and the glyph disorder measurement value as a glyph disorder coefficient of each Chinese character vocabulary; The construction of the word segmentation vocabulary embedding evaluation coefficient includes: determining the sum of the forbidden word hidden interference coefficients of each Chinese character in the Chinese character vocabulary and the previous Chinese character as a first forbidden interference sum value, counting the number of special characters between each Chinese character in the Chinese character vocabulary and the previous Chinese character, using the number as the exponent of an exponential function with a natural constant as the base, determining the sum of the products of the calculation results of the exponential function of all Chinese characters in the Chinese character vocabulary and the first forbidden interference sum value as a second forbidden interference sum value, and the word segmentation vocabulary embedding evaluation coefficient of each Chinese character vocabulary is the product of the front and back divergence coefficients of each Chinese character vocabulary and the second forbidden interference sum value; The method of using a neural network model to process banned words in advertising materials includes: Each Chinese word in the advertising corpus and the corresponding word segmentation word embedding evaluation coefficient are used as the input of the neural network model, and the output is the possibility that each Chinese word in the advertising corpus is a banned word.

2. A method for processing banned words in advertising language as claimed in claim 1, characterized in that: The construction of the Chinese character glyph decomposition matrix includes: For each Chinese character, each element in the Chinese character glyph decomposition matrix is ​​the frequency of occurrence of each stroke in the corresponding Chinese character.

3. A system for processing banned words in advertising language, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.