Text recognition method, device and equipment

By performing character-level segmentation and phonetic-graphic vector encoding on text from internet platforms, combined with a recognition model and a sensitive word database, the problem of machine translation models struggling to identify abnormal information has been solved, achieving more accurate and flexible identification of abnormal information.

CN113128241BActive Publication Date: 2024-11-01KOUBEI SHANGHAI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110535189.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-17
Publication Date
2024-11-01
Estimated Expiration
2041-05-17

AI Technical Summary

Technical Problem

Existing machine translation models struggle to effectively identify the combination of abnormal information and normal text on internet platforms, leading to inaccurate abnormal information identification results.

Method used

By segmenting the text to be identified into multiple character elements and encoding each character element with a phonetic-graphic vector, semantic translation is performed using a pre-built recognition model, and a sensitive word database is used to determine whether the text contains abnormal information.

Benefits of technology

It improves the accuracy and flexibility of abnormal information identification, and can encode at the level of similar shape and similar sound to ensure the accuracy of the identification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113128241B_ABST
    Figure CN113128241B_ABST
Patent Text Reader

Abstract

The present application discloses a text recognition method, device and equipment, which relates to the field of Internet technology. For deformed abnormal information in the text to be recognized, it can be translated into the original text in combination with a machine model and then the abnormal information can be recognized, while ensuring the accuracy of the recognition result, the flexibility of abnormal information recognition is improved. The method includes: obtaining multiple character elements formed by character-level segmentation of the text to be recognized; encoding each character element to form a sound-shaped code vector of the character element; inputting the sound-shaped code vector of the character element into a pre-constructed recognition model to obtain the original text mapped to the text to be recognized, and the recognition model has the function of semantically translating the deformed information in the sound-shaped code vector; using a pre-constructed sensitive word library, determining whether the original text mapped to the text to be recognized contains abnormal information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a text recognition method, device and equipment. Background Art

[0002] With the rapid development of the Internet, the problem of information overload has become increasingly prominent. More and more words appear on the Internet. Once these words contain harmful, sensitive, illegal and other abnormal information, how to effectively and reasonably identify such abnormal information from normal text is of great significance for network supervision and network purification.

[0003] In related technologies, products on Internet platforms must be supervised by relevant departments, so that no abnormal texts can appear online. Usually, on the basis of building a large number of corpora, the machine translation model can be used to comprehensively learn and train texts to obtain the word vectors of the texts, realize text translation, and match sensitive characters of the word vectors of the texts to identify whether there is abnormal information in the text. However, since the texts generated on Internet platforms are usually continuous and readable, the context relevance of the training corpus in the machine translation process is required to be high, and the abnormal information scenarios that need to be considered are more complex. The continuity and relevance of abnormal information in text content monitoring scenarios are weak, making it difficult for the compilation process of the machine translation model to combine abnormal information with normal text for identification, affecting the identification results of abnormal information. Summary of the invention

[0004] In view of this, the present application provides a text recognition method, device and equipment, the main purpose of which is to solve the problem in the prior art that it is difficult to combine abnormal information with normal text for recognition during the compilation process of the machine translation model, thus affecting the recognition result of the abnormal information.

[0005] According to a first aspect of the present application, a text recognition method is provided, the method comprising:

[0006] Obtain multiple character elements formed by character-level segmentation of the text to be recognized;

[0007] Perform encoding processing on each character element to form a sound-shape code vector of the character element;

[0008] Inputting the phonetic-graphic code vector of the character element into a pre-built recognition model to obtain the original text mapped to the text to be recognized, wherein the recognition model has the function of semantically translating the deformation information in the phonetic-graphic code vector;

[0009] Using the pre-built sensitive word library, it is determined whether the original text of the to-be-recognized text mapping contains abnormal information.

[0010] Furthermore, the encoding process is performed on each character element to form a sound and shape code vector of the character element, specifically including:

[0011] Obtain deformation description features of character element mapping;

[0012] For each character element, encoding is performed on the deformation description feature mapped to the character element to obtain a vector representation of each character element in different deformation dimensions;

[0013] According to a preset splicing order, the vector representations of each character element at different deformation dimensions are spliced ​​to form the phonetic code vector of the character element.

[0014] Furthermore, the step of obtaining deformation description features of character element mapping specifically includes:

[0015] Using the deformation recognition algorithm pre-set for sensitive words, various deformation patterns of sensitive words in application scenarios are extracted;

[0016] According to various deformation modes of the sensitive words in the application scenario, deformation description features of character element mapping are obtained.

[0017] Furthermore, the deformation dimension at least includes a deformation dimension, a sound change dimension and a glyph similarity dimension, the composition of the sound-shape code vector at least includes a word vector of a character element, a sound-shape vector of a character element and a graphic vector of a character element, and the encoding process of the deformation description feature mapped to the character element for each character element to obtain a vector representation of each character element in different deformation dimensions specifically includes:

[0018] Use the text representation of each character element to semantically encode each character element to obtain the word vector of the character element;

[0019] Using the phonetic notation result and the glyph structure of each character element, the character element is encoded and combined in the sound change dimension and the shape change dimension to obtain the sound and shape vector of the character element;

[0020] Encoding the character element on a glyph similarity dimension using the image pixel representation of each character element to form a graphic vector of the character element;

[0021] The step of splicing the vector representations of each character element at different deformation dimensions according to a preset splicing order to form the sound-shape code vector of the character element specifically includes:

[0022] According to a preset splicing order, the word vector of the character element, the phonetic-morphological vector of the character element, and the phonetic-morphological vector of the character element are spliced ​​to form a phonetic-morphological code vector of the character element.

[0023] Furthermore, the method of encoding and combining the character element in the sound change dimension and the shape change dimension by using the phonetic notation result and the glyph structure of each character element to obtain the sound-shape vector of the character element specifically includes:

[0024] Using the phonetic notation result and the glyph structure of each character element, extracting the sound-shape combination form of the character element, wherein the sound-shape combination includes various combination forms formed by processing the character element on the phonetic notation result and the glyph structure;

[0025] According to various combination forms formed by processing the character elements on the phonetic results and the glyph structures, the character elements are encoded and combined on the sound change dimension and the shape change dimension to obtain the sound and shape vectors of the character elements.

[0026] Furthermore, the step of encoding the character element on a glyph similarity dimension using the image pixel representation of each character element to form a graphic vector of the character element specifically includes:

[0027] Perform pixel marking on each character element to generate a character image of a preset size, wherein the character image includes pixel points formed by the character elements;

[0028] The character elements in the character image are encoded on a glyph similarity dimension using pixel points formed by the character elements to form a graphic vector of the character elements.

[0029] Furthermore, the step of encoding the character elements on a glyph similarity dimension using the pixel points formed by the character elements in the character image to form a graphic vector of the character elements specifically includes:

