Text recognition method, computer readable storage medium and computer device

By extracting key words in the text and encoding and connecting them in multiple classification dimensions, a target matrix is ​​generated, which solves the problem of low text recognition accuracy in the existing technology and achieves more accurate and precise text recognition.

CN110765757BActive Publication Date: 2024-08-27TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN201910982889.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-16
Publication Date
2024-08-27
Estimated Expiration
2039-10-16

AI Technical Summary

Technical Problem

Existing text recognition methods calculate the frequency of word occurrences, resulting in low text category discrimination capabilities and low recognition accuracy.

Method used

Extract at least two words in the text to be recognized, obtain their codes in the semantic dimension and multiple text classification dimensions, generate a target matrix through connection processing, and calculate the classification probability to determine the text recognition result.

Benefits of technology

It improves the accuracy and category distinguishing ability of text recognition, achieves more accurate text recognition, enhances the filtering ability of text that does not meet the requirements, and improves text quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110765757B
    Figure CN110765757B
Patent Text Reader

Abstract

The present application relates to a text recognition method, a computer-readable storage medium and a computer device, the method comprising: extracting at least two words from a text to be recognized; obtaining the word encoding of each word in a semantic dimension, and the word encoding of each word in at least two text classification dimensions; connecting the word encoding of each word in the semantic dimension, and the word encoding of each word in at least two text classification dimensions to obtain a target matrix; according to the target matrix, determining the classification probability of the text to be recognized in each text classification dimension; according to the classification probability of the text to be recognized in each text classification dimension, determining the text recognition result of the text to be recognized. The scheme provided by the present application comprehensively considers the semantic information and interpretability of the word encoding of the text, and discriminates the text from multiple text recognition dimensions, so that the recognition of the text is more accurate, thereby improving the recognition accuracy of the text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a text recognition method, a computer-readable storage medium and a computer device. Background Art

[0002] With the development of Internet technology, various texts on the Internet are emerging one after another. In order to filter bad information in the text, such as prohibited, advertisements, etc., text needs to be identified.

[0003] However, the current text recognition method classifies the text to be recognized based on the frequency of occurrence of words in the text to be recognized in the entire text collection; however, the entire text collection contains multiple text types. For each word in the text to be recognized, its frequency of occurrence in the entire text collection is calculated, which will reduce the ability to distinguish text categories, thereby making the text recognition accuracy low. Summary of the invention

[0004] Based on this, it is necessary to provide a text recognition method, a computer-readable storage medium and a computer device in response to the technical problem of low accuracy of text recognition.

[0005] A text recognition method, comprising:

[0006] Extracting at least two words from the text to be recognized;

[0007] Obtain word encodings for each of the words in the semantic dimension, and word encodings for each of the words in at least two text classification dimensions;

[0008] The word encoding of each of the words in the semantic dimension and the word encoding of each of the words in the at least two text classification dimensions are connected to obtain the target matrix;

[0009] According to the target matrix, the classification probability of the text to be identified in each of the text classification dimensions is determined;

[0010] According to the classification probability of the text to be identified in each of the text classification dimensions, a text recognition result for the text to be identified is determined.

[0011] A text recognition device, comprising:

[0012] A word extraction module for extracting at least two words in the text to be identified;

[0013] A word encoding acquisition module is used to obtain word encodings of each of the words in the semantic dimension, and word encodings of each of the words in at least two text classification dimensions;

[0014] A target matrix acquisition module is used to connect the word codes of each of the words in the semantic dimension and the word codes of each of the words in at least two text classification dimensions to obtain a target matrix;

[0015] The classification probability acquisition module determines the classification probability of the text to be identified under each of the text classification dimensions according to the target matrix;

[0016] The text recognition module is used to determine the text recognition result for the text to be identified based on the classification probability of the text to be identified in each of the text classification dimensions.

[0017] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor causes the processor to perform the following steps:

[0018] Extracting at least two words from the text to be recognized;

[0019] Obtain word encodings for each of the words in the semantic dimension, and word encodings for each of the words in at least two text classification dimensions;

[0020] The word encoding of each of the words in the semantic dimension and the word encoding of each of the words in the at least two text classification dimensions are connected to obtain the target matrix;

[0021] According to the target matrix, the classification probability of the text to be identified in each of the text classification dimensions is determined;

[0022] According to the classification probability of the text to be identified in each of the text classification dimensions, a text recognition result for the text to be identified is determined.

[0023] A computer device, including a memory and a processor, the memory stores a computer program. When the computer program is executed by the processor, the processor causes the processor to perform the following steps:

[0024] Extracting at least two words from the text to be recognized;

[0025] Obtain word encodings for each of the words in the semantic dimension, and word encodings for each of the words in at least two text classification dimensions;

[0026] The word encoding of each of the words in the semantic dimension and the word encoding of each of the words in the at least two text classification dimensions are connected to obtain the target matrix;

[0027] According to the target matrix, the classification probability of the text to be identified in each of the text classification dimensions is determined;

[0028] A text recognition result for the text to be recognized is determined according to the classification probability of the text to be recognized under each of the text classification dimensions.

[0029] The above-mentioned text recognition method, device, computer-readable storage medium and computer equipment obtain a target matrix by extracting the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions, and determine the classification probability of the text to be recognized under each text classification dimension according to the target matrix, and then determine the text recognition result of the text to be recognized; the purpose of obtaining the text recognition result of the text to be recognized according to the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions is achieved; the semantic information and interpretability of the word encoding of the text to be recognized are comprehensively considered, so that the recognition of the text is more accurate, thereby improving the recognition accuracy of the text; at the same time, the word encoding of at least two words in the text to be recognized under at least two text classification dimensions is comprehensively considered, which is conducive to distinguishing the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text set, thereby improving the category distinction ability of the text to be recognized, and is conducive to realizing accurate recognition of the text, and further improving the recognition accuracy of the text. In addition, by obtaining the text recognition result of the text to be recognized, it is conducive to filtering texts that do not meet the requirements, thereby improving the text quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is an application environment diagram of the text recognition method in one embodiment;

[0031] Figure 2 is a structural block diagram of a computer device in one embodiment;

[0032] Figure 3 It is a flow diagram of the text recognition method in one embodiment;

[0033] Figure 4 A flow diagram of the steps of extracting at least two words in the text to be identified in one embodiment;

[0034] Figure 5 A flow diagram of the steps of obtaining word encoding for each word in one embodiment;

[0035] Figure 6 A flow diagram of the steps for obtaining the statistical probability of each word in at least two text classification dimensions in one embodiment;

[0036] Figure 7 A flow diagram of the steps for obtaining the conditional probability of each word appearing under each text classification dimension in one embodiment;

[0037] Figure 8 A flow diagram of the steps for obtaining the weights of each word in each text classification dimension in one embodiment;

[0038] Fig. 9 A flow diagram of the steps for obtaining the target matrix in one embodiment;

[0039] Fig.10 A flow diagram of the steps for determining the classification probability of the text to be identified in each text classification dimension in one embodiment;

[0040] Fig.11 A flow diagram of the steps for determining the classification probability of the text to be identified in each text classification dimension in another embodiment;

[0041] Fig.12 A flow diagram of the steps for training a text classification model in one embodiment;

[0042] Fig.13 A flow diagram for determining the steps for text recognition results to be recognized in one embodiment;

[0043] Fig.14 A flow diagram of the steps for determining the text tag of the text to be identified in one embodiment;

[0044] Fig.15 A flow diagram of the steps for storing the text to be identified in one embodiment;

[0045] Fig.16 It is an application environment diagram of the text recognition method in one embodiment;

[0046] Fig.17 It is a flow diagram of the text recognition method in another embodiment;

[0047] Fig.18 An interface diagram of text audit in one embodiment;

[0048] Fig.19 It is a flow diagram of the text recognition method in another embodiment;

[0049] Fig. 20 It is a flow diagram of the advertisement recognition method in one embodiment;

[0050] Fig.21 It is a structural block diagram of the text recognition device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] Figure 1 It is an application environment diagram of the text recognition method in one embodiment. Reference Figure 1 , the application environment diagram includes a server 110. The server 110 extracts at least two words in the text to be recognized, such as word 1 of the text to be recognized, word 2 of the text to be recognized, word 3 of the text to be recognized, etc.; obtains the word encoding of each word under the semantic dimension, and the word encoding of each word under at least two text classification dimensions; connects the word encoding of each word under the semantic dimension, and the word encoding of each word under at least two text classification dimensions to obtain a target matrix; according to the target matrix, determines the classification probability of the text to be recognized under each text classification dimension; according to the classification probability of the text to be recognized under each text classification dimension, determines the text recognition result of the text to be recognized. Among them, the text recognition result of the text to be recognized can be used to push to the corresponding user; for example, based on the text recognition request of the terminal, the server pushes the text recognition result of the text to be recognized to the corresponding terminal for viewing by the user corresponding to the terminal. In addition, the text recognition method can also be applied to text review systems, text recommendation systems, text transmission systems, etc., which are not specifically limited in this application.

[0053] Figure 2 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The server 110 in FIG. Figure 2 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a text recognition method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute a text recognition method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0054] Those skilled in the art will understand that Figure 2The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0055] As Figure 3 shown, in one embodiment, a text recognition method is provided. In this embodiment, the method is mainly exemplified by being applied to the server 110 in the above Figure 1 . Referring to Figure 3 , the text recognition method specifically includes the following steps:

[0056] S302, extract at least two words from the text to be recognized.

[0057] Among them, the text to be recognized refers to the text whose text type needs to be determined, which can be a complete sentence, a combination of multiple sentences, or a passage. Specifically, this application does not make a limitation. The text to be recognized is generally composed of multiple words; for example, if the text to be recognized is "During shipping, moms who need to place an order should place an order quickly", then at least two words included in the text to be recognized are: shipping, during, need, place an order, mom, quickly, place an order.

[0058] It should be noted that at least two words in the text to be recognized can be two or more words. Specifically, this application does not make a limitation.

[0059] Specifically, the server, based on big data technology, collects texts not recalled on the current network as the text to be recognized; performs word segmentation processing on the text to be recognized to obtain at least two words in the text to be recognized.

[0060] Furthermore, after obtaining the words included in the text to be recognized, in order to avoid some words being stop words, such as "of", "in", etc., the server can also perform filtering processing on the words included in the text to be recognized; for example, match the words included in the text to be recognized with the preset stop words respectively. If the word included in the text to be recognized matches the preset stop word successfully, then the word is recognized as a stop word and discarded; if the word included in the text to be recognized fails to match the preset stop word, then the word is recognized as a valid word and marked; the marked words are used as the valid words in the text to be recognized, so as to obtain at least two words in the text to be recognized. In this way, by performing stop word filtering processing on the words in the obtained text to be recognized, the interference of redundant words is avoided, so that the words extracted from the text to be recognized are more accurate, and the extraction accuracy of the words in the text to be recognized is further improved.

[0061] In one embodiment, the server can also extract the text to be recognized from the locally cached text; perform word segmentation on the text to be recognized to obtain the words contained in the text to be recognized; perform stop word filtering on the words contained in the text to be recognized to confirm which words are stop words and which words are not stop words, thereby obtaining the stop words contained in the text to be recognized, and discard the stop words contained in the text to be recognized to obtain valid words contained in the text to be recognized as at least two words in the text to be recognized finally obtained.

[0062] S304, obtain word encodings for each word in the semantic dimension, and word encodings for each word in at least two text classification dimensions.

[0063] Among them, word encoding refers to word vector, which is a real-valued vector of a specified dimension, specifically a multidimensional vector that maps words in one space to another space. In addition, word encoding of words in the semantic dimension refers to representing words as word vectors containing semantic information; for example, the word encoding of the word "shipment" in the semantic dimension is: shipment (A1, A2, A3...An); where n represents the dimension of the word encoding.

[0064] Among them, the text classification dimension refers to the classification angle used to determine the text type of the text to be identified, and there is a one-to-one correspondence with the text type; and the text fields of the text to be identified are different, and the corresponding text classification dimensions are also different; for example, in terms of advertising text, the text classification dimension can refer to normal, advertising, suspected advertising, fraudulent likes and attention, mention of competing products, etc. In addition, the word encoding of a word under at least two text classification dimensions refers to representing the word as a word vector under at least two text classification dimensions, and the dimension of the word encoding is consistent with the number of text classification dimensions. For example, the word encoding of the word "shipment" under at least two text classification dimensions is: shipment (B1, B2, B3······Bn); wherein n represents the dimension of the word encoding, and also represents the number of text classification dimensions.

[0065] It should be noted that at least two text classification dimensions may be two or more text classification dimensions, and this application is not limited in detail.

[0066] Specifically, the server performs word encoding conversion of the semantic dimension on at least two words in the text to be recognized, and obtains the word encoding of each word in the semantic dimension; identifies the text domain identifier of the text to be recognized, queries the corresponding relationship between the preset text domain identifier and the text classification dimension, and determines at least two text classification dimensions corresponding to the text domain identifier; performs word encoding conversion of at least two text classification dimensions on at least two words in the text to be recognized, and obtains the word encoding of each word in at least two text classification dimensions; facilitates the subsequent determination of the classification probability of the text to be recognized in each text classification dimension based on the word encoding of each word in the semantic dimension and the word encoding of each word in at least two text classification dimensions, thereby obtaining the text recognition result of the text to be recognized; by comprehensively considering the semantic information and interpretability of the word encoding of the text to be recognized, it is beneficial to improve the recognition accuracy of the text.

[0067] S306, the word encoding of each word in the semantic dimension and the word encoding of each word in at least two text classification dimensions are connected to obtain the target matrix.

[0068] S308, according to the target matrix, determine the classification probability of the text to be identified in each text classification dimension.

[0069] The target matrix refers to the matrix formed by connecting the word codes of each word in the semantic dimension and the word codes of each word in at least two text classification dimensions. For example, the word codes of word A and word B in the semantic dimension are (A1 A2 A3) and (B1 B2 B3) respectively; the word codes of word A and word B in the text classification dimensions a, b and c are (A1 A2 A3) and (B1 B2 B3) respectively. a A b A c )、(B a B b B c ); then the target matrix is:

[0070]

[0071] The classification probability of the text to be recognized under each text classification dimension refers to the probability that the text to be recognized belongs to the text type corresponding to each text classification dimension. It should be noted that the sum of the classification probabilities of the text to be recognized under each text classification dimension is always 1.

[0072] Specifically, the server constructs a matrix of the text to be recognized in the semantic dimension according to the word encoding of each word in the semantic dimension; constructs a matrix of the text to be recognized in at least two text classification dimensions according to the word encoding of each word in at least two text classification dimensions; connects the matrix of the text to be recognized in the semantic dimension and the matrix of the text to be recognized in at least two text classification dimensions to obtain a target matrix; analyzes and processes the target matrix to obtain the classification probability of the text to be recognized in each text classification dimension; facilitates the subsequent determination of the text recognition result of the text to be recognized based on the classification probability of the text to be recognized in each text classification dimension; thereby achieving the purpose of distinguishing the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire training text, thereby improving the category distinction ability of the text to be recognized, facilitating the accurate recognition of the text, and further improving the recognition accuracy of the text.

[0073] S310 determines the text recognition result for the text to be identified based on the classification probability of the text to be identified in each text classification dimension.

[0074] Among them, the text recognition result for the text to be recognized refers to the review result for the text to be recognized, and specifically refers to the text type of the text to be recognized.

[0075] Specifically, the server determines the target probability of the text to be recognized according to the classification probability of the text to be recognized under each text classification dimension; and determines the text recognition result of the text to be recognized according to the target probability of the text to be recognized. In this way, by obtaining the text recognition result of the text to be recognized, it is helpful to filter out the text that does not meet the requirements, thereby improving the text quality.

[0076] For example, the server selects the maximum classification probability from the classification probabilities of the text to be recognized under various text classification dimensions as the target probability of the text to be recognized; and uses the text classification dimension corresponding to the target probability as the text type of the text to be recognized.

[0077] In one embodiment, after determining the text recognition result of the text to be recognized, the server can also receive a text recognition request from the terminal, the text recognition request carrying a text identifier; parse the text recognition request to obtain the text identifier; determine the text recognition result of the text to be recognized corresponding to the text identifier from the pre-stored text recognition results of multiple texts to be recognized, and push the text recognition result to the corresponding terminal; in this way, it is beneficial for the user corresponding to the terminal to view the text recognition result to determine whether the text meets the requirements and then perform other further operations; it avoids the defect of manual review of the text, which leads to a cumbersome process, and is beneficial to saving a lot of manpower review costs, thereby improving text recognition efficiency.

[0078] The above-mentioned text recognition method obtains a target matrix by extracting the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions, and determines the classification probability of the text to be recognized under each text classification dimension according to the target matrix, and then determines the text recognition result of the text to be recognized; the purpose of obtaining the text recognition result of the text to be recognized according to the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions is achieved; the semantic information and interpretability of the word encoding of the text to be recognized are comprehensively considered, so that the recognition of the text is more accurate, thereby improving the recognition accuracy of the text; at the same time, the word encoding of at least two words in the text to be recognized under at least two text classification dimensions is comprehensively considered, which is conducive to distinguishing the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text set, thereby improving the category distinction ability of the text to be recognized, and is conducive to realizing accurate recognition of the text, and further improving the recognition accuracy of the text. In addition, by obtaining the text recognition result of the text to be recognized, it is conducive to filtering texts that do not meet the requirements, thereby improving the text quality.

[0079] like Figure 4 As shown, in one embodiment, at least two words in the text to be identified are extracted in step S302, specifically including the following steps:

[0080] S402, word segmentation is performed on the text to be recognized to obtain the words contained in the text to be recognized.

[0081] Specifically, the server obtains a preset word segmentation processing file, and performs word segmentation processing on the text to be recognized according to the preset word segmentation processing file; for example, a word segmentation method based on string matching, a word segmentation method based on understanding, a word segmentation method based on statistics, etc., performs word segmentation processing on the text to be recognized, and can obtain the words contained in the text to be recognized. Among them, the word segmentation processing file is an algorithm file that can automatically perform word segmentation processing on the text to be recognized.

[0082] Of course, the server may also perform word segmentation processing on the recognized text based on other word segmentation processing methods, and the specific application is not limited.

[0083] For example, if the text to be recognized is "Shipping in progress, moms who need to place an order, please come and place the order quickly", then after word segmentation processing by the server, the words contained in the text to be recognized are: shipping, in progress, need, order, of, mom, hurry up, come, place an order.

