Data extraction method, system, terminal and medium

By performing text recognition and field matching on medical record images, the problem of low data extraction accuracy caused by different hospital medical record formats was solved, and efficient data extraction from medical records with different page layouts was achieved.

CN116311270BActive Publication Date: 2025-12-12UNISOUND SHANGHAI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310285939.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2025-12-12
Estimated Expiration
2043-03-22

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of medical record data extraction is low, mainly due to differences in medical record formats among different hospitals and doctors' writing habits, which leads to inaccurate data extraction.

Method used

By performing text recognition on the target medical record image, and combining document category and location information, fields are extracted. If it is a table field, the header is matched to determine the number of rows, and the field values ​​are extracted based on the number of rows. For non-table fields, the field name is matched to determine the content of the target row and the field values ​​are extracted.

Benefits of technology

It improves the accuracy of data extraction, can adapt to medical records with different page layouts, reduces the dependence on fixed positions of medical records, and enhances the flexibility and accuracy of data extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116311270B_ABST
    Figure CN116311270B_ABST
Patent Text Reader

Abstract

The application provides a data extraction method, system, terminal and medium, the method comprises the following steps: carrying out character recognition on a target medical record image to obtain a character recognition result, the character recognition result comprises image characters and position information corresponding to each image character, and a document category; carrying out field extraction on the image characters according to the document category and the position information to obtain an extracted field, and carrying out line division on the position information of the extracted field; if the extracted field is a table field, carrying out table header matching on the extracted field, and determining the number of table arrangement according to the table header matching result; carrying out segmentation on the extracted field according to the number of table arrangement, and carrying out field value extraction on each table header in the segmented extracted field to obtain extracted data. The application does not need to set a fixed position of a medical record, can effectively carry out data extraction on medical records with different page layouts, and improves the accuracy of data extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a data extraction method, system, terminal, and medium. Background Technology

[0002] The processing and structuring of electronic medical record data is a major challenge in the development of medical informatization. Currently, the vast majority of medical records are still paper-based, and there are not only various types of medical documents, but also different formats for medical records in different hospitals. However, medical record data is crucial for medical insurance, verifying diagnoses, and resolving billing disputes.

[0003] Medical record data extraction is of great significance for various aspects such as clinical medicine, medical insurance, and diagnostic verification. The process involves extracting relevant information from the medical record data, such as extracting the "diagnosis name" from the "medical record cover page".

[0004] For data extraction from non-electronic medical records, existing technologies generally use a template-based approach. For example, for the first page of a hospital's medical record, only the text information in a fixed location of the medical record is extracted to obtain the extracted data. However, due to differences in medical record formats from different hospitals and doctors' writing habits, the accuracy of data extraction is low. Summary of the Invention

[0005] The purpose of this invention is to provide a data extraction method, system, terminal, and medium to solve the problem of low accuracy in data extraction during existing medical record data processing.

[0006] This invention is implemented as follows: a data extraction method, the method comprising:

[0007] The target medical record image is subjected to text recognition to obtain text recognition results, which include the text in the image and the location information and document category corresponding to each text in the image.

[0008] Based on the document category and the location information, the image text is extracted to obtain extracted fields, and the location information of the extracted fields is divided into rows.

[0009] If the extracted field is a table field, then the extracted field is matched with the table header, and the number of rows to be sorted is determined based on the table header matching result.

[0010] The extraction field is divided according to the number of rows, and the field values ​​are extracted from each header in the divided extraction field to obtain the extracted data.

[0011] Preferably, determining the number of rows to be sorted based on the header matching result includes:

[0012] If the table header matching result is a matching success, the number of matching successes is obtained, and the number of matching successes is determined as the table arrangement number;

[0013] If the table header matching result is a matching failure, table header field matching is performed on the extracted field to obtain a table header field, and the columns of the table header field are marked;

[0014] Column identification is performed on the unmarked column of the extracted field, and the table arrangement number is determined according to the column identification result and the number of marked columns.

