Text information output method and device, storage medium and electronic equipment

By performing text recognition and keyword matching on the image, determining the content area and merging text information, the cross-line text recognition problem is solved, and the recognition accuracy and information integrity are improved.

CN119693959APending Publication Date: 2025-03-25BEIJING JIAHE HAISEN HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411865237.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When faced with complex and changeable text images, existing image text recognition technology is difficult to accurately identify and merge cross-line text, resulting in a decrease in recognition accuracy and may lead to the omission or misunderstanding of key information.

Method used

By obtaining the image to be processed, text recognition and labeling text boxes, recording files based on the information of the text boxes and preset keywords, determining the first keyword, and determining the content area based on the location information, combining and outputting text information when the content area is not empty.

Benefits of technology

Accurate recognition and merging of cross-line texts is realized, the accuracy of image text recognition is improved, and the omission or misunderstanding of key information is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693959A_ABST
    Figure CN119693959A_ABST
Patent Text Reader

Abstract

The invention provides a text information output method and device, a storage medium and electronic equipment, and the method comprises the steps: firstly obtaining a to-be-processed image; performing text recognition on the image to obtain a recognition result of the image; the recognition result comprises each textbox marked on the image and text information of each textbox; obtaining each first keyword of the recognition result according to the text information of each textbox and a preset keyword recording file; for each first keyword, determining a content area corresponding to the first keyword based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image under the condition that the existence of the target adjacent keyword of the first keyword is detected; and when it is detected that the content area is not empty, merging and outputting the text information in the content area. By applying the method provided by the embodiment of the invention, the cross-line text can be accurately identified and merged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a text information output method, device, storage medium and electronic equipment. Background Art

[0002] In the era of rapid digitalization and informatization, image text recognition technology, as a model of deep integration of computer vision and artificial intelligence, has been widely used in various fields. The core of this technology is to accurately capture and parse text information from complex images, thereby promoting the rapid circulation and efficient use of information.

[0003] However, existing image text recognition technologies still face many challenges when facing complex and changeable text images. Among them, the problem of text display across lines is a difficult problem that image text recognition technologies often encounter in practical applications.

[0004] Due to the diversity of text content and the complexity of layout, especially in cases where the document layout is not standardized, the font size is different, and the line spacing is tight, there will often be overlap, staggered or broken text lines, resulting in the text content that originally belonged to the same field being incorrectly divided into multiple lines for recognition. This cross-line text recognition problem not only affects the accuracy of image text recognition technology, but may also lead to the omission or misunderstanding of key information, which in turn leads to a series of serious consequences. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a text information output method, device, storage medium and electronic device, which can accurately identify and merge inter-line text. The specific scheme is as follows:

[0006] A text information output method, comprising:

[0007] Get the image to be processed;

[0008] Performing text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and text information of each text box;

[0009] Obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one or more adjacent text information and is consistent with a second keyword in the keyword record file;

[0010] For each of the first keywords, when the existence of a target adjacent keyword of the first keyword is detected, the content area corresponding to the first keyword is determined based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image; when it is detected that the content area is not empty, the text information in the content area is merged and output.

[0011] Optionally, in the above method, obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file includes:

[0012] Selecting the target text information to be processed from each text information according to the position information of each text box;

[0013] Determining whether there is adjacent text information of the target text information in the recognition result;

[0014] If the recognition result contains adjacent text information of the target text information, the target text information is merged with the adjacent text information to obtain merged text information; and each first keyword of the recognition result is obtained according to the merged text information and a preset keyword record file;

[0015] If there is no adjacent text information of the target text information in the recognition result, and there is a second keyword consistent with the target text information in the keyword record table, the target text information is determined to be the first keyword, and the processing of the target text information is determined to be completed;

[0016] If the recognition result does not contain adjacent text information of the target text information, and the keyword record table does not contain a second keyword consistent with the target text information, determining that the processing of the target text information is completed;

[0017] In the case that there is unprocessed text information in the recognition result, returning to execute the step of selecting the target text information to be processed from each text information according to the position information of each text box;

[0018] When all text information in the recognition result has been processed, all currently determined first keywords are used as the first keywords of the recognition result.

[0019] Optionally, in the above method, obtaining each first keyword of the recognition result according to the merged text information and a preset keyword record file includes:

