Text structured processing method, processing device, electronic device and storage medium
By combining text detection, recognition and classification, semantic categories are extracted, which solves the problem of difficulty in category recognition and low accuracy in text image structured processing, and improves the accuracy of text structured processing.
Patent Information
- Application Number
- CN202110921811.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-08-11
AI Technical Summary
In the structured processing of text images, the existing technology faces the problems of large layout changes and small visual differences, which leads to difficulty in category recognition and low accuracy, especially when the positional relationship between keyword categories and numerical categories is not fixed. When, the robustness is poor.
Combining text detection, text recognition and text classification, the text detection algorithm obtains category information, the text recognition algorithm obtains the recognition results, and uses the text classification model to extract semantic categories, generate text structured results, and improve accuracy.
By using the semantic information of the text itself for category recognition, the accuracy and practicality of text structuring is improved, and the problem of large format changes and small visual differences is solved.
Smart Images

Figure CN113627439B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of computer vision and deep learning technology, and can be applied to scenarios such as OCR optical character recognition, and specifically to a text structured processing method, a processing device, an electronic device, and a storage medium. Background Art
[0002] With the continuous development and popularization of information technology, all walks of life have widely used information technology to improve efficiency, thus generating a large amount of text data. These text data may contain more structured information. Obtaining this structured information will help provide assistance for in-depth applications based on text data. Summary of the invention
[0003] The present disclosure provides a text structured processing method, a processing device, an electronic device and a storage medium.
[0004] According to one aspect of the present disclosure, a text structuring processing method is provided, comprising: performing text detection on a text image to obtain category information of at least one text detection box corresponding to the text image, wherein the category information includes a keyword category or a numerical category; determining a text image corresponding to a target text detection box in the at least one text detection box, wherein the target text detection box is a text detection box whose category information is the numerical category; performing text recognition on the text image corresponding to the target text detection box to obtain a text recognition result of the text image corresponding to the target text detection box; performing text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result; and generating a text structuring result, wherein the text structuring result includes a value corresponding to the keyword category and a value corresponding to the numerical category, the value corresponding to the keyword category includes the semantic category result, and the value corresponding to the numerical category includes the text recognition result.
[0005] According to another aspect of the present disclosure, a text structuring processing device is provided, including: a text detection module, used to perform text detection on a text image, and obtain category information of at least one text detection box corresponding to the above text image, wherein the above category information includes a keyword category or a numerical category; a determination module, used to determine a text image corresponding to a target text detection box in the above at least one text detection box, wherein the above target text detection box is a text detection box whose category information is the above numerical category; a text recognition module, used to perform text recognition on the text image corresponding to the above target text detection box, and obtain a text recognition result of the text image corresponding to the above target text detection box; a text classification module, used to perform text classification on the above text recognition result, and obtain a semantic category result corresponding to the above text recognition result; and a generation module, used to generate a text structuring result, wherein the above text structuring result includes a value corresponding to the above keyword category and a value corresponding to the above numerical category, the value corresponding to the above keyword category includes the above semantic category result, and the value corresponding to the above numerical category includes the above text recognition result.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above method.
[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program implements the above method when executed by a processor.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 An exemplary system architecture to which a text structure processing method and a processing device according to an embodiment of the present disclosure can be applied is schematically shown;
[0012] Figure 2A flowchart of a text structure processing method according to an embodiment of the present disclosure is schematically shown;
[0013] Figure 3 A schematic diagram schematically shows a text structuring process according to an embodiment of the present disclosure;
[0014] Figure 4 A block diagram schematically shows a text structuring processing device according to an embodiment of the present disclosure; and
[0015] Figure 5 A block diagram of an electronic device applicable to a text structuring processing method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0016] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0017] Text structuring can be understood as processing text content into a form including values corresponding to keyword categories and values corresponding to numerical categories. Keyword categories (i.e., Key) and numerical categories (i.e., Value) can be understood as a Key-Value. Text data can be presented in the form of an image, that is, forming a text image. The text structuring of a text image can be achieved in the following two ways.
[0018] Method 1: Use a detection algorithm to process a text image to obtain a category recognition result for a target text included in the text image, use a text recognition algorithm to process the target text to obtain a text recognition result, and obtain a text structured result for the target text based on the category recognition result and the text recognition result. The text structured result includes a value corresponding to a keyword category and a value corresponding to a numerical category, the value corresponding to the keyword category includes a category recognition result, and the value corresponding to the numerical category includes a text recognition result.
[0019] Method 2: Process the text image using a text detection algorithm to obtain the position information of the target text included in the text image, process the target text using a text recognition algorithm to obtain a text recognition result, determine the category recognition result corresponding to the target text based on the position information and the preset position relationship, and obtain the text structuring result for the target text based on the category recognition result and the text recognition result. The preset position relationship can be understood as the position relationship between the keyword category and the numerical category corresponding to the keyword category.
[0020] In the process of implementing the concept of the present disclosure, it is found that when the layout of the text image changes a lot, since the visual differences between different texts are relatively small, it is difficult to implement category recognition using the first method, and category recognition errors may occur. Since the relative positions between the keyword category and the numerical category corresponding to the keyword category in the text image are not fixed, the robustness of the second method is relatively poor. Therefore, the accuracy of text structuring using the text detection algorithm and the text recognition algorithm is not high.
[0021] In the process of implementing the concept of the present disclosure, it was found that since the target text itself contains semantic information, semantic extraction can be performed on the target text to obtain a semantic category recognition result (i.e., category recognition result) corresponding to the target text. Therefore, text classification can be combined with text detection and text recognition to achieve text structuring of text images.
[0022] To this end, the disclosed embodiment provides a text structuring processing scheme that combines text detection, text recognition and text classification, that is, using text detection and text recognition to determine the text recognition result of the text image, using text classification to determine the semantic category recognition result of the text image, and obtaining the text structuring result of the text image based on the text recognition result and the semantic category recognition result. Since the semantic information included in the text itself is used for category recognition, the accuracy of text structuring is improved.
[0023] Based on the above content, the embodiments of the present disclosure provide a text structured processing method, a processing device, an electronic device, a non-transitory computer-readable storage medium storing computer instructions, and a computer program product. The text structured processing method may include: performing text detection on a text image to obtain category information of at least one text detection box corresponding to the text image, wherein the category information includes a keyword category or a numerical category, determining a text image corresponding to a target text detection box in at least one text detection box, wherein the target text detection box is a text detection box whose category information is a numerical category; performing text recognition on the text image corresponding to the target text detection box to obtain a text recognition result of the text image corresponding to the target text detection box, performing text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result, and generating a text structured result, wherein the text structured result includes a value corresponding to the keyword category and a value corresponding to the numerical category, the value corresponding to the keyword category includes a semantic category result, and the value corresponding to the numerical category includes a text recognition result.
[0024] Figure 1 An exemplary system architecture to which the text structuring processing method and processing device according to an embodiment of the present disclosure can be applied is schematically shown.
[0025] It should be noted that Figure 1 The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, the exemplary system architecture 100 to which the text structured processing method and processing device can be applied may include a terminal device, but the terminal device may implement the text structured processing method and processing device provided by the embodiments of the present disclosure without interacting with the server.
[0026] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0027] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0028] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0029] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0030] Server 105 may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services (Virtual Private Server, VPS). Server 105 may also be an edge server. Server 105 may also be a server of a distributed system, or a server combined with a blockchain.
[0031] It should be noted that the text structure processing method provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the text structure processing apparatus provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0032] Alternatively, the text structuring processing method provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the text structuring processing device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The text structuring processing method provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the text structuring processing device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0033] For example, the server 105 performs text detection on the text image, obtains the category information of at least one text detection box corresponding to the text image, determines the text image corresponding to the target text detection box, performs text recognition on the text image corresponding to the target text detection box, obtains the text recognition result of the text image corresponding to the target text detection box, performs text classification on the text recognition result, obtains the semantic category result corresponding to the text recognition result, and generates a text structured result. Alternatively, a server or server cluster capable of communicating with the terminal devices 101, 102, 103 and / or the server 105 performs text detection on the text image, and finally generates a text structured result.
[0034] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0035] Figure 2 The flowchart of the text structuring processing method according to the embodiment of the present disclosure is schematically shown.
[0036] like Figure 2 As shown, the method 200 includes operations S210 to S250.
[0037] In operation S210, text detection is performed on the text image to obtain category information of at least one text detection box corresponding to the text image, wherein the category information includes a keyword category or a value category.
[0038] In operation S220, a text image corresponding to a target text detection frame among the at least one text detection frame is determined, wherein the target text detection frame is a text detection frame whose category information is a numerical category.
[0039] In operation S230, text recognition is performed on the text image corresponding to the target text detection frame to obtain a text recognition result of the text image corresponding to the target text detection frame.
[0040] In operation S240, text classification is performed on the text recognition result to obtain a semantic category result corresponding to the text recognition result.
[0041] In operation S250, a text structured result is generated, wherein the text structured result includes values corresponding to the keyword category and values corresponding to the numerical category, the values corresponding to the keyword category include semantic category results, and the values corresponding to the numerical category include text recognition results.
[0042] According to an embodiment of the present disclosure, a text image may refer to an image including text content. The types of text images may include multiple types, for example, a text image may include a medical text image, a commodity list text image, or a financial text image, etc. The text detection frame may include a four-corner point frame, that is, it may be represented by four coordinates. The category information of the text detection frame may include a keyword category or a numerical category, the keyword category may represent the category attribute of the text content included in the text detection frame, and the numerical category may represent the content attribute of the text content included in the text detection frame. The text recognition result of the text image corresponding to the target detection frame can be used to represent the value of the numerical category corresponding to the text image. The semantic category recognition result can be used to represent the value of the key category corresponding to the text image.
[0043] For example, a text detection box includes the text content "x 1 x 2 Central Hospital", the category information of the text detection box is a numerical category. The text content included in a text detection box is "name", the category information of the text detection box is a keyword category. The text content included in a text detection box is "Zhang San", the category information of the text detection box is a numerical category.
[0044] According to an embodiment of the present disclosure, a text detection model can be used to process a text image to obtain category information of at least one text detection box corresponding to the text image. The text detection model can be obtained by training a first preset model using a first training sample set and a first label set. The first preset model may include a deep learning model or a traditional model. The deep learning model may include a text detection model based on a candidate box, a text detection model based on segmentation, or a text detection model based on a mixture of the two. The traditional model may include a text detection model based on SWT (Stroke Width Transform) or a text detection model based on EdgeBox (i.e., edge box), etc.
[0045] According to an embodiment of the present disclosure, after obtaining a text detection frame corresponding to a text image, a text detection frame whose category information is a numerical category can be determined from at least one text detection frame according to category information, and the text detection frame whose category information is a numerical category can be determined as a target text detection frame. After determining the target text detection frame, the text image corresponding to the target text detection frame can be extracted from the text image, and then text recognition is performed on the text image corresponding to the target text detection frame. The text image corresponding to the target text detection frame can be processed using a text recognition model. The text recognition model can be obtained by training a second preset model using a second training sample set and a second label set. The second preset model may include a pattern matching model, a machine learning model, or a deep learning model. The deep learning model may include a text recognition model based on single character recognition or a text recognition model based on overall recognition.
[0046] For example, the text recognition model may be a text recognition model based on single character recognition. 1 x 2 The text image of "Central Hospital" is recognized and the result is the same as "x 1 x 2 The text recognition result corresponding to each character in "City Center Hospital" can be obtained. 1 "The corresponding text recognition mark is 2, which is the same as "x 2 The text category identification corresponding to "x" is 3, the text category identification corresponding to "city" is 4, the text category identification corresponding to "zhong" is 5, the text category identification corresponding to "xin" is 7, the text category identification corresponding to "yi" is 8, and the text category identification corresponding to "yuan" is 6. According to the mapping relationship between the character meaning and the text identification identification, the text category identification corresponding to the target text detection box is determined, including "x 1 x 2 The text recognition result of the text image of "City Center Hospital" is "x 1 x 2Central Hospital".
[0047] According to an embodiment of the present disclosure, after obtaining the text recognition result corresponding to the target text detection frame, the text recognition result can be processed using a text classification model, that is, the semantic features included in the text recognition result are extracted using the text classification model, and the semantic category result corresponding to the text recognition result is determined based on the semantic features. The text classification model can be obtained by training a third preset model using a third training sample set. The third preset model may include a machine learning model or a deep learning model. The machine learning model may include a text classification model based on a naive Bayes algorithm or a text classification model based on a decision tree.
[0048] For example, the text recognition result is "Zhang San", and the text recognition result is classified to obtain the semantic recognition result of "name".
[0049] According to an embodiment of the present disclosure, the semantic category result obtained in operation S240 and the text recognition result obtained in operation S230 may be combined into a text structured result in which the value corresponding to the keyword category is the semantic category result and the value corresponding to the numerical category is the text recognition result.
[0050] It should be noted that in the technical solution of the embodiment of the present disclosure, the acquisition of the text images, category information of the text images, text recognition results, semantic category results and text structuring results involved all comply with the provisions of relevant laws and regulations, have taken necessary confidentiality measures, and do not violate public order and good morals.
[0051] According to an embodiment of the present disclosure, text detection is performed on a text image to obtain category information of at least one text detection box corresponding to the text image, the category information including a keyword category or a numerical category, the text image corresponding to the target text detection box is determined, text recognition is performed on the text image corresponding to the target text detection box to obtain a text recognition result of the text image corresponding to the target text detection box, text classification is performed on the text recognition result to obtain a semantic category result corresponding to the text recognition result, and a text structuring result is generated, so that computer vision and language models are combined to realize category recognition using the semantic information included in the text itself, thereby improving the accuracy of text structuring.
[0052] According to an embodiment of the present disclosure, operation S240 may be performed as follows.
[0053] The text classification model is used to process the text recognition results to obtain semantic category results corresponding to the text recognition results.
[0054] According to an embodiment of the present disclosure, the text classification model may include a deep learning model or a machine learning model. The third preset model may be trained using a third training sample set and a third label set to obtain a text classification model, the third training sample set may include multiple training texts, and the third label set may include a third label corresponding to each training text.
[0055] According to an embodiment of the present disclosure, training a third preset model using a third training sample set and a third label set to obtain a text classification model may include: inputting each training text of a plurality of training texts into the third preset model to obtain a semantic category result corresponding to each training text. Inputting the semantic category result corresponding to each training text and the third label into the first loss function to obtain a first output value. According to the first output value, adjusting the model parameters of the third preset model until the first output value converges. The third preset model obtained when the first output value converges is determined as the text classification model.
[0056] According to an embodiment of the present disclosure, by processing the text recognition results with a text classification model, a semantic category result corresponding to the text recognition result is obtained, so that the semantic information contained in the text recognition result itself can be fully utilized, thereby improving the accuracy and practicality of text structured extraction.
[0057] According to an embodiment of the present disclosure, the text classification model may include a deep learning model.
[0058] According to an embodiment of the present disclosure, the deep learning model may include a text classification model based on fast text (i.e., FastText), a text classification model based on a text convolutional neural network (i.e., TextCNN), a text classification model based on a recurrent neural network (i.e., TextRNN), or a text classification model based on a dilate gated convolutional neural network (DGCNN).
[0059] According to an embodiment of the present disclosure, operation S210 may include the following operations.
[0060] Text detection is performed on the text image to obtain category information and position information of at least one text detection box corresponding to the text image.
[0061] According to an embodiment of the present disclosure, the position information corresponding to the text detection box can be used to represent the position of the text detection box on the text image. The position information can be represented by the coordinate information of the four corner point box.
[0062] According to an embodiment of the present disclosure, operation S220 may include the following operations.
[0063] A text image corresponding to the target text detection frame is extracted from the text image according to position information corresponding to the target text detection frame in the at least one text detection frame.
[0064] According to an embodiment of the present disclosure, the position information may be used as a basis for extracting a text image corresponding to a target text detection frame from a text image.
[0065] According to an embodiment of the present disclosure, extracting a text image corresponding to a target text detection box from a text image based on position information corresponding to a target text detection box in at least one text detection box may include the following operations.
[0066] The position information corresponding to the target text detection frame in the at least one text detection frame is converted into the target position information by using affine transformation. According to the target position information, the text image corresponding to the target text detection frame is extracted from the text image.
[0067] According to the embodiments of the present disclosure, an affine transformation is a linear transformation from two-dimensional coordinates to two-dimensional coordinates, which is used to maintain the "straightness" and "parallelism" of two-dimensional graphics. Straightness can be understood as a straight line is still a straight line after the transformation, without bending, and an arc is still an arc. Parallelism can be understood as keeping the relative position relationship between different two-dimensional graphics unchanged, parallel lines are still parallel lines, and the angle between intersecting lines is unchanged. Affine transformation can be achieved by at least one of translation, scaling, flipping, rotation and shearing.
[0068] According to an embodiment of the present disclosure, the position information corresponding to the target text detection box can be converted into the target position information using an affine transformation, which may include: the text detection box in the form of a four-corner point box can be converted into a text detection box in the form of a rectangular box using an affine transformation, and the position information corresponding to the text detection box in the form of a rectangular box is determined as the target position information, so that the text image corresponding to the target text detection box can be extracted from the text image according to the target position information.
[0069] For example, the target text detection box is a four-corner point box, which can be represented by {P 1 , P 2 , P 3 , P 4} characterization, P 1 The point representing the upper left corner of the four-corner point box, P 2 The point representing the upper right corner of the four-corner point box, P 3 The point representing the lower left corner of the four-corner point box, P 4 The point representing the lower right corner of the four-corner point box. 1 The coordinates of can be represented as {x 1 ,y 1}, P 2The coordinates of can be represented as {x 2 ,y 2}, P 3 The coordinates of can be represented as {x 3 ,y 3}, P 4 The coordinates of can be represented as {x 4 ,y 4}. Using affine transformation, P 1 →P′ 1 , P 2 →P′ 2 , P 3 →P′ 3 , P 4 →P′ 4 , and get the rectangular box {P′ 1 , P′ 2 , P′ 3 , P′ 4}. 1 The coordinates of ' can be represented as {x′ 1 , y′ 1}, P′ 2 The coordinates of can be represented as {x′ 2 , y′ 2}, P′ 3 The coordinates of can be represented as {x′ 3 , y′ 3}, P′ 4 The coordinates of can be represented as {x′ 4 , y′ 4}.
[0070] According to an embodiment of the present disclosure, operation S210 may include the following operations.
[0071] The text image is processed using a text detection model to obtain category information of at least one text detection box corresponding to the text image.
[0072] According to an embodiment of the present disclosure, a text detection model may include a deep learning model, and the deep learning model may include a text detection model based on a candidate box, a text detection model based on segmentation, or a text detection model based on a mixture of the two. The basic idea of implementing text detection based on a candidate box text detection model is to pre-generate multiple candidate text detection boxes, and then use non-maximum suppression to obtain category information and position information corresponding to the text detection box. The basic idea of a segmentation-based text detection model is to use a segmentation network to perform pixel-level segmentation on a text image, and then process it to obtain category information and position information corresponding to the text detection box.
[0073] According to an embodiment of the present disclosure, a first preset model can be trained using a first training sample set and a first label set to obtain a text detection model, wherein the first training sample set includes multiple training text images, and the first label set includes a first label corresponding to each training text image, wherein the first label represents real position information and real category information corresponding to at least one text detection box included in the training text image.
[0074] According to an embodiment of the present disclosure, training a first preset model using a first training sample set and a first label set to obtain a text detection model may include: inputting each of a plurality of training text images into the first preset model to obtain category information and position information corresponding to at least one text detection box included in each training text image. Inputting the category information, position information and first label corresponding to each text detection box into a second loss function to obtain a second output value. According to the second output value, adjusting the model parameters of the first preset model until the second output value converges. The first preset model obtained when the second output value converges is determined as the text detection model.
[0075] According to an embodiment of the present disclosure, operation S230 may include the following operations.
[0076] The text image corresponding to the target text detection frame is processed using the text recognition model to obtain a text recognition result of the text image corresponding to the text detection frame.
[0077] According to an embodiment of the present disclosure, a second preset model can be trained using a second training sample set and a second label set to obtain a text recognition model. The second training sample set may include multiple training text image slices, and the second label set includes a second label corresponding to each training text image slice.
[0078] According to an embodiment of the present disclosure, training a second preset model using a second training sample set and a second label set to obtain a text recognition model may include: inputting each training text image slice of a plurality of training text image slices into the second preset model to obtain a text recognition result corresponding to each training text image slice. Inputting the text recognition result and the second label corresponding to each training text image slice into a third loss function to obtain a third output value. According to the third output value, adjusting the model parameters of the second preset model until the third output value converges. The second preset model obtained when the third output value converges is determined as the text recognition model.
[0079] According to an embodiment of the present disclosure, the trained text detection model, text recognition model, and text classification model may be determined as a text structuring model.
[0080] According to an embodiment of the present disclosure, the above-mentioned text structuring processing method may further include the following operations.
[0081] The text image is obtained by data preprocessing.
[0082] According to an embodiment of the present disclosure, data preprocessing may include at least one of the following: noise reduction processing, tilt correction processing, and sharpening processing. For example, before performing text detection on a text image, for a tilted text image, the text image may be corrected by some tilt correction algorithms and then input into a text detection model for text detection.
[0083] According to the embodiments of the present disclosure, by performing data preprocessing on text images, the quality of text images can be improved, making the text structuring results more accurate and practical.
[0084] According to an embodiment of the present disclosure, the text image may include a medical text image.
[0085] According to the embodiments of the present disclosure, medical text is an important way to save information in medical scenarios, which contains a lot of structured information of users. Obtaining this structured information helps to understand the health status of users, and then conduct targeted analysis and processing. At the same time, a complete database and user portrait can also be established. Medical text can exist in the form of images. How to extract the required structured information from medical text images is a technical difficulty faced in medical scenarios, which can be achieved using the text structuring solution provided in the embodiments of the present disclosure.
[0086] Reference below Figure 3 , the training method of the abnormal audio classification model according to the embodiment of the present disclosure is further explained in combination with specific embodiments.
[0087] Reference below Figure 3 , the text structuring processing method according to the embodiment of the present disclosure is further explained in combination with specific embodiments.
[0088] Figure 3 The schematic diagram schematically shows a text structuring processing process according to an embodiment of the present disclosure.
[0089] like Figure 3 As shown, in the text structuring process 300, the text detection model 302 performs text detection on the text image 301, and obtains the category information and position information of at least one text detection frame corresponding to the text image 301. The category information may include a keyword category or a numerical category, and the at least one text detection frame may include at least one of a text detection frame 303, a text detection frame 304, a text detection frame 305, a text detection frame 306, and a text detection frame 307. The category information of the text detection frame 304 and the text detection frame 306 may be a keyword category, and the category information of the text detection frame 303, the text detection frame 305, and the text detection frame 307 may be a numerical category.
[0090] A text image corresponding to a target text detection frame is determined, and the target text detection frame may be a text detection frame whose category information is a numerical value. The target text detection frame may include at least one of a text detection frame 303, a text detection frame 305, and a text detection frame 307. The following describes the operations of text recognition, text classification, and generating text structured results by taking the text detection frame 303 as the target text detection frame as an example.
[0091] The text recognition model 308 performs text recognition on the text image 303 - 1 corresponding to the text detection frame 303 , and obtains a text recognition result 303 - 2 of the text image 303 - 1 corresponding to the text detection frame 303 .
[0092] The text classification model 309 performs text classification on the text recognition result 303 - 2 to obtain a semantic category result 310 corresponding to the text recognition result 303 - 2 .
[0093] The semantic classification result 310 and the text recognition result 303-2 are combined into a structured result 311. The structured result 311 includes values corresponding to the keyword category and values corresponding to the numerical category. The values corresponding to the keyword category include the semantic classification result 310, and the values corresponding to the numerical category include the text recognition result 303-2.
[0094] Figure 4 The block diagram of the text structuring processing device according to the embodiment of the present disclosure is schematically shown.
[0095] like Figure 4 As shown, the text structuring processing apparatus 400 may include a text detection module 410 , a determination module 420 , a text recognition module 430 , a text classification module 440 and a generation module 450 .
[0096] The text detection module 410 is used to perform text detection on the text image to obtain category information of at least one text detection box corresponding to the text image, wherein the category information includes a keyword category or a numerical category.
[0097] The determination module 420 is used to determine a text image corresponding to a target text detection frame in at least one text detection frame, wherein the target text detection frame is a text detection frame whose category information is a numerical category.
[0098] The text recognition module 430 is used to perform text recognition on the text image corresponding to the target text detection frame to obtain a text recognition result of the text image corresponding to the target text detection frame.
[0099] The text classification module 440 is used to perform text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result.
[0100] Generation module 450 is used to generate text structured results, wherein the text structured results include values corresponding to keyword categories and values corresponding to numerical categories, the values corresponding to keyword categories include semantic category results, and the values corresponding to numerical categories include text recognition results.
[0101] According to an embodiment of the present disclosure, the text classification module 440 may include a first obtaining submodule.
[0102] The first acquisition submodule is used to process the text recognition result using the text classification model to obtain the semantic category result corresponding to the text recognition result.
[0103] According to an embodiment of the present disclosure, the text classification model may include a deep learning model.
[0104] According to an embodiment of the present disclosure, the text detection module 410 may include a second obtaining submodule.
[0105] The second obtaining submodule is used to perform text detection on the text image to obtain category information and position information of at least one text detection box corresponding to the text image.
[0106] According to an embodiment of the present disclosure, the determination module 420 may include an extraction submodule.
[0107] The extraction submodule is used to extract a text image corresponding to a target text detection frame from the text image according to position information corresponding to a target text detection frame in at least one text detection frame.
[0108] According to an embodiment of the present disclosure, the extraction submodule may include a conversion unit and an extraction unit.
[0109] The conversion unit is used to convert the position information corresponding to the target text detection frame in at least one text detection frame into the target position information by using affine transformation.
[0110] The extraction unit extracts a text image corresponding to the target text detection frame from the text image according to the target position information.
[0111] According to an embodiment of the present disclosure, the text detection module 410 may include a third obtaining submodule.
[0112] The third acquisition submodule is used to process the text image using the text detection model to obtain category information of at least one text detection box corresponding to the text image.
[0113] According to an embodiment of the present disclosure, the text recognition module 430 may include a fourth obtaining submodule.
[0114] The fourth acquisition submodule is used to use the text recognition model to process the text image corresponding to the target text detection frame in the at least one text detection frame to obtain the text recognition result of the text image corresponding to the target text detection frame.
[0115] According to an embodiment of the present disclosure, the above-mentioned text structuring processing device 400 may further include an obtaining module.
[0116] The acquisition module is used to obtain a text image by using data preprocessing, wherein the data preprocessing includes at least one of the following: noise reduction processing, tilt correction processing and sharpening processing.
[0117] According to an embodiment of the present disclosure, the text image includes a medical text image.
[0118] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0119] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0120] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0121] According to an embodiment of the present disclosure, a computer program product includes a computer program, and the computer program implements the above method when executed by a processor.
[0122] Figure 5 A block diagram of an electronic device suitable for a text structured processing method according to an embodiment of the present disclosure is shown. The electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0123] like Figure 5As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0124] A number of components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0125] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the text structuring processing method. For example, in some embodiments, the text structuring processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the text structuring processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the text structuring processing method in any other appropriate manner (e.g., by means of firmware).
[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0131] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0133] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A text structured processing method, comprising: Performing text detection on the text image to obtain category information of at least one text detection box corresponding to the text image, wherein the category information includes a keyword category or a numerical category; Determine a text image corresponding to a target text detection frame in the at least one text detection frame, wherein the target text detection frame is a text detection frame whose category information is the numerical category; Performing text recognition on the text image corresponding to the target text detection frame to obtain a text recognition result of the text image corresponding to the target text detection frame; Performing text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result; and Generate a text structured result, wherein the text structured result includes a value corresponding to the keyword category and a value corresponding to the numerical category, the value corresponding to the keyword category includes the semantic category result, and the value corresponding to the numerical category includes the text recognition result.
2. The method according to claim 1, wherein: The performing text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result includes: The text recognition result is processed using a text classification model to obtain a semantic category result corresponding to the text recognition result.
3. The method according to claim 2, wherein: The text classification model includes a deep learning model.
4. The method according to any one of claims 1 to 3, wherein: The performing text detection on the text image to obtain category information of at least one text detection frame corresponding to the text image includes: Performing text detection on the text image to obtain category information and position information of at least one text detection frame corresponding to the text image; Wherein, determining a text image corresponding to a target text detection frame in the at least one text detection frame includes: A text image corresponding to the target text detection frame is extracted from the text image according to position information corresponding to the target text detection frame in the at least one text detection frame.
5. The method according to claim 4, wherein: The extracting, from the text image, a text image corresponding to the target text detection frame according to the position information corresponding to the target text detection frame in the at least one text detection frame comprises: Converting the position information corresponding to the target text detection frame in the at least one text detection frame into the target position information by using an affine transformation; and A text image corresponding to the target text detection frame is extracted from the text image according to the target position information.
6. The method according to any one of claims 1 to 3, wherein: The performing text detection on the text image to obtain category information of at least one text detection frame corresponding to the text image includes: The text image is processed using a text detection model to obtain category information of at least one text detection box corresponding to the text image.
7. The method according to any one of claims 1 to 3, wherein: The performing text recognition on the text image corresponding to the target text detection frame to obtain a text recognition result of the text image corresponding to the target text detection frame includes: The text image corresponding to the target text detection frame is processed using a text recognition model to obtain a text recognition result of the text image corresponding to the target text detection frame.
8. The method according to any one of claims 1 to 3, further comprising: The text image is obtained by data preprocessing, wherein the data preprocessing includes at least one of the following: noise reduction processing, tilt correction processing and sharpening processing.
9. The method according to any one of claims 1 to 3, wherein: The text image includes a medical text image.
10. A text structure processing device, comprising: A text detection module, used to perform text detection on a text image to obtain category information of at least one text detection frame corresponding to the text image, wherein the category information includes a keyword category or a numerical category; a determination module, configured to determine a text image corresponding to a target text detection frame in the at least one text detection frame, wherein the target text detection frame is a text detection frame whose category information is the numerical category; A text recognition module, used to perform text recognition on the text image corresponding to the target text detection frame, and obtain a text recognition result of the text image corresponding to the target text detection frame; A text classification module, used for performing text classification on the text recognition result to obtain a semantic category result corresponding to the text recognition result; and A generation module is used to generate text structured results, wherein the text structured results include values corresponding to the keyword categories and values corresponding to the numerical categories, the values corresponding to the keyword categories include the semantic category results, and the values corresponding to the numerical categories include the text recognition results.
11. The device according to claim 10, wherein: The text classification module comprises: The first obtaining submodule is used to process the text recognition result using a text classification model to obtain a semantic category result corresponding to the text recognition result.
12. The device according to claim 11, wherein The text classification model includes a deep learning model.
13. The device according to any one of claims 10 to 12, wherein: The text detection module comprises: A second obtaining submodule is used to perform text detection on the text image to obtain category information and position information of at least one text detection frame corresponding to the text image; Wherein, the determination module includes: The extraction submodule is used to extract a text image corresponding to the target text detection frame from the text image according to the position information corresponding to the target text detection frame in the at least one text detection frame.
14. The device according to claim 13, wherein: Extract submodules, including: A conversion unit, configured to convert the position information corresponding to the target text detection frame in the at least one text detection frame into the target position information by using an affine transformation; and The extraction unit extracts a text image corresponding to the target text detection frame from the text image according to the target position information.
15. The device according to any one of claims 10 to 12, wherein: The text detection module comprises: The third obtaining submodule is used to process the text image using a text detection model to obtain category information of at least one text detection box corresponding to the text image.
16. The device according to any one of claims 10 to 12, wherein: The text recognition module comprises: The fourth acquisition submodule is used to process the text image corresponding to the target text detection frame using a text recognition model to obtain a text recognition result of the text image corresponding to the target text detection frame.
17. The device according to any one of claims 10 to 12, further comprising: The acquisition module is used to obtain the text image by using data preprocessing, wherein the data preprocessing includes at least one of the following: noise reduction processing, tilt correction processing and sharpening processing.
18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 9.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method, device and equipment for text detection and analysis based on depth neural network
CN109086756A
Method and device for extracting structured information, equipment and readable storage medium
CN111753727A