[0030] Performing similarity analysis on the character elements using the pixel points formed by the character elements in the character image to obtain similar character representations corresponding to the character elements;

[0031] The character element is encoded on a glyph similarity dimension according to similar character representations corresponding to the character element to form a graphic vector of the character element.

[0032] Furthermore, encoding the deformation description features of the character element mapping for each character element to obtain a vector representation of each character element in different deformation dimensions specifically includes:

[0033] Encode each character element in the traditional and simplified Chinese transformation dimension according to whether each character element has traditional and simplified Chinese, and obtain the traditional and simplified Chinese vector of the character element;

[0034] According to a preset splicing order, the traditional and simplified Chinese vectors are spliced ​​into the phonetic and graphic code vectors of the character elements.

[0035] Furthermore, encoding the deformation description features of the character element mapping for each character element to obtain a vector representation of each character element in different deformation dimensions specifically includes:

[0036] Encoding each character element on the symbol deformation dimension according to whether each character element contains a special symbol to form a symbol vector of the character element;

[0037] According to a preset splicing order, the symbol vector is spliced ​​into the phonetic code vector of the character element.

[0038] Furthermore, the recognition model includes multiple layers of networks with different processing functions, and the inputting of the phonetic code vector of the character element into the pre-built recognition model to obtain the original text mapped to the text to be recognized specifically includes:

[0039] Using the first layer network of the recognition model to perform nonlinear transformation on the phonetic-graphic code vector of the character element to obtain an intermediate semantic vector of the phonetic-graphic code vector;

[0040] The second layer network of the recognition model is used to extract the mapping relationship between the output and input of the sound-shape code vector at different time states to obtain a self-attention weight parameter;

[0041] The third layer network of the recognition model is used in combination with the self-attention weight parameter to perform weighted summation on the intermediate semantic vector to obtain the original text mapped to the text to be recognized.

[0042] According to a second aspect of the present application, a text recognition method is provided, the method comprising:

[0043] In response to the text recognition instruction, receiving the text to be recognized uploaded by the platform;

[0044] The text to be recognized is sent to a server, so that the server performs encoding processing on a plurality of character elements formed by character-level segmentation of the text to be recognized, obtains a phonetic-graphic code vector of the character element, and uses a pre-built recognition model to perform semantic translation on deformation information in the phonetic-graphic code vector of the character element, and determines whether the original text mapped by the text to be recognized contains abnormal information;

[0045] If the original text mapped to the text to be recognized contains abnormal information, the text to be recognized is intercepted as abnormal text.

[0046] According to a third aspect of the present application, a text recognition device is provided, the device comprising:

[0047] An acquisition unit, used for acquiring a plurality of character elements formed by character-level segmentation of the text to be recognized;

[0048] The encoding unit is used to perform encoding processing on each character element to form a sound and shape code vector of the character element;

[0049] A recognition unit, used for inputting the phonetic-graphic code vector of the character element into a pre-built recognition model to obtain the original text mapped to the text to be recognized, wherein the recognition model has the function of semantically translating the deformation information in the phonetic-graphic code vector;

[0050] The determination unit is used to determine whether the original text mapped to the text to be identified contains abnormal information by using a pre-built sensitive word library.

[0051] Furthermore, the encoding unit comprises:

[0052] An acquisition module is used to obtain deformation description features of character element mapping;

[0053] An encoding module, used for encoding the deformation description features mapped to each character element to obtain a vector representation of each character element in different deformation dimensions;

[0054] The splicing module is used to splice the vector representations of each character element at different deformation dimensions according to a preset splicing order to form a phonetic code vector of the character element.

[0055] Furthermore, the acquisition module includes:

[0056] An extraction submodule is used to extract various deformation patterns of sensitive words in application scenarios by using a deformation recognition algorithm pre-set for sensitive words;

[0057] The acquisition submodule is used to acquire deformation description features of character element mapping according to various deformation modes existing in the application scenario of the sensitive word.

[0058] Furthermore, the deformation dimension at least includes a deformation dimension, a sound change dimension and a character shape similarity dimension, the composition of the sound-shape code vector at least includes a word vector of a character element, a sound-shape vector of a character element and a graphic vector of a character element, and the encoding module includes:

[0059] A first encoding submodule, used to semantically encode each character element using the text representation of each character element to obtain a word vector of the character element;

[0060] The second encoding submodule is used to encode and combine the character elements in the sound change dimension and the shape change dimension by using the phonetic notation result and the glyph structure of each character element to obtain the sound-shape vector of the character element;

[0061] A third encoding submodule, used to encode each character element on a glyph similarity dimension using a picture pixel representation of each character element to form a graphic vector of the character element;

[0062] The splicing module is specifically used to splice the word vector of the character element, the sound-shape vector of the character element, and the sound-shape vector of the character element in a preset splicing order to form the sound-shape code vector of the character element.

[0063] Furthermore, the second encoding submodule is specifically used to extract the sound-shape combination form of the character element by using the phonetic notation result and the glyph structure of each character element, wherein the sound-shape combination includes various combination forms formed by processing the character element on the phonetic notation result and the glyph structure;

[0064] The second encoding submodule is specifically used to encode and combine the character elements in the sound change dimension and the shape change dimension according to various combination forms formed by processing the character elements on the phonetic results and the glyph structure, so as to obtain the sound-shape vector of the character element.

[0065] Furthermore, the third encoding submodule is specifically used to perform pixel dotting on each character element to generate a character image of a preset size, wherein the character image includes pixel dots formed by the character elements;

[0066] The third encoding submodule is specifically used to encode the character elements in the glyph similarity dimension using the pixel points formed by the character elements in the character image to form a graphic vector of the character elements.

[0067] Furthermore, the third encoding submodule is specifically used to perform similarity analysis on the character elements using the pixel points formed by the character elements in the character image, and obtain similar character representations corresponding to the character elements;

[0068] The third encoding submodule is further specifically used to encode the character element on the glyph similarity dimension according to the similar character representation corresponding to the character element to form a graphic vector of the character element.

[0069] Furthermore, the encoding module also includes:

[0070] A fourth encoding submodule, used to encode each character element in the traditional and simplified deformation dimension according to whether each character element has traditional and simplified forms, so as to obtain a traditional and simplified vector of the character element;

[0071] The splicing module is specifically used to splice the traditional and simplified Chinese vector into the phonetic code vector of the character element according to a preset splicing order.

[0072] Furthermore, the encoding module also includes:

[0073] a fifth encoding submodule, configured to encode each character element on a symbol deformation dimension according to whether each character element contains a special symbol, so as to form a symbol vector of the character element;

[0074] The splicing module is specifically used to splice the symbol vector into the phonetic code vector of the character element according to a preset splicing order.