[0020] If the keyword record file contains a second keyword that is consistent with the merged text information, the merged text information is determined as new target text information, and the step of determining whether there is adjacent text information of the target text information in the recognition result is returned to execute;

[0021] If the keyword record file does not contain a second keyword that is consistent with the merged text information, and the keyword record file contains a second keyword that is consistent with the target text information, the target text information is determined to be the first keyword, and the processing of the target text information is determined to be completed;

[0022] If the keyword record file does not contain a second keyword consistent with the merged text information, and the keyword record file does not contain a second keyword consistent with the target text information, it is determined that the processing of the target text information is completed.

[0023] The above method, optionally, detecting the existence of a target adjacent keyword of the first keyword includes:

[0024] If there are adjacent keywords of the first keyword in a preset direction of the first keyword, the adjacent keywords in the preset direction are determined as target adjacent keywords of the first keyword.

[0025] In the above method, optionally, determining the content area corresponding to the first keyword based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image includes:

[0026] Determining a content area boundary according to the position information of the first keyword and the position information of the target adjacent keyword;

[0027] The content area corresponding to the first keyword is determined according to the content area boundary.

[0028] In the above method, optionally, the process of detecting that the content area corresponding to the first keyword is not empty includes:

[0029] If there is a text box intersecting the content area in the recognition result, and the ratio of the area of ​​the text box intersecting the content area to the area of ​​the text box is greater than a preset ratio threshold, it is determined that the content area corresponding to the first keyword is not empty.

[0030] In the above method, optionally, the step of merging and outputting the text information in the content area includes:

[0031] Determining a splicing order of each piece of text information in the content area according to position information of each piece of text information in the content area;

[0032] splicing the respective text information in the content area according to the splicing order of the respective text information in the content area;

[0033] The spliced ​​text information in the content area is output.

[0034] A text information output device, comprising:

[0035] An acquisition unit, used for acquiring an image to be processed;

[0036] A recognition unit, configured to perform text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and text information of each text box;

[0037] A first execution unit, configured to obtain each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one or more adjacent text information and is consistent with a second keyword in the keyword record file;

[0038] A second execution unit is configured to determine, for each of the first keywords, a content area corresponding to the first keyword based on position information of the first keyword on the image and position information of the target adjacent keyword on the image when the existence of a target adjacent keyword of the first keyword is detected; and to merge and output text information within the content area when it is detected that the content area is not empty.

[0039] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned text information output method.

[0040] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the above-mentioned text information output method.

[0041] Based on the above-mentioned implementation of the present invention, a text information output method, device, storage medium and electronic device are provided, the method comprising: obtaining an image to be processed; performing text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and the text information of each text box; obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes multiple preset second keywords, each of the first keywords includes one text information or is obtained by merging multiple adjacent text information, and is consistent with a second keyword in the keyword record file; for each first keyword, when the target adjacent keyword of the first keyword is detected, based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image, determine the content area corresponding to the first keyword; when it is detected that the content area is not empty, merge and output the text information in the content area. The method provided by the embodiment of the present invention can accurately recognize and merge cross-line text. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A method flow chart of a text information output method provided by the present invention;

[0044] Figure 2 A flowchart of a process of obtaining each first keyword of a recognition result provided by the present invention;

[0045] Figure 3 A flowchart of a keyword merging process provided by the present invention;

[0046] Figure 4 An example diagram of an inspection report provided by the present invention;

[0047] Figure 5 Another example diagram of an inspection report provided by the present invention;

[0048] Figure 6 Another example diagram of an inspection report provided by the present invention;

[0049] Figure 7 Another example diagram of an inspection report provided by the present invention;

[0050] Figure 8 A flow chart of a content merging process provided by the present invention;

[0051] Fig. 9 This is an example diagram of the fifth inspection report provided by the present invention;

[0052] Fig.10 This is an example diagram of the sixth inspection report provided by the present invention;

[0053] Fig.11 This is an example diagram of the seventh inspection report provided by the present invention;

[0054] Fig.12 A structural schematic diagram of a text information output device provided by the present invention;

[0055] Fig.13 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0058] The embodiment of the present invention provides a method for outputting text information. The method can be applied to an electronic device, which can be a computer, a smart phone, a tablet device, a smart wearable device, a server cluster or a cloud computing center, etc. The method flow chart is as follows: Figure 1 As shown, specifically including:

