Medical data intelligent extraction method and system, electronic equipment and storage medium

By constructing structured prompt word templates and multi-level validation rules, the accuracy and reliability issues of medical data extraction in existing technologies have been resolved, enabling efficient and controllable medical data extraction in diverse clinical scenarios.

CN121542415APending Publication Date: 2026-02-17TONGFANG KNOWLEDGE DIGITAL PUBLISHING TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511725261.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing technologies struggle to balance accuracy, domain generalization, and application reliability when extracting numerical medical data from unstructured text. Rule-based methods exhibit poor generalization capabilities, while large language models suffer from illusion problems and uncontrollable output.

Method used

A structured prompt word template is constructed to guide the output of the large language model, and the results are verified by string matching and preset rules. Finally, the accuracy of the extraction results is judged by numerical operators.

Benefits of technology

It improves the accuracy and reliability of numerical medical data extraction, enhances the generalization ability in diverse clinical scenarios, ensures the controllability and traceability of results, and can handle complex numerical expressions and standardize output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542415A_ABST
    Figure CN121542415A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a medical data intelligent extraction method and system, electronic equipment and a storage medium, and the method comprises the following steps: receiving numerical data extraction parameters input by a user; screening out a target text containing the medical part and the keyword from a medical text database; constructing a cue word template based on the keyword and the numerical operator, splicing the target text and the cue word template, inputting the spliced target text and cue word template into a large language model, and obtaining an extraction result; and performing character string matching verification on the basis of the extraction result and the target text, extracting a final numerical value and a unit from the successfully verified extraction result on the basis of a preset rule, comparing the final numerical value and the unit with an input numerical data extraction parameter on the basis of a numerical operator, and outputting extraction state judgment. According to the method, the extraction accuracy, the field generalization and the application reliability can be balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and specifically to a method, system, electronic device, and storage medium for intelligent extraction of medical data. Background Technology

[0002] With the rapid development of medical informatization, Hospital Information Systems (HIS), Picture Archiving and Communication Systems (PACS), and Laboratory Information Systems (LIS) have accumulated massive amounts of unstructured medical text data. This data contains a large amount of numerical medical data crucial for clinical diagnosis and research, such as white blood cell counts in laboratory reports, tumor size in imaging reports, and blood pressure values ​​in vital sign records. Efficiently and accurately extracting this specific numerical information from the text is of great significance for assisting doctors in diagnosis, assessing disease conditions, and conducting medical research.

[0003] Currently, the mainstream methods for extracting numerical medical data from unstructured text fall into two main technical categories. The first category is rule-based methods, such as relying on regular expressions for pattern matching. This method can achieve high accuracy when the text format is fixed and the expression is standardized, but its generalization ability is poor, making it difficult to adapt to the varied expression methods and diverse text structures in clinical practice. In addition, the writing and maintenance of rules are highly dependent on domain experts, which is costly and difficult to cover all situations.

[0004] The second type of method directly utilizes general-purpose large language models for end-to-end extraction. This method, with its powerful semantic understanding capabilities, overcomes the generalization problem caused by the variability of expressions to some extent. However, in rigorous medical applications, this method carries significant risks. The inherent "illusion" problem of large language models may cause them to generate or output numerical values, location descriptions, or type descriptions that do not exist in the original text, resulting in the extraction results losing their authenticity and traceability. Furthermore, the uncontrollability of its output format and the diversity of unit representations further increase the complexity and uncertainty of result processing.

[0005] Therefore, this application provides a method for intelligent extraction of medical data to solve the above-mentioned technical problems. Summary of the Invention

[0006] The purpose of this invention is to provide a method, system, electronic device and storage medium for intelligent extraction of medical data, in order to solve the technical problem that it is difficult to achieve an ideal balance between extraction accuracy, domain generalization and application reliability in the prior art.

[0007] To address the aforementioned technical problems, this invention provides a method for intelligent extraction of medical data, comprising:

[0008] It receives numerical data extraction parameters input by the user, including data source, medical part, keywords, numerical operators, specific numerical value and numerical unit;

[0009] Based on the data source, medical location, and keywords, target texts containing the medical location and keywords are filtered from the medical text database;

[0010] A prompt word template is constructed based on the keywords and numerical operators. The prompt word template includes instructions for extracting medical part information, medical entity type information and size numerical information, filtering rules for multiple records, and structured output requirements.

[0011] The target text is concatenated with the prompt word template and then input into the large language model to obtain the extraction results containing medical part text, medical entity type text and size numerical text;