[0015] Preferably, the column identification on the unmarked column of the extracted field and the determination of the table arrangement number according to the column identification result and the number of marked columns comprise:

[0016] Regular matching is respectively performed on each unmarked column;

[0017] If the number of matching successes in any unmarked column is greater than a number threshold, the unmarked column is determined as an identified column, and a number sum between the number of identified columns and the number of marked columns is calculated to obtain the table arrangement number.

[0018] Preferably, the column identification on the unmarked column of the extracted field and the determination of the table arrangement number according to the column identification result and the number of marked columns comprise:

[0019] Data scoring is respectively performed on each unmarked column to obtain a field scoring value, and a scoring average of each unmarked column is respectively determined according to the field scoring value;

[0020] The unmarked column corresponding to the minimum scoring average is determined as an identified column, and a number sum between the number of identified columns and the number of marked columns is calculated to obtain the table arrangement number.

[0021] Preferably, after the table header matching result is a matching failure, the method further comprises:

[0022] Table tail identification is performed on the extracted field, and a table tail line in the extracted field is determined according to the table tail identification result;

[0023] Noise screening is performed on the extracted field according to the table tail line.

[0024] Preferably, after the position information of the extracted field is divided into lines, the method further comprises:

[0025] If the extraction field is a non-table field, field name matching is performed on the extraction field, and target line content in the extraction field is determined according to a field name matching result;

[0026] Field value extraction is performed on the target line content to obtain the extraction data.

[0027] Preferably, the field value extraction on the target line content to obtain the extraction data comprises:

[0028] Regular matching is performed on the target line content;

[0029] If the regular matching of the target line content succeeds, a field value of the target line content is obtained to obtain the extraction data;

[0030] If the regular matching of the target line content fails, a null result is returned for the target line content;

[0031] Or, text scoring is performed on the target line content to obtain a text scoring value, and if the text scoring value is less than a text threshold value, a field value of the target line content is obtained to obtain the extraction data.

[0032] Another object of the embodiment of the application is to provide a data extraction system, which comprises:

[0033] a character recognition module, configured to perform character recognition on a target medical record image to obtain a character recognition result, the character recognition result comprising image characters and position information corresponding to each image character, and a document category;

[0034] a field extraction module, configured to perform field extraction on the image characters according to the document category and the position information to obtain extraction fields, and perform line division on position information of the extraction fields;

[0035] a table header matching module, configured to, if the extraction fields are table fields, perform table header matching on the extraction fields, and determine a table quantity according to a table header matching result;

[0036] a data extraction module, configured to divide the extraction fields according to the table quantity, and perform field value extraction on each table header in the divided extraction fields to obtain extraction data.

[0037] Another object of the embodiment of the application is to provide a terminal device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor performs the steps of the above method when executing the computer program.

[0038] Another object of the present application is to provide a computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above method.

[0039] In the embodiment of the present application, the image text can be effectively field extracted based on the document category and position information. If the extracted field is a table field, the table header row in the extracted field is determined by table header matching on the extracted field, the number of table rows is effectively determined based on the table header row, the extracted field is effectively segmented based on the number of table rows, and the extracted data is effectively obtained by field value extraction on each table header in the segmented extracted field. The embodiment does not need to set the fixed position of the medical record, and can effectively extract data from medical records with different page layouts, thereby improving the accuracy of data extraction. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 is a flowchart of the data extraction method provided by the first embodiment of the present application;

[0041] Figure 2 is a flowchart of the data extraction method provided by the second embodiment of the present application;

[0042] Figure 3 is a structural schematic diagram of the data extraction system provided by the third embodiment of the present application;

[0043] Figure 4 is a flowchart of the specific implementation of the data extraction system provided by the third embodiment of the present application;

[0044] Figure 5 is a structural schematic diagram of the terminal device provided by the fourth embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0046] In order to illustrate the technical solutions of the present application, the following specific embodiments are used to illustrate the technical solutions of the present application.

[0047] Example One