[0059] S101: Acquire an image to be processed.

[0060] In this embodiment, the image to be processed may be any image including text information, for example, various test report images, admission record images, case images, etc. in the medical field.

[0061] S102: Perform text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and text information of each text box.

[0062] In this embodiment, OCR recognition technology can be used to perform text recognition on the image to be processed to obtain a recognition result of the image.

[0063] In some embodiments, the text box may carry position information, and the position information may include coordinate information of each point on the text box, coordinate information of the center point of the text box, etc.

[0064] S103: Obtain each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes multiple preset second keywords, each first keyword includes one text information or is obtained by merging multiple adjacent text information, and is consistent with a second keyword in the keyword record file.

[0065] In this embodiment, each first keyword of the recognition result can be obtained according to the text information, position information and keyword record file of each text box.

[0066] In this embodiment, the processing order of each text message can be determined based on the position information of each text box. The processing order can be from top to bottom and from left to right. Then, the target text message to be processed is selected based on the processing order of each text message.

[0067] Optionally, it may be determined whether there is text information adjacent to the target text information in a preset direction, for example, to the right, below, etc., in the recognition result.

[0068] If there is adjacent text information in the preset direction of the target text information, the target text information is merged with the adjacent text information to obtain the merged text information; based on the merged text information and the preset keyword record file, each first keyword of the recognition result is obtained. Specifically, the merged text information can be matched with the keyword record file. If there is a second keyword consistent with the merged text information in the keyword record file, the merged text information can be determined as the new target text information, and the step of determining whether there is adjacent text information in the preset direction of the target text information in the recognition result is returned to be executed; if there is no second keyword consistent with the merged text information in the keyword record file, the target text information can be determined as the first keyword if there is a second keyword consistent with the target text information in the keyword record file. If there is no second keyword consistent with the target text information in the keyword record file, the target text information to be processed is re-determined until all text information in the recognition result is processed.

[0069] If there is no adjacent text information, the target text information can be determined as the first keyword if there is a second keyword consistent with the target text information in the keyword record file; if there is no second keyword consistent with the target text information in the keyword record file, the target text information to be processed is re-determined until all the text information in the recognition result is processed.

[0070] In some embodiments, for each text box, if there is an adjacent text box of the text box in the recognition result, the text information in the text box is merged with the text information in the adjacent text box of the text box to obtain merged text information; if the merged text information is consistent with a second keyword in the keyword record file, the merged text information is determined as the first keyword; if the merged text information is inconsistent with a second keyword in the keyword record file, and the text information in the text box is consistent with a second keyword in the keyword record file, the text information in the text box is determined as the first keyword.

[0071] S104: For each first keyword, when the existence of a target adjacent keyword of the first keyword is detected, the content area corresponding to the first keyword is determined based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image; when it is detected that the content area is not empty, the first keyword and the text information in the content area are merged and output.

[0072] Optionally, detecting the existence of a target adjacent keyword of the first keyword includes: if an adjacent keyword of the first keyword exists in a preset direction of the first keyword, determining the adjacent keyword in the preset direction as the target adjacent keyword of the first keyword.

[0073] Specifically, for each first keyword, if the text box of the first keyword and the text box of the keyword to its right have an intersection on the y-axis, the keyword to the right that is closest to the first keyword and has an intersection is determined as the first target adjacent keyword of the keyword. If there is a lower keyword text box within a preset range below the text box of the first keyword, the keyword in the lower keyword text box is determined as the second target adjacent keyword of the first keyword. The target adjacent keyword of the first keyword can be at least one of the first target adjacent keyword and the second target adjacent keyword.

[0074] In an embodiment provided by the present application, based on the above solution, optionally, based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image, the process of determining the content area corresponding to the first keyword includes:

[0075] Determining a content area boundary according to the position information of the first keyword and the position information of the target adjacent keyword;

[0076] The content area corresponding to the first keyword is determined according to the content area boundary.

[0077] In this embodiment, the line between the position information of the first keyword and the position information of the target adjacent keyword may be used as the content region boundary, and then the content region corresponding to the first keyword is determined by each content region boundary.