[0012] Based on the extraction results, string matching verification is performed with the target text, and the final value and unit are extracted from the verified extraction results according to preset rules, wherein the preset rules include medical part matching verification, value extraction and unit processing.

[0013] The final value and unit are compared with the input numeric data extraction parameters based on numeric operators, and the extraction status is output.

[0014] In some specific embodiments, the numerical data extraction parameters input by the user include data source, medical location, keywords, numerical operators, specific numerical values, and numerical units, and further include:

[0015] The system receives user-specified data source parameters through a graphical user interface, wherein the data source is limited to a specific document type in a medical text database.

[0016] Receives medical site parameters specified by the user through an input component, the medical site parameters being used to define the range of the target anatomical structure;

[0017] Receive keyword parameters input by the user, whereby the keywords are used to identify specific medical entities that need to be extracted;

[0018] The system receives a user-selected numeric operator parameter along with its corresponding numerical value and unit. The numeric operator includes one or more of the following: greater than, less than, equal to, and not equal to.

[0019] In some specific embodiments, filtering target text containing the medical site and keywords from a medical text database based on the data source, medical site, and keywords further includes:

[0020] The partition of the medical text database to be queried is determined based on the data source parameters;

[0021] Perform preliminary screening based on medical parts within the defined database partitions, using a string matching algorithm to identify text containing the specified medical parts;

[0022] In the initial screening results, a secondary screening based on keywords is performed. Regular expressions are used to match and locate text segments containing keywords, and deduplication and formatting are performed to form a standardized target text set.

[0023] In some specific embodiments, a prompt word template is constructed based on the keywords and numerical operators. The target text is concatenated with the prompt word template and then input into a large language model to obtain extraction results containing medical part text, medical entity type text, and size numerical text. This further includes:

[0024] Based on keywords, specific extraction instructions are constructed for medical part information, medical entity type information, and size numerical information.

[0025] The filtering logic is defined based on the numeric operator to handle multiple records, including returning the record with the maximum value or the record with the minimum value.

[0026] Set a specific return format when relevant information cannot be retrieved, including returning a null value or a specific identifier;

[0027] The output must use a structured data format and contain only the specified key fields;

[0028] The target text and the constructed prompt word template are integrated into a single input string, and a processing request is submitted through the large language model interface to parse the response data.

[0029] In some specific embodiments, the string matching verification based on the extraction result and the target text further includes:

[0030] Perform a full-text scan matching between the extracted medical part text and the target text;

[0031] Perform substring matching verification between the extracted medical entity type text and the target text;

[0032] Perform pattern matching, including numbers and units, between the extracted size numerical text and the target text;

[0033] Set a matching similarity threshold; if the matching similarity of any text fragment is lower than the matching similarity threshold, the verification is deemed to have failed.

[0034] The string matching verification is confirmed to be successful only when the matching degree of all text fragments reaches the matching similarity threshold requirement.

[0035] In some specific embodiments, the final value and unit are extracted from the verified extraction results based on preset rules. These preset rules include medical site matching verification, value extraction, and unit processing, and further include:

[0036] Verify whether the medical part text in the extracted results completely contains the medical part parameters entered by the user;

[0037] Extract all numeric characters from size numeric text using predefined regular expression patterns, including integers, decimals, and specially formatted numeric values;

[0038] The extracted values ​​are subjected to extreme value selection processing based on the type of numeric operator to determine whether the maximum or minimum value is used as the final value.

[0039] The system identifies the unit identifier in the numerical dimension text and compares it with the input unit. If they do not match, the system performs numerical conversion according to preset unit conversion rules.

[0040] In some specific embodiments, the final numerical value and unit are compared with the input numerical data extraction parameters based on numerical operators, and the extraction status is output, further including:

[0041] Parse the comparison logic relationships defined by numeric operators;

[0042] After confirming that the units are consistent, the extracted final value is compared with the specific input value;

[0043] Perform comparison operations based on numeric operators and determine whether the comparison result meets preset conditions;

[0044] The extraction status of the corresponding target text is marked as successful or unsuccessful based on the comparison operation result;

[0045] Summarize the extraction status information of all target texts and generate a structured extraction result report.

[0046] Based on the same concept, the present invention also provides a medical data intelligent extraction system, comprising:

[0047] The parameter extraction input module is configured to receive numerical data extraction parameters input by the user, including data source, medical part, keywords, numerical operators, specific values ​​and numerical units;

[0048] The target text filtering module is configured to filter target text containing the medical parts and keywords from a medical text database based on the data source, medical parts, and keywords.