[0075] Furthermore, the recognition model includes multiple layers of networks with different processing functions, and the recognition unit includes:

[0076] A transformation module, used for performing nonlinear transformation on the phonetic-graphic code vector of the character element by using the first layer network of the recognition model to obtain an intermediate semantic vector of the phonetic-graphic code vector;

[0077] An extraction module, used to extract the mapping relationship between the output and input of the sound-shape code vector at different time states by using the second layer network of the recognition model, and obtain a self-attention weight parameter;

[0078] A weighting module is used to use the third layer network of the recognition model in combination with the self-attention weight parameter to perform weighted summation on the intermediate semantic vector to obtain the original text mapped to the text to be recognized.

[0079] According to a fourth aspect of the present application, a text recognition device is provided, the device comprising:

[0080] A receiving unit, configured to receive the text to be recognized uploaded by the platform in response to the interactive instruction trigger of the text recognition;

[0081] A sending unit, used to send the text to be recognized to a server, so that the server performs encoding processing on a plurality of character elements formed by character-level segmentation of the text to be recognized, obtains a phonetic code vector of the character element, and uses a pre-built recognition model to perform semantic translation on deformation information in the phonetic code vector of the character element, and determines whether the original text mapped by the text to be recognized contains abnormal information;

[0082] The interception unit is used to display whether the original text mapped to the text to be recognized contains abnormal information, and intercept the original text containing abnormal information.

[0083] According to a fifth aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned text recognition method is implemented.

[0084] According to a sixth aspect of the present application, a text recognition device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned text recognition method when executing the program.

[0085] By means of the above technical scheme, the present application provides a text recognition method, device and equipment. Compared with the current existing method of using a machine translation model to match sensitive characters on the word vector of the text, the present application obtains multiple character elements formed by character-level segmentation of the text to be recognized, and encodes each character element to form a sound-shape code vector of the character element. The sound-shape code vector can encode the text from the pinyin and glyph levels, which can overcome the disadvantage that the machine translation model can only recognize the scenario of synonymous abnormal information. By introducing a graphic representation of text, the deformation information in the text can be recognized from the glyph level, and the sound-shape code vector of the glyph element is further input into a pre-constructed recognition model. The recognition model has the function of semantically translating the deformation information in the sound-shape code vector. If there is deformation information in the text to be recognized, the text to be recognized can be translated into the original text, and the pre-constructed sensitive word library is further used to determine whether the original text mapped by the text to be recognized contains abnormal information. On the basis of encoding the text at the level of shape and sound, the abnormal information can be recognized in combination with the machine model, ensuring the accuracy of the recognition result while improving the flexibility of abnormal information recognition.

[0086] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0088] Figure 1 A flowchart of a text recognition method provided by an embodiment of the present application is shown;

[0089] Figure 2 A flowchart of another text recognition method provided by an embodiment of the present application is shown;

[0090] Figure 3 A schematic diagram of a similar glyph image provided by an embodiment of the present application is shown;

[0091] Figure 4A flowchart of a text recognition method provided by an embodiment of the present application is shown;

[0092] Figure 5 A flowchart of another text recognition method provided by an embodiment of the present application is shown;

[0093] Figure 6 A schematic diagram of the structure of a text recognition device provided in an embodiment of the present application is shown;

[0094] Figure 7 A schematic diagram of the structure of another text recognition device provided in an embodiment of the present application is shown;

[0095] Figure 8 A structural schematic diagram of another text recognition device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0096] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0097] In related technologies, products on Internet platforms must be supervised by relevant departments, so that sensitive texts are not allowed to appear online. Usually, on the basis of building a large number of corpora, a machine translation model can be used to comprehensively learn and train texts to obtain word vectors of texts, realize text translation, and match sensitive characters in the word vectors of texts to identify whether there is abnormal information in the text. However, since the texts generated on Internet platforms are usually continuous and readable, the context relevance of the training corpus in the machine translation process is required to be high, and the abnormal information scenarios that need to be considered are more complex. The continuity and relevance of abnormal information in text content monitoring scenarios are weak, making it difficult for the compilation process of the machine translation model to combine abnormal information with normal text, affecting the recognition results of abnormal information.

[0098] In order to solve this problem, this embodiment provides a text recognition method, such as Figure 1 As shown, the method is applied to the server of the Internet platform and includes the following steps:

[0099] 101. Obtain multiple character elements formed by character-level segmentation of the text to be recognized.

[0100] The text to be identified may be text data accumulated in the Internet platform, and the text data may include texts in various text forms, such as Chinese, English, Pinyin, traditional and simplified Chinese, and special characters, which may be mathematical symbols, such as brackets, plus signs, equal signs, etc., graphic characters, such as triangles, squares, circles, etc., punctuation marks, such as question marks, exclamation marks, semicolons, etc., and special symbols, such as asterisks, pound signs, etc. Usually, the text data in the Internet platform is massive, and the text to be identified as part of the massive data will contain a large amount of semantic information. Whether the semantic information contains abnormal information, that is, non-compliant text or pictures, requires the use of algorithms to identify and intercept changes that may occur in the text in different dimensions.

[0101] It can be understood that the text to be recognized is usually the expression form of text sentences in text data, and in order to facilitate the segmentation of the text to be recognized, the text to be recognized can also be the text segmentation formed after string matching of the text sentences in the text data. For example, after string matching of the text sentence "I love to eat hot dry noodles", the text segmentation formed includes: "I", "love", "hot dry noodles", and the text to be recognized at this time is the expression form of text segmentation. In the subsequent character-level segmentation process of the text to be recognized, it is necessary to further segment the text segmentation into single words. Specifically, for the text to be recognized whose segmentation is already a single word, there is no need to segment it, and for the text to be recognized whose segmentation is not a single word, it is still necessary to further segment it. For example, "hot dry noodles" also needs to be divided into "hot", "dry", and "noodles".

[0102] The above-mentioned string matching process and the process of segmenting the text to be recognized should also set up a matching process for special characters, so that special characters can be formed into character elements. For example, for the text sentence "I*come) Tianjin", first, string matching can be performed on the text sentence to form the text to be recognized "I", "from", "Tianjin". On the one hand, the text to be recognized is segmented at the character level, and on the other hand, special characters are matched to form character elements. Finally, multiple character elements are formed including: "I", "*", "come", "from", ")", "Tian", and "Tianjin".

[0103] For the execution subject of the embodiments of the present invention, it can be a text recognition device or the server of an Internet platform, which can collect text data from various service providers, including some abnormal information. To promote the healthy development of the Internet platform, it is particularly important to identify abnormal information. Usually, simple abnormal information can be easily identified using existing recognition algorithms. However, to avoid recognition, abnormal information often appears in a deformed form. The complex and changeable text forms and abnormal information mixed with special characters increase the difficulty of text recognition. In this application, the text to be recognized is segmented at the character level to form multiple character elements, and the deformed character elements are restored. Since the original text after restoration has real text information, the abnormal information can be accurately identified by recognizing the original text after restoration, improving the recognition accuracy of abnormal information in the text.