[0048] Please refer to Figure 1 is a flowchart of the data extraction method provided by the first embodiment of the present application, which can be applied to any terminal device or system. The data extraction method comprises the following steps:

[0049] Step S10, perform text recognition on the target medical record image to obtain a text recognition result;

[0050] Among them, the text recognition result includes image text, the corresponding position information and document category of each image text. In this step, OCR recognition can be used for text recognition to obtain the text in the target medical record image and the corresponding box information. For example, the box information includes: {"top_left_x": 811, "top_left_y": 442, "box_h": 68, "box_w": 560, "str": "Inpatient Medical Record First Page", "score": 0.994, "box": [[811.0, 442.0], [1371.0, 442.0], [1371.0, 510.0], [811.0, 510.0]]};

[0051] Step S20, extract fields from the image text according to the document category and the position information, obtain the extracted fields, and perform row division on the position information of the extracted fields;

[0052] Among them, based on the document category and position information, the image text can be effectively field-extracted to obtain the extracted fields, and based on the position information of the extracted fields, row division can be effectively performed. In this step, the configuration file content is preset according to user needs, and the configuration file content is named doc_general.yml: mainly including the extracted fields corresponding to different document categories, and related rules, thred, etc. configurations. The example is as follows:

[0053] "EMR080001" represents the document code of the medical record first page, "value" represents the non-table fields in the medical record, "table" represents the table fields in the medical record, "Diagnosis Name" represents the column name of the table, and "patterns: ["[出山]院.*?诊断"]" represents regular matching of table column name and other information.

[0054] Step S30, if the extracted field is a table field, perform header matching on the extracted field, and determine the number of tables to be arranged according to the header matching result;

[0055] Among them, when the extracted field is a table field, by performing header matching on the extracted field to determine the header row in the extracted field, and based on the header row, the number of tables to be arranged can be effectively determined. Optionally, the determining the number of tables to be arranged according to the header matching result includes:

[0056] If the header matching result is successful, obtain the number of successful matches, and determine the number of successful matches as the number of tables to be arranged;

[0057] If the table header matching result is a match, it is determined that the table header in the extraction field is recognized, the number of times of successful matching is used to effectively determine the number of times of the recognized table header, and the number of times of the recognized table header is used to effectively determine the number of table arrangements;

[0058] If the table header matching result is a match, it is determined that the table header in the extraction field is recognized, the number of times of successful matching is used to effectively determine the number of times of the recognized table header, and the number of times of the recognized table header is used to effectively determine the number of table arrangements;

[0059] If the table header matching result is a match, it is determined that the table header in the extraction field is recognized, the number of times of successful matching is used to effectively determine the number of times of the recognized table header, and the number of times of the recognized table header is used to effectively determine the number of table arrangements;

[0060] The unmarked column in the extraction field is column-identified, and the number of arrangements is determined according to the column identification result and the number of marked columns.

[0061] Further, the column identification of the unmarked column in the extraction field and the determination of the number of arrangements according to the column identification result and the number of marked columns comprises:

[0062] Each unmarked column is respectively regular matched;

[0063] If the number of successful matches in any unmarked column is greater than the number threshold, the unmarked column is determined as a recognized column, and the sum of the number of recognized columns and the number of marked columns is calculated to obtain the number of arrangements;

[0064] The number threshold can be set according to requirements, the recognized column can be effectively determined based on the number of successful matches in the unmarked column, and the number of arrangements can be effectively determined based on the sum of the number of recognized columns and the number of marked columns.

[0065] Preferably, the column identification of the unmarked column in the extraction field and the determination of the number of arrangements according to the column identification result and the number of marked columns comprises:

[0066] Each unmarked column is respectively data scored to obtain a field score value, and the average score of each unmarked column is determined according to the field score value;

[0067] The unmarked column corresponding to the minimum average score is determined as a recognized column, and the sum of the number of recognized columns and the number of marked columns is calculated to obtain the number of arrangements;