[0078] By applying the method provided in the embodiment of the present invention, it is possible to accurately identify and merge inter-line texts.

[0079] In some embodiments provided in the present application, based on the above solution, optionally, the process of detecting that the content area corresponding to the first keyword is not empty includes:

[0080] If there is a text box intersecting the content area in the recognition result, and the ratio of the area of ​​the text box intersecting the content area to the area of ​​the text box is greater than a preset ratio threshold, it is determined that the content area corresponding to the first keyword is not empty.

[0081] In this embodiment, the ratio threshold is set to any value such as 50%, 60%, etc., which can be pre-calibrated by a technician.

[0082] In an embodiment provided in the present application, based on the above solution, optionally, a process of obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file is as follows: Figure 2 As shown, including:

[0083] S201: Selecting target text information to be processed currently from various text information according to the position information of each text box.

[0084] S202: Determine whether there is adjacent text information of the target text information in the recognition result; if so, execute S203; if not, execute S207.

[0085] S203: Merge the target text information with the adjacent text information to obtain merged text information.

[0086] S204: Detect whether there is a second keyword consistent with the merged text information in the keyword record file; if so, execute S205; if not, execute S206.

[0087] S205: Determine the merged text information as new target text information, and return to execute S202.

[0088] S206: Detect whether there is a second keyword consistent with the target text information in the keyword record file, if yes, execute S207; if not, execute S208;

[0089] S207: Determine the target text information as the first keyword, determine that the processing of the target text information is completed, and jump to S212.

[0090] S208: Determine that the processing of the target text information is completed, and jump to S212.

[0091] S209: Determine whether there is a second keyword that is consistent with the target text information in the keyword record table. If so, execute S210; if not, execute S211.

[0092] S210: Determine the target text information as the first keyword, and determine that the processing of the target text information is completed.

[0093] S211: Determine that the processing of the target text information is completed.

[0094] S212: Check whether there is unprocessed text information in the recognition result; if so, return to execute S201; if not, execute S213.

[0095] S213: taking all currently determined first keywords as the first keywords of the recognition results.

[0096] In the embodiment provided in the present application, the first step of keyword merging can be performed first, with the purpose of merging the cross-line text contained in the first keyword; and then judging the cross-line merging of the content through the area divided in the second step.

[0097] Step one: keyword merging.

[0098] In this embodiment, the process of keyword merging is as follows: Figure 3 As shown, the specific steps include:

[0099] (1) Collect data. Optionally, collect a large number of de-identified images of relevant reports in the medical field.

[0100] (2) Obtain keyword record files. Collect the keywords in each report or document in the desensitized image to form a keyword record file, as shown in Table 1:

[0101] Table 1

[0102] Keywords Pathology No. Receipt time Name gender … Follow-up doctor Review Doctor

[0103] (3) Cross-industry keyword positioning.

[0104] In this embodiment, see Figure 4 , which is an example diagram of a medical examination report provided in an embodiment of the present application, can perform OCR recognition on the example examination report to obtain a text recognition result. The text recognition result is as follows Figure 5 As shown, at this time, the position of the box in the image and the text recognition information in the box can be obtained. Then, the content of each text box is processed from top to bottom and from left to right, and the text information in the current text box to be processed is used as the keyword k1. For example, the first keyword k1 is "signing time". Then, it is merged with the text information in the text box within a certain range (content range) below, and it is detected whether it is in the keyword record file. Since cross-line data is usually presented in an up-down form, it is only necessary to find the text box below for merging. If the nearest keyword below is found to be k2="name", they are merged and queried in the keyword record file. If it is found that "signing time name" is not in the keyword record file, only k1 will be output to obtain a first keyword, and it is determined that the keyword k1 does not exist in cross-line text.

[0105] Next, the next k1 becomes the text information "2024-02-28 12:48"; this text information is not in the keyword record file and can be output directly.

[0106] By repeatedly executing the above method, the keyword k1="report" can be continuously identified. When k1 and k2="date" are merged to obtain "report date", it is found that it is in the keyword record file. Therefore, they are merged and the search continues for the content below the next keyword "date". At this time, k1="report date", k2=next keyword. If k2 does not exist as in the example, the merged result can be directly output. Assuming that there is another keyword "confirmation" below, for example, the merged content is "report date confirmation", and it is also in the keyword record file, then the contents of these three text boxes are merged and output until the next keyword k2 is not found, or the result after merging k1 and k2 is not in the keyword record file, then the merge is stopped and the result is output.