[0049] The prompt word template construction module is configured to construct prompt word templates based on the keywords and numerical operators. The prompt word templates include extraction instructions for medical part information, medical entity type information, and size numerical information, filtering rules for multiple records, and structured output requirements.

[0050] The extraction result acquisition module is configured to concatenate the target text with the prompt word template and input it into the large language model to obtain extraction results including medical part text, medical entity type text and size numerical text;

[0051] The verification and rule extraction module is configured to perform string matching verification based on the extraction results and the target text, and extract the final value and unit from the verified extraction results based on preset rules, wherein the preset rules include medical part matching verification, value extraction and unit processing.

[0052] The extraction status determination output module is configured to compare the final value and unit with the input numeric data extraction parameters based on numeric operators, and output the extraction status determination.

[0053] Based on the same concept, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a medical data intelligent extraction method.

[0054] Based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a medical data intelligent extraction method.

[0055] Compared with existing technologies, its advantages are as follows:

[0056] This invention discloses a method, system, electronic device, and storage medium for intelligent extraction of medical data, which improves the accuracy of numerical medical data extraction: by constructing a structured prompt word template to accurately guide the output direction of a large language model, and combined with subsequent multi-level verification and rule extraction processes, it effectively avoids erroneous extraction caused by model illusion or semantic ambiguity, and ensures the accuracy of the final output results.

[0057] Enhanced generalization ability in diverse clinical scenarios: Leveraging the powerful natural language understanding capabilities of large language models to adapt to varied clinical expressions and text structures, overcoming the strong dependence of traditional rule-based methods on fixed formats, and reducing extraction failures caused by differences in expression.

[0058] To ensure the controllability and reliability of the extraction process and results: By introducing an existence verification step, it is ensured that all extracted content originates from the original text, guaranteeing the traceability and authenticity of the results; at the same time, numerical extraction and unit standardization are performed through preset rules, ensuring the uniformity of the output format and the consistency of logical judgments, making the entire process controllable and reliable.

[0059] Achieve accurate parsing and standardization of complex numerical representations: By integrating regular expression extraction, multi-value extreme value selection, and automatic unit conversion rules, it can accurately process complex size descriptions such as "8x6cm" and standardize them into a single value that can be compared with a preset threshold, thereby improving the system's ability to process complex medical data. Attached Figure Description

[0060] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0061] Figure 1 This is a flowchart illustrating some specific embodiments of the intelligent medical data extraction method of the present invention;

[0062] Figure 2 This is a flowchart illustrating another embodiment of the intelligent medical data extraction method of the present invention;

[0063] Figure 3 This is a schematic diagram of the structure of a medical data intelligent extraction system according to some specific embodiments of the present invention;

[0064] Figure 4 This is a schematic diagram of the structure of an electronic device according to some specific embodiments of the present invention;

[0065] In the diagram, 710 is the processor; 720 is the memory; 730 is the input device; and 740 is the output device. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0067] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0068] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0069] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0070] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0071] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0072] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0073] Reference Figure 1 A method for intelligent extraction of medical data, comprising:

[0074] S101, receives numerical data extraction parameters input by the user, including data source, medical part, keywords, numerical operators, specific numerical values ​​and numerical units;

[0075] S102, based on the data source, medical part and keywords, filter out target text containing the medical part and keywords from the medical text database;

[0076] S103, construct a prompt word template based on the keywords and numerical operators, wherein the prompt word template includes extraction instructions for medical part information, medical entity type information and size numerical information, filtering rules for multiple records, and structured output requirements;

[0077] S104, after concatenating the target text with the prompt word template, input it into the large language model to obtain the extraction results containing medical part text, medical entity type text and size numerical text;

[0078] S105, perform string matching verification based on the extraction result and the target text, and extract the final value and unit from the verified extraction result based on preset rules, wherein the preset rules include medical part matching verification, value extraction and unit processing.

[0079] S106 compares the final value and unit with the input numeric data extraction parameters based on numeric operators, and outputs the extraction status determination.