[0084] S404, filter each word contained in the to-recognized text to obtain at least two words in the to-recognized text.

[0085] Specifically, the server obtains a preset stop word filtering processing file, and performs filtering processing on each word contained in the text to be recognized according to the preset stop word filtering processing file, so as to filter out the stop words contained in the text to be recognized, and obtain valid words contained in the text to be recognized as at least two words in the text to be recognized finally obtained. Among them, the stop word filtering processing file is an algorithm file that can automatically filter the stop words contained in the text to be recognized.

[0086] For example, if the words to be recognized "Shipping in progress, moms who need to place an order, please come and place the order quickly" are: shipping, in progress, need, order, of, mom, hurry up, come, order, then after server filtering, the stop words determined are: of, come, then at least two of the words in the text to be recognized finally are: shipping, in progress, need, order, mom, hurry up, order.

[0087] Furthermore, the server can also obtain a preset stop word identifier, which refers to identification information used to identify stop words; obtain identifiers corresponding to words contained in the text to be recognized, and match the identifiers corresponding to the words contained in the text to be recognized with the stop word identifiers respectively. If the match is successful, the word is identified as a stop word, thereby obtaining the stop words contained in the text to be recognized, and discarding the stop words contained in the text to be recognized to obtain valid words contained in the text to be recognized as at least two words in the text to be recognized finally obtained.

[0088] In this embodiment, by performing word segmentation and filtering on the text to be recognized, at least two words in the text to be recognized are obtained, which is beneficial to avoid interference from redundant words, thereby making the extracted words in the text to be recognized more accurate, further improving the extraction accuracy of the words in the text to be recognized.

[0089] like Figure 5 As shown, in one embodiment, obtaining the word codes of each word in the semantic dimension and the word codes of each word in at least two text classification dimensions in step S304 specifically includes the following steps:

[0090] S502, input each word into a pre-trained word encoding model to obtain a word encoding of each word in a semantic dimension; the pre-trained word encoding model is used to generate a word encoding of each word in a semantic dimension.

[0091] Among them, the pre-trained word coding model is a model that can map words into word coding in semantic dimensions, such as the word embedding model; it is obtained through multiple training of historical data.

[0092] Specifically, the server inputs each word into a pre-trained word encoding model, performs word encoding conversion on each word in a semantic dimension through the pre-trained word encoding model, and obtains the word encoding of each word in the semantic dimension.

[0093] Furthermore, the server can also use the existing word embedding technology to perform word encoding conversion on each word in the semantic dimension to obtain word encoding of each word in the semantic dimension.

[0094] For example, if one word in the text to be identified is "shipping", the server converts the word "shipping" into a 64-dimensional word vector containing semantic information based on the existing wordedding technology.

[0095] S504, obtain the statistical probability of each word under at least two text classification dimensions respectively.

[0096] Among them, the statistical probability of a word in at least two text classification dimensions refers to a statistical probability of a word in each text classification dimension when there are at least two text classification dimensions, that is, a posterior probability of the word in each text classification dimension; it is used to represent the probability distribution of a word in at least two text classification dimensions, and can better handle emergency bad cases of online feedback; for example, when faced with emergency bad cases of online feedback, it can be directly used to adjust the text recognition results.

[0097] Specifically, the server uses a preset naive Bayes model to separately count the posterior probabilities of each word in each text classification dimension as the statistical probability of each word in each text classification dimension, thereby obtaining the statistical probability of each word in at least two text classification dimensions; wherein the preset naive Bayes model is a model that can count the posterior probabilities of each word in each text classification dimension.

[0098] S506, the word encoding of each word under at least two text classification dimensions is obtained according to the statistical probability of each word under at least two text classification dimensions.

[0099] Specifically, the server combines the statistical probability of each word under at least two text classification dimensions to obtain word encodings for each word under at least two text classification dimensions.

[0100] For example, if a word in the text to be recognized is word A, at least two text classification dimensions are text classification dimension a, text classification dimension b, and text classification dimension c; the statistical probability of word A under text classification dimension a is a1, the statistical probability of word A under text classification dimension b is b1, and the statistical probability of word A under text classification dimension c is c1, then the word encoding of word A under text classification dimension a, text classification dimension b, and text classification dimension c is A(a1, b1, c1).

[0101] In this embodiment, by obtaining the word encoding of each word in the semantic dimension and the word encoding of each word in at least two text classification dimensions, it is beneficial to comprehensively consider the semantic information and interpretability of the word encoding of the text to be recognized, so that subsequent text recognition based on the word encoding of each word in the semantic dimension and the word encoding of each word in at least two text classification dimensions is more accurate, thereby improving the recognition accuracy of the text.

[0102] like Figure 6 As shown, in one embodiment, in step S504, the statistical probability of each word in at least two text classification dimensions is obtained, specifically including the following steps:

[0103] S602, obtain the text proportions under each text classification dimension respectively.

[0104] Among them, the text ratio under each text classification dimension refers to the proportion of the number of texts under each text classification dimension in the entire text set, specifically refers to the prior probability of each text classification dimension.

[0105] Specifically, the server obtains the number of texts under each text classification dimension and the number of texts in the entire text collection, and calculates the ratio of the number of texts under each text classification dimension to the number of texts in the entire text collection as the text ratio under each text classification dimension.

[0106] Furthermore, the server can also calculate the text ratio under each text classification dimension through the following formula:

[0107]

[0108] Among them, y c represents the text classification dimension c, P(y c ) represents the text ratio under the text classification dimension c, also known as the prior probability under the text classification dimension c, N D Represents the number of texts in the entire text set D, L j Indicates the text classification dimension to which text j belongs, Indicates the number of texts under the text classification dimension c.

[0109] S604, obtain the conditional probability of each word appearing under each text classification dimension.

[0110] Specifically, the server obtains the conditional probability of each word appearing under each text classification dimension, thereby obtaining the conditional probability of each word appearing under each text classification dimension.

[0111] S606, determining the statistical probability of each word in at least two text classification dimensions according to the text proportions in each text classification dimension and the conditional probability of each word appearing in each text classification dimension.

[0112] Specifically, the server multiplies the text proportion under each text classification dimension by the conditional probability of a word appearing in the text to be recognized under the corresponding text classification dimension to obtain corresponding products, and adds each corresponding product to obtain a first target value; obtains the ratio of the product of the text proportion under each text classification dimension and the conditional probability of a word appearing in the text to be recognized under the corresponding text classification dimension to the first target value as the statistical probability of a word in the text to be recognized under at least two text classification dimensions; and so on, obtains the statistical probability of each word in the text to be recognized under at least two text classification dimensions.

[0113] For example, assuming that one of the words in the text to be recognized is the first word, the text classification dimension includes the first text classification dimension and the second text classification dimension, the text ratio under the first text classification dimension is the first text ratio, the text ratio under the second text classification dimension is the second text ratio, the conditional probability of the first word appearing under the first text classification dimension is the first conditional probability, the conditional probability of the first word appearing under the second text classification dimension is the second conditional probability, the statistical probability of the first word under the first text classification dimension is the first statistical probability, and the statistical probability of the first word under the second text classification dimension is the second statistical probability, then

[0114] First statistical probability = (first conditional probability × first text proportion) / (first conditional probability × first text proportion + second conditional probability × second text proportion);

[0115] The second statistical probability = (second conditional probability × second text proportion) / (first conditional probability × first text proportion + second conditional probability × second text proportion).

[0116] Furthermore, the server can also obtain the statistical probability of each word in at least two text classification dimensions through the following naive Bayes formula:

[0117]

[0118] Among them, yc Represents the text classification dimension c, x i Represents the word i, k represents any text classification dimension among all text classification dimensions, All Label represents all text classification dimensions, P(y c |x i ) represents the statistical probability of word i in the text classification dimension c, also known as the posterior probability of word i in the text classification dimension c, P(x i |y c ) represents the conditional probability of the word i appearing under the text classification dimension c, P(y c ) represents the text ratio under the text classification dimension c, also known as the posterior probability of the text classification dimension c; P(x i |y k ) represents the conditional probability of the word i appearing under any text classification dimension k, P(y k ) represents the text ratio under any text classification dimension k.

[0119] In this embodiment, by obtaining the statistical probability of each word in at least two text classification dimensions, it is beneficial to subsequently obtain the word encoding of each word in at least two text classification dimensions based on the statistical probability of each word in at least two text classification dimensions; at the same time, the statistical probability of each word in at least two text classification dimensions is comprehensively considered, which is beneficial to distinguish the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text collection, thereby improving the category distinction ability of the text to be recognized, facilitating the accurate recognition of the text, and further improving the recognition accuracy of the text.

[0120] like Figure 7 As shown, in one embodiment, in step S604, the conditional probability of each word appearing under each text classification dimension is obtained, specifically including the following steps:

[0121] S702, obtain the word frequency of each word in the text to be identified.

[0122] Among them, the word frequency is used to indicate the frequency of occurrence of the word in the text to be identified.

[0123] Specifically, the server separately counts the frequency of occurrence of each word in the text to be identified, and uses the frequency of occurrence of each word in the text to be identified as the frequency of word in the text to be identified.

[0124] Further, the server can also calculate the word frequency of each word in the text to be identified by the following formula:

[0125]

[0126] Among them, TFi,j represents the frequency of word i in text j, n i,j Indicates the number of times the word i appears in text j, w is all the words that appear in text j, n k,j It indicates the number of occurrences of any word k in w in text j.