[0104] 102. Perform encoding processing on each character element to form the phonetic and shape code vector of the character element.

[0105] Since abnormal information has multiple deformation modes, for example, phonetic transformation, shape transformation, insertion of invalid symbols, visualization, and combinations of these deformation modes. The process of encoding each character element here can be a process of encoding multiple deformation modes of the character element. Since the text has its deformation characteristics in each deformation mode, specifically, the character element can be encoded in combination with the deformation characteristics of each deformation mode to obtain encoding vectors with different deformation characteristics, and then the encoding vectors with different deformation characteristics are spliced to form the phonetic and shape code vector of the character element.

[0106] The above deformation modes can at least include the pinyin deformation mode, the structural deformation mode, and the shape deformation mode. The following is a specific elaboration for each deformation mode. For the pinyin deformation mode, the text has the deformation characteristics of full pinyin and initial letter mixed pinyin in the pinyin deformation mode. For example, the text "上学" can be fully spelled as "shangxue" or mixed spelled as "sx". Here, the character element can be encoded in combination with the deformation characteristics of full pinyin and initial letter mixed pinyin to form the initial letter encoding of the character element. For the structural deformation mode, the text has the deformation characteristic of word splitting in the structural deformation mode. For example, the word "骑" can be split into "马奇". Here, the character element can be encoded in combination with the deformation characteristic of word splitting. For the shape deformation mode, the text has the deformation characteristic of similar word shape expressions in the shape deformation mode. For example, the words "末" and "未", the words "日" and "曰". Here, the character element can be encoded in combination with the deformation characteristic of similar word shape expressions.

[0107] 103. Input the phonetic and shape code vector of the character element into a pre-constructed recognition model to obtain the original text mapped by the text to be recognized.

[0108] Among them, the recognition model has the function of semantically translating the deformation information in the phonetic code vector. By inputting the phonetic code vector of the character element into the pre-built recognition model, for the case where there is deformation information in the phonetic code vector, the text to be recognized can be restored to the original text output; for the case where there is no deformation information in the phonetic code vector, the text to be recognized can be output as the original text.

[0109] The specific recognition model can use the self-attention mechanism in deep learning to calculate the intermediate semantic vectors formed during the model training process, so that the original text mapped to the text to be recognized can be more accurately focused on each character element to obtain a more accurate original text. It is understandable that if there are special symbols such as brackets and asterisks between the characters in the text to be recognized, the recognition model can remove the special symbols to ensure the semantic coherence of the restored original text.

[0110] 104. Using the pre-built sensitive word library, determine whether the original text mapped to the text to be identified contains abnormal information.

[0111] Among them, the sensitive word library can be a corpus word library established for sensitive words on different sensitive dimensions. Here, the sensitive dimensions can be set for different sensitivity levels, different sensitivity types, and different sensitive scenarios. For example, the first sensitive dimension set for the sensitivity level is illegal information, which requires direct text interception. The second sensitive dimension set for the sensitivity level is uncivilized information, which can be replaced by sensitive character strings. For another example, the first sensitive dimension set for sensitive scenarios is that e-commerce sells goods that are not suitable for sale, and the relevant text of the goods needs to be directly intercepted. The second sensitive dimension set for sensitive scenarios is uncivilized words for video releases, which can be replaced by sensitive character strings.

[0112] Compared with the current existing method of using a machine translation model to match sensitive characters on the word vector of a text, the text recognition method provided in the embodiment of the present application obtains multiple character elements formed by character-level segmentation of the text to be recognized, and performs encoding processing on each character element to form a phonetic code vector of the character element. The phonetic code vector can encode and represent the text from the pinyin and glyph levels, which can overcome the disadvantage that the machine translation model can only recognize synonymous abnormal information scenarios. By introducing a graphic representation of text, the deformation information in the text can be recognized from the glyph level, and the phonetic code vector of the glyph element is further input into a pre-constructed recognition model. The recognition model has the function of semantically translating the deformation information in the phonetic code vector. If the text to be recognized contains deformation information, the text to be recognized can be translated into the original text, and the pre-constructed sensitive word library is further used to determine whether the original text mapped by the text to be recognized contains abnormal information. On the basis of encoding the text at the level of shape and pronunciation, the abnormal information can be recognized in combination with the machine model, ensuring the accuracy of the recognition result while improving the flexibility of abnormal information recognition.

[0113] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, this embodiment provides another text recognition method, such as Figure 2 As shown, the method includes:

[0114] 201. Obtain multiple character elements formed by character-level segmentation of the text to be recognized.

[0115] It is understandable that the display form of the text to be recognized on the Internet platform can be in text form, in which case it is necessary to use regular expressions to segment the text to be recognized to form multiple character elements, or it can be in picture form, in which case it is necessary to perform pixel-level segmentation of the text to be recognized in the form of a picture, detect individual characters and the connection relationship between characters, and then determine the final text line based on the connection relationship between characters, and mark each text character in the text line to form an image array of a single word, so as to perform single word recognition processing and form multiple character elements. Character elements here include but are not limited to words, symbols, letters, pictures, etc.

[0116] The process of pixel-level segmentation of the text to be recognized in the form of pictures mainly involves the line segmentation process and the character segmentation process. For line segmentation, it is mainly to segment out lines of characters to form single-line character text image data. Here, after binarizing the input picture containing text, scan line by line from top to bottom and calculate the pixels of each scanned line to obtain the horizontal projection of the picture. Each peak in the projection corresponds to each text line in the picture. There is a relatively wide section of projection information as 0 between adjacent lines, which corresponds to the blank area between adjacent lines. Accordingly, the line spacing of each line of text can be calculated. After accumulating and summing up all the line spacings, the standard line spacing of the text picture is obtained. The text picture is roughly segmented according to the standard line spacing, and finally scanned up and down near the segmented lines for fine adjustment to select the most suitable segmentation position to segment out multiple text line pictures; for character segmentation, it is mainly to segment out single-character pictures from the segmented text line pictures. Here, the single-character pictures can be segmented out by using the blank intervals formed by the blank gaps between characters in the vertical projection of the text line picture. At the same time, considering the text structure, there will also be blank intervals in the vertical projection for characters with left-right structures, and the size of the blank intervals needs to be restricted. Further, the width of the text is estimated based on the height of the characters in the text line picture. The width of the text and the blank intervals are used as the basis for segmentation to ensure that the internal structure of the text is not separated, so as to segment out multiple character pictures.

