Method and device for constructing text information analysis model, analysis method and model
By constructing a text information analysis model, using feature extraction networks and sequence modeling networks, the fine-grained features of the text are identified, and the problem of limited recognition accuracy in the existing technology is solved, achieving higher recognition accuracy and better interpretability.
Patent Information
- Application Number
- CN202311325144.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-10-13
AI Technical Summary
Existing text recognition technology cannot effectively identify the fine-grained features of text, such as strokes, radicals, radicals, etc., resulting in limited recognition accuracy and inability to output the reasons for text errors, and requires manual inspection of errors.
By constructing a text information analysis model, including feature extraction networks and sequence modeling networks, using cross-entropy functions to train the network, using a larger-scale convolution kernel and a higher-dimensional matrix than a vector, to identify the sequence information in the image information.
It realizes fine-grained recognition of text information, increases the interpretability of text information analysis results, improves recognition accuracy, and reduces the need for manual troubleshooting of errors.
Smart Images

Figure CN117315675B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a text information recognition model and a training method thereof. Background Art
[0002] The concept of text information analysis technology was first proposed by German scientist Tausheck in 1929. It usually refers to the use of computers, optics and other technologies to detect text in images and then identify the text content in the image. This is one of the most important branches in the field of computer vision research. After nearly a hundred years of development, Optical Character Recognition (OCR) has achieved good results in document recognition, road sign recognition, license plate recognition, industrial number recognition and other fields. At present, text information analysis has also been widely used in medical, education, industry and other industries. It integrates theoretical knowledge of digital image processing, computer graphics and artificial intelligence, and is increasingly becoming the focus of attention in the field of artificial intelligence.
[0003] Patent CN112257719A discloses a text recognition method, which acquires a text database, establishes a text recognition model based on the text database; acquires and sends a text image to be recognized; divides the text image to be recognized into regions to obtain one or more text recognition region images; imports each text recognition region image into the text recognition model in turn for text recognition, generates and sends one or more text recognition results; generates and sends a text recognition report based on the text recognition results. The lowest unit of this recognition is a single character, and it is impossible to further subdivide the character, such as the strokes, radicals, and other more detailed information of the character. When correcting the text, it is still necessary to manually check the wrong text, and the cause of the text error cannot be output.
[0004] Patent CN113221885A discloses a hierarchical modeling method based on whole characters and radicals, which combines convolutional neural networks, recurrent neural networks and confidence score fusion strategies, respectively calculates the confidence of the decoding result of the whole character and the confidence of the decoding result of each radical, and fuses them to obtain the final recognition result of the whole character. The feature extraction of this solution is low in dimensionality and has limited recognition accuracy, which is not conducive to the development of text information analysis.
[0005] Based on the above, this application provides a technical solution to solve the above technical problems. Summary of the invention
[0006] The present invention provides a method for constructing a text information analysis model, comprising the following steps:
[0007] Step S1: Obtain the text to be recognized;
[0008] Step S2: inputting the text to be recognized into a feature extraction network to obtain a feature matrix;
[0009] Step S3: Encoding the feature matrix to obtain a coded feature matrix;
[0010] Step S4: inputting the encoding feature matrix into the sequence modeling network, outputting the text sequence data, and inputting the sample sequence data into the sequence modeling network;
[0011] Step S5: Train the feature extraction network and the sequence modeling network until the feature extraction network and the sequence modeling network reach a convergence state.
[0012] In a specific embodiment of the present invention, the feature matrix in step S2 is a visual tensor, expressed as (b, c, h, w); the encoded feature matrix in step S3 is an encoded visual tensor, expressed as (b, h*w, c); wherein b represents the number of the tensor, c represents the number of channels of the tensor, and h and w represent the width and height of the tensor, respectively.
[0013] In a specific embodiment of the present invention, the encoded feature matrix is input into the sequence modeling network and at the same time, the encoded feature matrix is input into the auxiliary module; the auxiliary module is a classifier structure network in a fully connected mode; the feature extraction network includes: a convolution layer, a normalization layer, an activation layer, and a downsampling layer; the sequence modeling network consists of a multi-layer transformer stacking structure, including: a self-attention module, a cross-attention module, and a forward algorithm module; wherein the convolution layer is a 15*15 large-scale convolution layer.
[0014] In a specific embodiment of the present invention, a cross entropy function is used to calculate the difference between the text sequence data and the sample sequence data. When the value of the cross entropy function no longer decreases, the feature extraction network and the sequence modeling network reach a convergence state.
[0015] In a specific embodiment of the present invention, the cross entropy function is:
[0016]
[0017] in, is the output of the sequence modeling network construction process;
[0018] is the sample sequence data;
[0019] N represents the amount of sample data in a batch during the construction process;
[0020] C is the number of unique sequence characters in the entire data set;
[0021] is the probability that the nth sample is identified as the cth category;
[0022] is the value of the cth category of the nth sample.
[0023] In a specific implementation of the present invention, the text sequence data in step S4 is expressed as: <structure_1+position information_1+(strokes of structure_1)+structure_2+position information 2+(stroke information of structure 2)+<…> >.
[0024] The present invention also provides a device for constructing a text information analysis model, comprising at least:
[0025] An acquisition module is configured to acquire an image to be recognized;
[0026] A feature extraction network module is configured to receive an image to be identified and output a feature matrix;
[0027] The encoding module is configured to perform encoding processing on the feature matrix and output an encoded feature matrix;
[0028] A sequence modeling network module is configured to receive a coding feature matrix and a sample sequence and output sequence data;
[0029] The training module is configured to train the feature extraction network and the sequence modeling network until the feature extraction network and the sequence modeling network reach a convergence state.
[0030] The present invention also provides a text information analysis method, characterized in that it comprises at least the following steps:
[0031] Step A1: Obtain an image to be recognized;
[0032] Step A2: inputting the image to be identified into a feature extraction network to obtain a feature matrix;
[0033] Step A3: Encoding the feature matrix to obtain a coded feature matrix;
[0034] Step A4: input the encoding feature matrix into the sequence modeling network, and output the current text sequence data;
[0035] Among them, the feature extraction network and the sequence modeling network are constructed by the construction method of the aforementioned text information analysis model.
[0036] In a specific embodiment of the present invention, step A4 further includes: the encoding feature matrix and an empty sequence are simultaneously input into the sequence modeling network, and the empty sequence only includes start information.
[0037] The present invention also provides a text information analysis model, characterized in that it at least includes:
[0038] An acquisition module is configured to acquire an image to be recognized;
[0039] A feature extraction network module is configured to receive an image to be identified and output a feature matrix;
[0040] The encoding module is configured to perform encoding processing on the feature matrix and output an encoded feature matrix;
[0041] A sequence modeling network module is configured to receive the encoding feature matrix and output the current text sequence data;
[0042] The feature extraction network and the sequence modeling network are constructed by the aforementioned text information analysis model construction method.
[0043] The text information analysis method provided by the present invention converts the text information into a feature matrix first, and encodes the feature matrix to form a coding feature matrix. The sequence model will continuously identify the sequence information in the image information according to the received coding feature matrix, such as the strokes, radicals, radicals, structure and other information of the font. The method for constructing the text information analysis model provided by the present invention trains the feature extraction network and the sequence modeling network through the cross entropy function, and adopts a larger-scale convolution kernel with a matrix with a higher dimensionality than the vector, so that the neural network can learn more fine-grained features, thereby increasing the interpretability of the text information analysis results. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and their implementation methods.
[0045] Figure 1 It is a flowchart of the method for constructing a text information analysis model;
[0046] Figure 2 This is a schematic diagram of the structure of the feature extraction network and the sequence modeling network;
[0047] Figure 3 is a schematic diagram of a stroke set;
[0048] Figure 4 A schematic diagram of the device structure for constructing a text information analysis model;
[0049] Figure 5 It is a flowchart of the text information analysis method;
[0050] Figure 6 Schematic diagram of the text information analysis model structure. DETAILED DESCRIPTION
[0051] Various aspects of the present invention are described in further detail below.
[0052] Unless otherwise defined or indicated, all professional and scientific terms used herein have the same meanings as those familiar to those skilled in the art. In addition, any methods and materials similar or equivalent to those described herein can be applied to the present invention.
[0053] The following is an explanation of the terms.
[0054] Unless otherwise clearly specified and limited, the "or" mentioned in the present invention includes the relationship of "and". The "and" is equivalent to the Boolean logic operator "AND", the "or" is equivalent to the Boolean logic operator "OR", and "AND" is a subset of "OR".
[0055] It is to be understood that although the terms "first", "second", etc. may be used herein to describe different elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. Therefore, the first element may be referred to as the second element without departing from the teachings of the present invention.
[0056] In the present invention, the terms "comprising", "including" or "comprising" indicate that various components can be applied together in the mixture or composition of the present invention. Therefore, the term "consisting mainly of..." is included in the terms "comprising", "including" or "comprising".
[0057] Unless otherwise clearly specified and limited, the terms "connected", "connected" and "connection" in the present invention should be understood in a broad sense, for example, it can be a fixed connection, or it can be connected through an intermediary medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0058] For example, if an element (or component) is referred to as being on, coupled to, or connected to another element, the element may be directly formed on, coupled to, or connected to the other element, or there may be one or more intervening elements between them. In contrast, if the expressions "directly on," "directly coupled to," and "directly connected to" are used herein, then no intervening elements are indicated. Other words used to describe the relationship between elements should be similarly interpreted, such as "between" and "directly between," "attached" and "directly attached," "adjacent" and "directly adjacent," etc.
[0059] It should also be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the drawings. The words "inner" and "outer" used refer to directions toward or away from the geometric center of a particular component, respectively. It can be understood that these terms are used here to describe the relationship of one element, layer or region relative to another element, layer or region as shown in the drawings. In addition to the orientations described in the drawings, these terms should also include other orientations of the device.
[0060] Other aspects of the present invention will be apparent to those skilled in the art in view of the disclosure herein.
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0062] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation. The type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated. For example, the thickness of the components in the drawings may be exaggerated for the sake of clarity. Embodiment 1
[0063] In view of the technical gap in the prior art for fine-grained text recognition, the present invention proposes a method for constructing a text information analysis model. The above method can enable the neural network to learn more fine-grained features, thereby increasing the interpretability of the text information analysis results.
[0064] See attached Figure 1 , a method for constructing a text information analysis model includes:
[0065] Step S1: Obtain the text to be recognized.
[0066] The text to be recognized may be a picture with only a few Chinese characters, or may be a picture with text in a partial area, which is not limited in the present invention.
[0067] Step S2: Input the text to be recognized into a feature extraction network to obtain a feature matrix.
[0068] In an optional embodiment, the feature extraction network includes mutually stacked convolution layers, normalization layers, activation layers, and pooling layers for extracting text features.
[0069] In an optional embodiment, the convolution layer uses a large-scale convolution kernel of 15*15.
[0070] Specifically, in a convolutional network, the receptive field is the size of the area where the pixels on the feature map output by each layer of the convolutional neural network are mapped on the input image. It can increase the analysis performance of high-dimensional features. In the field of image recognition, most neural networks use 3x3 convolutional convolutional neural networks, but for font data, a larger receptive field is required to capture high-dimensional features in complex structures and increase the interpretability of text analysis results. However, if the convolution kernel is too large, the computational difficulty will increase exponentially, so a certain trade-off is needed, such as choosing a convolution kernel with a scale of 15*15.
[0071] In an optional embodiment, the feature matrix is a visual feature tensor, represented as (b, c, h, w).
[0072] Among them, b represents the number of tensors, c represents the number of channels of the tensor, and h and w represent the width and height of the tensor respectively.
[0073] Step S3: Encoding the feature matrix to obtain a coded feature matrix;
[0074] In an optional embodiment, the encoding process is to transform the shape of the visual feature tensor by encoding to obtain an encoded visual tensor, which is expressed as (b, h*w, c).
[0075] Step S4: inputting the encoding feature matrix into the sequence modeling network, outputting the text sequence data, and inputting the sample sequence data into the sequence modeling network;
[0076] In an optional embodiment, see the attached Figure 2 The sequence modeling network consists of a multi-layer transformer stack structure, including: self-attention module (Self-Attention), cross-attention module (Cross-Attention), forward algorithm module (Forward Mode), which is used to model text.
[0077] In an optional embodiment, the encoding feature matrix is input into the sequence modeling network and at the same time, the encoding feature matrix is input into an auxiliary module. The auxiliary module is a classifier structure network in a fully connected mode, which is used to assist in training the visual neural network.
[0078] Step S5: Train the feature extraction network and the sequence modeling network until they reach a convergence state.
[0079] In an optional embodiment, in the method for constructing the text information analysis model, before step S1, it further includes a data preparation step S0, which specifically includes:
[0080] Step S0: Each Chinese character structure can be split into a set composed of several strokes, and then the strokes are grouped according to the radicals of the Chinese characters. According to the writing habits and cultural inheritance of Chinese characters, after statistically sorting out the Chinese characters included in GB18030-2005, a stroke set composed of 26 strokes is obtained, and each stroke is represented by the corresponding 26 letters, as shown in the appendix Figure 3 (Reference source: http: / / www.hanzi5.com / bishun / 5c71.html).
[0081] A Chinese character information can be split into the following sequence representation: <Structure_1 + Position information_1 + (Strokes of Structure_1) + Structure_2 + Position information 2 + (Stroke information of Structure 2) + <…> >.
[0082] For example, taking the Chinese character "厘" as an example, the upper left part of this character is a "厂", and "厂" is composed of the strokes "j" and "s"; the lower right part is a "里", and further decomposing "里", its upper half is a "田", and the lower half is a "土". "田" is composed of the strokes "f", "c", "j", "f", "j", and "土" is composed of "j", "f", "j". Therefore, the Chinese character "厘" is decomposed into the sequence: 厘<LU_厂(js)RD_里<U_田(fcjfj)D_土(jfj)>>. Among them, the content between < > represents a complete Chinese character structure.
[0083] It should be understood that if the character "厘" appears in the image to be recognized, the text sequence data output by the sequence modeling network is "<LU_厂(js)RD_里<U_田(fcjfj)D_土(jfj)>>".
[0084] The text sequence representation method proposed by the present invention can clearly represent Chinese characters based on strokes and adapt to all Chinese characters. Refer to the appendix Figure 3 , in the text sequence representation method, 26 strokes are made to correspond one by one with 26 letters to simply represent each stroke, which is simpler and more direct than the Wubi representation method, is beneficial for users to understand the sequence meaning, reduces the calculation difficulty at the same time, is also beneficial for the neural network to learn more fine-grained text features, accelerates the convergence of the neural network, improves the recognition effect, and is also beneficial for the subsequent transmission and storage of sequence data.
[0085] The present invention takes "centi" as an example. Any addition, deletion or modification in any form should be included in the gist of the present invention as long as it does not limit the purpose of the present invention.
[0086] In an optional embodiment, a cross entropy function is used to calculate the difference between the text sequence data and the sample sequence data, and the cross entropy function is expressed as:
[0087]
[0088] in, is the output of the sequence modeling network during training;
[0089] is the sample sequence data;
[0090] N represents the amount of sample data in a batch during training;
[0091] C is the number of unique sequence characters contained in the entire data set;
[0092] is the probability that the nth sample is identified as the cth category;
[0093] is the value of the cth category of the nth true sample.
[0094] When the value of the cross entropy function no longer decreases, the feature extraction network and the sequence modeling network reach a convergence state.
[0095] The present invention uses strokes as the smallest unit of character decomposition and adopts a more fine-grained measurement, thereby increasing the recognition of local information, accelerating the convergence of the neural network, and improving the recognition effect.
[0096] In an optional embodiment, the cross entropy function is also the loss function of the auxiliary module. When the value of the cross entropy function no longer decreases, the auxiliary module also reaches a convergence state. Embodiment 2
[0097] See attached Figure 4 , which is a schematic diagram of the structure of a text information analysis model building device according to another specific embodiment of the present invention.
[0098] The text information analysis model building device at least includes the following structure:
[0099] An acquisition module is configured to acquire an image to be recognized;
[0100] A feature extraction network module is configured to receive an image to be identified and output a feature matrix;
[0101] The encoding module is configured to perform encoding processing on the feature matrix and output an encoded feature matrix;
[0102] A sequence modeling network module is configured to receive a coding feature matrix and a sample sequence and output sequence data;
[0103] The training module is configured to train the feature extraction network and the sequence modeling network until the feature extraction network and the sequence modeling network reach a convergence state.
[0104] It should be understood that the structures of the feature extraction network module and the sequence modeling network module in this embodiment are the same as those of the feature extraction network and the sequence modeling network in Example 1; the feature matrix, the encoding feature matrix, the text sequence data representation method, the training method and the neural network convergence conditions are consistent with those in Example 1. In addition, this embodiment also includes an auxiliary module for assisting neural network training, and the structure is the same as that of the auxiliary module in Example 1. Embodiment 3
[0105] See attached Figure 5 , which is another specific embodiment of the text information analysis method of the present invention, at least comprises the following steps:
[0106] Step A1: Obtain an image to be recognized;
[0107] Step A2: inputting the image to be identified into a feature extraction network to obtain a feature matrix;
[0108] Step A3: Encoding the feature matrix to obtain a coded feature matrix;
[0109] Step A4: Input the encoding feature matrix into the sequence modeling network and output the current text sequence data.
[0110] In a preferred embodiment, step A4 further comprises: the encoding feature matrix and an empty sequence are simultaneously input into the sequence modeling network, and the empty sequence only comprises start information.
[0111] Specifically, an empty sequence can be represented as: <bos>____________________________.
[0112] The above empty sequence representation method is only an example, including but not limited to other representation methods. Any addition or deletion in any form should be included in the gist of the present invention as long as it does not limit the purpose of the present invention.
[0113] Among them, the feature extraction network and sequence modeling network in this embodiment are constructed by the construction method of Example 1. Therefore, the feature extraction network, sequence modeling network, feature matrix, and encoding feature matrix in this embodiment are the same as those in Example 1, and the current text sequence data is consistent with the text sequence data format in Example 1. Embodiment 4
[0114] See attached Figure 6 , which is another specific embodiment of the text information analysis model of the present invention, at least includes the following structure:
[0115] An acquisition module is configured to acquire an image to be recognized;
[0116] A feature extraction network module is configured to receive an image to be identified and output a feature matrix;
[0117] The encoding module is configured to perform encoding processing on the feature matrix and output an encoded feature matrix;
[0118] The sequence modeling network module is configured to receive the encoding feature matrix and output the current text sequence data.
[0119] Among them, the feature extraction network module and the sequence modeling network module in this embodiment are constructed by the construction method of Example 1. Therefore, the feature extraction network, sequence modeling network, feature matrix, and encoding feature matrix in this embodiment are the same as those in Example 1, and the current text sequence data is consistent with the text sequence data format in Example 1.
[0120] In summary, the present invention has achieved the following effects:
[0121] The text information analysis method provided by the present invention converts the text information into a feature matrix first, and encodes the feature matrix to form a coding feature matrix. The sequence model will continuously identify the sequence information in the image information according to the received coding feature matrix, such as the strokes, radicals, radicals, structure and other information of the font. The method for constructing the text information analysis model provided by the present invention trains the feature extraction network and the sequence modeling network through the cross entropy function, and adopts a larger-scale convolution kernel with a matrix with a higher dimensionality than the vector, so that the neural network can learn more fine-grained features, thereby increasing the interpretability of the text information analysis results.
[0122] Based on this application, it should be understood by those skilled in the art that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0123] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, it is entirely possible to realize the same functions in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.
[0124] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
[0125] All documents mentioned in the present invention are cited as references in this application, just as each document is cited as reference separately. In addition, it should be understood that after reading the above content of the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the claims attached to this application.< / bos>
Claims
1. A method for constructing a text information analysis model, characterized in that: At least the following steps are included: Step S1: Obtain the text to be recognized; Step S2: inputting the text to be recognized into a feature extraction network to obtain a visual tensor, wherein the visual tensor is represented as (b, c, h, w); Step S3: encoding the visual tensor to obtain an encoded visual tensor, wherein the encoded visual tensor is represented by (b, h*w, c), where b represents the number of the tensor, c represents the number of channels of the tensor, and h and w represent the width and height of the tensor respectively; Step S4: inputting the encoded visual tensor and sample sequence data into a sequence modeling network, and outputting text sequence data; Step S5: training the feature extraction network and the sequence modeling network until the feature extraction network and the sequence modeling network reach a convergence state; The sequence modeling network consists of a multi-layer transformer stack structure, including: self-attention module, cross-attention module, and forward algorithm module; The text sequence data is expressed as: <structure_1+position information_1+(strokes of structure_1)+structure_2+position information 2+(stroke information of structure 2)+<…> >.
2. The method for constructing a text information analysis model according to claim 1, characterized in that: Also includes: While inputting the encoding feature matrix into the sequence modeling network, the encoding feature matrix is input into the auxiliary module; The auxiliary module is a classifier structure network in a fully connected mode; The feature extraction network includes: convolution layer, normalization layer, activation layer, and downsampling layer; Among them, the convolution layer is a 15*15 large-scale convolution layer.
3. The method for constructing a text information analysis model according to claim 2, characterized in that: Also includes: The cross entropy function is used to calculate the difference between the text sequence data and the sample sequence data. When the value of the cross entropy function no longer decreases, the feature extraction network and the sequence modeling network reach a convergence state.
4. The method for constructing a text information analysis model according to claim 3, characterized in that: The cross entropy function is: ; in, is the output of the sequence modeling network construction process; is the sample sequence data; N represents the amount of sample data in a batch during the construction process; C is the number of unique sequence characters in the entire data set; is the probability that the nth sample is identified as the cth category; is the value of the cth category of the nth sample.
5. A device for constructing a text information analysis model, characterized in that: At least: An acquisition module, configured to acquire text to be recognized; A feature extraction network module is configured to receive the text to be recognized and output a visual tensor, wherein the visual tensor is represented as (b, c, h, w); The encoding module is configured to encode the visual tensor and output an encoded visual tensor, wherein the encoded visual tensor is represented by (b, h*w, c), where b represents the number of the tensor, c represents the number of channels of the tensor, and h and w represent the width and height of the tensor respectively; A sequence modeling network module is configured to receive the encoded visual tensor and the sample sequence and output text sequence data; A training module is configured to train the feature extraction network and the sequence modeling network until the feature extraction network and the sequence modeling network reach a convergence state; The sequence modeling network consists of a multi-layer transformer stack structure, including: self-attention module, cross-attention module, and forward algorithm module; The text sequence data is expressed as: <structure_1+position information_1+(strokes of structure_1)+structure_2+position information 2+(stroke information of structure 2)+<…> >.
6. A text information analysis method, characterized in that: At least the following steps are included: Step A1: Obtain the text to be recognized; Step A2: inputting the text to be recognized into a feature extraction network to obtain a visual tensor; Step A3: encoding the visual tensor to obtain an encoded visual tensor; Step A4: inputting the encoded visual tensor into a sequence modeling network, and outputting current text sequence data; Among them, the feature extraction network and the sequence modeling network are constructed by the method for constructing the text information analysis model described in any one of claims 2-4.
7. The text information analysis method according to claim 6, characterized in that: Step A4 further includes: The encoding feature matrix and an empty sequence are simultaneously input into a sequence modeling network, wherein the empty sequence only includes start information.
8. A text information analysis device, characterized in that: At least: An acquisition module, configured to acquire text to be recognized; A feature extraction network module is configured to receive text to be recognized and output a visual tensor; The encoding module is configured to encode the visual tensor and output the encoded visual tensor; A sequence modeling network module is configured to receive the encoded visual tensor and output the current text sequence data; Wherein, the feature extraction network module and the sequence modeling network module are constructed by the method for constructing a text information analysis model according to any one of claims 1-4.
Citation Information
Patent Citations
Character recognition method and system and storage medium
CN112257719A
Hierarchical modeling method and system based on whole character and radicals
CN113221885A
Neural machine translation method integrating pushing network and character coding
CN113392656A
Character recognition method and device, equipment and storage medium
CN113792741A