[0127] S704, obtain the weight of each word in each text classification dimension respectively.

[0128] Among them, the weight of a word in a text classification dimension is used to measure the importance of the word in the text classification dimension from a text classification dimension that is mutually exclusive with the text classification dimension; specifically, it represents the inverse of the proportion of texts in which the word appears in the text classification dimension that is mutually exclusive with the text classification dimension.

[0129] Specifically, the server separately counts the weight of each word in each text classification dimension, thereby obtaining the weight of each word in each text classification dimension.

[0130] Furthermore, when online feedback indicates that there is a problem with the weight learned for a certain text classification dimension of a certain word, the weight of the word in a certain text classification dimension is adjusted to make the weight of the word in a certain text classification dimension larger or smaller, thereby adjusting the statistical probability of the word in a certain text classification dimension and further adjusting the text recognition result.

[0131] S706, the conditional probability that each word appears under each text classification dimension is obtained based on the word frequency in the text to be identified and the weight of each word under each text classification dimension.

[0132] Specifically, the server multiplies the word frequency in the text to be recognized by the weight of the word in each text classification dimension to obtain the feature value of the word in each text classification dimension. Similarly, the feature value of each word in each text classification dimension can be obtained; based on the feature value of each word in each text classification dimension, the conditional probability of each word appearing in each text classification dimension is obtained.

[0133] Further, the server can also calculate the characteristic value of the word in the text classification dimension through the following formula:

[0134] CRTFIDF i,j =TF i,j ×CRIDF i,c ;

[0135] Among them, CRTFIDF i,j Represents the eigenvalue of the word i in text j under the text classification dimension c, TF i,j Represents the frequency of word i in text j, CRIDFi,c It represents the weight of the word i in text j under the text classification dimension c.

[0136] Furthermore, the server can also calculate the conditional probability of each word appearing under each text classification dimension through the following formula:

[0137]

[0138] Among them, P(x i |y c ) represents the conditional probability of the word i appearing under the text classification dimension c, CRTFIDF i,j Represents the eigenvalue of the word i in text j under the text classification dimension c. W is all the words that appear in text j, k represents any word in all words w, L j Indicates the text classification dimension to which text j belongs.

[0139] In this embodiment, by obtaining the conditional probability of each word appearing in each text classification dimension, it is convenient to subsequently determine the statistical probability of each word in at least two text classification dimensions based on the conditional probability of each word appearing in each text classification dimension.

[0140] like Figure 8 As shown, in one embodiment, in step S704, the weights of each word under each text classification dimension are obtained, specifically including the following steps:

[0141] S802, respectively obtain the text ratio of each word in the text classification dimension that is mutually exclusive to each text classification dimension.

[0142] Specifically, the server obtains the number of first texts under a text classification dimension that is mutually exclusive with the text classification dimension, and the number of second texts in which words appear under the text classification dimension that is mutually exclusive with the text classification dimension; obtains the ratio of the number of second texts to the number of first texts as the proportion of texts in which words appear under the text classification dimension that is mutually exclusive with the text classification dimension; and so on, the proportion of texts in which words appear under the text classification dimension that is mutually exclusive with each text classification dimension can be obtained, and then the text proportion of each word appears under the text classification dimension that is mutually exclusive with each text classification dimension can be obtained.

[0143] For example, if there are three text classification dimensions, namely text classification dimension a, text classification dimension b, and text classification dimension c; the number of first texts under the text classification dimension b and text classification dimension c that are mutually exclusive with text classification dimension a is n, and the number of second texts containing word A under the text classification dimension b and text classification dimension c that are mutually exclusive with text classification dimension a is m, then under the text classification dimension b and text classification dimension c that are mutually exclusive with text classification dimension a, the proportion of texts containing word A is m / n.

[0144] S804, according to the text ratio of each word appears under the text classification dimension that is mutually exclusive to each text classification dimension, the weight of each word under the text classification dimension is determined.

[0145] Specifically, the server obtains the inverse of the text proportion of the word under the text classification dimension that is mutually exclusive with the text classification dimension as the target proportion; obtains the logarithm of the target proportion as the weight of the word under the text classification dimension; and so on, the weight of the word under each text classification dimension can be obtained, and then the weight of each word under each text classification dimension can be obtained.

[0146] For example, if the text ratio of word A under text classification dimension b and text classification dimension c, which are mutually exclusive with text classification dimension a, is m / n, and the target ratio is n / m, then the weight of word A under text classification dimension a is log(n / m).

[0147] It should be noted that considering that the word A may not appear in the entire text set and the target proportion needs to be converted to n / (m+1), the weight of the word A in the text classification dimension a is log[n / (m+1)].

[0148] Further, the server can also calculate the weight of the words in the text classification dimension through the following formula:

[0149]

[0150] Among them, CRIDF i,c Represents the weight of the word i in text j under the text classification dimension c, L j Indicates the text classification dimension to which text j belongs, Indicates the number of texts in the entire text collection that do not belong to the text classification dimension c. It indicates the number of texts in which the word i appears under the text classification dimension c.

[0151] In this embodiment, the weight of each word under each text classification dimension is determined by measuring the proportion of text in which each word appears under the text classification dimension that is mutually exclusive with the text classification dimension. This is beneficial for measuring the importance of the word under the text classification dimension from the text classification dimension that is mutually exclusive with the text classification dimension, avoiding simply calculating the frequency of occurrence of the word in the entire text collection, thereby improving the ability to distinguish the categories of the text to be identified, facilitating the subsequent accurate recognition of the text, and further improving the recognition accuracy of the text.

[0152] like Fig. 9 As shown, in one embodiment, in step S306, the word codes of each word in the semantic dimension and the word codes of each word in at least two text classification dimensions are connected to obtain a target matrix, which specifically includes the following steps:

[0153] S902, obtain the first matrix according to the word encoding of each word in the semantic dimension.

[0154] Among them, the first matrix refers to a matrix constructed from word encoding of each word in the semantic dimension.

[0155] Specifically, the server combines word encodings of each word in the semantic dimension to obtain a first matrix.

[0156] For example, if there are three words in the text to be identified, namely the word A, the word B, and the word C, then the word code of the word A in the semantic dimension is (A1 A2 A3 … A n ), the word code of word B in the semantic dimension is (B1 B2 B3… B n ), the word code of word C in the semantic dimension is (C1 C2 C3 … C n ), then the first matrix is:

[0157]

[0158] S904, obtain a second matrix according to the word encoding of each word in at least two text classification dimensions.

[0159] Among them, the second matrix refers to a matrix constructed from word encodings of each word in at least two text classification dimensions.

[0160] Specifically, the server combines word encodings for each word in at least two text classification dimensions to obtain a second matrix.

[0161] For example, in combination with the above embodiment, if there are three text classification dimensions, namely text classification dimension a, text classification dimension b, and text classification dimension c, then the word code of word A under text classification dimensions a, b, and c is (Aa A b A c ), the word encoding of word B under text classification dimensions a, b and c is (B a B b B c ), the word encoding of word C under text classification dimensions a, b and c is (C a C b C c ), then the second matrix is:

[0162]

[0163] S906: Connect the first matrix and the second matrix to obtain a target matrix.

[0164] The target matrix refers to a matrix formed by connecting the first matrix and the second matrix.

[0165] Specifically, the server obtains a preset matrix connection processing file, and performs connection processing on the first matrix and the second matrix according to the preset matrix connection processing file to obtain a target matrix. The preset matrix connection processing file is an algorithm file that can automatically connect matrices, such as a concat algorithm file.

[0166] For example, in combination with the above embodiment, the first matrix is ​​a 3×n matrix, and the second matrix is ​​a 3×3 matrix. Then, the first matrix and the second matrix are connected, and the obtained target matrix is ​​a 3×(n+3) matrix:

[0167]

[0168] It should be noted that the number of rows in the first matrix and the second matrix is ​​equal, both referring to the number of words in the text to be recognized; the number of columns in the first matrix refers to the dimension of the semantic dimension, and the number of columns in the second matrix refers to the number of text classification dimensions.

[0169] In this embodiment, a target matrix is ​​obtained based on a first matrix constructed from word codes of each word in a semantic dimension and a second matrix constructed from word codes of each word in at least two text classification dimensions; the semantic information and interpretability of the word codes of the text to be recognized are comprehensively considered, so that subsequent text recognition is more accurate, thereby improving the recognition accuracy of the text; at the same time, it is beneficial to accurately determine the classification probability of the text to be recognized in each text classification dimension according to the target matrix, thereby achieving the purpose of distinguishing the text to be recognized from multiple text recognition dimensions, and further improving the recognition accuracy of the text.

[0170] like Fig.10As shown, in one embodiment, in step S308, the classification probability of the text to be recognized under each text classification dimension is determined according to the target matrix, which specifically includes the following steps:

[0171] S1002, performing convolution processing on the target matrix according to the preset multiple convolution layers respectively, to obtain multiple text feature codes of different lengths.

[0172] Among them, the convolution layer is used to perform convolution processing on the target matrix, generally including multiple convolution kernels; text feature coding refers to the text feature vector obtained after convolution processing, and generally the length of the text feature coding obtained after convolution processing is different.

[0173] Specifically, the server obtains multiple preset convolutional layers, and performs convolution processing on the target matrix according to each preset convolutional layer to obtain multiple text feature codes of different lengths.