[0107] Finally, the fusion result can be obtained, as shown in the following figure: Figure 6 As shown, for the convenience of display, only the merged results are displayed.

[0108] In this embodiment, combined with Figure 7 The process of finding k2 is described as follows: after obtaining a first keyword k1, determine the position of the first keyword k1 in the image, which can be determined by the four vertex coordinates of the box (upper left, upper right, lower right, and lower left). Then, perform an overlap check on the box below that belongs to the keyword. The way to check is to see whether the two have an intersection in the x-direction of the horizontal coordinate, and the intersection range is >90%. In this way, it is determined whether the keyword k2 is directly below. For example, "signing time" and "name" overlap in the x-direction, but do not overlap with "gender", so there is no need to judge its merging relationship with "gender". In this way, it can be confirmed above that k2 = "name"; after this first step of keyword merging, the keyword merging work is completed.

[0109] Step 2: Content merging. In this embodiment, the process of content merging is as follows: Figure 8 As shown in FIG9 , after obtaining the result of keyword merging (each first keyword), the content area of ​​a first keyword can be determined. Specifically, the midpoint of the text box of the current first keyword k can be used as the reference, and the midpoints of the keyword boxes closest to the right and below can be connected. As shown in FIG9 , the content range corresponding to the first keyword “receipt time” can be obtained.

[0110] Determine the text boxes that intersect with the content range. If the intersection area of ​​the text boxes is greater than 50% of the text box area, these text boxes can be sorted and merged from top to bottom and from left to right, that is, first sort by the height of y to separate the texts in different rows, and then sort the texts in the same row from left to right according to the size of x, and finally merge them together.

[0111] In some embodiments, Fig.10 As shown, if there is no adjacent keyword to the right of a first keyword "seen by the naked eye", the middle line of the text box of the first keyword is connected to the edge of the image, and then the midpoint of the keyword "pathological diagnosis" below it is connected to the edge coordinates to form the content area of ​​the first keyword "seen by the naked eye".

[0112] Finally, the text information in the content area can be merged across lines. The merged result is as follows Fig.11 As shown, the merged text recognition results are output. The specific output content is as follows:

[0113] …

[0114] “What the naked eye sees”

[0115] "1# (sinus curvature - erosion) 1 piece of grayish-white irregular tissue, the maximum diameter is 0.2cm. 2# (body curvature - piebald) 1 piece of grayish-white irregular tissue, the maximum diameter is 0.4cm."

[0116] …

[0117] "Report date 2024-03-01 Sample collection object A First-time patient object B Follow-up doctor reviewing doctor object C".

[0118] and Figure 1 Corresponding to the method described above, the embodiment of the present invention further provides a text information output device for Figure 1 The specific implementation of the method is shown in the following diagram: Fig.12 As shown, specifically including:

[0119] An acquisition unit 1201 is used to acquire an image to be processed;

[0120] The recognition unit 1202 is used to perform text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and text information of each text box;

[0121] The first execution unit 1203 is used to obtain each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one text information or is obtained by merging a plurality of adjacent text information, and is consistent with a second keyword in the keyword record file;

[0122] The second execution unit 1204 is used to determine, for each of the first keywords, a content area corresponding to the first keyword based on position information of the first keyword on the image and position information of the target adjacent keyword on the image when the existence of a target adjacent keyword of the first keyword is detected; and when it is detected that the content area is not empty, merge the first keyword with the text information in the content area for output.

[0123] In an embodiment provided in the present application, based on the above solution, optionally, the first execution unit 1203 includes:

[0124] A selection subunit is used to select the target text information to be processed from each text information according to the position information of each text box;

[0125] A first determination subunit is used to determine whether there is adjacent text information of the target text information in the recognition result;

[0126] A first execution subunit is used to merge the target text information with the adjacent text information if there is adjacent text information of the target text information to obtain merged text information; and obtain each first keyword of the recognition result according to the merged text information and a preset keyword record file;

[0127] A second execution subunit is used for determining the target text information as the first keyword and completing the processing of the target text information if there is no adjacent text information of the target text information in the recognition result and there is a second keyword consistent with the target text information in the keyword record table;