[0117] 202. Obtain the deformed description features of the character element mapping.

[0118] Among them, the deformed description features can be the features describing the deformation of the text in different dimensions. For example, the features of deformation in the structural dimension and the features of deformation in the pinyin dimension. That is to say, although the text has deformed in different dimensions, the essence of the text can still be abstracted based on the deformed description features. For the features of deformation in the structural dimension, it can be structural splitting. For example, "地" can be split into "土也" structure, and "的" can be split into "白勺" structure. It can also be structural similarity. For example, "土" and "士" have similar structures, and "血" and "皿" have similar structures.

[0119] Since users of sensitive words will make various deformations to avoid detection, in order to accurately obtain the deformed description features, a deformation recognition algorithm pre-set for sensitive words can be used to extract various deformation patterns of sensitive words in the application scenario. The application scenario can be application scenarios for different platform types. For example, application scenarios for video platforms and application scenarios for forum platforms. The deformation patterns here can include splitting deformation, pinyin deformation, structural similarity deformation, etc. Then, according to the various deformation patterns of sensitive words in the application scenario, the deformed description features of the character element mapping are obtained.

[0120] 203. For each character element, encoding processing is performed on the deformation description feature mapped to the character element to obtain a vector representation of each character element in different deformation dimensions.

[0121] Among them, the deformation dimension at least includes the deformation dimension, the sound change dimension and the glyph similarity dimension. For different deformation dimensions, the way of encoding the deformation description features mapped to the character elements is also different. It can be understood that when the character elements are not deformed, the vector representation of the character elements in the undeformed dimension is also required, that is, the vector representation of the original character elements. When the character elements are deformed, the vector identification of the character elements in different deformation dimensions is required. Therefore, in the process of identifying the character elements, it is necessary to consider whether the character elements are deformed.

[0122] Specifically, for the vector representation of the original character elements, the text representation of each character element can be used to semantically encode each character element to obtain the word vector of the character element; for the vector representation of the character elements in the sound change dimension and the shape change dimension, the phonetic notation result and the glyph structure of each character element can be used to encode and combine the character elements in the sound change dimension and the shape change dimension to obtain the sound-shape vector of the character element; for the vector representation of the character elements in the glyph similarity dimension, the image pixel representation of each character element can be used to encode the character elements in the glyph similarity dimension to form a graphic vector of the character element. Here, the encoding process of each deformation dimension can form an encoding module, a pinyin module can be formed for the sound change dimension, a glyph module can be formed for the deformation dimension, and a glyph similarity module can be formed for the glyph similarity dimension, and each deformation dimension is also provided with at least one deformation feature. Specifically, the encoding process needs to be combined with the encoding of the deformation feature, which is equivalent to processing each deformation feature into a vector representation for splicing according to the encoding order set for the deformation feature. For example, the deformation features on the sound change dimension include at least pinyin letters, first letters, alphabetical order, tones, etc. The encoding process can process each deformation feature into a vector representation for splicing according to the encoding order set for the deformation features on the silver edge dimension. The deformation features included in the deformation dimension include at least radicals, abbreviations, etc. The encoding order set on the deformation dimension can be that each deformation feature is processed into a vector representation for splicing according to the encoding order set for the deformation features on the deformation dimension.

[0123] Specifically for the phonetic and graphic vectors, the phonetic and graphic combination forms of character elements can be extracted by using the phonetic annotation results and graphic structures of each character element. The phonetic and graphic combination includes various combination forms formed by processing the character elements in the phonetic annotation results and graphic structures. For example, the full spelling, the initial letter spelling, and one or more combinations in the character splitting are included. Then, according to the various combination forms formed by processing the character elements in the phonetic annotation results and graphic structures, the character elements are encoded and combined in the phonetic variation dimension and the graphic variation dimension to obtain the phonetic and graphic vectors of the character elements.

[0124] Specifically for the graphic vectors, pixel dotting can be performed on each character element to generate a character picture of a preset size. The character picture includes the pixel dots formed by the character elements. Then, the pixel dots formed by the character elements in the character picture are used to encode the character elements in the dimension of graphic similarity to form the graphic vectors of the character elements. Here, as shown in Figure 3 the two characters '习' and '刁' have great similarity. Due to the deformation of the character form in the text, it is difficult to distinguish the change in the character form from the structure. The pixel dots formed by the character elements in the character picture can be used to perform similarity analysis on the character elements. The similarity analysis can compare the similarity percentage of the pixel dot positions based on the pixel dot quantities being in the same magnitude range. For the case where the similarity percentage of the pixel dot positions exceeds a certain threshold, it is defaulted that the character elements have structural similarity, and further obtain the similar character representation corresponding to the character elements. Then, according to the similar character representation corresponding to the character elements, the character elements are encoded in the dimension of graphic similarity to form the graphic vectors of the character elements.

[0125] In the actual application scenario, the deformation dimension can also include the simplified and traditional character deformation dimension. For the simplified and traditional character deformation dimension, each character element can be encoded in the simplified and traditional character deformation dimension by using whether each character element has simplified and traditional characters to obtain the simplified and traditional character vectors of the character elements.

[0126] In the actual application scenario, the deformation dimension can also include the symbol deformation dimension. For the symbol deformation dimension, each character element can be encoded in the symbol deformation dimension by using whether each character element contains special symbols to form the symbol vectors of the character elements.

[0127] 204. According to the preset splicing order, splice the vector representations of each character element in different deformation dimensions to form the phonetic and graphic code vectors of the character elements.

[0128] The composition of the sound-shape code vector at least includes the word vector of the character element, the sound-shape vector of the character element and the graphic vector of the character element. Specifically, the word vector of the character element, the sound-shape vector of the character element and the sound-shape vector of the character element can be spliced ​​in a preset splicing order to form the sound-shape code vector of the character element. Correspondingly, for the traditional and simplified Chinese vector of the character element, it is necessary to splice the traditional and simplified Chinese vector into the sound-shape code vector of the character element in a preset splicing order; for the symbol vector of the character element, it is necessary to splice the symbol vector into the sound-shape code vector of the character element in a preset splicing order.

[0129] It should be noted that the above-mentioned preset splicing order is a fixed order in the encoding process, and the encoding process for each character element needs to use the preset splicing order to splice the vectors encoded in different deformation dimensions.

[0130] 205. Input the phonetic and graphic code vectors of the character elements into a pre-built recognition model to obtain the original text mapped to the text to be recognized.