[0174] S1004, performing maximum pooling processing on multiple text feature codes of different lengths to obtain a target feature code.

[0175] Among them, the target feature encoding refers to the feature vector obtained after maximum pooling processing.

[0176] Specifically, the server performs maximum pooling processing on multiple text feature codes of different lengths to obtain multiple text feature codes of the same length; and performs concatenation processing on multiple text feature codes of the same length to obtain a target feature code; in this way, the obtained multiple text feature codes are prevented from being affected by different lengths.

[0177] S1006, performing convolution processing on the target feature code according to the preset convolution kernels under multiple text classification dimensions, to obtain the classification code of the text to be recognized under each text classification dimension.

[0178] Among them, the classification code refers to the vector obtained after the convolution kernel processing under the text classification dimension.

[0179] Specifically, the server obtains convolution kernels under multiple preset text classification dimensions, and performs convolution processing on the target feature code according to the convolution kernel under each preset text classification dimension to obtain the classification code of the text to be identified under each text classification dimension.

[0180] S1008, normalizing the classification codes of the text to be recognized under each text classification dimension to obtain the classification probability of the text to be recognized under each text classification dimension.

[0181] Specifically, the server normalizes the classification codes of the text to be recognized in each text classification dimension, which means mapping the classification codes of the text to be recognized in each text classification dimension to a numerical value belonging to [0,1] as the classification probability of the text to be recognized in each text classification dimension.

[0182] For example, if the target matrix is ​​a 7×69 matrix, there are 3 preset convolutional layers, and each convolutional layer has 8 convolution kernels; specifically, the size of the convolution kernel in the first convolutional layer is 69×2, the size of the convolution kernel in the second convolutional layer is 69×3, and the size of the convolution kernel in the third convolutional layer is 69×4. The target matrix is ​​convolved according to the convolution kernels in the first convolutional layer, the second convolutional layer, and the third convolutional layer, respectively, to obtain 8 text feature vectors with a length of 6, 8 text feature vectors with a length of 5, and 8 text feature vectors with a length of 4, a total of 24 text feature vectors. Perform maximum pooling processing on the 24 text feature vectors respectively to obtain multiple text feature vectors of the same length; perform concat processing on multiple text feature vectors of the same length to obtain a 24-dimensional target feature vector; perform full connection processing on the 24-dimensional target feature vector to obtain the vector of the text to be recognized in each text classification dimension; perform Softmax processing on the vector of the text to be recognized in each text classification dimension to obtain the classification probability of the text to be recognized in each text classification dimension.

[0183] In this embodiment, by processing the obtained target matrix, the classification probability of the text to be recognized under each text classification dimension can be obtained, which is convenient for subsequent discrimination of the text to be recognized from multiple text classification dimensions, making the text recognition more accurate, thereby improving the text recognition accuracy.

[0184] like Fig.11 As shown, in another embodiment, in step S308, the classification probability of the text to be recognized under each text classification dimension is determined according to the target matrix, which specifically includes the following steps:

[0185] S1102, input the target matrix into the pre-trained text classification model.

[0186] Among them, the pre-trained text classification model is a convolutional neural network model that can classify text, such as the TextCNN model.

[0187] S1104, through the pre-trained text classification model, based on the preset multiple convolution layers, convolution processing is performed on the target matrix to obtain multiple text feature codes of different lengths; maximum pooling processing is performed on the multiple text feature codes of different lengths to obtain the target feature code; convolution processing is performed on the target feature code according to the convolution kernels under the preset multiple text classification dimensions to obtain the classification code of the text to be recognized under each text classification dimension; normalization processing is performed on the classification code of the text to be recognized under each text classification dimension to obtain the classification probability of the text to be recognized under each text classification dimension.

[0188] In this embodiment, the obtained target matrix is ​​processed by a pre-trained text classification model to obtain the classification probability of the text to be recognized under each text classification dimension, which is convenient for subsequent discrimination of the text to be recognized from multiple text classification dimensions, making the text recognition more accurate, thereby improving the text recognition accuracy.

[0189] Furthermore, if Fig.12 As shown, the text classification model in the above embodiment can be trained in the following way:

[0190] S1202, obtaining a target matrix of the sample text and an actual classification probability under a preset text classification dimension.

[0191] S1204, training the text classification model to be trained according to the target matrix of the sample text to obtain a trained text classification model.

[0192] Specifically, the server trains the text classification model to be trained multiple times through target matrices of different sample texts.

[0193] S1206, obtaining a prediction error between the classification probability under a preset text classification dimension output by the trained text classification model and the corresponding actual classification probability.

[0194] S1208, when the prediction error is greater than or equal to a preset threshold, the network parameters of the text classification model are adjusted according to the prediction error to obtain an adjusted text classification model, and the adjusted text classification model is repeatedly trained until the prediction error obtained according to the trained text classification model is less than the preset threshold.

[0195] Specifically, when the prediction error is greater than or equal to a preset threshold, the server continuously adjusts the network parameters in the text classification model, and repeatedly trains the adjusted text classification model according to the target matrix of the sample text until the prediction error obtained according to the trained text classification model is less than the preset threshold, and the current text classification model is used as the pre-trained text classification model.

[0196] Furthermore, the pre-trained text classification model can be used to obtain the classification probability of the text to be recognized under various text classification dimensions, thereby determining the text recognition result for the text to be recognized, making it convenient to push the corresponding text recognition result to the corresponding user according to the user's request.

[0197] In this embodiment, the server can improve the accuracy of the classification probability of the text to be recognized under the text classification dimension predicted by the text classification model by repeatedly training the text classification model, making subsequent text recognition more accurate, thereby improving the recognition accuracy of the text.

[0198] like Fig.13 As shown, in one embodiment, step S308 determines the text recognition result of the text to be recognized according to the classification probability of the text to be recognized under each text classification dimension, and specifically includes the following steps:

[0199] S1302, screening out the maximum classification probability from the classification probabilities of the text to be recognized under various text classification dimensions.

[0200] S1304: taking the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized.

[0201] Specifically, the server uses the text type of the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized.

[0202] For example, if the classification probabilities of the text to be recognized under text classification dimensions a, b, and c are 50%, 30%, and 20%, respectively, the text type corresponding to the text classification dimension a is used as the text type of the text to be recognized.

[0203] In this embodiment, the purpose of determining the text recognition result of the text to be recognized based on the classification probability of the text to be recognized in each text classification dimension is achieved. Comprehensive consideration of the classification probability of the text to be recognized in multiple text classification dimensions is conducive to recognizing the text to be recognized from multiple dimensions, thereby improving the recognition accuracy of the text.

[0204] like Fig.14 As shown, in one embodiment, in step S1304, after taking the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized, the following is further included:

[0205] S1402, filtering out classification probabilities greater than or equal to a preset probability from the classification probabilities of the text to be recognized under various text classification dimensions.

[0206] S1404: Use the text classification dimension corresponding to the classification probability that is greater than or equal to the preset probability as the text label of the text to be recognized.

[0207] The text label of the text to be recognized is used to identify key information of the text to be recognized.

[0208] For example, if the classification probabilities of the text to be recognized under text classification dimensions a, b, and c are 50%, 45%, and 5% respectively, and the preset probability is 40%, then the classification types corresponding to the text classification dimensions a and b will be used as text labels for the text to be recognized.

[0209] In this embodiment, by using the text classification dimension corresponding to the classification probability greater than or equal to the preset probability as the text label of the text to be recognized, it is helpful to accurately identify the key information of the text to be recognized.

[0210] like Fig.15 As shown, in one embodiment, the text recognition method of the present application further includes a step of storing the text to be recognized, which specifically includes the following steps:

[0211] S1502: Obtain the text identifier of the text to be recognized.

[0212] The text identifier refers to identification information used to identify the text to be identified, such as a text number, a text name, etc.

[0213] Specifically, the server assigns a corresponding text number, such as 1, 2, 3, etc., to the text to be recognized, and uses the text number as a text identifier of the text to be recognized.

[0214] Furthermore, the server may also obtain a text name of the text to be recognized, and use the text name as a text identifier of the text to be recognized.

[0215] S1504, storing the text to be recognized in a preset database according to the text identifier; the text to be recognized stored in the preset database carries the text tag and the text type.

[0216] Specifically, the server stores the text to be recognized in the Redis database according to the text identifier, so as to store multiple texts to be recognized and text labels and text types corresponding to the texts to be recognized through the Redis database. Of course, the server can also use other cache methods to store the texts to be recognized.

[0217] Furthermore, after storing the text to be recognized in the preset database according to the text identifier, when the user initiates a text recognition request, the server can also extract the corresponding text label and text type from the preset database, and push the text label and text type to the corresponding user.

[0218] In this embodiment, the purpose of storing the text type and text label of the text to be recognized is achieved, so that the corresponding text label and text type can be accurately pushed to the corresponding user based on the text recognition request initiated by the user. There is no need for manual review of the text, which greatly reduces labor costs and improves text recognition efficiency.

[0219] In one embodiment, the present application also provides another text recognition method, which can be applied to Fig.16 As shown in the application environment diagram. Fig.16 , the text recognition method is applied to a text audit system. The text audit system includes a user terminal 1610 and a server 1620; the user terminal 1610 and the server 1620 are connected via a network. The user terminal can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers, and can be a public cloud server or a private cloud server.

