Advertisement text detection method and device
By using a neural network model to automatically detect advertising text, the problem of low efficiency in advertising text detection is solved, and efficient and accurate abnormal word recognition is achieved.
Patent Information
- Application Number
- CN202010604391.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-06-29
AI Technical Summary
Existing technologies are not efficient in detecting advertising text and have problems with inaccurate detection of misleading words.
An automated detection method based on a neural network model is adopted. By extracting the original semantic information of the advertising text and obtaining semantic feature information, the feature is fused and processed using a bidirectional recurrent neural network and a convolutional neural network to determine whether the advertising text contains abnormal words.
It improves the efficiency and accuracy of advertising text detection, reduces manual intervention, and can quickly identify and provide feedback on whether the advertising text contains abnormal words.
Smart Images

Figure CN113761930B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method and device for detecting advertisement text. Background Art
[0002] In recent years, the rapid development of the Internet has greatly facilitated people's lives. For example, users can purchase items through the Internet. Items sold through the Internet are generally accompanied by advertising texts. Some advertising texts include abnormal words that do not comply with relevant regulations. Abnormal words such as "free of formaldehyde" and "zero profit" are misleading to users when purchasing items. Therefore, it is of great significance to detect advertising texts to determine whether the advertising texts contain abnormal words.
[0003] At present, the method for detecting advertisement text is to manually detect advertisements. In the process of realizing this application, the inventor found that there are at least the following problems in the prior art: the efficiency of the method for detecting advertisement text is not high. Summary of the invention
[0004] The embodiments of the present application provide an advertisement text detection method and device to solve the technical problem of low efficiency in advertisement text detection.
[0005] In a first aspect, an embodiment of the present application provides an advertising text detection method, comprising: receiving advertising text from a terminal device; based on the advertising text, obtaining original semantic information of the advertising text; based on the original semantic information, obtaining semantic feature information of the advertising text; according to the semantic feature information, determining the detection result, the detection result being used to indicate that the advertising text does not contain abnormal words or contains abnormal words; and sending the detection result to the terminal device.
[0006] In this solution, the server receives the advertisement text from the terminal device, extracts the original semantic information of the advertisement text to obtain the semantic feature information of the advertisement text, determines the detection result of the advertisement text according to the semantic feature information of the advertisement text, and the detection result is used to indicate that the advertisement text does not contain abnormal words or contains abnormal words; the server sends the detection result of the advertisement text to the terminal device so that the terminal device displays the detection result of the advertisement text. The user can know whether the advertisement text contains abnormal words according to the detection result displayed by the terminal device, without manual detection, thereby improving the detection efficiency of the advertisement text. At the same time, in this solution, the detection result of the advertisement text is obtained by extracting the semantic feature information of the advertisement text, and the detection accuracy is high.
[0007] In a possible implementation, the obtaining of the semantic feature information of the advertisement text based on the original semantic information includes: performing a first operation, the first operation including: extracting the i-th initial semantic feature information of the advertisement text based on the i-th information, fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information; initially, i=1, and the first information is the original semantic information; performing a second operation, the second operation including: adding 1 to i, and using the i-th intermediate semantic feature information as the i+1-th information; repeating the first operation and the second operation until the M-th intermediate semantic feature information is obtained; M is an integer greater than or equal to 1; and obtaining the semantic feature information of the advertisement text based on the M-th intermediate semantic feature information.
[0008] This solution provides a specific implementation of obtaining the semantic feature information of the advertising text based on the original semantic information. When M=1, the efficiency of obtaining the semantic feature information of the advertising text based on the original semantic information is high. When M is greater than 1, the accuracy of the semantic feature information of the advertising text extracted based on the original semantic information is high.
[0009] In a possible implementation, the i-th information includes a first matrix, the i-th initial semantic feature information includes at least one second matrix, and the fusing of the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information includes: adding or concatenating the first matrix and the at least one second matrix to obtain a third matrix; activating the third matrix to obtain an i-th intermediate matrix, and the i-th intermediate semantic feature information includes the i-th intermediate matrix.
[0010] In this solution, adding the first matrix and at least one second matrix can reduce the number of components of the i-th intermediate matrix, thereby reducing the computational complexity and saving memory resources and computing resources of the server. Concatenating the first matrix and at least one second matrix can improve the efficiency of obtaining the i-th intermediate semantic feature information.
[0011] In a possible implementation, obtaining the semantic feature information of the advertisement text based on the Mth intermediate semantic feature information includes: using the Mth intermediate semantic feature information as the semantic feature information of the advertisement text. This solution is highly efficient in obtaining the semantic feature information of the advertisement text.
[0012] In a possible implementation, the obtaining of the semantic feature information of the advertisement text based on the Mth intermediate semantic feature information includes: obtaining the semantic feature information of the advertisement text according to the M intermediate semantic feature information and the respective weights of the M intermediate semantic feature information. The semantic feature information of the advertisement text obtained by this solution has high accuracy.
[0013] In a possible implementation, determining the detection result of the advertisement text according to the semantic feature information includes: obtaining a semantic tag of the advertisement text according to the semantic feature information, the semantic tag being used to indicate the probability that the advertisement text contains abnormal words and / or does not contain abnormal words; and determining the detection result of the advertisement text according to the semantic tag. This solution provides a specific implementation of obtaining the detection result of the advertisement text according to the semantic feature information.
[0014] In a possible implementation, obtaining the semantic label of the advertisement text according to the semantic feature information includes: processing the semantic feature information; the processing includes pooling processing; and obtaining the semantic label of the advertisement text according to the processing result of the semantic feature information. This solution can reduce the computational complexity of obtaining the semantic label of the advertisement text.
[0015] In a possible implementation, the pooling process is an average pooling process. In this solution, the average pooling process can reduce the loss of some semantic information of the advertisement text and improve the accuracy of the detection result of the advertisement text.
[0016] In a possible implementation, the detection result is obtained based on a neural network model, the neural network model includes M first sub-neural network models and N second sub-neural network models, M and N are both positive integers, the semantic feature information of the advertisement text is obtained based on the original semantic information, and the detection result is determined according to the semantic feature information, including: based on the original semantic information of the advertisement text, the semantic feature information of the advertisement text is obtained by using the first type of sub-neural network model; based on the semantic feature information of the advertisement text, the detection result is determined by using the second type of sub-neural network model. This solution provides a specific implementation of obtaining the detection result of the advertisement text.
[0017] In a possible implementation, the neural network corresponding to the first type of sub-neural network model is a bidirectional recurrent neural network RNN or a bidirectional long short-term memory recurrent neural network BLSTM; the neural network corresponding to the second type of sub-neural network model is a convolutional neural network CNN. This solution obtains a high accuracy detection result of the advertising text.
[0018] In a second aspect, an embodiment of the present application provides an advertising text detection device, comprising: a transceiver module, used to receive advertising text from a terminal device; a processing module, used to obtain original semantic information of the advertising text based on the advertising text; the processing module is also used to obtain semantic feature information of the advertising text based on the original semantic information; the processing module is also used to determine the detection result based on the semantic feature information, the detection result being used to indicate that the advertising text does not contain abnormal words or contains abnormal words; the transceiver module is also used to send the detection result to the terminal device.
[0019] In a possible implementation, the processing module is specifically used to: obtain original semantic information of the advertising text, where the original semantic information is obtained based on the words after the advertising text is segmented; based on the original semantic information, obtain semantic feature information of the advertising text; and determine the detection result based on the semantic feature information.
[0020] In a possible implementation, the processing module is specifically used to: perform a first operation, the first operation comprising: based on the i-th information, extracting the i-th initial semantic feature information of the advertising text, fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information; initially, i=1, and the first information is the original semantic information; perform a second operation, the second operation comprising: adding 1 to i, and taking the i-th intermediate semantic feature information as the i+1-th information; repeating the first operation and the second operation until the M-th intermediate semantic feature information is obtained; M is an integer greater than or equal to 1; based on the M-th intermediate semantic feature information, obtain the semantic feature information of the advertising text.
[0021] In a possible implementation, the i-th information includes a first matrix, the i-th initial semantic feature information includes at least one second matrix, and the fusing of the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information includes: adding or concatenating the first matrix and the at least one second matrix to obtain a third matrix; activating the third matrix to obtain an i-th intermediate matrix, and the i-th intermediate semantic feature information includes the i-th intermediate matrix.
[0022] In a possible implementation, obtaining the semantic feature information of the advertisement text based on the Mth intermediate semantic feature information includes: using the Mth intermediate semantic feature information as the semantic feature information of the advertisement text.
[0023] In a possible implementation, obtaining the semantic feature information of the advertisement text based on the Mth intermediate semantic feature information includes: obtaining the semantic feature information of the advertisement text according to M intermediate semantic feature information and respective weights of the M intermediate semantic feature information.
[0024] In a possible implementation, determining the detection result of the advertising text based on the semantic feature information includes: obtaining a semantic tag of the advertising text based on the semantic feature information, the semantic tag being used to indicate the probability that the advertising text contains abnormal words and / or does not contain abnormal words; and determining the detection result of the advertising text based on the semantic tag.
[0025] In a possible implementation, obtaining the semantic label of the advertisement text according to the semantic feature information includes: processing the semantic feature information; the processing includes pooling processing; obtaining the semantic label of the advertisement text according to the processing result of the semantic feature information
[0026] In a possible implementation, the pooling process is an average pooling process.
[0027] In a possible implementation, the detection result is obtained based on a neural network model, the neural network model includes M first sub-neural network models and N second sub-neural network models, M and N are both positive integers, and the processing module is specifically used to: based on the original semantic information of the advertising text, use the first type of sub-neural network model to obtain the semantic feature information of the advertising text; based on the semantic feature information of the advertising text, use the second type of sub-neural network model to determine the detection result.
[0028] In a possible implementation, the neural network corresponding to the first type of sub-neural network model is a bidirectional recurrent neural network RNN or a bidirectional long short-term memory recurrent neural network BLSTM; the neural network corresponding to the second type of sub-neural network model is a convolutional neural network CNN.
[0029] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor; a memory; a memory for storing executable instructions of the processor; wherein the processor is configured to: execute the executable instructions to implement the method described in the first aspect and any possible implementation manner of the first aspect.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect and any possible implementation of the first aspect.
[0031] In this application, the server receives the advertisement text from the terminal device, extracts the original semantic information of the advertisement text to obtain the semantic feature information of the advertisement text, determines the detection result of the advertisement text according to the semantic feature information of the advertisement text, and the detection result is used to indicate that the advertisement text does not contain abnormal words or contains abnormal words; the server sends the detection result of the advertisement text to the terminal device so that the terminal device displays the detection result of the advertisement text, and the user can know whether the advertisement text contains abnormal words according to the detection result displayed by the terminal device, without manual detection, thereby improving the detection efficiency of the advertisement text. At the same time, in this scheme, the detection result of the advertisement text is obtained by extracting the semantic feature information of the advertisement text, and the detection accuracy is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0033] Figure 1 A system architecture diagram provided for an embodiment of the present application;
[0034] Figure 2 The process of the advertising text detection method provided in the embodiment of the present application Figure 1 ;
[0035] Figure 3 A schematic diagram of a neural network corresponding to the target neural network model provided in an embodiment of the present application;
[0036] Figure 4 The process of the advertising text detection method provided in the embodiment of the present application Figure 2 ;
[0037] Figure 5 A schematic diagram of a process for obtaining the i-th intermediate semantic feature information according to the i-th information provided in an embodiment of the present application;
[0038] Figure 6 Schematic diagram of the process of obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model provided in the embodiment of the present application Figure 1 ;
[0039] Figure 7 Schematic diagram of the process of obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model provided in the embodiment of the present application Figure 2 ;
[0040] Figure 8 A schematic diagram of the structure of the advertising text detection device provided in the embodiment of the present application
[0041] Fig. 9A schematic diagram of an electronic device provided in an embodiment of the present application.
[0042] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0044] The rapid development of the Internet has greatly facilitated people's lives. For example, users can buy items through the Internet. Items sold through the Internet are generally accompanied by advertising texts. Some advertising texts contain abnormal words, where abnormal words refer to words that violate laws and regulations related to advertising. For example, misleading words such as "formaldehyde-free" and "zero profit" are all abnormal words. Advertisements containing abnormal words are misleading to users when purchasing items. Therefore, it is of great significance to detect advertising texts to determine whether the advertising texts contain abnormal words. The current method for detecting advertising texts is to manually detect advertisements. However, the efficiency of manual detection of advertising texts is not high.
[0045] In order to improve the detection efficiency of advertisement texts, the inventors have discovered an advertisement text detection method that can be implemented by a machine, thereby improving the detection efficiency of advertisement texts.
[0046] Figure 1 For the system architecture diagram provided in the embodiment of this application, see Figure 1 ,The system architecture includes servers and terminal devices.
[0047] The terminal device receives the advertisement text to be detected input by the user, and sends the advertisement text to the server. After receiving the advertisement text, the server detects the advertisement text, obtains the detection result of the advertisement text, and sends the detection result of the advertisement text to the terminal device, and the terminal device displays the detection result of the advertisement text. The detection result is used to indicate whether the advertisement text does not contain abnormal words or contains abnormal words. The user can know whether the advertisement text contains abnormal words based on the detection result displayed by the terminal device, without manual detection, which improves the detection efficiency of the advertisement text.
[0048] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0049] Figure 2 The process of the advertising text detection method provided in the embodiment of the present application Figure 1 , see Figure 2 , the method of this embodiment includes:
[0050] Step S201: The terminal device sends an advertisement text to a server.
[0051] Step S202: The server detects the advertisement text to obtain a detection result of the advertisement text, where the detection result is used to indicate whether the advertisement text contains no abnormal words or contains abnormal words.
[0052] In one method, the server detects the advertisement text to obtain the detection result of the advertisement text, including: using the target neural network model to detect the advertisement text to obtain the detection result of the advertisement text. Wherein, using the target neural network model to detect the advertisement text to obtain the detection result of the advertisement text may include: based on the advertisement text, using the target neural network model, obtaining the semantic label of the advertisement text, the semantic label of the advertisement text indicates the probability that the advertisement text contains abnormal words and / or the probability that the advertisement text does not contain abnormal words; obtaining the detection result of the advertisement text according to the semantic label. Wherein, the semantic label can be a numerical value or a vector including two components. When the semantic label is a numerical value, the semantic label can indicate the probability that the advertisement text contains abnormal words or the probability that the advertisement text does not contain abnormal words. When the semantic label is a vector including two components, the first component can indicate the probability that the advertisement text contains abnormal words, and the second component can indicate the probability that the advertisement text does not contain abnormal words.
[0053] Among them, the target neural network model includes M first sub-neural network models and N second sub-neural network models in sequence, and M and N are both positive integers.
[0054] The neural network corresponding to the first sub-neural network model can be but is not limited to any of the following: bidirectional recurrent neural networks (BRNN), bidirectional long short term memory neural networks (BLSTM), recurrent neural networks (RNN), and long short term memory neural networks (LSTM).
[0055] The neural network corresponding to the second sub-neural network model may be, but is not limited to, a convolutional neural network (CNN). It is understandable that the convolutional neural network in the embodiment of the present application may not include a convolutional layer, such as a pooling layer and a fully connected layer.
[0056] For example, see Figure 3 The neural network corresponding to the target neural network model includes 3 BLSTMs and a CNN, which includes a pooling layer and a fully connected layer.
[0057] In another embodiment, the server detects the advertisement text to obtain the detection result of the advertisement text, including: determining whether the advertisement text includes words in a preset abnormal word set; if so, obtaining the detection result that the advertisement text contains abnormal words, if not, obtaining the detection result that the advertisement text does not contain abnormal words.
[0058] Step S203: The server sends the detection result to the terminal device.
[0059] After obtaining the detection result of the advertisement file, the server sends the detection result to the terminal device.
[0060] Step S204: The terminal device displays the detection result.
[0061] In this embodiment, the terminal device receives the advertisement text to be detected input by the user, and sends the advertisement text to the server. After receiving the advertisement text, the server detects the advertisement text and obtains the detection result of the advertisement text, and the detection result is used to indicate whether the advertisement text does not contain abnormal words or contains abnormal words. The server sends the detection result of the advertisement text to the terminal device, and the terminal device displays the detection result of the advertisement text. Therefore, the user can know whether the advertisement text contains abnormal words according to the detection result displayed by the terminal device, without manual detection, thereby improving the detection efficiency of the advertisement text.
[0062] The following specific embodiments are used to Figure 2 An implementation scheme of “detecting the advertisement text to obtain the detection result of the advertisement text” in the illustrated embodiment is described in detail. Figure 4 The process of the advertising text detection method provided in the embodiment of the present application Figure 2 , the execution subject of this embodiment is the server. Figure 4 , the method of this embodiment includes:
[0063] Step S401: The server obtains original semantic information of the advertisement text based on the advertisement text.
[0064] The server obtains the original semantic information of the advertisement text based on the advertisement text, including but not limited to the following schemes:
[0065] In the first solution, the server obtains the original semantic information of the advertisement text based on the advertisement text, including the following a1 to a2:
[0066] a1. Segment the advertisement text into words and obtain K words.
[0067] Segmenting the advertisement text includes: deleting punctuation marks and special characters in the advertisement text to obtain preprocessed advertisement text; segmenting the preprocessed advertisement text according to a segmentation tool and a preset word set, so that the first word included in the advertisement text is not segmented, the first word is a word in the preset word set and the first word can be further divided into at least two words. The segmentation tool can be a Jieba segmentation tool (jieba.load_userdict), and the words included in the preset word set can be, for example, "immediate price increase", "0 profit", "promote cell metabolism", etc.
[0068] In the process of advertising text segmentation, the preset word set is taken into consideration, which can avoid some obviously abnormal words being divided into multiple words, and the probability of the multiple words being detected as abnormal words is reduced, thereby improving the accuracy of detecting advertising text. For example, after "0 profit" is segmented, it may get two words "0" and "profit", and the probability of these two words being detected as abnormal words is lower than the probability of "0 profit" being detected as an abnormal word.
[0069] a2. Obtain a word sequence matrix based on the K words. The original semantic information of the advertisement text includes the word sequence matrix.
[0070] In one method, a word sequence matrix is obtained based on K words, including: obtaining word vectors of each of the K words based on a preset word vector set, the word vectors of each of the K words form a word sequence matrix, and each word vector is a row of the word sequence matrix. It can be understood that the order of the word vectors of the words in the word sequence matrix is the same as the order of the words in the advertisement text, that is, the kth word in the advertisement text is located in the kth row of the word sequence matrix, where k = 1, 2..., K.
[0071] Wherein, according to the preset word vector set, the word vectors of the K words are obtained, including: for any word among the K words, if the word vector of the word is included in the preset word vector set, the word vector of the word in the preset word vector set is used as the word vector of the word, and if the word vector of the word is not included in the preset word vector set, the first preset word vector is used as the word vector of the word. Optionally, the first preset word vector is the word vector of the "end" character.
[0072] The preset word vector set may be a set of word vectors trained using open source corpus, and the preset word vector set may include more than 5.42 million words, and the number of components included in each word vector is 300. Among them, the open source corpus refers to the corpus collected from multiple application scenarios.
[0073] In this method, the size of the word sequence matrix is a "K×L" matrix, where L is the number of components included in each word vector, for example, L=300.
[0074] In another way, based on K words, a word sequence matrix is obtained, including:
[0075] (1) When K is greater than or equal to S, select S words from the K words, obtain the word vectors of the S words according to the preset word vector set, and the word vectors of the S words form a word sequence matrix, and each word vector is a row of the training word sequence matrix. Among them, S words can be randomly selected from the K words, the first S words of the K words can be selected, and the last S words of the K words can be selected.
[0076] The method of “obtaining the word vectors of S words according to a preset word vector set” refers to the method of “obtaining the word vectors of K words according to a preset word vector set”.
[0077] (2) When K is less than S, obtain the word vectors of the K words according to the preset word vector set; the word vectors of the K words and KS second preset word vectors form a word sequence matrix, and each word vector is a row of the training word sequence matrix. Optionally, the second preset word vector can be the word vector of the "nan" character.
[0078] In this method, the size of the word sequence matrix is an "S×L" matrix, where L is the number of components included in each word vector, for example, L=300.
[0079] In the second solution, the server obtains the original semantic information of the advertisement text based on the advertisement text, including: segmenting the advertisement text to obtain K words; the K words are the original semantic information of the advertisement text. The method of segmenting the advertisement text to obtain K words is described in a1 above.
[0080] Step S402: The server obtains semantic feature information of the advertisement text based on the original semantic information.
[0081] The server obtains semantic feature information of the advertisement text based on the original semantic information, including but not limited to the following schemes:
[0082] In the first solution, semantic feature information of the advertisement text is obtained based on the original semantic information, including the following b1 to b4:
[0083] b1. Execute the first operation, which includes: based on the i-th information, extract the i-th initial semantic feature information of the advertisement text, and fuse the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information; initially, i=1, and the first information is the original semantic information obtained in step S301.
[0084] b2. Execute the second operation, which includes: adding 1 to i and taking the i-th intermediate semantic feature information as the i+1-th information.
[0085] b3. Repeat the first operation and the second operation until the Mth intermediate semantic feature information is obtained; M is an integer greater than or equal to 1.
[0086] For b1-b3: In a specific implementation, the first operation may be based on Figure 2 In the illustrated embodiment, the target neural network model includes the i-th first-class sub-neural network model, that is, the first operation includes: based on the i-th information, using the i-th first-class sub-neural network model to extract the i-th initial semantic feature information of the advertising text, fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information. Among them, when the maximum value of i is M, the target neural network model includes M first-class sub-neural network models, each first-class sub-neural network model corresponds to a first-class neural network, and the first-class neural network can be but is not limited to any one of the following: BRNN, RNN, BLSTM, LSTM. At this time, the process diagram of the corresponding first operation can be as shown below. Figure 5 shown.
[0087] It is understood that in the first operation is based on Figure 2 When the i-th first-type sub-neural network model included in the target neural network model in the shown embodiment is implemented, the i-th information, the i-th initial semantic feature information, the i-th intermediate semantic feature information, and the semantic feature information of the advertising text are all in matrix form.
[0088] When i=1, the first information is the original semantic information obtained in step S301 (i.e., the word sequence matrix obtained in step S301), the original semantic information is the input of the first first-category sub-neural network model included in the target neural network model, the first intermediate semantic feature information is the output of the first first-category sub-neural network model, and the first initial semantic feature information is the intermediate information obtained after the original semantic information is input to the first first-category sub-neural network model. When i=2, the first intermediate semantic feature information is the second information in the first operation, the first intermediate semantic feature information is the input of the second first-category sub-neural network model included in the target neural network model, the second intermediate semantic feature information is the output of the second first-category sub-neural network model, and the second initial semantic feature information is the intermediate information obtained after the second information is input to the first first-category sub-neural network model. And so on, until i=M, the Mth intermediate semantic feature information is obtained. That is, when M≥2, the output of the i-th first-category sub-neural network model is the input of the i+1-th first-category sub-neural network model. Among them, 1≤M≤10, for example, M can be 1 or 2 or 3 or 4 or 5 or 6.
[0089] It can be understood that when M=1, steps b2 and b3 are not included. At this time, "obtaining semantic feature information of the advertising text based on the original semantic information" can also be expressed as: "Based on the original semantic information, extracting the initial semantic feature information of the advertising text, fusing the original semantic information and the initial semantic feature information to obtain the intermediate semantic feature information."
[0090] The following is an explanation of fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information:
[0091] In one possible implementation, the i-th information includes a first matrix, the i-th initial semantic feature information includes at least one second matrix, and the i-th information and the i-th initial semantic feature information are fused to obtain the i-th intermediate semantic feature information, including: adding the first matrix and at least one second matrix to obtain a third matrix; activating the third matrix to obtain the i-th intermediate matrix, and the i-th intermediate semantic feature information includes the i-th intermediate matrix.
[0092] Here, matrix addition means adding the elements at the same position of the matrix.
[0093] In this solution, the size of the i-th intermediate matrix is the same as the size of the first matrix and the second matrix, the calculation complexity is small, and the memory resources and computing resources of the server are saved.
[0094] In another possible implementation, the i-th information includes a first matrix, the i-th initial semantic feature information includes at least one second matrix, and the i-th information and the i-th initial semantic feature information are fused to obtain the i-th intermediate semantic feature information, including: splicing the first matrix and at least one second matrix to obtain a third matrix; activating the third matrix to obtain the i-th intermediate matrix, and the i-th intermediate semantic feature information includes the i-th intermediate matrix.
[0095] The concatenation of matrix A and matrix B means: concatenating the j-th column of matrix B with the j-th column of matrix A, where j=1,...,J. J is the number of columns of matrix A or matrix B.
[0096] This scheme is highly efficient in fusing the i-th information and the i-th initial semantic feature information.
[0097] b4. Based on the Mth intermediate semantic feature information, the semantic feature information of the advertisement text is obtained.
[0098] Optionally, the Mth intermediate semantic feature information is used as the semantic feature information of the advertisement text. This optional method is highly efficient in obtaining the semantic feature information of the advertisement text.
[0099] Optionally, semantic feature information of the advertisement text is obtained according to the M intermediate semantic feature information and the respective weights of the M intermediate semantic feature information. The semantic feature information of the advertisement text obtained by this optional method is relatively comprehensive, and thus the accuracy of the detection result of the advertisement file is high.
[0100] The first solution for the server to obtain the semantic feature information of the advertisement text based on the original semantic information corresponds to the first solution for obtaining the original semantic information in step S401.
[0101] In the second scheme, based on the original semantic information, the semantic feature information of the advertising text is obtained, including: according to the K words after the advertising text is segmented, determining whether there are words belonging to the preset abnormal word set among the K words; if so, the semantic feature information of the advertising text is the words belonging to the preset abnormal word set that exist in the advertising text; if so, the semantic feature information of the advertising text is the words that do not belong to the preset abnormal word set in the advertising text.
[0102] The second solution for the server to obtain the semantic feature information of the advertisement text based on the original semantic information corresponds to the second solution for obtaining the original semantic information in step S401.
[0103] Step S403: The server determines a detection result of the advertisement text based on the semantic feature information of the advertisement text.
[0104] The server obtains the detection result of the advertisement text based on the semantic feature information of the advertisement text, including but not limited to the following schemes:
[0105] In the first solution, the server obtains the detection results of the advertisement text according to the semantic feature information of the advertisement text, including the following c1 and c2:
[0106] c1. The server obtains a semantic tag of the advertisement text according to the semantic feature information of the advertisement text. The semantic tag is used to indicate the probability that the advertisement text contains abnormal words and / or does not contain abnormal words.
[0107] In a specific implementation, the server obtains the semantic tag of the advertisement text according to the semantic feature information of the advertisement text, and can Figure 2 In the target neural network model in the illustrated embodiment, N second-type sub-neural network models are implemented, each second-type sub-neural network model corresponds to a second-type sub-neural network, and the second-type sub-neural network may be, but is not limited to, CNN. When the neural network corresponding to the second-type sub-neural network model is CNN, CNN may include a convolutional layer, a pooling layer, and a fully connected layer, or CNN may include a pooling layer and a fully connected layer.
[0108] Optionally, obtaining the semantic label of the advertising text according to the semantic feature information of the advertising text includes: processing the semantic feature information of the advertising text, and obtaining the semantic label of the advertising text according to the processing result of the semantic feature information of the advertising text. The processing of the semantic feature information of the advertising text includes pooling processing. Wherein, when the neural network corresponding to the second type of sub-neural network model includes a pooling layer and a fully connected layer, processing the semantic feature information of the advertising text includes pooling processing of the semantic feature information of the advertising text, and the result after the pooling processing is input into the fully connected layer to output the semantic label of the advertising text. When the neural network corresponding to the second type of sub-neural network model includes a convolutional layer, a pooling layer and a fully connected layer, the semantic feature information of the advertising text is convolutionally processed and then pooled, and the result after the pooling processing is input into the fully connected layer to output the semantic label of the advertising text.
[0109] The pooling process may be a maximum pooling process or an average pooling process. As described above, the semantic feature information of the advertisement text may be in the form of a matrix; wherein, when performing pooling on the matrix, the average pooling process refers to obtaining the average value of each column of the matrix, and the maximum pooling process refers to extracting the maximum value of each column of the matrix. Therefore, when the pooling process is an average pooling process, the loss of semantic information of the advertisement text can be suppressed, thereby improving the accuracy of the detection result of the advertisement text.
[0110] For semantic labels, in one method, the semantic label can be a value between 0 and 1, which is used to indicate the probability that the advertising text contains abnormal words or does not contain abnormal words. For example, the semantic label is used to indicate the probability that the advertising text contains abnormal words. The semantic label of the advertising text obtained by the server based on the semantic feature information of the advertising text is 0.3, and the probability that the advertising text contains abnormal words is 0.3. In another method, the semantic label can be a vector containing two components, the first component is used to indicate the probability that the advertising text contains abnormal words, and the second component is used to indicate the probability that the advertising text does not contain abnormal words. Exemplarily, the semantic label of the advertising text obtained by the server based on the semantic feature information of the advertising text is (0.2, 0.8), then the probability that the advertising text contains abnormal words is 0.2, and the probability that it does not contain abnormal words is 0.8.
[0111] c2. Determine the detection result of the advertising text according to the semantic label of the advertising text.
[0112] If the probability that the advertisement text indicated by the semantic tag contains abnormal words is greater than a first preset value or the probability that the advertisement text indicated by the semantic tag does not contain abnormal words is less than a first preset value, the detection result of the advertisement text is determined to be that the advertisement text contains abnormal words. The first preset value may be 0.5.
[0113] If the probability that the advertisement text indicated by the semantic tag contains abnormal words is less than a first preset value or the probability that the advertisement text indicated by the semantic tag does not contain abnormal words is greater than the first preset value, the detection result of the advertisement text is determined to be that the advertisement text does not contain abnormal words.
[0114] Exemplarily, the semantic tag is used to indicate the probability that the advertisement text contains abnormal words. The semantic tag of the advertisement text obtained by the server based on the semantic feature information of the advertisement text is 0.3, then the probability that the advertisement text contains abnormal words is 0.3, and the first preset value is 0.5. If 0.3 is less than 0.5, then the detection result of the advertisement text is determined to be that the advertisement text does not contain abnormal words.
[0115] It can be understood that the first solution of the server acquiring the detection result of the advertisement text based on the semantic feature information of the advertisement text corresponds to the first solution of acquiring the semantic feature information of the advertisement text in step S402.
[0116] In the second scheme, the server obtains the detection result of the advertising text according to the semantic feature information of the advertising text, including: if the semantic feature information of the advertising text is that the advertising text contains words belonging to a preset abnormal word set, then the detection result is determined to be that the advertising text contains abnormal words; if the semantic feature information of the advertising text is that the advertising text does not contain words belonging to the preset abnormal word set, then the detection result is determined to be that the advertising text does not contain abnormal words.
[0117] It can be understood that the second solution of the server acquiring the detection result of the advertisement text based on the semantic feature information of the advertisement text corresponds to the second solution of acquiring the semantic feature information of the advertisement text in step S402.
[0118] This embodiment provides a specific implementation of a server detecting an advertisement text to obtain a detection result of the advertisement text. This embodiment is efficient and accurate in obtaining the detection result of the advertisement text.
[0119] The following uses several specific examples to illustrate the process of the server obtaining the semantic label of the advertisement text based on the original semantic information of the advertisement text and the target neural network model in the above embodiments.
[0120] Example 1: M=1, N=1, the size of the original semantic information of the advertisement text - word sequence matrix E is S×300, the matrix E is input into the BLSTM sub-neural network model in the target neural network model, and the initial semantic information - matrix C is obtained by the BLSTM algorithm f and C b , C f is obtained by the forward LSTM algorithm, C b It is obtained by the backward LSTM algorithm, E and C f and C b After adding them together, we get the matrix V. After activating the matrix V, we get the output matrix Y of the BLSTM sub-neural network model, where Y is the semantic feature information of the advertising text.
[0121] The matrix V can be obtained according to the following formula:
[0122] V(w x )=C f (w x )+E(w x )+C b (w x ) Formula 1;
[0123] Among them, w x represents the xth word in S words, C f (w x ) represents the vector obtained by the forward LSTM algorithm after the original word vector of the xth word in S words, C b (w x ) represents the vector obtained by the backward LSTM algorithm after the word vector of the xth word in S words. E(w x ) is the original word vector of the x-th word in the S words, that is, the word vector of the x-th word in the word sequence matrix E of the advertisement text.
[0124] The activation matrix V can be calculated according to the following formula:
[0125] Y = tanh(W 1 V+b 1 ) Formula 2;
[0126] Among them, tanh is the activation function, W 1 is the weight matrix, b 1 is the bias vector.
[0127] The matrix Y is used as the input of the CNN sub-neural network model. After average pooling in the pooling layer, vector X is obtained. X is input into the fully connected layer, and the output of the fully connected layer is the semantic label of the advertisement text. Among them, average pooling is to calculate the average value of each column of matrix Y, and the average value of each column of Y constitutes vector X.
[0128] The calculation formula of the fully connected layer is as follows:
[0129]
[0130] in, is a semantic label, the output function f uses the sigmoid function, W 2 is the weight matrix of the fully connected layer, b 2 is the bias vector of the fully connected layer.
[0131] The schematic diagram of the process of the server corresponding to this example obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model can be shown as follows: Figure 6 shown.
[0132] This embodiment provides a specific implementation of the server obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model when M=1 and N=1.
[0133] Example 2: M = 3, N = 1, the size of the original semantic information of the advertisement text - word sequence matrix E is S × 300, the matrix E is input into the first BLSTM sub-neural network model in the target neural network model, and the first initial semantic information is obtained by the BLSTM algorithm. The first initial semantic information matrix includes C f1 and C b1 , C f1 is obtained by the forward LSTM algorithm, C b1 It is obtained by the backward LSTM algorithm, E and C f1 and C b1 Add them together to get the matrix V 1 , activation matrix V 1 Then we get the output matrix Y of the BLSTM sub-neural network model 1 , Y 1 It is the first intermediate semantic feature information and also the second information.
[0134] Y1 As the second information, the matrix Y 1 Input the second BLSTM sub-neural network model in the target neural network model, and obtain the second initial semantic information through the BLSTM algorithm. The second initial semantic information matrix includes C f2 and C b2 , C f2 is obtained by the forward LSTM algorithm, C b2 It is obtained by the backward LSTM algorithm. 1 , C f2 and C b2 Add them together to get the matrix V 2 , activation matrix V 2 Then we get the output matrix Y of the BLSTM sub-neural network model 2 , Y 2 It is the second intermediate semantic feature information.
[0135] Y 2 As the third information, the matrix Y 2 Input the third BLSTM sub-neural network model in the target neural network model, and obtain the third initial semantic information through the BLSTM algorithm. The third initial semantic information matrix includes C f3 and C b3 , C f3 is obtained by the forward LSTM algorithm, C b3 It is obtained by the backward LSTM algorithm. 2 , C f3 and C b3 Add them together to get the matrix V 3 , activation matrix V 3 Then we get the output matrix Y of the BLSTM sub-neural network model 3 , Y 3 It is the third intermediate semantic feature information.
[0136] Take Y = a 1 ×Y 1 +a 2 ×Y 2 +a 3 ×Y 3 , a 1 、a 2 、a 3 are the weights of the first intermediate semantic feature information, the second intermediate semantic feature information, and the third intermediate semantic feature information respectively.
[0137] The matrix Y is used as the input of the CNN sub-neural network model. After average pooling in the pooling layer, vector X is obtained. X is input into the fully connected layer, and the output of the fully connected layer is the semantic label of the advertisement text. Among them, average pooling is to calculate the average value of each column of matrix Y, and the average value of each column of Y constitutes vector X.
[0138] The schematic diagram of the process of the server corresponding to this example obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model can be shown as follows: Figure 7 shown.
[0139] This embodiment provides a specific implementation of the server obtaining the semantic label of the advertisement text based on the original semantic information and the target neural network model when M=3 and N=1.
[0140] It can be understood that the target neural network model in the above embodiments is trained based on a large number of training samples, and the training samples include the original semantic information and semantic labels of the training advertisement text. During the training process, the original semantic information of the training advertisement text is used as the input of the intermediate neural network model in the training process, and the semantic labels of the training advertisement text are used as the expected output. The neural network algorithm corresponding to the target neural network model is used to finally obtain the target neural network model. Among them, the method for obtaining the training word sequence matrix included in the original semantic information of the training advertisement text can be as follows:
[0141] d1. Segment the training advertisement text to obtain R words. The segmentation method is the same as the segmentation method described in a1 above.
[0142] d2. According to the R words, a training word sequence matrix is obtained. The original semantic information of the training advertisement text includes the training word sequence matrix.
[0143] In one method, according to R words, a word sequence matrix is obtained, including: according to a preset word vector set, obtaining the word vectors of each of the R words, the word vectors of each of the R words form a training word sequence matrix, and each word vector is a row of the word sequence matrix. It can be understood that the order of the word vectors of the words in the training word sequence matrix is the same as the order of the words in the training advertisement text, that is, the rth word in the training advertisement text is located in the rth row of the training word sequence matrix, where r = 1, 2..., R. The preset word vector set here is the same as the preset word vector set described in a1.
[0144] Among them, according to the preset word vector set, the word vectors of each of the R words are obtained, including: for any word among the R words, if the preset word vector set includes the word vector of the word, then the word vector of the word in the preset word vector set is used as the word vector of the word; if the preset word vector set does not include the word vector of the word, then an initial vector is randomly initialized as the word vector of the word, and the number of components included in the initial vector is the same as the number of word vectors included in the preset word vector set.
[0145] In another way, according to R words, a training word sequence matrix is obtained, including:
[0146] (1) When R is greater than or equal to S, select S words from the R words, and obtain the word vectors of the S words according to the preset word vector set. The word vectors of the S words form a training word sequence matrix, and each word vector is a row of the training word sequence matrix. Among them, S words can be randomly selected from the R words, the first S words of the R words can be selected, and the last S words of the R words can be selected. Among them, the method of "obtaining the word vectors of the S words according to the preset word vector set" refers to the method of "obtaining the word vectors of the R words according to the preset word vector set".
[0147] (2) When R is less than S, obtain the word vectors of the R words according to the preset word vector set; the word vectors of the R words and RS second preset word vectors form a training word sequence matrix, and each word vector is a row of the training word sequence matrix. Optionally, the second preset word vector may be the word vector of the "nan" character.
[0148] This embodiment provides a method for acquiring a target neural network model.
[0149] The above is a description of the advertisement text detection method of the present application. The following is a description of the advertisement text detection device involved in the present application.
[0150] Figure 8 For a structural diagram of the advertising text detection device provided in the embodiment of the present application, see Figure 8 , the device of this embodiment includes: a transceiver module 801 and a processing module 802.
[0151] The transceiver module 801 is used to receive an advertisement text from a terminal device; the processing module 802 is also used to obtain original semantic information of the advertisement text based on the advertisement text; the processing module 802 is also used to obtain semantic feature information of the advertisement text based on the original semantic information; the processing module 802 is also used to determine the detection result based on the semantic feature information, and the detection result is used to indicate that the advertisement text does not contain abnormal words or contains abnormal words; the transceiver module 801 is also used to send the detection result to the terminal device.
[0152] In a possible implementation, the processing module 801 is specifically used to: perform a first operation, the first operation comprising: based on the i-th information, extracting the i-th initial semantic feature information of the advertising text, fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information; initially, i=1, and the first information is the original semantic information; perform a second operation, the second operation comprising: adding 1 to i, and taking the i-th intermediate semantic feature information as the i+1-th information; repeating the first operation and the second operation until the M-th intermediate semantic feature information is obtained; M is an integer greater than or equal to 1; based on the M-th intermediate semantic feature information, obtain the semantic feature information of the advertising text.
[0153] In a possible implementation, the i-th information includes a first matrix, the i-th initial semantic feature information includes at least one second matrix, and the processing module 801 is specifically used to: add or concatenate the first matrix and the at least one second matrix to obtain a third matrix; activate the third matrix to obtain an i-th intermediate matrix, and the i-th intermediate semantic feature information includes the i-th intermediate matrix.
[0154] In a possible implementation manner, the processing module 801 is specifically configured to: use the Mth intermediate semantic feature information as the semantic feature information of the advertisement text.
[0155] In a possible implementation manner, the processing module 801 is specifically configured to obtain the semantic feature information of the advertisement text according to the M pieces of intermediate semantic feature information and respective weights of the M pieces of intermediate semantic feature information.
[0156] In a possible implementation, the processing module 801 is specifically used to: obtain a semantic label of the advertising text based on the semantic feature information, wherein the semantic label is used to indicate the probability that the advertising text contains abnormal words and / or does not contain abnormal words; and determine a detection result of the advertising text based on the semantic label.
[0157] In a possible implementation, the processing module 801 is specifically used to: process the semantic feature information; the processing includes pooling processing; and obtain the semantic tag of the advertisement text according to the processing result of the semantic feature information.
[0158] In a possible implementation, the pooling process is an average pooling process.
[0159] In a possible implementation, the detection result is obtained based on a neural network model, the neural network model includes M first sub-neural network models and N second sub-neural network models, M and N are both positive integers, and the processing module 801 is specifically used to: based on the original semantic information of the advertising text, use the first type of sub-neural network model to obtain the semantic feature information of the advertising text; based on the semantic feature information of the advertising text, use the second type of sub-neural network model to determine the detection result.
[0160] In a possible implementation, the neural network corresponding to the first type of sub-neural network model is a bidirectional recurrent neural network RNN or a bidirectional long short-term memory recurrent neural network BLSTM; the neural network corresponding to the second type of sub-neural network model is a convolutional neural network CNN.
[0161] The device of this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0162] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 900 can be used to implement the method described in the above method embodiment, and please refer to the description in the above method embodiment for details. Among them, the electronic device 900 can be a server or a terminal device.
[0163] The electronic device 900 may include one or more processors 901, which may also be referred to as a processing unit, and control the execution of the method in the above method embodiment. The processor 901 may be a general-purpose processor or a dedicated processor, etc. For example, it may be a baseband processor or a central processing unit. The baseband processor may be used to process the communication protocol and communication data, and the central processing unit may be used to control the communication device, execute the software program, and process the data of the software program.
[0164] Optionally, the processor 901 may also store instructions 903 or data (such as intermediate data). The instructions 903 may be executed by the processor, so that the electronic device 900 executes the method described in the above method embodiment.
[0165] Optionally, the electronic device 900 may include one or more memories 902, on which instructions 904 may be stored. The instructions may be executed on the processor, so that the electronic device 900 executes the method described in the above method embodiment.
[0166] Optionally, data may also be stored in the memory. The processor 901 and the memory 902 may be provided separately or integrated together.
[0167] Optionally, the electronic device 900 may further include a transceiver 905 and / or an antenna 906. The transceiver 905 may be referred to as a transceiver unit, a transceiver, a transceiver circuit, or a transceiver, etc., and is used to implement the transceiver function of the communication device.
[0168] The processor 901 and the transceiver 905 described in the present application can be implemented in an integrated circuit (IC), an analog IC, a radio frequency integrated circuit (RFIC), a mixed signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc. The processor and the transceiver can also be manufactured using various IC process technologies, such as complementary metal oxide semiconductor (CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (positive channel metal oxide semiconductor, PMOS), bipolar junction transistor (BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
[0169] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0170] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0171] An embodiment of the present application further provides a computer storage medium, including: computer executable instructions. When the program or instructions are executed on a computer, the method corresponding to the server or terminal device in any of the above method embodiments is executed.
[0172] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0173] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for detecting advertisement text, characterized in that: include: Receiving advertising text from a terminal device; Based on the advertisement text, obtaining original semantic information of the advertisement text; Executing a first operation, the first operation comprising: extracting i-th initial semantic feature information of the advertisement text based on i-th information, fusing the i-th information and the i-th initial semantic feature information to obtain i-th intermediate semantic feature information; initially, i=1, and the first information is the original semantic information; Performing a second operation, the second operation comprising: adding 1 to i, and using the i-th intermediate semantic feature information as i+1-th information; Repeat the first operation and the second operation until the Mth intermediate semantic feature information is obtained; M is a positive integer; Based on the Mth intermediate semantic feature information, obtaining semantic feature information of the advertisement text; Determining a detection result according to the semantic feature information, wherein the detection result is used to indicate that the advertisement text does not contain abnormal words or contains abnormal words; Send the detection result to the terminal device.
2. The method according to claim 1, characterized in that The said i The information includes a first matrix, the first i The initial semantic feature information includes at least one second matrix, and the fusion of the first matrix i Information and i Initial semantic feature information to obtain the first i Intermediate semantic feature information, including: Adding or concatenating the first matrix and the at least one second matrix to obtain a third matrix; Activate the third matrix and get i The intermediate matrix, i The intermediate semantic feature information includes the i Intermediate matrix.
3. The method according to claim 2, characterized in that The obtaining the semantic feature information of the advertisement text based on the Mth intermediate semantic feature information includes: The semantic feature information of the advertisement text is obtained according to the M intermediate semantic feature information and the respective weights of the M intermediate semantic feature information.
4. The method according to any one of claims 1 to 3, characterized in that Determining the detection result of the advertisement text according to the semantic feature information includes: Acquire a semantic tag of the advertisement text according to the semantic feature information, wherein the semantic tag is used to indicate the probability that the advertisement text contains an abnormal word and / or does not contain an abnormal word; A detection result of the advertisement text is determined according to the semantic tag.
5. The method according to claim 4, characterized in that Acquiring a semantic tag of the advertisement text according to the semantic feature information includes: Processing the semantic feature information; the processing includes pooling processing; The semantic tag of the advertisement text is obtained according to the processing result of the semantic feature information.
6. The method according to any one of claims 1 to 3, characterized in that: The detection result is obtained based on a neural network model, the neural network model includes M first-type sub-neural network models and N second-type sub-neural network models, M and N are both positive integers, the semantic feature information of the advertisement text is obtained based on the original semantic information, and the detection result is determined according to the semantic feature information, including: Based on the original semantic information of the advertisement text, the first type of sub-neural network model is used to obtain semantic feature information of the advertisement text; Based on the semantic feature information of the advertisement text, a second type of sub-neural network model is used to determine the detection result.
7. The method according to claim 6, characterized in that The neural network corresponding to the first type of sub-neural network model is a bidirectional recurrent neural network RNN or a bidirectional long short-term memory recurrent neural network BLSTM; The neural network corresponding to the second type of sub-neural network model is a convolutional neural network CNN.
8. An advertising text detection device, characterized in that: include: A transceiver module, used for receiving advertisement text from a terminal device; A processing module, configured to obtain original semantic information of the advertisement text based on the advertisement text; The processing module is further used to obtain semantic feature information of the advertisement text based on the original semantic information; The processing module is further used to determine a detection result based on the semantic feature information, wherein the detection result is used to indicate that the advertisement text does not contain abnormal words or contains abnormal words; The transceiver module is further used to send the detection result to the terminal device; The processing module is specifically used to perform a first operation, which includes: extracting the i-th initial semantic feature information of the advertisement text based on the i-th information, fusing the i-th information and the i-th initial semantic feature information to obtain the i-th intermediate semantic feature information; initially, i = 1, and the first information is the original semantic information; Performing a second operation, the second operation comprising: adding 1 to i, and using the i-th intermediate semantic feature information as i+1-th information; Repeat the first operation and the second operation until the Mth intermediate semantic feature information is obtained; M is a positive integer; Based on the Mth intermediate semantic feature information, the semantic feature information of the advertisement text is obtained.
9. An electronic device, comprising: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is configured to: execute the executable instructions to implement the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Entity tag identification method and related equipment
CN110069781A