A method, system and storage medium for automatically analyzing and generating data records
By identifying and analyzing table contents in PDF files and extracting keywords and data values, it solves the problems of low data recording processing efficiency and high error rate in medical research, realizes automated processing, and improves the accuracy and efficiency of data recording.
Patent Information
- Application Number
- CN202111481774.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2041-12-06
AI Technical Summary
In medical research, the extraction and processing of experimentally recorded data from PDF files has problems of low efficiency and high error rates. Transcription errors are prone to occur especially when multiple files need to be transcribed and summarized manually.
By identifying and analyzing the table content in PDF files, converting them into editable text format, extracting keywords and data values, and entering them into the corresponding table areas according to the predetermined format, it supports the processing of regular and irregular documents, and utilizes key Word matching and approximate dictionaries improve the accuracy of data extraction.
It realizes automated data recording processing, improves the efficiency and accuracy of data recording, reduces manual transcription errors, and simplifies the integration and processing of experimental data.
Smart Images

Figure CN114186536B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to a method, system and storage medium for automatically analyzing and generating data records. Background Art
[0002] In the process of medical research, whether in the pharmacy or R&D stage, drug synthesis or purchased samples need to be analyzed, including impurities, liquid phase, appearance, protein concentration, insoluble particles, osmotic pressure and other inspection items. The analysis process will use a lot of testing equipment and generate a lot of data. Some of them need to be transcribed by experimenters on the on-site equipment, and some equipment can fully record the original data in the process, but to finally become a usable experimental record result, the experimenter needs to further calculate. At this time, the original data needs to be exported into Excel, PDF and other format documents. Due to compliance requirements, various types of equipment often choose PDF format for transmission, and multiple files need to be transcribed and summarized by experimenters separately, which will cause transcription errors, omissions and other problems. For example, under the traditional experimental steps, when an experimental record uses data in a PDF report, it is necessary to open the PDF report, find multiple data from multiple data, and then transcribe and enter them in the experimental record, which is easy to lead to low efficiency, high error rate and high experimental rework rate. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a method for automatically analyzing and generating data records, comprising the following steps:
[0004] S1, identifying and analyzing the table contents in the uploaded multiple PDF data documents, and transferring them into first texts in an editable format, respectively, wherein the first texts include the table in the PDF file, the data in the table, and the document ID;
[0005] S2, if the PDF data document is a rule document, query the rule document library for a rule document template corresponding to the PDF data document, obtain the keyword set and table type in the rule document template, and directly extract each keyword and its corresponding data value from the first text according to the table type and keyword set;
[0006] S3, if the pdf data document is a non-regular document, the contents of each cell of the table of the first text are searched and matched by keywords, the distribution area of the cell where the corresponding data value is located is queried according to the data format to which the matched keyword belongs, and the table type of the first text is obtained according to the distribution area, and the cell where the data value to which the matched keyword belongs is determined according to the table type and the corresponding data value is obtained;
[0007] S4, dividing the second text into different table areas according to the different document IDs from which the acquired keywords and the corresponding data values come, and entering the keywords and the corresponding data values acquired from each first text recognition into the table areas corresponding to the corresponding documents according to a predetermined format.
[0008] Preferably, the table type includes but is not limited to a first table and a second table, the data types in the first table are arranged vertically and the data value cells belonging to each data type are arranged horizontally at the back, and the data types in the second table are arranged horizontally and the data value cells belonging to each data type are arranged vertically at the back.
[0009] Preferably, the step S3 specifically includes:
[0010] S31, if the pdf data document is a non-regular document, searching and matching the contents of each cell of the table of the first text by keywords;
[0011] S32, if the keyword is matched, query the data format to which the keyword belongs; otherwise, retrieve the approximate dictionary table, use the approximate words of the keyword in turn for matching, and obtain the data format to which the corresponding keyword belongs for the matched approximate words;
[0012] S33, starting from the cell where the keyword or similar word is located, querying the data formats of the cells below the same column and the cells to the right of the same row according to the data format, and obtaining a distribution area of cells having the same data format as that of the keyword;
[0013] S34, obtaining the table type of the first text according to the distribution area, and determining the cells where the data values of the matched keywords are located according to the table type and obtaining the corresponding data values.
[0014] Preferably, the step S3 further comprises:
[0015] S35, if the keyword and the similar word are not matched, then retrieve the data format of each keyword, and check whether there are multiple cells in the table that are connected in sequence horizontally or vertically and conform to the same data format;
[0016] S36, if it exists, obtain the data of each cell in the row or column; if the data formats in the cells other than the first cell are the same or blank, obtain the data values and arrangement order of each cell in the row or column;
[0017] S37, obtaining the text in the first cell of the row or column as a post-complement word, using the data values of the remaining cells of the row or column as the corresponding data values of the post-complement word, and establishing a correspondence between the post-complement word and keywords with the same data format.
[0018] Preferably, the step S37 further comprises: adding the post-complement word into the approximate dictionary table as an approximate word of the keyword with the same data format as the post-complement word.
[0019] Preferably, the step S4 further comprises:
[0020] S41, dividing the second text into different table areas according to the obtained keywords / similar words / supplement words and different document IDs from which the corresponding data values come;
[0021] S42, if keywords are obtained, the keywords and corresponding data values obtained from the first text recognition are respectively entered into the table area corresponding to the corresponding document according to a predetermined format;
[0022] S43, if an approximate word is obtained, the approximate word obtained from each first text recognition is replaced with the corresponding keyword, and the corresponding data value is respectively entered into the table area corresponding to the corresponding document according to a predetermined format;
[0023] S44: If the post-complementary words are obtained, the post-complementary words obtained from the first text recognition and the corresponding keywords and the corresponding data values are respectively entered into the table area corresponding to the corresponding document according to a predetermined format.
[0024] The present invention also discloses a data record automatic analysis and generation system, comprising: a batch upload module, used for identifying and analyzing the table contents in the uploaded multiple PDF data documents, and transferring them into editable first texts respectively, wherein the first texts contain tables in the PDF files, data in the tables and document IDs; a first extraction module, used for, when the PDF data document is a rule document, querying the rule document template corresponding to the PDF data document in the rule document library, obtaining the keyword set and table type in the rule document template, and directly extracting each keyword and the corresponding data value from the first text according to the table data structure and the keyword set; a second extraction module, used for, when the PDF data document is a non-rule document, searching and matching the contents of each cell of the table of the first text by keywords, querying the distribution area of the cell where the corresponding data value is located according to the data format to which the matched keyword belongs, and obtaining the table type of the first text according to the distribution area, determining the cell where the data value to which the matched keyword belongs is located according to the table type and obtaining the corresponding data value; a data generation module, used for dividing the second text into different table areas according to different document IDs from which the obtained keywords and the corresponding data values come, and entering the keywords and the corresponding data values obtained from each first text recognition into the table area corresponding to the corresponding document according to a predetermined format.
[0025] Preferably, the second extraction module includes: a keyword matching module, which is used to retrieve and match the contents of each cell of the table of the first text through keywords when the pdf data document is a non-regular document; a format acquisition module, which is used to query the data format to which the keyword belongs when the keyword is matched; when the keyword is not matched, the approximate dictionary table is called up, and each approximate word of the keyword is used for matching in turn, and the data format to which the corresponding keyword belongs is obtained for the matched approximate word; a distribution analysis module, which is used to query the data format of each cell below the same column and the data format of each cell on the right side of the same row based on the data format and the cell where the keyword or the approximate word is located as the starting point, and obtain the distribution area of cells having the same data format as the keyword; a data extraction module, which is used to obtain the table type of the first text according to the distribution area, and determine the cell where the data value of each matched keyword is located according to the table type and obtain the corresponding data value.
[0026] The present invention also discloses a data record automatic analysis and generation device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above methods when executing the computer program.
[0027] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0028] The method and system for automatic analysis and generation of data records disclosed in the present invention can automatically obtain PDF files of experimental data records, upload and parse them in batches, automatically extract corresponding content and data in the table of PDF files according to keywords, and copy and paste them into the experimental record system as needed, which can greatly improve data recording efficiency, improve accuracy, reduce transcription workload, and avoid manual transcription errors.
[0029] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0031] Figure 1 A schematic flow chart of a method for automatically analyzing and generating data records disclosed in an embodiment.
[0032] Figure 2This is a schematic diagram of a specific flow chart of step S3 disclosed in an embodiment.
[0033] Figure 3 Another flowchart diagram of step S3 disclosed in an embodiment.
[0034] Figure 4 This is a schematic diagram of a specific flow of step S4 disclosed in an embodiment.
[0035] Figure 5 A schematic diagram of the structural principle of a system for automatically analyzing and generating data records disclosed in an embodiment. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment 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.
[0037] In the present invention, unless otherwise clearly specified and limited, the technical terms or scientific terms used herein shall have the common meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "an" do not indicate a quantity limitation, but indicate the existence of at least one.
[0038] In the actual drug development process, many detection equipment will be used in the analysis process, generating a large amount of data. For example, when an experimenter performs chromatographic analysis on a drug, the equipment will have its original data records, but the chromatograph and other equipment work continuously, and there will be many samples of the project that need to be tested later, so the data needs to be exported into Excel and PDF files to the experimenter's own computer for data processing and calculation, which will generate a lot of PDF files. The experimenter needs to distinguish each file according to the project, equipment, sample and other numbers and process them one by one. Due to compliance requirements, the PDF format will eventually be selected for transmission, and multiple files need to be copied by the experimenter separately, and there will often be problems such as transcription errors and omissions. This patent discloses a method for automatic analysis and generation of data records, which can automatically obtain PDF files, batch upload, batch analysis, automatically extract table contents in PDF files, and copy and paste them into other systems for experimental record processing as needed, such as electronic experimental record systems. After extracting and editing the table contents in the PDF file, participating in the subsequent experimental data processing can greatly improve the efficiency of data recording, improve accuracy, reduce the workload of transcription, and avoid manual transcription errors.
[0039] Attached Figure 1 This is a schematic diagram of specific steps of a method for automatically analyzing and generating data records disclosed in this embodiment. The method may specifically include the following steps:
[0040] Step S1, identifying and analyzing the table contents in the uploaded multiple PDF data documents, and transferring them into first texts in an editable format, respectively. The first texts include the tables in the PDF files, the data in the tables, and the document ID.
[0041] Specifically, the first text can be a file in the form of txt, word, excel, etc. The method for automatically analyzing and generating data records can be applied to management software such as the pharmaceutical R&D life cycle management system. By uploading the attachment information related to the experiment in the attachment module of the recording unit, the PDF file of the test results can be uploaded in batches in the attachment. Then the content in the table in the PDF file is parsed, and the page will display the data in the columns or rows such as name, time, peak value, peak value percentage, etc. after the PDF is parsed.
[0042] Step S2: If the PDF data document is a rule document, query the rule document library for the rule document template corresponding to the PDF data document, obtain the keyword set and table type in the rule document template, and directly extract each keyword and its corresponding data value from the first text according to the table type and keyword set.
[0043] The table types include but are not limited to a first table and a second table, wherein the data types in the first table are arranged vertically and the data value cells belonging to each data type are arranged horizontally at the back, and the data types in the second table are arranged horizontally and the data value cells belonging to each data type are arranged vertically at the back.
[0044] Specifically, if it is a rule document, the keywords to be extracted in the first text can be directly located according to the keyword set match of the rule document template, and then the cell distribution type of the data value belonging to the first text can be obtained according to the table type of the rule document template, and then the cells where the data values corresponding to the keywords are located can be directly found to extract data.
[0045] In some rule document tables, the table type in which data is arranged horizontally may be converted to a table type in which data is arranged vertically due to the amount of data and the desired presentation effect. For example, the original table type is a first type table in which data is arranged horizontally, but when there are too many data values belonging to some data types, the other data will be horizontally placed in the second column when the horizontal arrangement is used again, which does not conform to the conventional table habits and data presentation effect. At this time, the table may be converted from the first table type to the second table type, so that more data values of the same data type can be presented in the same page table.
[0046] Step S3, if the pdf data document is a non-regular document, the contents of each cell of the table of the first text are retrieved and matched by keywords, the distribution area of the cell where the corresponding data value is located is queried according to the data format to which the matched keyword belongs, and the table type of the first text is obtained according to the distribution area, and the cell where the data value to which the matched keyword belongs is determined according to the table type and the corresponding data value is obtained.
[0047] Specifically, if the pdf data document is a non-regular document, the contents of each cell of the table of the first text are searched and matched by keywords.
[0048] As attached Figure 2 As shown, the step S3 specifically includes:
[0049] Step S31: If the PDF data document is a non-regular document, the contents of each cell of the table of the first text are searched and matched by keywords.
[0050] Step S32, if the keyword is matched, the data format to which the keyword belongs is queried; otherwise, the approximate dictionary table is retrieved, and each approximate word of the keyword is used for matching in turn, and the data format to which the corresponding keyword belongs is obtained for the matched approximate word.
[0051] Specifically, if a keyword is matched, it is determined whether the cell contains only the keyword or other text information in addition to the keyword. For example, if the keyword is time, and the document contains A time, B time, etc., the name is matched first, and then the keyword is compared by hashCode to determine whether it is the required keyword. If all keywords are matched and no corresponding data is found, the approximate keywords are matched. The approximate keywords are maintained in the program dictionary table and can be added and deleted.
[0052] After matching the keyword, the program needs to record the location of the current keyword, and then in the subsequent parsing, the data at the corresponding position is the keyword data we need. Until the end keyword is parsed. If there is a blank line, you need to compare the upper and lower lines to find where the blank line is, and then exclude the blank line and recalculate the line where the data is located, and then get the key data. If there are special symbols, a set of special character dictionaries can also be stored in the system, and then filter out the special characters during parsing, and then record the keywords. If there is a merged row, it is divided into different cases. If the merged row contains the row where the keyword is located, the entire row of data is taken as the key data. If the merged row is not the row where the keyword is located, recalculate the changes in the row where the relevant keyword is located, and then record the key data under the corresponding row.
[0053] It is best to select the content to be copied according to the user's needs. After confirmation, the data will be automatically recorded in the latest spreadsheet in the current experimental record.
[0054] Step S33, based on the data format, starting from the cell where the keyword or similar word is located, query the data format in the cells below the same column and the data format in the cells on the right side of the same row to obtain the distribution area of cells with the same data format as the keyword.
[0055] In some specific embodiments, the first text table may have multiple table types. For example, the conventional first table and the second table described above, wherein the data types in the first table are arranged vertically and the data value cells belonging to each data type are arranged horizontally at the back, and the data types in the second table are arranged horizontally and the data value cells belonging to each data type are arranged vertically at the back. In the first text table, keywords may include name, time, peak value, peak value percentage, etc., wherein the data formats of the keywords may be different, for example, the data format of the keyword "name" is all text data, and the number of characters contained therein is also within a certain range, such as 2 to 10 characters; the data format of the keyword "time" includes digital and text information; the keyword "peak value" only contains pure digital information; the keyword "peak value percentage" contains digital information and special symbols "%", wherein the numbers are also between 0 and 100, and the data belonging to the keyword is best distinguished. The above is only an example of commonly used keywords and their data formats, and they can be set and updated according to specific keywords and their data in specific applications. In some preferred embodiments, since the recognizability of the data formats described by some keywords varies greatly, for example, the data format to which the keyword "name" belongs is easily confused with other regular cell data and difficult to distinguish, the keywords can be divided into first-category keywords and second-category keywords according to the degree of distinguishability of the data formats to which the keywords belong, wherein the first-category keywords include keywords whose data formats have higher distinguishability, such as peak percentage and other keywords; and the second-category keywords include keywords whose data formats have lower distinguishability, such as name and other keywords.
[0056] In this embodiment, after matching a keyword or an approximate word, the keyword and approximate word database is queried to obtain the data format of one or more of the keywords or approximate words. Based on the obtained data format, the cell where the keyword or approximate word is located is used as the starting point to query the data format of each cell below the same column and the data format of each cell to the right of the same row. When the data format of the data in a cell is consistent with the data format of the keyword or approximate word, it is recorded, and finally the distribution area of cells with the same data format as the keyword is obtained.
[0057] In some preferred embodiments, among the matched keywords or approximate words, find out the first-category keywords or keywords similar to them that are approximate words of the first-category keywords, obtain the data formats of one or more of the first-category keywords or keywords similar to them that are approximate words of the first-category keywords, take the cell where the corresponding keyword or approximate word is located as the starting point, query the data formats of the cells below the same column and the data formats of the cells on the right side of the same row, and obtain the distribution area of cells with the same data format as the keyword or approximate word. Because the data formats of various keywords have different degrees of distinguishability, directly selecting the first-category keywords with higher distinguishability to perform cell data format screening and matching will achieve higher efficiency and accuracy.
[0058] Specifically in this embodiment, this step may further include the following content.
[0059] Determine whether the data formats of cells in the same row except the first cell are the same or blank. If so, obtain the data values and arrangement order of each cell in the row and use them as the data values of the corresponding keyword.
[0060] If the data formats of cells in the same row other than the first cell are different, determine whether the data formats of cells in the same column other than the first cell are the same or blank. If so, obtain the data values and arrangement order of each cell in the column and use them as the data values of the corresponding keyword.
[0061] If the data formats of cells in the same column other than the first cell are also different, the acquisition of the data value to which the keyword belongs is abandoned.
[0062] In a specific embodiment, when the data formats of cells in the same row other than the first cell are different and the data formats of cells in the same column other than the first cell are also different, another matched keyword or approximate word can be replaced to perform another data format judgment in the cell until a matched keyword is obtained that meets the same data format or is a blank in cells in the same row or column other than the first cell. Then, the table type of the first text is determined based on the distribution area of cells with the same data format to which the matched keyword or approximate word belongs. Based on the table type of the first text, the data values in the cells of the matched keywords or approximate words in the same row or column other than the first cell whose data formats are not exactly the same are obtained.
[0063] Step S34, obtaining the table type of the first text according to the distribution area, and determining the cells where the data values of the matched keywords are located according to the table type and obtaining the corresponding data values.
[0064] Specifically, if the cell where the corresponding keyword or approximate word is located is taken as the starting point, and the cells with the same data format as the keyword are all located in the same row as the keyword or approximate word, it indicates that the table is a table with data arranged horizontally, that is, the first table type mentioned above. If the cells with the same data format as the keyword are all located in the same column as the keyword or approximate word, it indicates that the table is a table with data arranged vertically, that is, the second table type mentioned above. After confirming the table type, the cells where the data values of other matching keywords or approximate words are located can be obtained from the corresponding cells according to the table type.
[0065] In this embodiment, if some cells have blank lines or spaces, it is necessary to compare the upper and lower lines to find out where the blank lines are located, and then recalculate the lines where the data is located after excluding the blank lines, and then obtain the key data. If there are special symbols, a set of special character dictionaries is also stored in the system, and then the special characters are filtered out during parsing, and then the keywords are recorded. If there are merged lines, the situation is divided into different cases. If the merged line contains the line where the keyword is located, the entire line of data is taken as the key data. If the merged line is not the line where the keyword is located, the changes in the line where the relevant keyword is located are recalculated, and then the key data under the corresponding line is recorded.
[0066] Specifically in this embodiment, the step of determining the cells where the data values of the matched keywords are located according to the table type and obtaining the corresponding data values also includes:
[0067] Get the same row or column where the data values of each matching keyword are located according to the table type.
[0068] Gets the data format of the data in the cells except the first cell in the same row or column.
[0069] According to the data format of the matching keyword or approximate word in the first cell, the data format of the data in other cells is checked, and the data in the cells with the same data format are used as the data value of the matching keyword or approximate word.
[0070] In other embodiments, as shown in the attached Figure 3 As shown, the step S3 also includes:
[0071] Step S35: If no keywords or similar words are matched, the data format of each keyword is retrieved to check whether there are multiple cells in the table that are connected in sequence horizontally or vertically and conform to the same data format.
[0072] Step S36, if it exists, obtain the data of each cell in the row or column. If the data formats in other cells except the first cell are the same or blank, obtain the data values and arrangement order of each cell in the row or column.
[0073] Step S37, obtaining the text in the first cell of the row or column as a post-complement word, using the data values of the remaining cells of the row or column as the corresponding data values of the post-complement word, and establishing a correspondence between the post-complement word and keywords with the same data format.
[0074] The step S37 further includes: adding the post-complement word into the approximate dictionary table as an approximate word of the keyword with the same data format as the post-complement word.
[0075] Due to the differences in experimental objects, experimental equipment and experimental personnel, there are always some slight differences in the keyword descriptions of some experimental documents, making it impossible to completely exhaust the approximate values of the keywords during the initial setting. It is necessary to update and supplement the approximate words of each keyword in the approximate dictionary table according to the specific work documents during the document processing. Therefore, by matching the data formats of some specific approximate words, we can preliminarily determine whether they are approximate words of the preset keywords, thereby completing the real-time supplement and update of the approximate dictionary table.
[0076] Step S4, dividing the second text into different table areas according to the different document IDs from which the acquired keywords and the corresponding data values come, and entering the keywords and the corresponding data values acquired from each first text recognition into the table areas corresponding to the corresponding documents in a predetermined format.
[0077] In this embodiment, when the data is copied and pasted into the electronic spreadsheet of the second text, it will be segmented according to the file to which the content belongs, and the user will be clearly informed of the document to which each segment of data belongs, so as to facilitate calculation and use. Figure 4 As shown, step S4 further includes:
[0078] Step S41 , dividing the second text into different table areas according to the obtained keywords / similar words / supplement words and the different document IDs from which the corresponding data values come.
[0079] Step S42: if keywords are obtained, the keywords and corresponding data values obtained from the first text recognition are respectively entered into the table area corresponding to the corresponding document according to a predetermined format.
[0080] Step S43: if similar words are obtained, the similar words obtained from the first text recognition are replaced with corresponding keywords, and are entered into the table area corresponding to the corresponding document in a predetermined format together with the corresponding data values.
[0081] Step S44, if the post-complementary words are obtained, the post-complementary words obtained from the first text recognition and the corresponding keywords are entered into the table area corresponding to the corresponding document in a predetermined format with the corresponding data values. The post-complementary words are words that are identified as being similar to the keywords in the current document parsing process, and need to be displayed in the second text when it is finally presented to prevent recognition errors, so that the processing personnel can confirm the post-complementary words again when processing the second text, and then enter them into the approximate dictionary table as similar words similar to the keywords after confirmation.
[0082] In this embodiment, when recording data, the content of the record book will be analyzed first. If the record book is empty, the data will be filled directly. If there is data in the record book, the data position will be calculated first by the coordinates of the data location and the edge coordinates. After finding the position to be inserted, the coordinates are used to calculate whether the number of rows to be inserted matches the number of remaining rows. If the number of remaining rows is insufficient, a blank row is added. If the number of remaining rows meets the addition requirement, the data is directly added. It is ensured that each insertion of data can be successful. And if multiple selections are made on the data of the pdf, it will be segmented when inserted, segmented by different pdf names, and the data of different pdfs will be segmented and displayed.
[0083] The method for automatic analysis and generation of data records disclosed in the present embodiment can automatically obtain PDF files of experimental data records, batch upload and parse them, automatically extract corresponding content and data in a table according to keywords, and copy and paste them into the experimental record system as needed, which can greatly improve data recording efficiency, improve accuracy, reduce transcription workload, and avoid manual transcription errors.
[0084] Attached Figure 5A data record automatic analysis and generation system disclosed in another embodiment can be a management system for the entire life cycle of pharmaceutical research and development or an electronic laboratory record system ELN, etc. The system can specifically include: a batch upload module 1, which is used to identify and analyze the table contents in the uploaded multiple PDF data documents, and transfer them into a first text in an editable format, respectively, wherein the first text contains the table in the PDF file, the data in the table, and the document ID. A first extraction module 2 is used to query the rule document template corresponding to the PDF data document in the rule document library when the PDF data document is a rule document, obtain the keyword set and table type in the rule document template, and directly extract each keyword and the corresponding data value from the first text according to the table data architecture and keyword set. A second extraction module 3 is used to retrieve and match the contents of each cell of the table of the first text by keywords when the PDF data document is a non-rule document, query the distribution area of the cell where the corresponding data value is located according to the data format to which the matched keyword belongs, and obtain the table type of the first text according to the distribution area, determine the cell where the data value to which the matched keyword belongs is located according to the table type, and obtain the corresponding data value. The data generation module 4 is used to divide the second text into different table areas according to the different document IDs from which the obtained keywords and the corresponding data values come, and enter the keywords and the corresponding data values obtained from each first text recognition into the table areas corresponding to the corresponding documents according to a predetermined format.
[0085] In this embodiment, the table types include but are not limited to a first table and a second table. The data types in the first table are arranged vertically and the data value cells belonging to each data type are arranged horizontally at the back. The data types in the second table are arranged horizontally and the data value cells belonging to each data type are arranged vertically at the back.
[0086] In this embodiment, the second extraction module 3 may include: a keyword matching module, which is used to search and match the contents of each cell of the table of the first text by keywords when the pdf data document is a non-regular document. A format acquisition module, which is used to query the data format to which the keyword belongs when the keyword is matched; when the keyword is not matched, the approximate dictionary table is retrieved, and each approximate word of the keyword is used for matching in turn, and the data format to which the corresponding keyword belongs is obtained for the matched approximate word. A distribution analysis module is used to query the data format of each cell below the same column and the data format of each cell on the right side of the same row based on the data format and the cell where the keyword or the approximate word is located as the starting point, and obtain the distribution area of cells with the same data format as the keyword. A data extraction module is used to obtain the table type of the first text according to the distribution area, and determine the cell where the data value of each matched keyword belongs according to the table type and obtain the corresponding data value.
[0087] The specific functions of the above-mentioned data record automatic analysis and generation system correspond one-to-one to the data record automatic analysis and generation method disclosed in the previous embodiment, so it will not be described in detail here. For details, please refer to the various embodiments of the data record automatic analysis and generation method disclosed in the previous embodiment. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
[0088] In other embodiments, a data record automatic analysis and generation device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the various steps of the data record automatic analysis and generation method described in the above embodiments are implemented.
[0089] The data record automatic analysis and generation device may include, but not limited to, a processor and a memory. The server may include, but not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a server and does not constitute a limitation on the server device, and may include more or fewer components than shown in the diagram, or may combine certain components, or different components, for example, the server device may also include input and output devices, network access devices, buses, etc.
[0090] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the server device, and uses various interfaces and lines to connect various parts of the entire server device.
[0091] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the server device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0092] If the data record automatic analysis and generation method is implemented 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. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable 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, computer-readable media do not include electric carrier signals and telecommunication signals.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
[0094] In conclusion, the above is only a preferred embodiment of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the patent of the present invention.
Claims
1. A method for automatically analyzing and generating data records, characterized in that: The steps include: S1, identifying and analyzing the table contents in the uploaded multiple PDF data documents, and transferring them into first texts in an editable format, respectively, wherein the first texts include the table in the PDF file, the data in the table, and the document ID; S2, if the PDF data document is a rule document, query the rule document library for a rule document template corresponding to the PDF data document, obtain the keyword set and table type in the rule document template, and directly extract each keyword and its corresponding data value from the first text according to the table type and keyword set; S3, if the pdf data document is a non-regular document, the contents of each cell of the table of the first text are searched and matched by keywords, the distribution area of the cell where the corresponding data value is located is queried according to the data format to which the matched keyword belongs, and the table type of the first text is obtained according to the distribution area, and the cell where the data value to which the matched keyword belongs is determined according to the table type and the corresponding data value is obtained; S4, dividing the second text into different table areas according to the different document IDs from which the acquired keywords and the corresponding data values come, and entering the keywords and the corresponding data values acquired from each first text recognition into the table areas corresponding to the corresponding documents according to a predetermined format.
2. The method for automatically analyzing and generating data records according to claim 1, characterized in that: The table types include but are not limited to a first table and a second table, wherein the data types in the first table are arranged vertically and the data value cells belonging to each data type are arranged horizontally at the back, and the data types in the second table are arranged horizontally and the data value cells belonging to each data type are arranged vertically at the back.
3. The method for automatically analyzing and generating data records according to claim 2, characterized in that: The step S3 specifically includes: S31, if the pdf data document is a non-regular document, searching and matching the contents of each cell of the table of the first text by keywords; S32, if the keyword is matched, query the data format to which the keyword belongs; otherwise, retrieve the approximate dictionary table, use the approximate words of the keyword in turn for matching, and obtain the data format to which the corresponding keyword belongs for the matched approximate words; S33, starting from the cell where the keyword or similar word is located, querying the data formats of the cells below the same column and the cells to the right of the same row according to the data format, and obtaining a distribution area of cells having the same data format as that of the keyword; S34, obtaining the table type of the first text according to the distribution area, and determining the cells where the data values of the matched keywords are located according to the table type and obtaining the corresponding data values.
4. The method for automatically analyzing and generating data records according to claim 3, characterized in that: The step S3 further comprises: S35, if the keyword and the similar word are not matched, then retrieve the data format of each keyword, and check whether there are multiple cells in the table that are connected in sequence horizontally or vertically and conform to the same data format; S36, if it exists, obtain the data of each cell in the row or column; if the data formats in the cells other than the first cell are the same or blank, obtain the data values and arrangement order of each cell in the row or column; S37, obtaining the text in the first cell of the row or column as a post-complement word, using the data values of the remaining cells of the row or column as the corresponding data values of the post-complement word, and establishing a correspondence between the post-complement word and keywords with the same data format.
5. The method for automatically analyzing and generating data records according to claim 4, characterized in that: The step S37 further includes: adding the post-complement word into the approximate dictionary table as an approximate word of the keyword with the same data format as the post-complement word.
6. The method for automatically analyzing and generating data records according to claim 5, characterized in that: The step S4 further comprises: S41, dividing the second text into different table areas according to the obtained keywords / similar words / supplement words and different document IDs from which the corresponding data values come; S42, if keywords are obtained, the keywords and corresponding data values obtained from the first text recognition are respectively entered into the table area corresponding to the corresponding document according to a predetermined format; S43, if an approximate word is obtained, the approximate word obtained from each first text recognition is replaced with the corresponding keyword, and the corresponding data value is respectively entered into the table area corresponding to the corresponding document according to a predetermined format; S44: If the post-complementary words are obtained, the post-complementary words obtained from the first text recognition and the corresponding keywords and the corresponding data values are respectively entered into the table area corresponding to the corresponding document according to a predetermined format.
7. A data record automatic analysis and generation system, characterized in that: include: A batch upload module, used for identifying and analyzing the table contents in the uploaded multiple PDF data documents, and transferring them into editable first texts, wherein the first texts include the table in the PDF file, the data in the table, and the document ID; A first extraction module is used for, when the PDF data document is a rule document, querying a rule document template corresponding to the PDF data document in a rule document library, obtaining a keyword set and a table type in the rule document template, and directly extracting each keyword and its corresponding data value from the first text according to the table data structure and the keyword set; A second extraction module is used for searching and matching the contents of each cell of the table of the first text by keywords when the PDF data document is a non-regular document, querying the distribution area of the cell where the corresponding data value is located according to the data format to which the matched keyword belongs, and obtaining the table type of the first text according to the distribution area, determining the cell where the data value to which the matched keyword belongs is located according to the table type and obtaining the corresponding data value; The data generation module is used to divide the second text into different table areas according to the different document IDs from which the obtained keywords and the corresponding data values come, and enter the keywords and the corresponding data values obtained from each first text recognition into the table areas corresponding to the corresponding documents according to a predetermined format.
8. The data record automatic analysis and generation system according to claim 7, characterized in that: The second extraction module comprises: A keyword matching module, used for searching and matching the contents of each cell of the table of the first text by keywords when the PDF data document is a non-regular document; The format acquisition module is used to query the data format to which the keyword belongs when the keyword is matched; when the keyword is not matched, the approximate dictionary table is retrieved, and the approximate words of the keyword are used for matching in turn, and the data format to which the corresponding keyword belongs is obtained for the matched approximate words; A distribution analysis module is used to query the data formats of the cells below the keyword or the similar word as the starting point according to the data format, and the data formats of the cells on the right of the same row, so as to obtain the distribution area of the cells having the same data format as the keyword; The data extraction module is used to obtain the table type of the first text according to the distribution area, and determine the cells where the data values of each matched keyword are located according to the table type and obtain the corresponding data values.
9. A data record automatic analysis and generation device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Table extraction method and device, terminal and computer readable storage medium
CN110659346A
Intelligent filing method and system for drug declaration documents
CN111352898A
Laboratory scientific data management system
CN112200547A
System and method for extraction and creation of image and table contents of information analysis
KR1020090039323A