[0220] like Fig.17 As shown, in one embodiment, another text recognition method is provided. This embodiment mainly applies this method to the above Fig.16 The server 1620 in FIG. 1 is used as an example. Fig.17 , the text recognition method specifically includes the following steps:

[0221] S1702, receiving a text recognition request sent by a terminal; the text recognition request carries a text identifier.

[0222] For example, Fig.18 As shown, the user selects the text to be reviewed on the text review interface of the terminal and clicks the review button, which triggers the terminal to generate a text recognition request based on the text selected by the user and send the text recognition request to the corresponding server.

[0223] S1704: Determine the text corresponding to the text identifier from a preset database.

[0224] The preset database stores text types and text labels of multiple texts.

[0225] Specifically, the server queries a preset database according to the text identifier, determines the text corresponding to the text identifier from the preset database, and thereby obtains the text type and text label corresponding to the text.

[0226] Furthermore, in addition to obtaining the text type and text label corresponding to the text corresponding to the text identifier from the preset database, the server may also determine the text type and text label of the text corresponding to the text identifier in real time.

[0227] For example, the server obtains text corresponding to the text identifier and extracts at least two words from the text; obtains word codes of each word in a semantic dimension and word codes of each word in at least two text classification dimensions; determines the classification probability of the text in each text classification dimension based on the word codes of each word in the semantic dimension and word codes of each word in at least two text classification dimensions; uses the text classification dimension corresponding to the maximum classification probability as the text type of the text; uses the text classification dimension corresponding to the classification probability greater than or equal to a preset probability as the text label of the text; thereby obtaining the text type and text label of the text.

[0228] S1706: Push the text type and text label corresponding to the text to the terminal.

[0229] Specifically, the server pushes the text type and text label corresponding to the text to the corresponding terminal, so as to display the text type and text label corresponding to the text through the text review interface of the terminal, so that the user can check whether the text meets the requirements.

[0230] Please refer to Fig.18 , take the text review application as an example to illustrate. The user terminal is installed with a text review application. Assuming that the user selects text A on the text review interface on the text review application and clicks the review button, a text recognition request can be triggered, and the text recognition request is sent to the Tencent cloud server through the terminal. According to the text recognition request, the Tencent cloud server obtains the text type and text label of text A from the preset database, or determines the text type and text label of text A in real time (see the embodiment of the above-mentioned text recognition method of this application for details), and pushes the text type and text label of text A to the text review application, so as to display the text type and text label of text A through the text review interface of the text review application.

[0231] It should be noted that the text recognition method of the present application can be applied to not only the above-mentioned text review scenarios, but also other scenarios, which are not specifically limited in the present application.

[0232] In this embodiment, the purpose of pushing the text type and text label of the corresponding text to the corresponding user according to the text recognition request is achieved without manual review of the text, thereby improving the text recognition efficiency and greatly reducing the manual review cost.

[0233] like Fig.19 As shown, in one embodiment, another text recognition method is provided. This embodiment mainly applies this method to the above Fig.16 The server 1620 in FIG. 1 is used as an example. Fig.19, the text recognition method specifically includes the following steps:

[0234] S1902, receiving a text recognition request sent by a terminal; the text recognition request carries text to be recognized.

[0235] S1904: extract at least two words from the text to be recognized.

[0236] Specifically, the server performs word segmentation processing on the text to be recognized to obtain words included in the text to be recognized; and performs filtering processing on each word included in the text to be recognized to obtain at least two words in the text to be recognized.

[0237] S1906, input each word into a pre-trained word encoding model to obtain a word encoding of each word in a semantic dimension; the pre-trained word encoding model is used to generate a word encoding of each word in a semantic dimension.

[0238] S1908, respectively obtain the text proportions under each text classification dimension.

[0239] S1910, respectively obtaining the conditional probability of each word appearing under each text classification dimension.

[0240] Specifically, the server obtains the word frequency of each word in the text to be recognized respectively; obtains the text proportion of each word under the text classification dimension that is mutually exclusive with each text classification dimension; determines the weight of each word under each text classification dimension according to the text proportion of each word under the text classification dimension that is mutually exclusive with each text classification dimension; obtains the conditional probability of each word appearing under each text classification dimension according to the word frequency of each word in the text to be recognized and the weight of each word under each text classification dimension.

[0241] S1912, determining the statistical probability of each word in at least two text classification dimensions according to the text proportion in each text classification dimension and the conditional probability of each word appearing in each text classification dimension.

[0242] S1914, obtaining a word code of each word under at least two text classification dimensions according to the statistical probability of each word under at least two text classification dimensions.

[0243] S1916, concatenating the word codes of each word in the semantic dimension and the word codes of each word in at least two text classification dimensions to obtain a target matrix.

[0244] Specifically, the server obtains a first matrix according to the word coding of each word in the semantic dimension; obtains a second matrix according to the word coding of each word in at least two text classification dimensions; and connects the first matrix and the second matrix to obtain a target matrix.

[0245] S1918, determining the classification probability of the text to be recognized under each text classification dimension according to the target matrix.

[0246] Specifically, the server performs convolution processing on the target matrix according to multiple preset convolution layers to obtain multiple text feature codes of different lengths; performs maximum pooling processing on multiple text feature codes of different lengths to obtain target feature codes; performs convolution processing on the target feature codes according to convolution kernels under multiple preset text classification dimensions to obtain classification codes of the text to be recognized under each text classification dimension; normalizes the classification codes of the text to be recognized under each text classification dimension to obtain the classification probability of the text to be recognized under each text classification dimension.

[0247] S1920, determining a text recognition result for the text to be recognized according to the classification probability of the text to be recognized under each text classification dimension.

[0248] Specifically, the server selects the maximum classification probability from the classification probabilities of the text to be recognized under various text classification dimensions; and uses the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized, thereby obtaining a text recognition result for the text to be recognized.

[0249] Furthermore, the server can also filter out classification probabilities greater than or equal to a preset probability from the classification probabilities of the text to be recognized under various text classification dimensions; and use the text classification dimension corresponding to the classification probability greater than or equal to the preset probability as the text label of the text to be recognized.

[0250] S1922, push the text recognition result of the text to be recognized to the corresponding terminal.

[0251] In this embodiment, the purpose of obtaining the text recognition result of the text to be recognized based on the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions is achieved; the semantic information and interpretability of the word encoding of the text to be recognized are comprehensively considered, so that the recognition of the text is more accurate, thereby improving the recognition accuracy of the text; at the same time, the word encoding of at least two words in the text to be recognized under at least two text classification dimensions is comprehensively considered, which is conducive to distinguishing the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text collection, thereby improving the category distinction ability of the text to be recognized, and is conducive to realizing accurate recognition of the text, and further improving the recognition accuracy of the text. In addition, by obtaining the text recognition result of the text to be recognized, it is conducive to filtering texts that do not meet the requirements, thereby improving the text quality.

[0252] like Fig. 20 As shown, Fig. 20 A flowchart of an advertisement identification method in an embodiment is provided. In one embodiment, an advertisement identification method is provided. This embodiment mainly applies the method to the above Fig.16 The server 1620 in FIG. 1 is used as an example.

[0253] Reference Fig. 20 , the advertisement recognition method specifically includes the following contents: the server extracts at least two words from the advertisement to be identified; for example, the server performs word segmentation and stop word filtering on the advertisement with label 0 (also called sentence i) "Shipping in progress, moms who need to place an order, please hurry up and place an order", and obtains at least two words in the advertisement: shipping, in progress, need, order, mom, hurry up, order. The server obtains the word encoding of each word in the semantic dimension, and the word encoding of each word under at least two text labels; for example, the server processes the at least two words in the obtained advertisement in two processes, the first process is that the server uses word embedding technology to directly obtain the semantic word vector corresponding to each word, and the second process is that the server calculates the CR-TF-IDF feature value of each word in the current sentence (specifically refer to the calculation of CRTFIDF in this application). i,j , such as CR-TF-IDF<shipping, j>, CR-TF-IDF<medium, j>, CR-TF-IDF<need, j>, CR-TF-IDF<order, j>, CR-TF-IDF<mom, j>, and CR-TF-IDF<hurry up, j>; and by using Naive Bayes for the CR-TF-IDF feature value of each word, calculate the classification probability of each word under the text label (specifically refer to the calculation of P(y in this application) c |x i) embodiment), as the CR-TF-IDF word vector of each word under the text label. The server determines the classification probability of the advertisement to be identified under each text label according to the word encoding of each word under the semantic dimension and the word encoding of each word under at least two text labels; for example, the server constructs a first matrix according to the word vector containing semantics corresponding to each word; constructs a second matrix according to the CR-TF-IDF word vector of each word under the text label; concats the first matrix and the second matrix to obtain a target matrix, uses the target matrix as the input of the TextCNN network, and performs a series of processing on the target matrix through the TextCNN network to obtain the classification probability of sentence i corresponding to each text label. The server determines the advertisement recognition result of the advertisement to be identified according to the classification probability of the advertisement to be identified under each text label; for example, there are 5 text labels, namely 0 normal, 1 advertisement, 2 suspected advertisement, 3 fraudulent likes and attention, and 4 mention of competing products. If the classification probability of the advertisement to be identified in 0 normal is the largest, it is confirmed that the advertisement to be identified has no suspicion of advertising and is compliant; if the classification probability of the advertisement to be identified in other text labels is the largest, it is confirmed that the advertisement to be identified is not compliant.