[0080] Specifically, in this embodiment of the invention, a complete set of numerical data extraction parameters input by the user through an interactive interface is received. This set includes data sources for limiting the search scope, medical parts defining the target anatomical structure, keywords identifying the target medical entity, operators representing numerical comparison relationships, specific numerical values ​​as comparison benchmarks, and numerical units for unit consistency comparison. Based on the received data source parameters, the corresponding subset in the medical text database is located. Then, based on the medical part and keywords, collaborative filtering is performed on this subset. Target text paragraphs containing both the description of the specified medical part and mentions of the keywords are found using string matching technology. A structured prompt word template is dynamically constructed based on the keywords and numerical operators. This template explicitly includes instructions requiring the large language model to extract medical part information, medical entity type information, and size numerical information. It defines the filtering logic to be followed when multiple related records exist and specifies the structured data format and characters that must be used for output. The process involves several steps: First, the target text is concatenated with the pre-constructed prompt word template to form a complete input. Then, the large language model application interface is called to retrieve the extracted results, including text representing medical parts, medical entity types, and numerical dimensions. Next, the model enters a verification and extraction phase. This phase rigorously verifies the various text contents returned by the model against the original target text to ensure the content's authenticity. For those that pass verification, medical parts are matched using preset rules. Regular expressions are used to extract all numeric characters from the numerical dimensions, and the maximum or minimum value is selected as the final value based on the operator type. Unit identifiers are also identified and subjected to consistency comparison and necessary standardization transformations. Finally, based on the initial input's numerical operators, the final value and unit extracted through the above process are compared with the specific value and unit in the user input parameters. The final extraction status is determined based on whether the comparison result meets the logical conditions defined by the operator.

[0081] In some applications, the system receives user-inputted numerical data extraction parameters, including data source, medical location, keywords, numerical operators, specific values, and numerical units. This includes receiving user-specified data source parameters via a graphical user interface, where the data source is limited to a specific document type in a medical text database; receiving user-specified medical location parameters via an input component, where the medical location parameters define the range of the target anatomical structure; receiving user-inputted keyword parameters, where the keywords identify specific medical entities to be extracted; and receiving user-selected numerical operator parameters along with their corresponding specific values ​​and numerical units, where the numerical operators include one or more of the following: greater than, less than, equal to, and not equal to.

[0082] Understandably, the system provides a data source selection component through a graphical user interface, receiving specific document types defined by the user from a medical text database. These document types include, but are not limited to, examination reports, test reports, or medical records. It also receives user-specified medical site parameters via text input boxes or drop-down menus. These parameters precisely define the range of the target anatomical structure, including specific locations such as the lungs, liver, kidneys, or heart. A separate text input component receives user-defined keyword parameters, which identify specific medical entities to be extracted from the text, including entity types such as nodules, tumors, cysts, or effusions. Finally, a selection control receives user-specified numeric operator parameters along with their corresponding numerical values ​​and units. Numerical operators cover one or more comparison relationships, including greater than, less than, equal to, and not equal to. Specific numerical values ​​are expressed as integers or decimals, and numerical units include commonly used medical units of measurement such as millimeters, centimeters, and percentages. All parameters undergo a unified validation mechanism to ensure correct formatting and logical rationality.

[0083] In some applications, target text containing the medical parts and keywords is filtered from a medical text database based on the data source, medical part, and keywords. This includes determining the medical text database partition to be queried based on the data source parameters; performing preliminary filtering based on medical parts in the determined database partition, using a string matching algorithm to identify text containing the specified medical parts; and performing secondary filtering based on keywords in the preliminary filtering results, using regular expression matching to locate text segments containing keywords, and performing deduplication and formatting to form a standardized set of target text.

[0084] Understandably, the process involves parsing the user-inputted data source parameters and determining the corresponding partition of the medical text database to be queried based on the document type specified in the parameters. Within the determined data partition, a preliminary screening based on medical parts is performed, using a string matching algorithm to scan and identify the text content. This algorithm supports both exact and fuzzy matching modes and can effectively identify text paragraphs containing descriptions of specified medical parts. Further secondary screening based on keywords is then performed on the text set obtained from the preliminary screening. Regular expression matching technology is used to locate text segments containing keywords. This regular expression pattern can adapt to the morphological changes and combinations of keywords in different contexts. The text results after the two screenings are then deduplicated to remove duplicate text records, and the text format is standardized, including unifying the encoding format and removing irrelevant characters and whitespace, ultimately forming a standardized target text set for subsequent processing.

[0085] In some applications, a prompt word template is constructed based on the keywords and numerical operators. The target text is concatenated with the prompt word template and input into a large language model to obtain extraction results containing medical part text, medical entity type text, and size numerical text. This includes constructing specific extraction instructions for medical part information, medical entity type information, and size numerical information based on keywords; defining filtering logic for multiple records based on numerical operators, including returning the record with the maximum value or minimum value; setting specific return formats when relevant information cannot be extracted, including returning null values ​​or specific identifiers; specifying that the output must use a structured data format and contain only specified key fields; integrating the target text and the constructed prompt word template into a single input string, submitting a processing request through the large language model interface, and parsing the response data.