[0131] Among them, the recognition model includes multiple layers of networks with different processing functions. Specifically, the first layer of the recognition model can be used to perform nonlinear transformation on the phonetic code vector of the character element to obtain the intermediate semantic vector of the phonetic code vector, and the second layer of the recognition model can be used to extract the mapping relationship between the output and input of the phonetic code vector at different time states to obtain the self-attention weight parameter, and the third layer of the recognition model is used in combination with the self-attention weight parameter to perform weighted summation on the intermediate semantic vector to obtain the original text of the text mapping to be recognized. Here, the first layer of the network is equivalent to the encoder layer, which can represent the input vector as an intermediate semantic vector through nonlinear changes, the second layer of the network is equivalent to the attention layer, and the weight parameters obtained through training can play a weighted role in nonlinear transformation, and the third layer of the network is equivalent to the decoder layer, which can output the original text of the text mapping to be recognized through weighted processing of the intermediate semantic vector and historical state information.

[0132] 206. Using the pre-built sensitive word library, determine whether the original text mapped to the text to be identified contains abnormal information.

[0133] Since the original text is authentic, the character elements containing abnormal information have been restored, and string matching for word segmentation can be directly performed. Specifically, in the process of determining whether the original text mapped by the recognized text contains abnormal information, first, the original text is segmented to obtain text word segmentation. Then, for the corpus word libraries set for different sensitive dimensions, the text word segmentation formed from the original text is used to perform string matching with the sensitive words in the corpus word library. For cases where there is a match, it indicates that the text word segmentation is a sensitive word, and further determines whether the original text mapped by the text to be recognized contains abnormal information.

[0134] Specifically, in an actual application scenario, the text recognition process can be as Figure 4 shown. Taking the text "犬(家)好" as an example, assume that "大家好" is the text containing abnormal information. To avoid the detection of abnormal information, the user will perform deformation processing on the abnormal information in a similar deformation mode combined with a symbol deformation mode during input. The Internet platform first performs character-level segmentation on the text to be recognized "犬(家)好", forming character elements including "犬", "(", "家", ")", "好", and inputs them into the encoding layer respectively. The four modules set in the encoding layer are used to perform encoding processing on the character elements. These four modules have ways to perform encoding processing on the deformation features in different deformation dimensions. Then, the vectors after encoding processing by the four modules are concatenated into the phonetic and shape code vectors of the character elements. Using this phonetic and shape code vector as the input layer, it is input into the encoder layer. The encoder layer performs non-linear transformation on the phonetic and shape code vector to obtain the intermediate semantic vector of the phonetic and shape code vector, and further inputs it into the attention layer. The attention layer extracts the mapping relationship between the input and output of the phonetic and shape code at different time states to obtain the self-attention weight parameters, and further inputs them into the decoder layer. The decoder layer combines the self-attention weight parameters to perform weighted summation on the intermediate semantic vector to obtain the original text mapped by the text to be recognized, that is, "大家好". Further, the restored original text is matched with the sensitive words in the sensitive word library to determine that the "大家好" mapped by "犬(家)好" contains abnormal information.

[0135] This embodiment provides another text recognition method, as Figure 5 shown. This method is applied to the client of the network platform and includes the following steps:

[0136] 301. In response to the trigger of the interaction instruction for text recognition, receive the text to be recognized uploaded by the platform.

[0137] It can be understood that the interactive instruction of text recognition here is an interactive instruction triggered by the client of the network platform after detecting that there is text to be recognized on the client. It can be triggered according to a time interval, for example, a text recognition instruction is triggered once every 1 minute. It can also be triggered according to the amount of text to be recognized, for example, a text recognition instruction is triggered once the amount of text to be recognized reaches a preset amount of text. This is not limited here. For the specific description of the text to be recognized, please refer to step 101, which will not be repeated here.

[0138] 302. Send the text to be recognized to the server.

[0139] Since the client does not have text recognition capabilities, the text to be recognized is sent to the server, which encodes the multiple character elements formed by character-level segmentation of the text to be recognized, obtains the phonetic and graphic code vectors of the character elements, and uses the pre-built recognition model to semantically translate the deformation information in the phonetic and graphic code vectors of the character elements to determine whether the original text mapped by the text to be recognized contains abnormal information.

[0140] 303: Display whether the original text mapped to the to-be-recognized text contains abnormal information, and intercept and process the original text containing the abnormal information.

[0141] For the original text containing abnormal information, it means that the original text may contain sensitive words, such as uncivilized words, sensitive words involving violent tendencies, etc., which should not be displayed directly on the network platform. Here, the text to be identified can be intercepted as abnormal text, and the abnormal information in the text to be identified can be processed and displayed, for example, mosaic or string replacement, etc., or the text to be identified can be directly blocked, or the text to be identified can be displayed after the abnormal information is deleted. There is no limitation here.

[0142] Further, as Figure 1-Figure 2 The specific implementation of the method, the embodiment of the present application provides a text recognition device, such as Figure 6 As shown, the device includes: an acquisition unit 41, an encoding unit 42, an identification unit 43, and a determination unit 44.

[0143] The acquisition unit 41 may be used to acquire a plurality of character elements formed by character-level segmentation of the text to be recognized;

[0144] The encoding unit 42 may be used to perform encoding processing on each character element to form a sound and shape code vector of the character element;

[0145] The recognition unit 43 may be used to input the phonetic-graphic code vector of the character element into a pre-built recognition model to obtain the original text mapped to the text to be recognized, wherein the recognition model has the function of semantically translating the deformation information in the phonetic-graphic code vector;

[0146] The determination unit 44 may be configured to use a pre-built sensitive word library to determine whether the original text mapped to the text to be identified contains abnormal information.

[0147] The text recognition device provided by the embodiment of the present invention is compared with the method of using a machine translation model to match sensitive characters on the word vector of the text in the existing method. The present application obtains multiple character elements formed by character-level segmentation of the text to be recognized, and performs encoding processing on each character element to form a phonetic code vector of the character element. The phonetic code vector can encode the text from the pinyin and glyph levels, which can overcome the disadvantage that the machine translation model can only recognize the scenario of synonymous abnormal information. The graphic representation of the text is introduced, and the deformation information in the text can be recognized from the glyph level. The phonetic code vector of the glyph element is further input into a pre-constructed recognition model. The recognition model has the function of semantically translating the deformation information in the phonetic code vector. If the text to be recognized contains deformation information, the text to be recognized can be translated into the original text. The pre-constructed sensitive word library is further used to determine whether the original text mapped by the text to be recognized contains abnormal information. On the basis of encoding the text at the level of shape and sound, the abnormal information can be recognized in combination with the machine model, ensuring the accuracy of the recognition result while improving the flexibility of abnormal information recognition.

[0148] In specific application scenarios, such as Figure 7 As shown, the encoding unit 42 includes:

[0149] An acquisition module 421 may be used to acquire deformation description features of character element mapping;

[0150] The encoding module 422 may be used to encode the deformation description features mapped to each character element to obtain a vector representation of each character element in different deformation dimensions;