[0254] In this embodiment, the purpose of obtaining the advertisement recognition result of the advertisement to be identified based on the word encoding of at least two words in the advertisement to be identified in the semantic dimension and the word encoding under at least two text tags is achieved; the semantic information and interpretability of the word encoding of the advertisement to be identified are comprehensively considered, so that the identification of the advertisement is more accurate, thereby improving the recognition accuracy of the advertisement; at the same time, the comprehensive consideration of the word encoding of at least two words in the advertisement to be identified under at least two text tags is conducive to distinguishing the advertisement to be identified from multiple dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text set, thereby improving the category distinction ability of the advertisement to be identified, facilitating the accurate identification of advertisements, and further improving the recognition accuracy of advertisements.

[0255] It should be understood that although Figure 3-15 The steps in the flowcharts of 17 and 19 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3-15 At least part of the steps in 17 and 19 may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages does not necessarily have to be sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0256] like Fig.21 As shown, in one embodiment, a text recognition device 2100 is provided, the device 2100 includes: a word extraction module 2102, a word encoding acquisition module 2104, a target matrix acquisition module 2106, a classification probability acquisition module 2108 and a text recognition module 2110, wherein:

[0257] The word extraction module 2102 is used to extract at least two words from the text to be recognized.

[0258] The word coding acquisition module 2104 is used to acquire the word coding of each word in the semantic dimension and the word coding of each word in at least two text classification dimensions.

[0259] The target matrix acquisition module 2106 is used to connect the word codes of each word in the semantic dimension and the word codes of each word in at least two text classification dimensions to obtain a target matrix.

[0260] The classification probability acquisition module 2108 is used to determine the classification probability of the text to be recognized under each text classification dimension according to the target matrix.

[0261] The text recognition module 2110 is used to determine the text recognition result of the text to be recognized according to the classification probability of the text to be recognized under each text classification dimension.

[0262] In one embodiment, the word extraction module 2102 is further used to perform word segmentation processing on the text to be recognized to obtain the words contained in the text to be recognized; and to perform filtering processing on each word contained in the text to be recognized to obtain at least two words in the text to be recognized.

[0263] In one embodiment, the word encoding acquisition module 2104 is also used to input each word into a pre-trained word encoding model respectively to obtain the word encoding of each word in the semantic dimension; the pre-trained word encoding model is used to generate the word encoding of each word in the semantic dimension; the statistical probability of each word in at least two text classification dimensions is obtained respectively; based on the statistical probability of each word in at least two text classification dimensions, the word encoding of each word in at least two text classification dimensions is obtained.

[0264] In one embodiment, the word encoding acquisition module 2104 is also used to respectively obtain the text proportion under each text classification dimension; respectively obtain the conditional probability of each word appearing under each text classification dimension; determine the statistical probability of each word under at least two text classification dimensions based on the text proportion under each text classification dimension and the conditional probability of each word appearing under each text classification dimension.

[0265] In one embodiment, the word encoding acquisition module 2104 is also used to respectively obtain the word frequency of each word in the text to be recognized; respectively obtain the weight of each word in each text classification dimension; according to the word frequency of each word in the text to be recognized and the weight of each word in each text classification dimension, obtain the conditional probability of each word appearing in each text classification dimension.

[0266] In one embodiment, the word encoding acquisition module 2104 is also used to respectively obtain the text proportion of each word under the text classification dimensions that are mutually exclusive with each text classification dimension; based on the text proportion of each word under the text classification dimensions that are mutually exclusive with each text classification dimension, determine the weight of each word under each text classification dimension.

[0267] In one embodiment, the target matrix acquisition module 2106 is also used to obtain a first matrix based on the word encoding of each word in the semantic dimension; obtain a second matrix based on the word encoding of each word in at least two text classification dimensions; and connect the first matrix and the second matrix to obtain a target matrix.

[0268] In one embodiment, the classification probability acquisition module 2108 is also used to perform convolution processing on the target matrix according to a plurality of preset convolution layers to obtain a plurality of text feature codes of different lengths; perform maximum pooling processing on the plurality of text feature codes of different lengths to obtain the target feature code; perform convolution processing on the target feature code according to the convolution kernels under a plurality of preset text classification dimensions to obtain the classification code of the text to be recognized under each text classification dimension; perform normalization processing on the classification code of the text to be recognized under each text classification dimension to obtain the classification probability of the text to be recognized under each text classification dimension.

[0269] In one embodiment, the classification probability acquisition module 2108 is also used to input the target matrix into a pre-trained text classification model; through the pre-trained text classification model, based on a preset plurality of convolutional layers, convolution processing is performed on the target matrix to obtain a plurality of text feature codes of different lengths; maximum pooling processing is performed on the plurality of text feature codes of different lengths to obtain a target feature code; convolution processing is performed on the target feature code according to the convolution kernels under the preset plurality of text classification dimensions respectively to obtain a classification code of the text to be recognized under each text classification dimension; and normalization processing is performed on the classification code of the text to be recognized under each text classification dimension to obtain the classification probability of the text to be recognized under each text classification dimension.

[0270] In one embodiment, the text recognition module 2110 is further used to screen out the maximum classification probability from the classification probabilities of the text to be recognized under various text classification dimensions; and use the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized.

[0271] In one embodiment, the text recognition device 2100 further includes: a text label determination module.

[0272] The text label determination module is used to screen out the classification probabilities greater than or equal to the preset probability from the classification probabilities of the text to be recognized under various text classification dimensions; and use the text classification dimension corresponding to the classification probability greater than or equal to the preset probability as the text label of the text to be recognized.

[0273] In one embodiment, the text recognition device 2100 further includes: a text storage module.

[0274] The text storage module is used to obtain the text identifier of the text to be recognized; store the text to be recognized in a preset database according to the text identifier; the text to be recognized stored in the preset database carries a text label and a text type.

[0275] In one embodiment, the text recognition device 2100 further includes: a text type push module.

[0276] The text type push module is used to receive a text recognition request sent by a terminal; the text recognition request carries a text identifier; determine the text corresponding to the text identifier from a preset database; and push the text type and text label corresponding to the text to the terminal.

[0277] In this embodiment, the target matrix is ​​obtained by extracting the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions, and the classification probability of the text to be recognized under each text classification dimension is determined according to the target matrix, so as to determine the text recognition result of the text to be recognized; the purpose of obtaining the text recognition result of the text to be recognized according to the word encoding of at least two words in the text to be recognized under the semantic dimension and the word encoding under at least two text classification dimensions is achieved; the semantic information and interpretability of the word encoding of the text to be recognized are comprehensively considered, so that the recognition of the text is more accurate, thereby improving the recognition accuracy of the text; at the same time, the word encoding of at least two words in the text to be recognized under at least two text classification dimensions is comprehensively considered, which is conducive to distinguishing the text to be recognized from multiple text recognition dimensions, avoiding simply calculating the frequency of occurrence of words in the entire text set, thereby improving the category distinction ability of the text to be recognized, and is conducive to realizing accurate recognition of the text, and further improving the recognition accuracy of the text. In addition, by obtaining the text recognition result of the text to be recognized, it is conducive to filtering the text that does not meet the requirements, thereby improving the text quality.

[0278] In one embodiment, the text recognition device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 2 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the text recognition device, such as: Fig.21 The illustrated word extraction module 2102, word encoding acquisition module 2104, target matrix acquisition module 2106, classification probability acquisition module 2108 and text recognition module 2110. The computer program composed of various program modules enables the processor to execute the steps of the text recognition method of each embodiment of the present application described in this specification.

[0279] For example, Figure 2 The computer device shown can be Fig.21 The word extraction module 2102 in the text recognition device shown extracts at least two words in the text to be recognized. The computer device can obtain the word code of each word in the semantic dimension and the word code of each word in at least two text classification dimensions through the word code acquisition module 2104. The computer device can connect the word code of each word in the semantic dimension and the word code of each word in at least two text classification dimensions through the target matrix acquisition module 2106 to obtain the target matrix. The computer device can determine the classification probability of the text to be recognized in each text classification dimension according to the target matrix through the classification probability acquisition module 2108; and determine the text recognition result of the text to be recognized according to the classification probability of the text to be recognized in each text classification dimension through the text recognition module 2110.

[0280] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned text recognition method. The steps of the text recognition method here may be the steps of the text recognition method in the above-mentioned various embodiments.

[0281] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above-mentioned text recognition method. The steps of the text recognition method here can be the steps in the text recognition method of each of the above-mentioned embodiments.

[0282] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0283] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0284] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A text recognition method, include: Extracting at least two words from the text to be recognized; Inputting each of the words into a pre-trained word encoding model to obtain a word encoding of each of the words in a semantic dimension; The pre-trained word encoding model is used to generate word encodings of each of the words in a semantic dimension; Obtaining the text proportions under each of the text classification dimensions respectively; Respectively obtain the word frequency of each of the words in the text to be recognized; Respectively obtain the weight of each of the words under each of the text classification dimensions; According to the word frequency of each of the words in the to-be-recognized text and the weight of each of the words under each of the text classification dimensions, the conditional probability of each of the words appearing under each of the text classification dimensions is obtained; Determine the statistical probability of each of the words under at least two text classification dimensions according to the text proportions under each of the text classification dimensions and the conditional probability of each of the words appearing under each of the text classification dimensions; Obtaining word codes of each of the words under at least two text classification dimensions according to the statistical probabilities of each of the words under at least two text classification dimensions; Connecting the word codes of each of the words in the semantic dimension and the word codes of each of the words in at least two text classification dimensions to obtain a target matrix; Determining the classification probability of the text to be recognized under each of the text classification dimensions according to the target matrix; A text recognition result for the text to be recognized is determined according to the classification probability of the text to be recognized under each of the text classification dimensions.