[0086] Understandably, based on user-input keywords, specific extraction instructions for medical part information, medical entity type information, and size numerical information are dynamically constructed, forming a structured semantic extraction framework. Filtering logic is defined for multiple records based on the type of numerical operator: when the operator is greater than, the record with the maximum value is returned; when the operator is less than, the record with the minimum value is returned, thus establishing a priority rule for record filtering. Specific return formats are clearly defined when relevant information cannot be extracted, including returning a set of null values ​​or a preset identifier for unextractable information, ensuring the integrity of the output results. Strictly stipulated that the output must use a standardized structured data format and contain only pre-specified key fields, excluding any interference from additional explanatory text. The preprocessed target text is seamlessly concatenated with the constructed prompt word template, integrating it into a single string conforming to the input specifications of the large language model. A processing request is submitted to the large language model through the application programming interface, and the response data returned by the model is parsed and its format verified, ultimately obtaining a complete extraction result containing standardized medical part text, medical entity type text, and size numerical text.

[0087] In some applications, string matching verification is performed based on the extraction results and the target text. This includes performing full-text scan matching of medical part text in the extraction results with the target text; performing substring matching verification of medical entity type text in the extraction results with the target text; performing pattern matching of size numerical text in the extraction results with the target text, including numbers and units; setting a matching similarity threshold, and determining verification failure when the matching degree of any text segment is lower than the matching similarity threshold; and confirming string matching verification as passed only when the matching degree of all text segments meets the matching similarity threshold requirement.

[0088] Understandably, the process involves performing a full-text scan and matching of the medical part text extracted from the large language model with the original target text to ensure that the part description has a complete correspondence in the original text; performing substring matching verification between the medical entity type text and the target text to confirm the exact existence of the type description in the original text; performing specific pattern matching containing numbers and units of measurement between the size and numerical text and the target text to verify the true source of the values ​​and units; using a preset matching similarity threshold as the verification standard, if the matching degree calculation result of any text segment is lower than the preset threshold, the verification is immediately judged as a failure and subsequent processing is terminated; only when the matching degree calculation results of the three segments—medical part text, medical entity type text, and size and numerical text—all meet or exceed the preset threshold requirements are the string matching verification confirmed as passed and the process proceeds to the next stage.

[0089] In some applications, the final value and unit are extracted from the validated extraction results based on preset rules. These preset rules include medical part matching verification, value extraction, and unit processing. The process includes verifying whether the medical part text in the extraction results completely contains the medical part parameters entered by the user; extracting all numerical characters from the size numerical text using predefined regular expression patterns, including integers, decimals, and special format values; performing extreme value selection processing on the extracted values ​​according to the type of numerical operator to determine whether to use the maximum or minimum value as the final value; identifying the unit identifier in the size numerical text and comparing it with the input unit for consistency. If they are inconsistent, the value is converted according to preset unit conversion rules.

[0090] Understandably, the process involves verifying whether the extracted medical part text completely contains the user-inputted medical part parameters to ensure the consistency of the target anatomical structure; scanning and extracting all numerical characters from the size numerical text using a predefined regular expression pattern that can recognize integers, decimals, and composite numerical values ​​in special formats; performing extreme value selection processing on the extracted numerical set based on the type of numerical operator input by the user: selecting the maximum value as the final value when the operator is greater than, and selecting the minimum value as the final value when the operator is less than; simultaneously identifying the unit identifier in the size numerical text and comparing it with the unit of the numerical value input by the user. When the identified unit is inconsistent with the input unit, numerical conversion processing is performed according to preset unit conversion rules to ensure that the final value is consistent with the input unit.

[0091] In some applications, the final value and unit are compared with the input numerical data extraction parameters based on numeric operators, and the extraction status is output. This includes parsing the comparison logic relationship defined by the numeric operators; after confirming that the units are consistent, the extracted final value is compared with the specific input value; comparison operations based on numeric operators are performed to determine whether the comparison result meets the preset conditions; the extraction status of the corresponding target text is marked as successful or unsuccessful according to the comparison operation result; and the extraction status information of all target texts is summarized to generate a structured extraction result report.

[0092] Understandably, the process involves parsing the comparison logic defined by numeric operators and establishing corresponding numeric comparison expressions; ensuring that the extracted units are completely consistent with the input units, accurately comparing the final standardized values ​​with the specific values ​​input by the user; performing mathematical comparison operations based on the semantics of numeric operators to determine whether the comparison results meet the preset logical conditions; marking the corresponding target text as either successfully extracted or unsuccessfully extracted based on the actual results of the comparison operations; and finally summarizing the extraction status information of all target texts during the processing, generating a structured extraction result report containing the number of successful extractions, the number of unsuccessful extractions, and a detailed list of entries according to a preset template.