[0068] In the data scoring process of each unlabeled field column, if kenlm recognition is used for data scoring, the field scoring value is the kenlm scoring result, after removing the columns with a field scoring value of 0, the column with the minimum average value is taken as the identified column; if the re matching mode is used for data scoring, 1 is taken as the matching success, and 0 is taken as the unsuccessful matching, the column with more than half of the matching success is taken as the identified column, and the number of the identified columns and the number of the labeled columns are summed to obtain the table number.

[0069] Further, after the table header matching result is a matching failure, the method further comprises:

[0070] The table tail is identified from the extracted field, the table tail row in the extracted field is determined according to the table tail identification result, and the noise is screened from the extracted field according to the table tail row.

[0071] In the case that the table header is not identified, the table tail is identified first, which effectively reduces unnecessary noise data when the kenlm / re column identification is used in the next step, and thus improves the accuracy of column identification.

[0072] In step S40, the extracted field is divided according to the table number, and the field value is extracted from each table header in the divided extracted field to obtain the extracted data.

[0073] In the embodiment, the image text can be effectively field extracted based on the document category and position information, if the extracted field is a table field, the table header row in the extracted field is determined by matching the table header, the table number is effectively determined based on the table header row, the extracted field is effectively divided based on the table number, and the extracted data is effectively obtained by extracting the field value from each table header in the divided extracted field. The embodiment does not need to set the fixed position of the medical record, and can effectively extract data from medical records with different page layouts, thereby improving the accuracy of data extraction.

[0074] Example Two

[0075] Please refer to Figure 2 is a flowchart of the secret embedding sharing method provided by the second embodiment of the present application, which is used to further refine the steps after step S20 in the first embodiment, and comprises the following steps:

[0076] In step S50, if the extracted field is a non-table field, the field name matching is performed on the extracted field, and the target row content in the extracted field is determined according to the field name matching result.

[0077] When the extraction field is a non-table field, the field name matching is performed on the extraction field to determine whether a preset field name exists in the extraction field, and the target row content is determined according to the identified field name in the extraction field. In this step, the content after the identified field name in the extraction field is reserved to obtain the target row content, and thus the accuracy of the target row content is improved.

[0078] In step S60, the field value extraction is performed on the target row content to obtain the extraction data.

[0079] Optionally, the field value extraction on the target row content to obtain the extraction data includes:

[0080] The regular matching is performed on the target row content.

[0081] If the regular matching of the target row content is successful, the field value of the target row content is obtained to obtain the extraction data. If the regular matching of the target row content is successful, the field value of the target row content is directly obtained to obtain the extraction data.

[0082] If the regular matching of the target row content fails, the null result is returned for the target row content.

[0083] Or, the text scoring is performed on the target row content to obtain a text scoring value. If the text scoring value is less than a text threshold value, the field value of the target row content is obtained to obtain the extraction data.

[0084] The text threshold value can be set according to requirements. If the text scoring value is less than the text threshold value, the field value of the target row content is obtained to obtain the extraction data.

[0085] Further, in the embodiment, a language model is trained. When the extraction data includes a field that cannot be completely matched by the regular matching, such as a diagnosis name or a medical order, the language model is used for judgment. In the embodiment, the kenlm can be used to train the language model.

[0086] In the embodiment, when the extraction field is a non-table field, the field name matching is performed on the extraction field to determine whether a preset field name exists in the extraction field. The field value extraction is performed on the target row content, so that the medical record with different page layouts can be effectively extracted, and the accuracy of the data extraction is improved.

[0087] Example Three

[0088] Please refer to Figure 3Fig. 3 is a structural schematic diagram of a data extraction system 100 provided by a third embodiment of the present application, comprising a character recognition module 10, a field extraction module 11, a table header matching module 12 and a data extraction module 13, wherein:

[0089] The character recognition module 10 is configured to perform character recognition on the target medical record image to obtain a character recognition result, wherein the character recognition result comprises image characters and position information corresponding to each image character, and a document category.

[0090] The field extraction module 11 is configured to perform field extraction on the image characters according to the document category and the position information to obtain extracted fields, and perform line division on the position information of the extracted fields.