[0128] A third execution subunit is used to determine that the processing of the target text information is completed if there is no adjacent text information of the target text information in the recognition result and there is no second keyword consistent with the target text information in the first keyword record table;

[0129] A fourth execution subunit is used for returning to trigger the selection subunit to execute the step of selecting the target text information to be processed from each text information according to the position information of each text box when there is unprocessed text information in the recognition result;

[0130] The fifth execution subunit is used to use all the currently determined first keywords as the first keywords of the recognition result when all the text information in the recognition result has been processed.

[0131] In an embodiment provided in the present application, based on the above solution, optionally, the first execution subunit includes:

[0132] A first execution module, configured to determine the merged text information as new target text information if a second keyword consistent with the merged text information exists in the keyword record file, and return to trigger the first determination subunit to execute the step of determining whether there is adjacent text information of the target text information in the recognition result;

[0133] a second execution module, configured to determine the target text information as the first keyword, and to complete processing of the target text information if the keyword record file does not contain a second keyword consistent with the merged text information, and the keyword record file contains a second keyword consistent with the target text information;

[0134] The third execution module is used to determine that the processing of the target text information is completed if the keyword record file does not contain the second keyword consistent with the merged text information and the keyword record file does not contain the second keyword consistent with the target text information.

[0135] In an embodiment provided in the present application, based on the above solution, optionally, the second execution unit 1204 includes:

[0136] The second determining subunit is configured to determine the adjacent keywords of the first keyword in the preset direction as target adjacent keywords of the first keyword if there are adjacent keywords of the first keyword in the preset direction of the first keyword.

[0137] In an embodiment provided in the present application, based on the above solution, optionally, the second execution unit 1204 includes:

[0138] a third determining subunit, configured to determine a content area boundary according to the position information of the first keyword and the position information of the target adjacent keyword;

[0139] The fourth determining subunit is configured to determine the content area corresponding to the first keyword according to the content area boundary.

[0140] In an embodiment provided in the present application, based on the above solution, optionally, the second execution unit 1204 includes:

[0141] The fifth determination subunit is used to determine that the content area corresponding to the first keyword is not empty if there is a text box intersecting the content area in the recognition result, and the ratio of the area of ​​the text box intersecting the content area to the area of ​​the text box is greater than a preset ratio threshold.

[0142] In an embodiment provided in the present application, based on the above solution, optionally, the second execution unit 1204 includes:

[0143] a sixth determining subunit, configured to determine a splicing order of each of the text information in the content area according to position information of each of the text information in the content area;

[0144] A splicing subunit, configured to splice the respective text information in the content area according to a splicing order of the respective text information in the content area;

[0145] The output subunit is used to output the spliced ​​text information in the content area.

[0146] The specific principles and execution processes of each unit and module in the text information output device disclosed in the above embodiment of the present invention are the same as those of the text information output method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the text information output method provided in the above embodiment of the present invention, and will not be repeated here.

[0147] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned text information output method.

[0148] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Fig.13 As shown, it specifically includes a memory 1301 and one or more instructions 1302, wherein the one or more instructions 1302 are stored in the memory 1301 and are configured to be executed by one or more processors 1303 to perform the following operations:

[0149] Get the image to be processed;

[0150] Performing text recognition on the image to obtain a recognition result of the image; the recognition result includes each text box marked on the image and text information of each text box;

[0151] Obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one of the text information or is obtained by merging a plurality of adjacent text information, and is consistent with a second keyword in the keyword record file;

[0152] For each of the first keywords, when the existence of a target adjacent keyword of the first keyword is detected, the content area corresponding to the first keyword is determined based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image; when it is detected that the content area is not empty, the text information in the content area is merged and output.

[0153] It should be noted that the data used in the present invention have been anonymized and there is no legal issue such as leaking the patient's personal privacy.

[0154] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0155] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.