[0151] The splicing module 423 can be used to splice the vector representations of each character element at different deformation dimensions according to a preset splicing order to form a phonetic code vector of the character element.

[0152] In specific application scenarios, such as Figure 7 As shown, the acquisition module 421 includes:

[0153] The extraction submodule 4211 may be used to extract various deformation patterns of sensitive words in application scenarios by using a deformation recognition algorithm pre-set for sensitive words;

[0154] The acquisition submodule 4212 may be used to acquire deformation description features of character element mapping according to various deformation modes of the sensitive word in the application scenario.

[0155] In specific application scenarios, such as Figure 7 As shown, the deformation dimension at least includes a deformation dimension, a sound change dimension and a character shape similarity dimension, the composition of the sound shape code vector at least includes a word vector of a character element, a sound shape vector of a character element and a graphic vector of a character element, and the encoding module 422 includes:

[0156] The first encoding submodule 4221 may be used to semantically encode each character element using the text representation of each character element to obtain a word vector of the character element;

[0157] The second encoding submodule 4222 may be used to encode and combine the character element in the sound change dimension and the shape change dimension by using the phonetic notation result and the glyph structure of each character element to obtain the sound-shape vector of the character element;

[0158] The third encoding submodule 4223 may be used to encode the character element on the glyph similarity dimension using the image pixel representation of each character element to form a graphic vector of the character element;

[0159] The splicing module 423 can be specifically used to splice the word vector of the character element, the phonetic-morphological vector of the character element, and the phonetic-morphological vector of the character element according to a preset splicing order to form the phonetic-morphological code vector of the character element.

[0160] In a specific application scenario, the second encoding submodule 4222 can be specifically used to extract the sound-shape combination form of the character element by using the phonetic notation result and the glyph structure of each character element, wherein the sound-shape combination includes various combination forms formed by processing the character element on the phonetic notation result and the glyph structure;

[0161] The second encoding submodule 4222 can also be specifically used to encode and combine the character elements in the sound change dimension and the shape change dimension according to various combination forms formed by processing the character elements on the phonetic results and the glyph structure, so as to obtain the sound-shape vector of the character element.

[0162] In a specific application scenario, the third encoding submodule 4223 may be used to perform pixel dotting on each character element to generate a character image of a preset size, wherein the character image includes pixel dots formed by the character elements;

[0163] The third encoding submodule 4223 may be specifically configured to encode the character elements in the glyph similarity dimension using the pixels formed by the character elements in the character image to form a graphic vector of the character elements.

[0164] In a specific application scenario, the third encoding submodule 4223 may be further used to perform similarity analysis on the character elements using the pixel points formed by the character elements in the character image to obtain similar character representations corresponding to the character elements;

[0165] The third encoding submodule 4223 may be specifically configured to encode the character element on a glyph similarity dimension according to a similar character representation corresponding to the character element, so as to form a graphic vector of the character element.

[0166] In specific application scenarios, such as Figure 7 As shown, the encoding module 422 also includes:

[0167] The fourth encoding submodule 4224 may be used to encode each character element in the traditional and simplified deformation dimension according to whether each character element has traditional and simplified forms, so as to obtain the traditional and simplified vector of the character element;

[0168] The splicing module 423 may be specifically configured to splice the traditional and simplified Chinese vector into the phonetic and graphic code vector of the character element according to a preset splicing order.

[0169] In specific application scenarios, such as Figure 7 As shown, the encoding module 422 also includes:

[0170] The fifth encoding submodule 4225 may be used to encode each character element on the symbol deformation dimension according to whether each character element contains a special symbol, so as to form a symbol vector of the character element;

[0171] The splicing module 423 may be specifically configured to splice the symbol vector into the phonetic code vector of the character element according to a preset splicing order.

[0172] In specific application scenarios, such as Figure 7 As shown, the recognition model includes multiple layers of networks with different processing functions, and the recognition unit 43 includes:

[0173] The transformation module 431 may be used to perform nonlinear transformation on the phonetic-graphic code vector of the character element using the first layer network of the recognition model to obtain an intermediate semantic vector of the phonetic-graphic code vector;

[0174] The extraction module 432 may be used to extract the mapping relationship between the output and input of the sound-shape code vector at different time states by using the second layer network of the recognition model to obtain a self-attention weight parameter;

[0175] The weighting module 433 can be used to use the third layer network of the recognition model combined with the self-attention weight parameter to perform weighted summation on the intermediate semantic vector to obtain the original text mapped to the text to be recognized.

[0176] It should be noted that for other corresponding descriptions of the functional units involved in the text recognition device applicable to the server side provided in this embodiment, please refer to Figure 1 and Figure 2 The corresponding description in will not be repeated here.

[0177] Further, as Figure 5 The specific implementation of the method, the embodiment of the present application provides a text recognition device, such as Figure 8 As shown, the device includes: a receiving unit 51, a sending unit 52, and an intercepting unit 53.

[0178] The receiving unit 51 may be configured to receive the text to be recognized uploaded by the platform in response to the interactive instruction trigger of the text recognition;

[0179] The sending unit 52 can be used to send the text to be recognized to the server, so that the server performs encoding processing on the multiple character elements formed by character-level segmentation of the text to be recognized, obtains the phonetic code vector of the character element, and uses the pre-built recognition model to perform semantic translation on the deformation information in the phonetic code vector of the character element, and determines whether the original text mapped by the text to be recognized contains abnormal information;

[0180] The interception unit 53 may be used to display whether the original text mapped to the to-be-recognized text contains abnormal information, and to intercept the original text containing abnormal information.

[0181] Based on the above Figure 1-Figure 2 , Figure 5 The method shown in the embodiment of the present application accordingly provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned Figure 1-Figure 2 , Figure 5 The text recognition method shown;

[0182] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0183] Based on the above Figure 1-Figure 2 The method shown, and Figure 6-Figure 7 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a server-side entity device, which can be a computer, a server, or other network devices, etc. The entity device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1-Figure 2 The text recognition method shown.

[0184] Based on the above Figure 5 The method shown, and Figure 8 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides a client entity device, which can be a computer, a smart phone, a tablet computer, a smart watch, or a network device, etc. The entity device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 5 The text recognition method shown.

[0185] Optionally, both of the above-mentioned physical devices may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0186] Those skilled in the art will appreciate that the physical device structure for text recognition provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0187] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device for the store search information processing, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the physical device for information processing.

[0188] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of the present application, compared with the current existing methods, the present application inputs the phonetic code vector of the glyph element into a pre-built recognition model. The recognition model has the function of semantically translating the deformation information in the phonetic code vector. If there is deformation information in the text to be recognized, the text to be recognized can be translated into the original text, and the pre-built sensitive word library is further used to determine whether the original text mapped by the text to be recognized contains abnormal information. On the basis of encoding the text at the level of similarity in shape and sound, the abnormal information can be identified by combining the machine model method, ensuring the accuracy of the recognition result while improving the flexibility of abnormal information identification.