[0091] The table header matching module 12 is configured to perform table header matching on the extracted fields if the extracted fields are table fields, and determine a table quantity according to a table header matching result.

[0092] The table header matching module 12 is further configured to: if the table header matching result is a matching success, obtain a matching success quantity, and determine the matching success quantity as the table quantity;

[0093] if the table header matching result is a matching failure, perform table header field matching on the extracted fields to obtain table header fields, and mark columns of the table header fields;

[0094] perform column recognition on unmarked field columns in the extracted fields, and determine the table quantity according to a column recognition result and a marked column quantity.

[0095] Further, the table header matching module 12 is further configured to: respectively perform regular matching on each unmarked field column;

[0096] if a matching success quantity in any unmarked field column is greater than a quantity threshold, determine the unmarked field column as a recognized column, and calculate a quantity sum between the recognized column quantity and the marked column quantity to obtain the table quantity.

[0097] Further, the table header matching module 12 is further configured to: respectively perform data scoring on each unmarked field column to obtain field scoring values, and respectively determine a scoring average value of each unmarked field column according to the field scoring values;

[0098] determine the unmarked field column corresponding to the minimum scoring average value as a recognized column, and calculate a quantity sum between the recognized column quantity and the marked column quantity to obtain the table quantity.

[0099] Preferably, the table header matching module 12 is further configured to perform table tail identification on the extracted field, and determine a table tail row in the extracted field according to the table tail identification result.

[0100] The extracted field is noise filtered according to the table tail row.

[0101] The data extraction module 13 is configured to divide the extracted field according to the table quantity, and perform field value extraction on each table header in the divided extracted field to obtain extracted data.

[0102] The data extraction module 13 is further configured to, if the extracted field is a non-table field, perform field name matching on the extracted field, and determine target row content in the extracted field according to the field name matching result.

[0103] The target row content is subjected to field value extraction to obtain the extracted data.

[0104] Further, the data extraction module 13 is further configured to perform regular matching on the target row content.

[0105] If the regular matching of the target row content is successful, the field value of the target row content is obtained to obtain the extracted data.

[0106] If the regular matching of the target row content fails, an empty value result is returned for the target row content.

[0107] Or, the target row content is subjected to text scoring to obtain a text scoring value, and if the text scoring value is less than a text threshold value, the field value of the target row content is obtained to obtain the extracted data.

[0108] Specifically, the data extraction system 100 is pre-provided with configuration file content according to user requirements, and the configuration file content is named as doc_general.yml: mainly including extracted fields corresponding to different types of documents, and related rules, thred, and other configurations, and an example is as follows:

[0109] “EMR080001” represents the document code of the front page of the medical record, “value” represents the non-table field in the medical record, “table” represents the table field in the medical record, “diagnosis name” represents the column name of the table, and “patterns:["[out of the mountain] hospital. *? Diagnose” represents regular matching of the table column name and other information.

[0110] The data extraction system 100 is further provided with a trained language model, and when there are fields such as diagnosis name and medical advice in the extracted data that cannot be completely matched by regular matching, the language model is used for judgment. In this embodiment, kenlm can be used to train the language model.

[0111] The specific implementation process of this embodiment includes:

[0112] a. Input: Non-electronic medical record image;

[0113] b. Use OCR to perform text recognition to obtain the text in the image and the corresponding box information, for example, {"top_left_x":811, "top_left_y":442, "box_h":68, "box_w":560, "str":"Inpatient Medical Records Cover Page", "score":0.994, "box":[[811.0, 442.0], [1371.0, 442.0], [1371.0, 510.0], [811.0, 510.0]]};

[0114] c. Based on the OCR recognition results, according to Figure 4 Data extraction is performed on the content, specifically... Figure 4 The steps include:

[0115] The document category is obtained based on the OCR recognition result, and the extracted fields are obtained based on the document category and the configuration file content.

[0116] If the extracted field is a table field, the box is divided into rows according to the coordinates in the OCR recognition result, and the header row is matched using regular expressions.

[0117] If the header row is identified, determine the number of times the header field is matched to determine the N rows of the table. Divide the page containing the extracted fields into N rows. If hastail=True (determine the tail row) in the configuration, the tail row needs to be determined. Otherwise, the tail of the table is the default tail of the page. Identify the column where each header field is located and extract the field values ​​in the order of the rows to obtain the extracted data.

[0118] If the header row is not identified and hastail=True (determine the tail row) is configured, then the tail row needs to be determined. Otherwise, the tail is the default page footer. In the case of not identifying the header row, identifying the tail row first is to reduce unnecessary noise data and improve the accuracy of column identification in the next step of using kenlm / re column identification.

[0119] The table header fields are matched according to the rules. Columns that match successfully are marked. Unmarked columns undergo column identification, which includes Kenlm or Re column identification. For each column, all data is scored. If Kenlm is used, the score is the Kenlm score result. After removing columns with a score of 0, the column with the smallest average score is selected as the identified column. If Re is used, a successful match is scored as 1, and an unsuccessful match is scored as 0. Columns that match more than half of the data are selected as the identified columns.

[0120] The number of columns containing the header fields determines the number of rows in the table. The page containing the extracted fields is divided into N rows. The field values ​​are extracted sequentially according to the columns containing each header field. Extraction stops when a necessary field is empty, or kenlm-score > thred, or re fails to match.

[0121] If the extracted field is a non-table field, the box is divided into rows according to the coordinates in the OCR recognition result, the row is matched according to the field name, and only the row content after the field name is retained;

[0122] Kenlm is used to match fields. Kenlm scores the text, and if score < thred, the value of that field is retrieved.

[0123] Use `re` to match field values. If a match is found, return the field value; otherwise, return nothing.

[0124] d. Obtain the extracted data, for example, the extracted data includes:

[0125] "table_result":[[{"item_name":"Diagnosis Name","item_content":"Proximal Fibula Fracture"},{"item_name":"Diagnosis Code","item_content":"S82.400x011"}],[{"item_name":"Diagnosis Name","item_content":"Superficial Injuries to Other Parts of the Head"},{"item_name":"Diagnosis Code","item_content":"S00.800"}]],"value_result":[{"item_name":"Admission Time","item_content":"2021-03-04"}].

[0126] In this embodiment, a language model is used to extract data, so the amount of training or labeled medical record data required is very small, and results can be obtained quickly. This makes up for the accuracy problem caused by insufficient data and the potential model speed problem. For different types of medical record documents and non-electronic medical records from different hospitals, only adding or deleting relevant configurations is required to complete the extraction of the required data, which greatly reduces the development cost.

[0127] Example Four

[0128] Figure 5 This is a structural block diagram of a terminal device 2 provided in the fourth embodiment of this application. For example... Figure 5As shown, the terminal device 2 of the embodiment comprises a processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the processor 20, for example, a program of the data extraction method. The processor 20 implements the steps in each of the embodiments of the above-mentioned data extraction method when executing the computer program 22.

[0129] For example, the computer program 22 can be divided into one or more modules, which are stored in the memory 21 and executed by the processor 20 to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 22 in the terminal device 2. The terminal device can include, but is not limited to, the processor 20 and the memory 21.

[0130] The processor 20 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0131] The memory 21 can be an internal storage unit of the terminal device 2, for example, a hard disk or a memory of the terminal device 2. The memory 21 can also be an external storage device of the terminal device 2, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 21 can include both the internal storage unit and the external storage device of the terminal device 2. The memory 21 is used to store the computer program and other programs and data required by the terminal device. The memory 21 can also be used to temporarily store data that has been output or will be output.

[0132] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0133] If the integrated module is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. The computer readable storage medium can be non-volatile or volatile. Based on this understanding, all or part of the processes in the above-mentioned embodiments can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable storage medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content included in the computer readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable storage medium does not include electrical carrier signals and telecommunication signals.