2. The method according to claim 1, It is characterized in that The step of extracting at least two words from the text to be recognized includes: Performing word segmentation processing on the text to be recognized to obtain words contained in the text to be recognized; Filter each of the words contained in the text to be recognized to obtain at least two words in the text to be recognized.

3. The method according to claim 1, It is characterized in that The weights of each of the words under each of the text classification dimensions are obtained respectively, including: Respectively obtaining the text proportions in which each of the words appears under the text classification dimensions that are mutually exclusive with each of the text classification dimensions; The weight of each of the words under each of the text classification dimensions is determined according to the text proportion in which each of the words appears under the text classification dimensions that are mutually exclusive with each of the text classification dimensions.

4. The method according to claim 1, It is characterized in that The word codes of each of the words in the semantic dimension and the word codes of each of the words in at least two text classification dimensions are connected to obtain a target matrix, including: According to the word coding of each of the words in the semantic dimension, a first matrix is ​​obtained; Obtaining a second matrix according to the word coding of each of the words under at least two text classification dimensions; The first matrix and the second matrix are connected to obtain a target matrix.

5. The method according to claim 1, It is characterized in that Determining the classification probability of the to-be-recognized text under each of the text classification dimensions according to the target matrix includes: According to a plurality of preset convolutional layers, the target matrix is ​​convolved to obtain a plurality of text feature codes of different lengths; Performing maximum pooling processing on the multiple text feature codes of different lengths to obtain a target feature code; According to the convolution kernels under the preset multiple text classification dimensions, the target feature code is convolved to obtain the classification code of the text to be recognized under each of the text classification dimensions; The classification codes of the text to be recognized under each of the text classification dimensions are normalized to obtain the classification probabilities of the text to be recognized under each of the text classification dimensions.

6. The method according to claim 1, It is characterized in that The step of determining the classification probability of the text to be recognized under each of the text classification dimensions according to the target matrix further includes: Inputting the target matrix into a pre-trained text classification model; Through the pre-trained text classification model, based on the preset multiple convolution layers, the target matrix is ​​convolved to obtain multiple text feature codes of different lengths; the multiple text feature codes of different lengths are subjected to maximum pooling processing to obtain the target feature code; the target feature code is convolved according to the convolution kernels under the preset multiple text classification dimensions to obtain the classification code of the text to be recognized under each of the text classification dimensions; the classification code of the text to be recognized under each of the text classification dimensions is normalized to obtain the classification probability of the text to be recognized under each of the text classification dimensions.

7. The method according to any one of claims 1 to 6, It is characterized in that Determining the text recognition result of the text to be recognized according to the classification probability of the text to be recognized under each of the text classification dimensions includes: Filtering out the maximum classification probability from the classification probabilities of the text to be recognized under each of the text classification dimensions; The text classification dimension corresponding to the maximum classification probability is used as the text type of the text to be recognized.

8. The method according to claim 7, It is characterized in that After taking the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized, the method further includes: From the classification probabilities of the text to be recognized under each of the text classification dimensions, screening out the classification probabilities that are greater than or equal to a preset probability; The text classification dimension corresponding to the classification probability that is greater than or equal to the preset probability is used as the text label of the text to be recognized.

9. The method according to claim 8, It is characterized in that The method further comprises: Obtaining a text identifier of the text to be recognized; The text to be recognized is stored in a preset database according to the text identifier; the text to be recognized stored in the preset database carries the text tag and the text type.

10. The method according to claim 9, It is characterized in that The method further comprises: A text recognition request sent by a receiving terminal; the text recognition request carries a text identifier; Determining the text corresponding to the text identifier from the preset database; The text type and text label corresponding to the text are pushed to the terminal.

11. A text recognition device, include: Extracting at least two words from the text to be recognized; Inputting each of the words into a pre-trained word encoding model to obtain a word encoding of each of the words in a semantic dimension; The pre-trained word encoding model is used to generate word encodings of each of the words in a semantic dimension; Obtaining the text proportions under each of the text classification dimensions respectively; Respectively obtain the word frequency of each of the words in the text to be recognized; Respectively obtain the weight of each of the words under each of the text classification dimensions; According to the word frequency of each of the words in the to-be-recognized text and the weight of each of the words under each of the text classification dimensions, the conditional probability of each of the words appearing under each of the text classification dimensions is obtained; Determine the statistical probability of each of the words under at least two text classification dimensions according to the text proportions under each of the text classification dimensions and the conditional probability of each of the words appearing under each of the text classification dimensions; Obtaining word codes of each of the words under at least two text classification dimensions according to the statistical probabilities of each of the words under at least two text classification dimensions; Connecting the word codes of each of the words in the semantic dimension and the word codes of each of the words in at least two text classification dimensions to obtain a target matrix; Determining the classification probability of the text to be recognized under each of the text classification dimensions according to the target matrix; A text recognition result for the text to be recognized is determined according to the classification probability of the text to be recognized under each of the text classification dimensions.

12. The device according to claim 11, It is characterized in that The step of extracting at least two words from the text to be recognized includes: Performing word segmentation processing on the text to be recognized to obtain words contained in the text to be recognized; Filter each of the words contained in the text to be recognized to obtain at least two words in the text to be recognized.

13. The device according to claim 11, It is characterized in that The weights of each of the words under each of the text classification dimensions are obtained respectively, including: Respectively obtaining the text proportions in which each of the words appears under the text classification dimensions that are mutually exclusive with each of the text classification dimensions; The weight of each of the words under each of the text classification dimensions is determined according to the text proportion in which each of the words appears under the text classification dimensions that are mutually exclusive with each of the text classification dimensions.

14. The device according to claim 11, It is characterized in that The word codes of each of the words in the semantic dimension and the word codes of each of the words in at least two text classification dimensions are connected to obtain a target matrix, including: According to the word coding of each of the words in the semantic dimension, a first matrix is ​​obtained; Obtaining a second matrix according to the word coding of each of the words under at least two text classification dimensions; The first matrix and the second matrix are connected to obtain a target matrix.

15. The device according to claim 11, It is characterized in that Determining the classification probability of the to-be-recognized text under each of the text classification dimensions according to the target matrix includes: According to a plurality of preset convolutional layers, the target matrix is ​​convolved to obtain a plurality of text feature codes of different lengths; Performing maximum pooling processing on the multiple text feature codes of different lengths to obtain a target feature code; According to the convolution kernels under the preset multiple text classification dimensions, the target feature code is convolved to obtain the classification code of the text to be recognized under each of the text classification dimensions; The classification codes of the text to be recognized under each of the text classification dimensions are normalized to obtain the classification probabilities of the text to be recognized under each of the text classification dimensions.

16. The device according to claim 11, It is characterized in that The step of determining the classification probability of the text to be recognized under each of the text classification dimensions according to the target matrix further includes: Inputting the target matrix into a pre-trained text classification model; Through the pre-trained text classification model, based on the preset multiple convolution layers, the target matrix is ​​convolved to obtain multiple text feature codes of different lengths; the multiple text feature codes of different lengths are subjected to maximum pooling processing to obtain the target feature code; the target feature code is convolved according to the convolution kernels under the preset multiple text classification dimensions to obtain the classification code of the text to be recognized under each of the text classification dimensions; the classification code of the text to be recognized under each of the text classification dimensions is normalized to obtain the classification probability of the text to be recognized under each of the text classification dimensions.

17. The device according to any one of claims 11 to 16, It is characterized in that Determining the text recognition result of the text to be recognized according to the classification probability of the text to be recognized under each of the text classification dimensions includes: Filtering out the maximum classification probability from the classification probabilities of the text to be recognized under each of the text classification dimensions; The text classification dimension corresponding to the maximum classification probability is used as the text type of the text to be recognized.

18. The device according to claim 17, It is characterized in that After taking the text classification dimension corresponding to the maximum classification probability as the text type of the text to be recognized, the method further includes: From the classification probabilities of the text to be recognized under each of the text classification dimensions, screening out the classification probabilities that are greater than or equal to a preset probability; The text classification dimension corresponding to the classification probability that is greater than or equal to the preset probability is used as the text label of the text to be recognized.

19. The device according to claim 18, It is characterized in that The device also includes: Obtaining a text identifier of the text to be recognized; The text to be recognized is stored in a preset database according to the text identifier; the text to be recognized stored in the preset database carries the text tag and the text type.

20. The device according to claim 19, It is characterized in that The device also includes: A text recognition request sent by a receiving terminal; the text recognition request carries a text identifier; Determining the text corresponding to the text identifier from the preset database; The text type and text label corresponding to the text are pushed to the terminal.

21. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 10.

22. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Chinese text classification system and method

    CN106897371A

  • Text classification and device

    CN107436875A

  • Display method and device for identifying text

    CN108536654A

  • Text classification method, apparatus, computer device, and storage medium

    CN109299264A

  • Short text classification method based on topic word vectors and convolutional neural network

    CN110134786A