[0093] The following is combined Figure 2 Another embodiment of the intelligent medical data extraction method of the present invention is described below:

[0094] like Figure 2 As shown, this embodiment includes:

[0095] Input steps: Receive user-inputted numerical data extraction parameters, including data source, medical location, keywords, numerical operators (such as greater than, less than, etc.), specific value, and unit of measurement. For example, when extracting data on lung nodules larger than 6mm from an examination report, the input data source is "examination report," the location is "lung," the keyword is "nodule," the numerical operator is "greater than," the specific value is 6, and the unit of measurement is "mm."

[0096] Text filtering steps: Based on data source, medical location, and keywords, filter target texts containing medical locations and keywords from the medical text database. For example, filter texts containing "lung" and "nodule".

[0097] Prompt word construction steps: Based on keywords and numerical operators, construct prompt word templates for the large language model. Template format example: Please extract the [keyword] part, [keyword] size, and [keyword] type from the above text. If there are multiple records, please return the one with [keyword] and [operator]. If the relevant information cannot be extracted, please return "Unable to extract". If it can be extracted, please return only JSON format with the fields [keyword] part, [keyword] type, and [keyword] size, without adding any other information. Taking the keyword "nodule" and the operator "greater than" as an example, the template is specified as: Please extract the nodule part, nodule size, and nodule type from the above text. If there are multiple records, please return the one with the largest nodule. If the relevant information cannot be extracted, please return "Unable to extract". If it can be extracted, please return only JSON format with the fields nodule part, nodule type, and nodule size, without adding any other information.

[0098] The steps for calling the large language model are as follows: Concatenate the filtered target text with the prompt word template into a string, call the large language model API, and obtain the returned result. For example, the returned data is in JSON format: {"Nodule location": "Left lung", "Nodule type": "Solid nodule", "Nodule size": "8x6cm"}.

[0099] The first verification step is to verify that the extraction results (such as location, type, and size text) returned by the large language model exist in the original target text. For example, match "left lung", "solid nodule", and "8x6cm" with the original text. If they exist, the result is considered valid, preventing the large language model from misleading the reader.

[0100] Rule extraction steps: Based on the rules, extract the final values ​​and units from the extraction results, and verify the part matching:

[0101] The extracted site text is verified to contain the input medical site. For example, the nodule site text "left lung" contains "lung";

[0102] Extract all numbers (including floating-point numbers and integers) from a text of varying sizes using regular expressions, and take the maximum value as the final value. For example, extract the numbers 8 and 6 from "8x6cm" and take the maximum value of 8.

[0103] The system matches units between large and small texts. If the units do not match the input units, the system standardizes the units. For example, if the input unit is "mm" and the extracted unit is "cm", the value 8 will be converted to 80mm.

[0104] The second verification step: Based on the numerical operator, the specific value, and the final extracted value, determine whether the text extraction was successful. For example, if the operator is "greater than", the specific value is 6, and the extracted value is 80, then 80 > 6, so the extraction was successful.

[0105] The following describes this embodiment in conjunction with an application scenario:

[0106] Data on lung nodules larger than 6mm were extracted from the examination reports:

[0107] Input steps: The user inputs data from the "examination report", the medical part is "lung", the keyword is "nodule", the numerical operator is "greater than", the specific value is 6, and the numerical unit is "mm".

[0108] Text filtering steps: Filter texts containing both "lung" and "nodule" from the examination report database, for example: "A solid nodule, approximately 8x6cm in size, is visible in the left lung".

[0109] Prompt word construction steps: Generate prompt word template: "Please extract the nodule location, nodule size, and nodule type from the above text. If there are multiple records, please return the one with the largest nodule. If the relevant information cannot be extracted, please return 'Unable to extract' directly. If the information can be extracted, please return only JSON format with the fields 'Nodule Location,' 'Nodule Type,' and 'Nodule Size,' without adding any other information."

[0110] Steps for calling the large language model: Concatenate the filtered text and the prompt word template, input them into the large language model, and obtain the returned result: {"Nodule location": "Left lung", "Nodule type": "Solid nodule", "Nodule size": "8x6cm"}.

[0111] First verification step: Verify that "left lung", "solid nodule", and "8x6cm" exist in the original text, and the match is successful.

[0112] Rule extraction steps:

[0113] Verify that "left lung" includes the medical term "lung";

[0114] Extract the numbers 8 and 6 from "8x6cm", and take the maximum value of 8;