[0189] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0190] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A text recognition method, characterized in that: include: Obtain multiple character elements formed by character-level segmentation of the text to be recognized; Performing encoding processing on each character element to form a sound-shape code vector of the character element, specifically including: obtaining deformation description features of the character element mapping; Using the text representation of each character element, semantically encode each character element to obtain a word vector of the character element; using the phonetic result and glyph structure of each character element, extract the sound-shape combination form of the character element, the sound-shape combination includes various combination forms formed by processing the character element on the phonetic result and glyph structure; according to the various combination forms formed by processing the character element on the phonetic result and glyph structure, encode and combine the character element on the sound change dimension and the shape change dimension to obtain the sound-shape vector of the character element; using the image pixel representation of each character element, encode the character element on the glyph similarity dimension to form a graphic vector of the character element; according to a preset splicing order, splice the word vector of the character element, the sound-shape vector of the character element, and the graphic vector of the character element to form a sound-shape code vector of the character element; Inputting the phonetic-graphic code vector of the character element into a pre-built recognition model to obtain the original text mapped to the text to be recognized, wherein the recognition model has the function of semantically translating the deformation information in the phonetic-graphic code vector; Using the pre-built sensitive word library, it is determined whether the original text of the to-be-recognized text mapping contains abnormal information.

2. The method according to claim 1, characterized in that The step of obtaining the deformation description feature of the character element mapping specifically includes: Using the deformation recognition algorithm pre-set for sensitive words, various deformation patterns of sensitive words in application scenarios are extracted; According to various deformation modes of the sensitive words in the application scenario, deformation description features of character element mapping are obtained.

3. The method according to claim 1, characterized in that The step of encoding the character element on a glyph similarity dimension using the image pixel representation of each character element to form a graphic vector of the character element specifically includes: Perform pixel marking on each character element to generate a character image of a preset size, wherein the character image includes pixel points formed by the character elements; The character elements in the character image are encoded on a glyph similarity dimension using pixel points formed by the character elements to form a graphic vector of the character elements.

4. The method according to claim 3, characterized in that The step of encoding the character elements in the character image on a glyph similarity dimension using the pixel points formed by the character elements to form a graphic vector of the character elements specifically includes: Performing similarity analysis on the character elements using the pixel points formed by the character elements in the character image to obtain similar character representations corresponding to the character elements; The character element is encoded on a glyph similarity dimension according to similar character representations corresponding to the character element to form a graphic vector of the character element.

5. A text recognition method, characterized in that: include: In response to the interactive instruction trigger of text recognition, receiving the text to be recognized uploaded by the platform; The text to be recognized is sent to a server, so that the server performs encoding processing on a plurality of character elements formed by character-level segmentation of the text to be recognized, obtains a phonetic-graphic code vector of the character element, and uses a pre-built recognition model to perform semantic translation on deformation information in the phonetic-graphic code vector of the character element, and determines whether the original text mapped by the text to be recognized contains abnormal information, wherein the encoding processing process is to obtain deformation description features of the character element mapping; Using the text representation of each character element, semantically encode each character element to obtain a word vector of the character element; using the phonetic result and glyph structure of each character element, extract the sound-shape combination form of the character element, the sound-shape combination includes various combination forms formed by processing the character element on the phonetic result and glyph structure; according to the various combination forms formed by processing the character element on the phonetic result and glyph structure, encode and combine the character element on the sound change dimension and the shape change dimension to obtain the sound-shape vector of the character element; using the image pixel representation of each character element, encode the character element on the glyph similarity dimension to form a graphic vector of the character element; according to a preset splicing order, splice the word vector of the character element, the sound-shape vector of the character element, and the graphic vector of the character element to form a sound-shape code vector of the character element; Display whether the original text mapped to the text to be recognized contains abnormal information, and intercept and process the original text containing abnormal information.

6. A text recognition device, characterized in that: include: An acquisition unit, used for acquiring a plurality of character elements formed by character-level segmentation of the text to be recognized; The encoding unit is used to perform encoding processing on each character element to form a sound-shape code vector of the character element, specifically including: obtaining deformation description features of character element mapping; using the text representation of each character element to semantically encode each character element to obtain a word vector of the character element; using the phonetic result and glyph structure of each character element to extract the sound-shape combination form of the character element, the sound-shape combination includes various combination forms formed by processing the character element on the phonetic result and glyph structure; according to the various combination forms formed by processing the character element on the phonetic result and glyph structure, the character element is encoded and combined in the sound change dimension and the shape change dimension to obtain the sound-shape vector of the character element; using the image pixel representation of each character element to encode the character element in the glyph similarity dimension to form a graphic vector of the character element; according to a preset splicing order, the word vector of the character element, the sound-shape vector of the character element, and the graphic vector of the character element are spliced ​​to form the sound-shape code vector of the character element; A recognition unit, used for inputting the phonetic-graphic code vector of the character element into a pre-built recognition model to obtain the original text mapped to the text to be recognized, wherein the recognition model has the function of semantically translating the deformation information in the phonetic-graphic code vector; The determination unit is used to determine whether the original text mapped to the text to be identified contains abnormal information by using a pre-built sensitive word library.

7. A text recognition device, characterized in that: include: A receiving unit, configured to receive the text to be recognized uploaded by the platform in response to the interactive instruction trigger of the text recognition; A sending unit, used to send the text to be recognized to a server, so that the server performs encoding processing on a plurality of character elements formed by character-level segmentation of the text to be recognized, obtains a phonetic code vector of the character element, and uses a pre-built recognition model to perform semantic translation on deformation information in the phonetic code vector of the character element, and determines whether the original text mapped by the text to be recognized contains abnormal information, wherein the encoding processing process is to obtain deformation description features of the character element mapping; Using the text representation of each character element, semantically encode each character element to obtain a word vector of the character element; using the phonetic result and glyph structure of each character element, extract the sound-shape combination form of the character element, the sound-shape combination includes various combination forms formed by processing the character element on the phonetic result and glyph structure; according to the various combination forms formed by processing the character element on the phonetic result and glyph structure, encode and combine the character element on the sound change dimension and the shape change dimension to obtain the sound-shape vector of the character element; using the image pixel representation of each character element, encode the character element on the glyph similarity dimension to form a graphic vector of the character element; according to a preset splicing order, splice the word vector of the character element, the sound-shape vector of the character element, and the graphic vector of the character element to form a sound-shape code vector of the character element; The interception unit is used to display whether the original text mapped to the text to be recognized contains abnormal information, and intercept the original text containing abnormal information.