[0156] For the convenience of description, the above device is described as being divided into various units according to their functions. Of course, when implementing the present invention, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0157] It can be known from the above description of the implementation mode that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0158] The above is a detailed introduction to a text information output method provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A text information output method, characterized in that: include: Get the image to be processed; Performing text recognition on the image to obtain a recognition result of the image; The recognition result includes each text box marked on the image and text information of each text box; Obtaining each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one or more adjacent text information and is consistent with a second keyword in the keyword record file; For each of the first keywords, in the case where a target adjacent keyword of the first keyword is detected, determining a content area corresponding to the first keyword based on position information of the first keyword on the image and position information of the target adjacent keyword on the image; When it is detected that the content area is not empty, the text information in the content area is merged and output.

2. The method according to claim 1, characterized in that The obtaining of each first keyword of the recognition result according to the text information of each text box and a preset keyword record file includes: Selecting the target text information to be processed from each text information according to the position information of each text box; Determining whether there is adjacent text information of the target text information in the recognition result; If the recognition result contains adjacent text information of the target text information, the target text information is merged with the adjacent text information to obtain merged text information; and each first keyword of the recognition result is obtained according to the merged text information and a preset keyword record file; If the recognition result does not contain adjacent text information of the target text information, and the keyword record table contains a second keyword that is consistent with the target text information, the target text information is determined to be the first keyword, and the processing of the target text information is determined to be completed; If the recognition result does not contain adjacent text information of the target text information, and the keyword record table does not contain a second keyword consistent with the target text information, determining that the processing of the target text information is completed; In the case that there is unprocessed text information in the recognition result, returning to execute the step of selecting the target text information to be processed from each text information according to the position information of each text box; When all text information in the recognition result has been processed, all currently determined first keywords are used as the first keywords of the recognition result.

3. The method according to claim 2, characterized in that The step of obtaining each first keyword of the recognition result according to the merged text information and the preset keyword record file includes: If the keyword record file contains a second keyword that is consistent with the merged text information, the merged text information is determined as new target text information, and the step of determining whether there is adjacent text information of the target text information in the recognition result is returned to execute; If the keyword record file does not contain a second keyword that is consistent with the merged text information, and the keyword record file contains a second keyword that is consistent with the target text information, the target text information is determined to be the first keyword, and the processing of the target text information is determined to be completed; If the keyword record file does not contain a second keyword that is consistent with the merged text information, and the keyword record file does not contain a second keyword that is consistent with the target text information, it is determined that the processing of the target text information is completed.

4. The method according to claim 1, characterized in that: Detecting the existence of a target adjacent keyword of the first keyword includes: If there are adjacent keywords of the first keyword in a preset direction of the first keyword, the adjacent keywords in the preset direction are determined as target adjacent keywords of the first keyword.

5. The method according to claim 1, characterized in that The determining the content area corresponding to the first keyword based on the position information of the first keyword on the image and the position information of the target adjacent keyword on the image includes: Determining a content area boundary according to the position information of the first keyword and the position information of the target adjacent keyword; The content area corresponding to the first keyword is determined according to the content area boundary.

6. The method according to claim 1, characterized in that The process of detecting that the content area corresponding to the first keyword is not empty includes: If there is a text box intersecting the content area in the recognition result, and the ratio of the area of ​​the text box intersecting the content area to the area of ​​the text box is greater than a preset ratio threshold, it is determined that the content area corresponding to the first keyword is not empty.

7. The method according to claim 1, characterized in that The merging and outputting the text information in the content area includes: Determining a splicing order of each piece of text information in the content area according to position information of each piece of text information in the content area; splicing the respective text information in the content area according to the splicing order of the respective text information in the content area; The spliced ​​text information in the content area is output.

8. A text information output device, characterized in that: include: An acquisition unit, used for acquiring an image to be processed; A recognition unit, used to perform text recognition on the image to obtain a recognition result of the image; The recognition result includes each text box marked on the image and text information of each text box; A first execution unit, configured to obtain each first keyword of the recognition result according to the text information of each text box and a preset keyword record file; the keyword record file includes a plurality of preset second keywords, each of the first keywords includes one or more adjacent text information and is consistent with a second keyword in the keyword record file; a second execution unit, configured to, for each of the first keywords, determine, when detecting the existence of a target adjacent keyword of the first keyword, a content area corresponding to the first keyword based on position information of the first keyword on the image and position information of the target adjacent keyword on the image; When it is detected that the content area is not empty, the text information in the content area is merged and output.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the text information output method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the text information output method according to any one of claims 1 to 7.