[0115] The unit "cm" is inconsistent with the input unit "mm". Convert it: 8cm = 80mm.

[0116] The second verification step: the operator is "greater than", the specific value is 6, and the extracted value 80 > 6, so the text extraction was successful.

[0117] For the purpose of simplicity, the method steps disclosed in the above embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0118] like Figure 3 As shown, the present invention also provides a medical data intelligent extraction system, comprising:

[0119] The parameter extraction input module 201 is configured to receive numerical data extraction parameters input by the user, including data source, medical part, keywords, numerical operators, specific values ​​and numerical units;

[0120] The target text filtering module 202 is configured to filter target text containing the medical parts and keywords from the medical text database based on the data source, medical parts and keywords.

[0121] The prompt word template construction module 203 is configured to construct a prompt word template based on the keywords and numerical operators. The prompt word template includes extraction instructions for medical part information, medical entity type information and size numerical information, filtering rules for multiple records, and structured output requirements.

[0122] The extraction result acquisition module 204 is configured to concatenate the target text with the prompt word template and input it into the large language model to obtain extraction results including medical part text, medical entity type text and size numerical text;

[0123] The verification and rule extraction module 205 is configured to perform string matching verification based on the extraction result and the target text, and extract the final value and unit from the verified extraction result based on preset rules, wherein the preset rules include medical part matching verification, value extraction and unit processing.

[0124] The extraction status determination output module 206 is configured to compare the final value and unit with the input numerical data extraction parameters based on numerical operators, and output the extraction status determination.

[0125] It is worth noting that although only some basic functional modules are disclosed in the embodiments of this invention, it does not mean that the composition of this system is limited to the above-mentioned basic functional modules. On the contrary, what this embodiment intends to express is that, based on the above-mentioned basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with existing technology to form an infinite number of embodiments or technical solutions. That is to say, this system is open rather than closed. The fact that this embodiment only discloses a few basic functional modules should not be considered as the scope of protection of the claims of this invention being limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above device is described separately according to its functions as various units and modules. Of course, in implementing this invention, the functions of each unit and module can be implemented in one or more software and / or hardware.

[0126] like Figure 4 As shown, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a medical data intelligent extraction method.

[0127] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. For example... Figure 4 The structure shown in this embodiment of the invention includes an electronic device comprising one or more processors 710 and a memory 720; the processors 710 in this electronic device may be one or more. Figure 4 Taking a processor 710 as an example; a memory 720 is used to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement a medical data intelligent extraction method as described in any one of the embodiments of the present invention.

[0128] The electronic device may also include an input device 730 and an output device 740.

[0129] The processor 710, memory 720, input device 730, and output device 740 in this electronic device can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0130] The memory 720 in this electronic device serves as a computer-readable storage medium, capable of storing one or more programs. These programs can be software programs, computer-executable programs, or modules, such as the program instructions / modules corresponding to the intelligent medical data extraction method provided in this embodiment of the invention. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 720, thereby implementing the intelligent medical data extraction method described in the above embodiment.

[0131] The memory 720 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 720 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include memory remotely located relative to the processor 710, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0132] Input device 730 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 740 may include display devices such as a display screen.

[0133] The present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a medical data intelligent extraction method.

[0134] Specifically, the computer storage medium in this embodiment of the invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions 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.

Claims