[0134] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A data extraction method, characterized by, The method comprises: performing character recognition on a target medical record image to obtain a character recognition result, the character recognition result comprising image characters and position information corresponding to each image character, and a document category; performing field extraction on the image characters according to the document category and the position information to obtain extracted fields, and performing line division on position information of the extracted fields; if the extracted fields are table fields, performing header matching on the extracted fields, and determining a table quantity according to a header matching result; segmenting the extracted fields according to the table quantity, and performing field value extraction on each header in the segmented extracted fields to obtain extracted data; the determining of the table quantity according to the header matching result comprises: if the header matching result is a matching success, obtaining a matching success quantity, and determining the matching success quantity as the table quantity; if the header matching result is a matching failure, performing header field matching on the extracted fields to obtain header fields, and marking columns of the header fields; performing column recognition on unmarked column fields in the extracted fields, and determining the table quantity according to a column recognition result and a marked column quantity.

2. The data extraction method of claim 1, wherein, the performing of the column recognition on the unmarked column fields in the extracted fields and the determining of the table quantity according to the column recognition result and the marked column quantity comprise: respectively performing regular matching on each unmarked column field; if a matching success quantity in any unmarked column field is greater than a quantity threshold, determining the unmarked column field as a recognized column, and calculating a quantity sum between a recognized column quantity and the marked column quantity to obtain the table quantity.

3. The data extraction method of claim 1, wherein, the performing of the column recognition on the unmarked column fields in the extracted fields and the determining of the table quantity according to the column recognition result and the marked column quantity comprise: respectively performing data scoring on each unmarked column field to obtain a field scoring value, and respectively determining a scoring average value of each unmarked column field according to the field scoring value; determining an unmarked column corresponding to a minimum scoring average value as a recognized column, and calculating a quantity sum between a recognized column quantity and the marked column quantity to obtain the table quantity.

4. The data extraction method of claim 1, wherein, the performing of the column recognition on the unmarked column fields in the extracted fields and the determining of the table quantity according to the column recognition result and the marked column quantity further comprise: performing tail recognition on the extracted fields, and determining a tail line in the extracted fields according to a tail recognition result; performing noise screening on the extracted fields according to the tail line.

5. The data extraction method of any one of claims 1 to 4, wherein, the performing of the line division on the position information of the extracted fields further comprises: if the extracted fields are non-table fields, performing field name matching on the extracted fields, and determining target line content in the extracted fields according to a field name matching result; performing field value extraction on the target line content to obtain the extracted data.

6. The data extraction method of claim 5, wherein, the performing of the field value extraction on the target line content to obtain the extracted data comprises: performing regular matching on the target line content; if the regular matching on the target line content is successful, obtaining a field value of the target line content to obtain the extracted data; If the regular matching of the target row content fails, an empty value result is returned for the target row content; Or, text scoring is performed on the target row content to obtain a text scoring value, if the text scoring value is less than a text threshold, a field value of the target row content is obtained to obtain the extraction data.

7. A data extraction system characterized by, The system comprises: a character recognition module, configured to perform character recognition on a target medical record image to obtain a character recognition result, the character recognition result comprising image characters and position information corresponding to each image character, and a document category; a field extraction module, configured to perform field extraction on the image characters according to the document category and the position information to obtain an extraction field, and perform row division on position information of the extraction field; a table header matching module, configured to, if the extraction field is a table field, perform table header matching on the extraction field, and determine a table arrangement number according to a table header matching result; a data extraction module, configured to divide the extraction field according to the table arrangement number, and perform field value extraction according to each table header in the divided extraction field to obtain extraction data; the table header matching module is further configured to, if the table header matching result is matching success, obtain a matching success number, and determine the matching success number as the table arrangement number; if the table header matching result is matching failure, perform table header field matching on the extraction field to obtain a table header field, and mark columns of the table header field; perform column recognition on unmarked field columns in the extraction field, and determine the table arrangement number according to the column recognition result and a number of marked columns.

8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image recognition method and device based on numerical extraction and storage medium

    CN112364857A

  • Table generation method, table generation device, storage medium and electronic equipment

    CN113779943A