1. A medical data intelligent extraction method, characterized in that, The method comprises the following steps: Receiving user input numerical data extraction parameters, including data source, medical site, keyword, numerical operator, specific value and numerical unit; According to the data source, medical site and keyword, the target text containing the medical site and keyword is screened out from the medical text database; Based on the keyword and numerical operator, a prompt word template is constructed, wherein the prompt word template contains extraction instructions for medical site information, medical entity type information and size numerical information, screening rules in multiple record cases, and structured output requirements; After splicing the target text and the prompt word template, the large language model is inputted to obtain the extraction result containing medical site text, medical entity type text and size numerical text; Based on the extraction result and the target text, string matching verification is performed, and based on the preset rules, the final value and unit are extracted from the extraction result that passes the verification, wherein the preset rules include medical site matching verification, numerical extraction and unit processing; Based on the numerical operator, the final value and unit are compared with the input numerical data extraction parameters, and the extraction state is determined. 2.The medical data intelligent extraction method of claim 1, wherein, Receiving user input numerical data extraction parameters, including data source, medical site, keyword, numerical operator, specific value and numerical unit, further comprising: Receiving user-specified data source parameters through a graphical user interface, wherein the data source is limited to a specific document type in the medical text database; Receiving user-specified medical site parameters through an input component, wherein the medical site parameters are used to limit the range of the target anatomical structure; Receiving user input keyword parameters, wherein the keyword is used to identify specific medical entities that need to be extracted; Receiving user-selected numerical operator parameters and corresponding specific values and numerical units, wherein the numerical operator includes one or more of greater than, less than, equal to, and not equal to. 3.The medical data intelligent extraction method of claim 1, wherein, According to the data source, medical site and keyword, the target text containing the medical site and keyword is screened out from the medical text database, further comprising: Determine the medical text database partition to be queried according to the data source parameter; Performing preliminary screening based on the medical site in the determined database partition, using a string matching algorithm to identify text containing the specified medical site; Performing secondary screening based on the keyword in the preliminary screening results, using regular expression matching to locate text segments containing the keyword, and performing deduplication and formatting to form a standardized target text set. 4.The medical data intelligent extraction method of claim 1, wherein, Based on the keyword and numerical operator, a prompt word template is constructed, wherein the prompt word template contains extraction instructions for medical site information, medical entity type information and size numerical information, screening rules in multiple record cases, and structured output requirements; Based on the keyword, specific extraction instructions for medical site information, medical entity type information and size numerical information are constructed; According to the numerical operator, define the screening logic in multiple record cases, including returning the maximum value record or the minimum value record; Set the specific return format when related information cannot be extracted, including returning null or a specific identifier; The output is required to be in a structured data format and only contains specified key fields; Integrate the target text with the completed prompt word template into a single input string, submit a processing request through a large language model interface, and parse the response data.

5. The medical data intelligent extraction method of claim 1, wherein, Based on the extraction result and the target text, further including: Full-text scanning matching of medical site text in the extraction result and the target text; Substring matching verification of medical entity type text in the extraction result and the target text; Size numerical value text in the extraction result and the target text are matched in a mode containing numbers and units; Set a matching similarity threshold, and determine that the verification fails when the matching degree of any text segment is lower than the matching similarity threshold; Only when the matching degree of all text segments meets the matching similarity threshold requirement, confirm that the string matching verification is passed.

6. The medical data intelligent extraction method of claim 1, wherein, Based on the preset rules, extract the final value and unit from the extraction result that passes the verification, wherein the preset rules include medical site matching verification, numerical value extraction and unit processing, further including: Verify whether the medical site text in the extraction result completely contains the medical site parameter input by the user; Extract all numerical characters, including integers, decimals and special format numbers, from the size numerical value text through a predefined regular expression pattern; According to the type of numerical operator, perform extreme value selection processing on the extracted numerical value to determine whether to use the maximum value or the minimum value as the final value; Identify the unit identifier in the size numerical value text and compare it with the input unit for consistency. When they are inconsistent, perform numerical conversion processing according to the preset unit conversion rules.

7. The medical data intelligent extraction method of claim 6, wherein, Based on the numerical operator, compare the final value and unit with the input numerical data extraction parameter, and output the extraction state judgment, further including: Parse the comparison logic relationship defined by the numerical operator; After confirming the consistency of the unit, compare the extracted final value with the input specific numerical value; Perform comparison operations based on numerical operators to determine whether the comparison result meets the preset conditions; According to the comparison operation result, mark the extraction state of the corresponding target text as success or failure; Summarize the extraction state information of all target texts to generate a structured extraction result report.

8. A medical data intelligent extraction system, characterized by, Including: An extraction parameter input module configured to receive user input numerical data extraction parameters, including data source, medical site, keyword, numerical operator, specific numerical value and numerical unit; A target text screening module configured to screen target texts containing the medical site and keyword from a medical text database according to the data source, medical site and keyword; A prompt word template construction module configured to construct a prompt word template based on the keyword and numerical operator, wherein the prompt word template contains extraction instructions for medical site information, medical entity type information and size numerical value information, screening rules for multiple records, and structured output requirements; An extraction result acquisition module configured to input the target text and the prompt word template into a large language model after splicing, and acquire an extraction result containing medical site text, medical entity type text and size numerical value text; The verification and rule extraction module is configured to perform string matching verification on the extracted result and the target text, and extract a final numerical value and a unit from the extracted result that passes the verification based on a preset rule. The preset rule includes medical site matching verification, numerical value extraction, and unit processing. The extraction state judgment output module is configured to compare the final numerical value and the unit with the input numerical data extraction parameter based on a numerical operator, and output an extraction state judgment.

9. An electronic device, comprising: The processor, the communication interface, the memory, and the communication bus are included. The memory stores a computer program executable by the electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The memory stores a computer program executable by the electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the method of any one of claims 1 to 7.