Adaptive extraction optimization method and device for medical information and storage medium
By using a terminology database-based method to filter and optimize prompt words, this approach addresses the high cost and low coverage issues in existing technologies for evaluating the quality of key information extracted from large language models, achieving efficient and accurate structured information extraction even without a gold standard.
Patent Information
- Application Number
- CN202510843804.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies require gold standard data as a reference when evaluating the quality of large language models extracting key information from unstructured medical texts. This results in high costs and difficulty in covering all scenarios. Furthermore, traditional evaluation methods cannot focus on the retention of specific key information.
By extracting medical terms from original medical texts based on a terminology database, screening key terms, determining prompt fragments based on their retention in the initial structured results, and optimizing prompt words for structured extraction, the system dynamically adjusts to improve the recall and accuracy of key information, avoiding reliance on the gold standard.
It enables rapid iterative optimization of prompt words without requiring a large amount of labeled data, improving the efficiency and accuracy of structured extraction and effectively enhancing the ability to extract key information from unstructured documents.
Smart Images

Figure CN120805904A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information processing, in particular to a self-adaptive extraction optimization method and device for medical information and a storage medium. BACKGROUND
[0002] With the increasing application of large language models (LLM) in the medical field, the ability of LLM to automatically extract structured information from massive unstructured medical texts (such as medical records, examination reports, literature, etc.) has attracted much attention. However, how to effectively, objectively and automatically evaluate the quality of the extraction results of these models, especially the integrity of the key medical information, has become a problem to be solved.
[0003] Traditional information extraction evaluation methods are mainly based on named entity recognition (NER). This method usually needs a "golden standard" structured data as a reference, and compares the matching degree of LLM output and the golden standard field by field. In this case, the indicators based on precise matching (such as Precision, Recall, F1) need to construct the "golden standard" structured data corresponding to the original text in advance, which itself needs a large amount of manual annotation work, and is costly and difficult to cover all scenarios. Secondly, the text similarity-based indicators (such as ROUGE, BLEU) are mainly used to evaluate the overall similarity between generated text and reference text, which are not suitable for evaluating the accuracy of structured data extraction and cannot focus on the preservation of specific key information.
[0004] Therefore, there is an urgent need for a method that can automatically identify key information in unstructured medical texts and robustly verify whether these information are preserved in the extraction results (which may have complex structures). SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a self-adaptive extraction optimization method and device for medical information and a storage medium.
[0006] To achieve the above-mentioned purpose, the first aspect of the present application provides a self-adaptive extraction optimization method for medical information, comprising: based on an original prompt word, performing structured extraction on medical documents of a plurality of first medical fields to obtain an initial structured result; extracting a plurality of medical terms from the original medical text based on a term library; screening out key terms in the plurality of medical terms; determining a prompt segment for each first medical field according to the preservation of each key term in the initial structured result; generating an optimized prompt word according to all prompt segments and the original prompt word; Based on the optimized prompt word, the medical documents in the plurality of first medical fields are restructured to obtain a new structured result.
[0007] In the embodiments of the present application, determining the prompt segment for each first medical field according to the retention of each key term in the initial structured result comprises: determining missing terms in the plurality of key terms and integrity scores corresponding to all key terms according to the retention of each key term in the initial structured result, wherein the missing terms refer to key terms that are not present in the initial structured result; determining a second medical field to which each missing term belongs, and determining a comprehensive score of each second medical field; performing normalization processing on the comprehensive score of each second medical field, and determining the processed result as a field weight value of each second medical field; and determining the prompt segment for each second medical field according to the field weight value of each second medical field.
[0008] In the embodiments of the present application, determining the comprehensive score of each second medical field comprises: determining a field loss rate of each second medical field according to the number of missing terms included in each second medical field; for each second medical field, determining an importance average value of the second medical field according to the number of missing terms included in the second medical field and the importance score of each missing term included in the second medical field; and determining the comprehensive score of each second medical field according to the field loss rate and the importance average value of each second medical field.
[0009] In the embodiments of the present application, the adaptive extraction optimization method further comprises: after determining the comprehensive score of each second medical field, determining a score mean and a score standard deviation of all comprehensive scores; determining a marked threshold for field screening according to the score mean, the score standard deviation and a first adjustment parameter; and marking the second medical field with a comprehensive score lower than the marked threshold as a weak field.
[0010] In the embodiments of the present application, the adaptive extraction optimization method further comprises: after marking the second medical field with a comprehensive score lower than the marked threshold as a weak field, determining a prompt word corresponding to the weak field; and for any one of the pre-set prompt segments, adding the prompt word corresponding to the weak field to the pre-set prompt segment when fine-tuning the pre-set prompt segment, and combining the missing terms to obtain an updated prompt segment.
[0011] In the embodiment of the present application, determining the missing terms in the plurality of key terms and the integrity scores corresponding to all the key terms according to the retention of each key term in the initial structured result comprises: for each key term, determining that the matching degree of the key term and the initial structured result is a first numerical value in the case that the key term exists in the initial structured result; for each key term, determining that the matching degree of the key term and the initial structured result is a second numerical value in the case that the key term does not exist in the initial structured result; and determining the integrity scores corresponding to all the key terms according to the matching degree of each key term and the initial structured result and the importance score.
[0012] In the embodiment of the present application, determining the prompt segment for each second medical field according to the field weight value of each second medical field comprises: for any second medical field, determining that the prompt segment of the second medical field is a detailed prompt segment in the case that the field weight value of the second medical field is greater than a first preset weight value; for any second medical field, determining that the prompt segment of the second medical field is a standard prompt segment in the case that the field weight value of the second medical field is greater than a second preset weight value and less than or equal to the first preset weight value; and for any second medical field, determining that the prompt segment of the second medical field is a basic prompt segment in the case that the field weight value of the second medical field is less than or equal to the second preset weight value.
[0013] In the embodiment of the present application, the adaptive extraction optimization method further comprises: after obtaining a new structured result, again determining the missing terms in the plurality of key terms and the integrity scores corresponding to all the key terms according to the retention of each key term in the new structured result; and in the case that the re-determined integrity score is greater than a preset improvement threshold, accepting this optimization and taking the new structured result as the final extraction result of the medical documents of the plurality of first medical fields.
[0014] In the embodiment of the present application, the adaptive extraction optimization method further comprises: in the case that the re-determined integrity score is less than or equal to the preset improvement threshold, re-determining the prompt segment for each first medical field according to the retention of each key term in the new structured result; again generating an optimized prompt word according to the re-determined all prompt segments and the original prompt word; re-performing structured extraction on the medical documents of the plurality of first medical fields based on the again generated optimized prompt word to obtain a new structured result; and until the latest determined integrity score is greater than the preset improvement threshold, accepting this optimization and taking the latest obtained structured result as the final extraction result of the medical documents of the plurality of first medical fields.
[0015] In the embodiments of the present application, the preset promotion threshold is a target value preset in advance, or the preset promotion threshold is a product of an integrity score determined according to the retention of each key term in the initial structured result and a preset promotion coefficient.
[0016] In the embodiments of the present application, the adaptive extraction optimization method further comprises: updating the optimization times for the prompt words after obtaining the new structured result; in the case that the optimization times are less than a preset update times, re-determining the prompt segments for each first medical field according to the retention of each key term in the new structured result; generating the optimized prompt words again according to all the re-determined prompt segments and the original prompt words; re-performing the structured extraction on the medical documents of the plurality of first medical fields based on the optimized prompt words generated again to obtain a new structured result; and accepting the current optimization and taking the latest obtained structured result as the final extraction result for the medical documents of the plurality of first medical fields until the optimization times are greater than or equal to the preset update times.
[0017] In the embodiments of the present application, generating the optimized prompt words according to all the prompt segments and the original prompt words further comprises: determining a plurality of key terms that do not belong to the lost terms in the initial structured result; selecting a plurality of lost terms with higher scores as reminder terms based on the importance scores corresponding to each lost term; and combining the all prompt segments and the original prompt words and adding the reminder terms to generate the optimized prompt words.
[0018] In the embodiments of the present application, screening the key terms from the plurality of medical terms comprises: determining an importance score of each medical term according to the number of occurrences of each medical term in the original medical text; determining a screening threshold based on the importance scores of all medical terms; and determining the medical terms with the importance scores higher than the screening threshold in the plurality of medical terms as the key terms.
[0019] In the embodiments of the present application, determining the importance score of each medical term according to the number of occurrences of each medical term in the original medical text comprises: determining a medical specificity score of each medical term; determining, for each medical term, the number of documents in which the medical term appears in the plurality of first medical fields; determining the total number of word units in the original medical text; and determining, for each medical term, the importance score according to the number of documents of the medical term, the medical specificity score, the total number of word units, the total number of documents included in all first medical fields, and the number of occurrences of the medical term in the original medical text.
[0020] In the embodiment of the present application, determining the screening threshold based on the importance scores of all medical terms comprises: determining the mean value and the standard deviation of the importance scores of all medical terms according to the importance scores of all medical terms; and determining the screening threshold according to the mean value, the standard deviation and the second adjustment parameter of the importance scores.
[0021] In the embodiment of the present application, the adaptive extraction optimization method further comprises: generating a corresponding evaluation report based on the integrity scores corresponding to the all key terms, the missing terms and the importance scores of each key term obtained from the latest obtained structured result after each time a new structured result is obtained.
[0022] The second aspect of the present application provides an adaptive extraction optimization device for medical information, comprising: a memory configured to store instructions; and a processor configured to call the instructions from the memory and capable of implementing the adaptive extraction optimization method for medical information according to any of the above aspects when executing the instructions.
[0023] The third aspect of the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, cause the processor to be configured to perform the adaptive extraction optimization method for medical information described above.
[0024] The present method does not rely on gold standard structured data, but starts from the original text to evaluate whether important information is "captured". The whole method focuses on observing "recall" information, but does not directly measure its "precision" or format correctness. Moreover, the present scheme indicates the optimization direction through key term missing analysis, realizes rapid iteration of the model, optimizes the prompt word without a large amount of labeled data to further optimize the structured extraction result, realizes the ability of the LLM to extract key information from unstructured documents in a short time, and effectively improves the efficiency and accuracy of structured extraction.
[0025] Other features and advantages of the embodiments of the present application will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0026] The accompanying drawings are used to provide a further understanding of the embodiments of the present application, and constitute a part of the specification, and are used to explain the embodiments of the present application together with the following specific embodiments, but do not constitute a limitation of the embodiments of the present application. In the drawings: Figure 1 The flowchart of the adaptive extraction optimization method for medical information according to the embodiments of the present application is schematically shown; Figure 2Fig. 1 schematically shows a flowchart of a method for adaptive extraction optimization of medical information according to an embodiment of the present application; Figure 3 Fig. 2 schematically shows an internal structure diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the specific embodiments described herein are merely intended to illustrate and explain the embodiments of the present application, and are not intended to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of protection of the present application.
[0028] Figure 1 Fig. 1 schematically shows a flowchart of a method for adaptive extraction optimization of medical information according to an embodiment of the present application. As shown in Figure 1 the method for adaptive extraction optimization of medical information specifically includes the following steps: Step 102, based on original prompt words, performing structured extraction on medical documents of a plurality of first medical fields to obtain initial structured results.
[0029] Step 104, extracting a plurality of medical terms from original medical texts based on a term library.
[0030] Step 106, screening out key terms in the plurality of medical terms.
[0031] Step 108, determining prompt segments for each first medical field according to the retention of each key term in the initial structured results.
[0032] Step 110, generating optimized prompt words according to all prompt segments and original prompt words.
[0033] Step 112, based on the optimized prompt words, re-performing structured extraction on the medical documents of the plurality of first medical fields to obtain new structured results.
[0034] Medical documents are diverse and can involve multiple medical fields. Medical documents can also be stored unstructured. For ease of description, the medical field covered by the medical document that is initially subjected to structured extraction is referred to as a first medical field. The original prompt is also relative. The main idea is to express that the prompt is the prompt used when the medical document is initially subjected to structured extraction. At this time, the prompt has not been optimized, or it refers to the original, earlier used prompt relative to the subsequently optimized prompt. That is, the original prompt is the "starting point" in the optimization process, and the purpose of the present scheme is to optimize the prompt so that the structured result output based on the prompt is more in line with the requirements. The role of the prompt is to output the specified text extracted based on the prompt when multiple medical documents are subjected to structured extraction. Specifically, when multiple medical documents of the first medical field are subjected to structured extraction based on the original prompt, the medical documents can be subjected to structured extraction using an LLM. LLM (Large Language Model, LLM) refers to a deep learning model trained using a large amount of text data, so that the model can generate natural language text or understand the meaning of language text. The specific extraction process can use conventional operations, which will not be described here.
[0035] The term library refers to a medical term library. In a specific embodiment, the disease term library provided by the International Classification of Diseases Eleventh Revision (ICD-11) can be used as a basic medical term library as a reference benchmark for professional medical terms. The original medical text can be a self-built database. For example, assuming that it is used in a first hospital, the original medical text here can refer to the medical text stored in the hospital, or the medical text stored jointly by the hospital and other superior and subordinate hospitals. The source and quantity of the medical text are not limited here. The original medical text is not limited to whether it is "original". The core meaning is that the medical text is a document recording medical data, such as a patient's case, or medical record data for a certain disease, etc.
[0036] Based on the original prompt, the medical documents of the multiple first medical fields are subjected to structured extraction, and an initial structured result can be obtained. Then, based on the term library, multiple medical terms can be extracted from the original medical text. Specifically, spaCy (a natural language processing library) can be loaded to extract multiple medical terms in the original medical text based on the term library. Further, during the extraction of medical terms, spaCy can be loaded to perform tokenization on the original medical text to extract word units in the text. The text is preprocessed to filter out invalid information such as stop words, punctuation marks, and white spaces. Then, based on the term library, multiple medical terms are extracted from the filtered multiple word units.
[0037] Further, key terms in the plurality of medical terms can be screened. That is, part of the medical terms meeting the requirements are selected as key terms. Subsequently, the prompt segment for each first medical field can be determined according to the retention of each key term in the initial structured result. That is, for each key term, it is necessary to determine whether the key term exists in the initial structured result. Then, the prompt segment for each first medical field is determined according to the retention of all key terms in the initial structured result. Subsequently, the optimized prompt word can be generated by combining and adjusting the original prompt word according to the prompt segment corresponding to all first medical fields. Then, the medical documents of the plurality of first medical fields can be restructured and extracted based on the optimized prompt word to obtain a new structured result.
[0038] The method does not rely on gold standard structured data, but starts from the original text to evaluate whether important information is "captured". The whole method focuses on observing "recall" information, but does not directly measure its "precision" or format correctness. Moreover, the scheme indicates the optimization direction through key term omission analysis, realizes rapid iteration of the model, and optimizes the prompt word without a large amount of labeled data to optimize the structured extraction result, thereby realizing the ability of the LLM to extract key information from unstructured documents in a short time, and effectively improving the efficiency and accuracy of structured extraction.
[0039] In one embodiment, screening the key terms in the plurality of medical terms includes: determining the importance score of each medical term according to the number of occurrences of each medical term in the original medical text; determining a screening threshold based on the importance scores of all medical terms; and determining the medical terms in the plurality of medical terms with an importance score higher than the screening threshold as key terms.
[0040] Based on the term library, a plurality of medical terms can be extracted from the original medical text, and a medical term set T is constructed, which means that the set T includes n medical terms t. Then, the number of occurrences of each medical term in the original medical text is determined . Subsequently, the importance score of each medical term is determined according to the number of occurrences of each medical term .
[0041] In one specific embodiment, determining the importance score of each medical term according to the number of occurrences of each medical term in the original medical text comprises: determining a medical specificity score of each medical term; determining, for each medical term, the number of documents in the plurality of first medical domains in which the medical term occurs; determining the total number of tokens in the original medical text; and determining, for each medical term, the importance score of each medical term according to the number of documents of the medical term, the medical specificity score, the total number of tokens, the total number of documents included in all the first medical domains, and the number of occurrences of the medical term in the original medical text.
[0042] In determining the number of occurrences of each medical term in the original medical text , the medical specificity score of each medical term can also be determined . Wherein, tokens represents the ith medical term, and also refers to any medical term, which will not be repeated hereinafter. In one specific embodiment, when the captured token tokens occurs in the term library, i.e., when any medical term occurs in the term library, the medical specificity score of the medical term can be assigned a value of 0.7. It can be understood that this is an example and does not limit the specific assignment of the medical specificity score. For each medical term , the number of documents in the plurality of first medical domains in which the medical term occurs, i.e., how many medical documents in which the medical term occurs, is also determined. Then the total number of tokens in the original medical text needs to be determined. For each medical term, the importance score of each medical term is determined according to the number of documents of the medical term, the medical specificity score, the total number of tokens, the total number of documents included in all the first medical domains, and the number of occurrences of the medical term in the original medical text . The specific calculation formula can be as follows:
[0043] Wherein, is a default weight parameter, which can be set to 0.6, for example. refers to the medical specificity score of the term. When the captured token tokens occurs in the term library, the medical specificity score of the token can be set to a default value of 0.7. refers to the TF-IDF score of the medical term . Wherein, TF-IDF (term frequency-inverse document frequency) is a commonly used weighting technique for information retrieval and data mining. TF is the term frequency, and IDF is the inverse document frequency index. wherein, , . refers to the term the number of occurrences of the term in the original medical text D, refers to the total number of word units included in the original medical text D, and N refers to the total number of documents included in the first medical field, refers to the number of documents in which the term occurs in all documents included in the first medical field.
[0044] After determining the importance score of each medical term according to the number of occurrences of each medical term in the original medical text, a screening threshold for selecting the key terms can also be determined based on the importance scores of all medical terms.
[0045] In one embodiment, determining the screening threshold based on the importance scores of all medical terms includes determining the mean and the standard deviation of the importance scores according to the importance scores of all medical terms; and determining the screening threshold according to the mean, the standard deviation and a second adjustment parameter.
[0046] After determining the importance score of each medical term, the mean and the standard deviation of the importance scores of all medical terms can be determined. Then the screening threshold is determined according to the mean , the standard deviation and a second adjustment parameter k. Specifically, the calculation formula is as follows: screening threshold , wherein the default value of the second adjustment parameter k can be set to 0.5. After determining the screening threshold, the key terms can be selected from the plurality of medical terms based on the screening threshold. Specifically, the medical terms in the plurality of medical terms whose importance scores are higher than the screening threshold can be determined as the key terms. At this time, the set of key terms is constructed as , wherein the set T is a medical term set constructed by the plurality of medical terms extracted from the original medical text based on the term library. In the formula, the refers to the medical terms extracted from the original medical text based on the term library.
[0047] In the embodiment, the screening threshold is determined based on the importance scores of all medical terms. That is, after the prompt word adjustment, the structured result obtained after the restructured extraction also changes, and the importance scores of each medical term also change, which leads to the change of the screening threshold calculated based on the importance scores of all medical terms. It can be seen that the screening threshold in the present scheme is not a fixed value, but dynamically changes, which makes the key terms selected based on the dynamically changing screening threshold more authoritative and reliable.
[0048] In one embodiment, determining the prompt segment for each first medical field according to the retention of each key term in the initial structured result comprises: determining missing terms in the plurality of key terms and integrity scores corresponding to all key terms according to the retention of each key term in the initial structured result, wherein the missing terms refer to key terms that are not present in the initial structured result; determining the second medical field to which each missing term belongs, and determining the comprehensive score of each second medical field; normalizing the comprehensive score of each second medical field, and determining the processed result as the field weight value of each second medical field; and determining the prompt segment for each second medical field according to the field weight value of each second medical field.
[0049] First, after selecting the key terms in the plurality of medical terms based on the screening threshold, the retention of each key term in the initial structured result can be determined, that is, whether each key term exists in the initial structured result, so as to determine the missing terms in the plurality of key terms. Specifically, for any key term, if the initial structured result does not include the key term, the key term can be considered as a missing term. It can be understood that the missing term is actually part of the key term, and is mainly used for description and distinction, so it is called a missing term to indicate that the key term does not exist in the initial structured result. Then the second medical field to which each missing term belongs can be determined, and the comprehensive score of each second medical field can be determined. Specifically, the mapping function of each medical term to the field can be set as follows: to field
[0050] wherein, is the mapping function of each missing term to field . Since the present embodiment is specifically used to determine the medical field of each missing term, in the above formula, refers to the i-th missing term. M refers to a set constructed based on all missing terms. is a lookup function for finding a term In the context of the first-level classification of the Eleventh Revision of the International Classification of Diseases (ICD-11). Thus, the second medical field to which each missing term belongs can be determined , and the term-field association is established.
[0051] It can be understood that the second medical field can belong to multiple first medical fields, i.e., the multiple first medical fields include the second medical field to which the missing term belongs. After determining the comprehensive score of each second medical field, the comprehensive score of each second medical field can be normalized first, and then the processed result is determined as the field weight value of each second medical field. Then, the prompt segment for each second medical field can be determined according to the field weight value of each second medical field. That is, the prompt segment for each second medical field can be determined according to the comprehensive score of each second medical field, so that the medical field in which each missing term is located can be optimized when the prompt word optimization is performed subsequently.
[0052] After the multiple medical terms are extracted from the original medical text based on the term library, the key terms can be screened from the multiple medical terms according to the dynamically determined screening threshold. The integrity score corresponding to all the key terms can also be determined according to the retention of each key term in the initial structured result. In an embodiment, determining the missing term in the multiple key terms and the integrity score corresponding to all the key terms according to the retention of each key term in the initial structured result comprises: for each key term, if the key term exists in the initial structured result, determining that the matching degree between the key term and the initial structured result is a first value; for each key term, if the key term does not exist in the initial structured result, determining that the matching degree between the key term and the initial structured result is a second value; and determining the integrity score corresponding to all the key terms according to the matching degree between each key term and the initial structured result and the importance score.
[0053] For each key term, if the key term exists in the initial structured result, it can be determined that the matching degree between the key term and the initial structured result is a first value. If the key term does not exist in the initial structured result, it can be determined that the matching degree between the key term and the initial structured result is a second value. Specifically, the matching degree between each key term and the initial structured result is calculated according to the following formula: , wherein S refers to the initial structured result, and in the formula refers to the key term that has been screened out.
[0054] After determining the matching degree of each key term with the initial structured result S according to the retention of each key term in the initial structured result S, the integrity score for all key terms can be determined according to the matching degrees and the importance scores of all key terms. Specifically, the integrity score of each key term is calculated according to the following formula: The calculation formula of the integrity score of each key term is as follows:
[0055] wherein K refers to the set of the screened key terms. refers to the importance score of the key term . refers to the matching degree of the key term with the initial structured result.
[0056] In one embodiment, determining the comprehensive score of each second medical field comprises: determining the field loss rate of each second medical field according to the number of missing terms included in each second medical field; for each second medical field, determining the importance average of the second medical field according to the number of missing terms included in the second medical field and the importance score of each missing term included in the second medical field; and determining the comprehensive score of each second medical field according to the field loss rate and the importance average of each second medical field.
[0057] After determining the missing terms in the plurality of key terms according to the retention of each key term in the initial structured result, the second medical field to which each missing term belongs can be determined first, and then the field loss rate of each second medical field can be determined. Specifically, the field loss rate of each second medical field is calculated according to the following formula:
[0058] wherein, refers to the number of medical terms included in the second medical field . refers to the number of missing terms included in the second medical field .
[0059] Further, for each second medical field, the importance average of the second medical field can be determined according to the number of missing terms included in the second medical field and the importance score of each missing term included in the second medical field. That is, the importance average of each second medical field is calculated according to the following formula:
[0060] It should be noted that in the formula, the refers to the number of missing terms included in the second medical field loss terms identified in the medical field importance score.
[0061] Then, a comprehensive score of each second medical field can be determined according to the field loss rate and the importance average value of each second medical field . The specific calculation formula is as follows:
[0062] wherein, and are loss weight coefficients and average importance weight coefficients, respectively. In one specific embodiment, the values of and can be set as 0.5 by default.
[0063] Further, after determining the comprehensive score of each second medical field, the comprehensive score of each second medical field can also be normalized. The formula of normalization is as follows: 。
[0064] wherein, represents a preset lower limit value, and the default value can be set as 0.3. represents a preset upper limit value, and the default value can be set as 0.9. Through the algorithm, the comprehensive score of each second medical field after normalization based on the preset upper limit value and lower limit value, the value obtained after normalization can be taken as the field weight value of each second medical field . Subsequently, the prompt segment for each second medical field can be determined according to the field weight value of each second medical field.
[0065] Further, in one embodiment, the adaptive extraction optimization method further comprises: after determining the comprehensive score of each second medical field, determining the score mean and the score standard deviation of all comprehensive scores; determining the marked threshold value for field screening according to the score mean, the score standard deviation and the first adjustment parameter; marking the second medical field with a comprehensive score lower than the marked threshold value as a weak field.
[0066] After determining the comprehensive score of each second medical field according to the foregoing scheme, the score mean and the score standard deviation of the comprehensive scores of all second medical fields can be further determined. Specifically, the score mean of the comprehensive scores is . Wherein, D refers to a set consisting of all second medical fields, is referred to as the comprehensive score of each second medical field, i.e., the comprehensive score of the ith second medical field. The standard deviation of the comprehensive score Then, the marking threshold for field screening can be determined according to the calculated score mean value, score standard deviation, and first adjustment parameter Subsequently, the second medical field with a comprehensive score lower than the marking threshold can be marked as a weak field.
[0067] Specifically, the calculation formula of the marking threshold is as follows: The default value of the first adjustment parameter may be set to 0.1. As can be seen from the calculation formula of the marking threshold, the marking threshold is also dynamically changed. When the prompt word changes, the change of the obtained structured result will also cause the change of the marking threshold. In this way, it can be dynamically identified which medical fields in the second medical field belong to the weak field.
[0068] In an embodiment, the adaptive extraction optimization method further comprises: after marking the second medical field with a comprehensive score lower than the marking threshold as a weak field, determining the prompt word corresponding to the weak field; for any one of the pre-set prompt segments, adding the prompt word corresponding to the weak field to the pre-set prompt segment when fine-tuning the pre-set prompt segment, and combining the missing terms to obtain an updated prompt segment.
[0069] In this embodiment, after marking the second medical field with a comprehensive score lower than the marking threshold as a weak field, the corresponding prompt word can be set for the determined weak field. Then, for any one of the pre-set prompt segments, the prompt word corresponding to the weak field can be added to the pre-set prompt segment when fine-tuning the pre-set prompt segment, and the missing terms can be combined, so that an updated prompt segment can be obtained. Subsequently, the prompt segment for each first medical field can be determined based on the updated prompt segment, so that the original prompt word can be optimized.
[0070] In an embodiment, determining the prompt segment for each second medical field according to the field weight value of each second medical field comprises: for any second medical field, determining the prompt segment of the second medical field as a detailed prompt segment when the field weight value of the second medical field is greater than a first pre-set weight value; for any second medical field, determining the prompt segment of the second medical field as a standard prompt segment when the field weight value of the second medical field is greater than a second pre-set weight value and less than or equal to the first pre-set weight value; and for any second medical field, determining the prompt segment of the second medical field as a basic prompt segment when the field weight value of the second medical field is less than or equal to the second pre-set weight value.
[0071] After extracting multiple medical terms from the original medical text based on a term library and filtering out key terms from the multiple medical terms based on a screening threshold, the missing terms from the multiple key terms and the completeness scores corresponding to all key terms can be determined based on the retention of each key term in the initial structured results. The second medical field to which each missing term belongs can then be determined, and a comprehensive score for each second medical field can be determined. The comprehensive scores for each second medical field can then be normalized, and the processed results can be used to determine a field weight value for each second medical field. A prompt segment for each second medical field can then be determined based on the field weight value for each second medical field. For any second medical field, if the field weight value for that second medical field is greater than a first preset weight value, the prompt segment for that second medical field can be determined as a detailed prompt segment. If the field weight value for any second medical field is greater than a second preset weight value and less than or equal to the first preset weight value, the prompt segment for that second medical field can be determined as a standard prompt segment. If the field weight value for any second medical field is less than or equal to the second preset weight value, the prompt segment for that second medical field can be determined as a basic prompt segment. In a specific embodiment, the first preset weight value may be set to 0.7, and the second preset weight value may be set to 0.5. The scheme for determining the prompt segment may be expressed by the following formula:
[0072] in, It refers to the second medical field 's prompt snippet. The second medical field The domain weight value of the detailed prompt segment, the standard prompt segment and the basic prompt segment, the complexity of the prompt content and the richness of the content are in descending order, that is, the richness of the prompt content included in the detailed prompt segment is higher than that in the standard prompt segment, and the richness of the prompt content included in the standard prompt segment is higher than that in the basic prompt segment. Moreover, these three prompt segments are corresponding to each second medical field, that is, each medical field has one or more detailed prompt segments, standard prompt segments and basic prompt segments corresponding to the medical field. The content of the specific prompt segment can be pre-set by the technician and is not limited here. For example, when the domain weight value of a certain medical field is 0.8, a detailed prompt segment containing 3 detailed examples and strict format requirements can be selected as the prompt segment of the medical field. When the domain weight value of a certain medical field is 0.4, a basic prompt segment can be selected as the prompt segment of the medical field.
[0073] In one embodiment, the adaptive extraction optimization method further comprises: after obtaining the new structured result, determining the missing terms in the plurality of key terms and the integrity scores corresponding to all the key terms again according to the retention of each key term in the new structured result; and in the case that the re-determined integrity score is greater than a preset promotion threshold, accepting this optimization and taking the new structured result as the final extraction result of the medical documents in the plurality of first medical fields.
[0074] After extracting the plurality of medical terms from the original medical text based on the term library and screening the key terms in the plurality of medical terms based on the screening threshold, the missing terms in the plurality of key terms and the integrity scores corresponding to all the key terms can be determined according to the retention of each key term in the initial structured result. Then the second medical field to which each missing term belongs can be determined, and the comprehensive score of each second medical field can be determined. Subsequently, the comprehensive score of each second medical field can be normalized, and the processed result is determined as the field weight value of each second medical field, and the prompt segment for each second medical field is determined according to the field weight value of each second medical field. Then the optimized prompt word can be generated according to all the prompt segments and the original prompt word. Subsequently, the medical documents in the plurality of first medical fields can be re-structured and extracted based on the optimized prompt word, and a new structured result can be obtained.
[0075] Subsequently, the missing terms in the plurality of key terms and the integrity scores corresponding to all the key terms can be determined again according to the retention of each key term in the new structured result. That is, for each key term, if the key term exists in the new structured result, it is determined that the matching degree of the key term and the new structured result is a first value. If the key term does not exist in the new structured result, it is determined that the matching degree of the key term and the new structured result is a second value. Then the integrity scores corresponding to all the key terms can be re-determined according to the matching degree of each key term and the new structured result and the importance score of each key term. If the re-determined integrity score is greater than a preset promotion threshold, this optimization is accepted. That is, the new structured result can be taken as the final extraction result of the medical documents in the plurality of first medical fields.
[0076] In one embodiment, the adaptive extraction optimization method further comprises: in the case that the re-determined integrity score is less than or equal to the preset promotion threshold, re-determining the prompt fragment for each first medical field according to the retention of each key term in the new structured result; generating the optimized prompt words again according to the re-determined prompt fragments and the original prompt words; re-performing the structured extraction on the medical documents of the plurality of first medical fields based on the generated optimized prompt words again to obtain a new structured result; and accepting the current optimization and taking the latest obtained structured result as the final extraction result of the medical documents of the plurality of first medical fields until the latest determined integrity score is greater than the preset promotion threshold.
[0077] If the re-determined integrity score is less than or equal to the preset promotion threshold, the prompt fragment for each first medical field can be re-determined according to the retention of each key term in the new structured result. Specifically, the lost terms in the plurality of key terms can be re-determined according to the retention of each key term in the new structured result, and the integrity score corresponding to all the key terms is re-determined according to the new structured result. Then, the second medical field to which each lost term belongs is determined, and the comprehensive score of each second medical field is determined. The comprehensive score of each second medical field is normalized, and the processed result is determined as the field weight value of each second medical field. Then, the prompt fragment for each second medical field is determined according to the field weight value of each second medical field. The optimized prompt words are generated again according to the re-determined prompt fragments and the original prompt words. The structured extraction is re-performed on the medical documents of the plurality of first medical fields based on the generated optimized prompt words again to obtain a new structured result again. And, the lost terms in the plurality of key terms and the integrity score corresponding to all the key terms are re-determined again according to the retention of each key term in the latest obtained structured result, and it is judged whether the re-obtained integrity score is greater than the preset promotion threshold. If the re-obtained integrity score is greater than the preset promotion threshold, the current optimization is accepted, and the latest obtained structured result is taken as the final extraction result of the medical documents of the plurality of first medical fields. Otherwise, if the re-obtained integrity score is less than or equal to the preset promotion threshold, the above steps can be performed again until the latest determined integrity score is greater than the preset promotion threshold, which indicates that the optimization of the prompt words is successful, so as to realize the closed-loop optimization.
[0078] In one embodiment, the preset promotion threshold is a target value set in advance.
[0079] In one embodiment, the preset promotion threshold is the product of the integrity score determined according to the retention of each key term in the initial structured result and a preset promotion coefficient. The expression can be: The preset promotion threshold value wherein the CompletenessScore is determined according to the retention of each key term in the initial structured result, is a preset promotion coefficient. In a specific embodiment, may be set to 0.05.
[0080] In an embodiment, the adaptive extraction optimization method further comprises: after obtaining the new structured result, updating the optimization times for the prompt words; in the case that the optimization times are less than a preset update times, re-determining the prompt segments for each first medical field according to the retention of each key term in the new structured result; generating the optimized prompt words again based on the re-determined prompt segments and the original prompt words; re-performing the structured extraction on the medical documents of the plurality of first medical fields based on the optimized prompt words generated again to obtain a new structured result; and accepting the current optimization and taking the latest obtained structured result as the final extraction result for the medical documents of the plurality of first medical fields until the optimization times are greater than or equal to the preset update times.
[0081] As Figure 2As shown, the original medical record document library includes a plurality of original medical texts, and based on the medical terminology library, the term corpus statistics can be performed. That is, a plurality of medical terms can be extracted from the original medical text based on the terminology library. The original medical text can also be an original medical record text, such as a medical record book, medical record data, etc. of a certain patient. For a single original medical text, in the process of extracting medical terms, spaCy can be loaded first to perform word segmentation on the original medical text to extract word units in the text. The text is preprocessed to filter out invalid information such as stop words, punctuation marks, and white space characters. Then, based on the terminology library, a plurality of medical terms are extracted from the filtered plurality of word units. Then, the importance score of each medical term can be determined according to the number of occurrences of each medical term in the original medical text. Then, the average value and the standard deviation of the importance scores of all medical terms are determined, and the screening threshold, i.e. the dynamic threshold of the key term, is determined according to the average value, the standard deviation of the importance scores and the second adjustment parameter. Then, the medical terms with importance scores higher than the screening threshold among the plurality of medical terms can be determined as key terms. In parallel, based on the original prompt word, the medical documents of the plurality of first medical fields can be structured extracted to obtain an initial structured result. It can be understood that the medical document here can also be an original medical record text selected from the original medical record document library, which involves a plurality of medical fields. Then, the missing terms in the plurality of key terms and the integrity scores corresponding to all key terms can be determined according to the retention of each key term in the initial structured result. The missing term refers to a key term that does not exist in the initial structured result. The second medical field to which each missing term belongs can also be determined, and the comprehensive score of each second medical field can be determined. After normalizing the comprehensive score of each second medical field, the processed result can be determined as the field weight value of each second medical field, and the prompt segment, i.e. the template segment selection, for each second medical field can be determined according to the field weight value of each second medical field. Then, the optimized prompt word can be generated according to all prompt segments and the original prompt word. After that, based on the optimized prompt word, the medical documents of the plurality of first medical fields can be restructured extracted to obtain a new structured result. At the same time, the score mean and the score standard deviation of all comprehensive scores can be determined, and after determining the marking threshold for field screening according to the score mean, the score standard deviation and the first adjustment parameter, the second medical field with a comprehensive score lower than the marking threshold can be marked as a weak field. Further, after obtaining the new structured result, the missing terms in the plurality of key terms and the integrity scores corresponding to all key terms can be determined again according to the retention of each key term in the new structured result. In the case where the re-determined integrity score is greater than a preset improvement threshold, the optimization is accepted, and the new structured result is taken as the final extraction result of the medical documents of the plurality of first medical fields.Conversely, in the case that the newly determined integrity score is less than or equal to the preset promotion threshold, the prompt segment for each first medical field is re-determined according to the retention of each key term in the new structured result. Then the optimized prompt word is generated again according to the re-determined prompt segment and the original prompt word. Based on the generated optimized prompt word, the medical documents of the plurality of first medical fields are re-structured to obtain a new structured result. Until the newly determined integrity score is greater than the preset promotion threshold, the current optimization is accepted, and the newly obtained structured result is taken as the final extraction result of the medical documents of the plurality of first medical fields. Figure 2 In the embodiment, the preset promotion threshold is set to 0.9. Alternatively, whether the optimization of the prompt word is completed can also be determined based on the set number of optimizations. Specifically, after obtaining the new structured result, the number of optimizations of the prompt word is updated. In the case that the number of optimizations is less than the preset update number N, the prompt segment for each first medical field is re-determined according to the retention of each key term in the new structured result. The optimized prompt word is generated again according to the re-determined prompt segment and the original prompt word. Based on the generated optimized prompt word, the medical documents of the plurality of first medical fields are re-structured to obtain a new structured result. Until the number of optimizations is greater than or equal to the preset update number, the current optimization is accepted, and the newly obtained structured result is taken as the final extraction result of the medical documents of the plurality of first medical fields.
[0082] That is, in the embodiment, after obtaining the new structured result, whether the optimization of the prompt word is completed can also be determined according to the number of optimizations of the prompt word. Specifically, after obtaining the new structured result each time, the number of optimizations of the prompt word can be updated first. For example, the number of optimizations of the prompt word is incremented by 1. Then the number of optimizations of the prompt word is compared with the preset update number. If the number of optimizations of the prompt word is less than the preset update number, the prompt segment for each first medical field is re-determined according to the retention of each key term in the new structured result. The specific determination method is consistent with the foregoing embodiment, which will not be described herein. Then the optimized prompt word is generated again according to the re-determined prompt segment and the original prompt word. Based on the generated optimized prompt word, the medical documents of the plurality of first medical fields are re-structured to obtain a new structured result. At this time, the number of optimizations of the prompt word needs to be updated again, and the number of optimizations of the prompt word is compared with the preset update number. If the number of optimizations of the prompt word is less than the preset update number, the above steps are executed again, and a new structured result is obtained again. Until the number of optimizations of the prompt word is greater than or equal to the preset update number, the current optimization is accepted, indicating that the optimization of the prompt word is completed, and the newly obtained structured result is taken as the final extraction result of the medical documents of the plurality of first medical fields.Figure 2 The missing terms refer to the missing terms. The template fragment refers to the prompt fragment.
[0083] In an embodiment, generating the optimized prompt based on the prompt fragments and the original prompt further includes: determining missing terms in the plurality of key terms that are not in the initial structured result; selecting one or more missing terms with higher scores as reminder terms based on the importance scores of the missing terms; and combining the prompt fragments and the original prompt and adding the reminder terms to generate the optimized prompt.
[0084] After extracting the plurality of medical terms from the original medical text based on the term library, the key terms in the plurality of medical terms can be screened. Then, the missing terms in the plurality of key terms can be determined according to the retention of each key term in the initial structured result. That is, the missing terms in the plurality of key terms that are not in the initial structured result are determined. Then, the importance scores of the missing terms can be calculated. Since the missing terms are part of the key terms, the importance scores of the missing terms are essentially the importance scores of the key terms. Based on the importance scores of each missing term, one or more missing terms with higher scores can be selected as reminder terms from the plurality of missing terms. When optimizing the prompt, the prompt fragments and the original prompt can be combined and the reminder terms can be added to generate the optimized prompt.
[0085] In an embodiment, the adaptive extraction optimization method further includes: generating a corresponding evaluation report based on the integrity scores of all the key terms obtained from the latest structured result, the missing terms, and the importance scores of each key term after each new structured result is obtained.
[0086] In this embodiment, a corresponding evaluation report can be generated based on the integrity scores of all the key terms obtained from the latest structured result, the missing terms, and the importance scores of each key term. Specifically, the evaluation report can include N key terms with higher importance scores as important terms. The comprehensive value of the evaluation report is that the extraction effect of different models can be quickly compared, and the missing terms can help to locate the weaknesses of the structured extraction model.
[0087] This method is used to improve the performance of large medical models in information extraction tasks. It indicates the optimization direction through the omission analysis of key terms, realizes rapid model iteration, and can evaluate model performance without a large amount of labeled data. In addition, in the hospital clinical decision support system, structured information needs to be extracted from a large number of cases in real time to support doctors' diagnosis. Based on this method, structured case information with completeness scores and key information prompts that have not been extracted can be output to reduce the risk of omissions in medical decisions. Furthermore, by evaluating the completeness of key information in documents in real time, this method can generate quality monitoring dashboards and trend analysis reports, which is conducive to improving the quality and standardization of medical records. This method can also be used to evaluate and screen high-quality extraction results, reduce data cleaning time, and improve data availability.
[0088] Figure 1 FIG. 1 is a flow chart of an adaptive extraction optimization method for medical information in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0089] In one embodiment, a device for adaptive extraction and optimization of medical information is provided (not shown in the figure), comprising: a memory configured to store instructions; and A processor is configured to call the instructions from the memory and to implement the adaptive extraction optimization method for medical information according to any one of the above embodiments when executing the instructions.
[0090] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned adaptive extraction optimization method for medical information is implemented.
[0091] An embodiment of the present application provides a processor, which is used to run a program, wherein the program executes the above-mentioned adaptive extraction optimization method for medical information when running.
[0092] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 3The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected through a system bus. The processor A01 of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The network interface A02 of the computer device is configured to communicate with external terminals through network connection. The computer program B02, when executed by the processor A01, implements an adaptive extraction optimization method for medical information.
[0093] The embodiments of the present application provide a computer (electronic) device. The device includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of any one of the adaptive extraction optimization methods for medical information are implemented.
[0094] The embodiments of the present application also provide a computer program product, when executed on a data processing device, is adapted to execute a program initialized with the steps of the adaptive extraction optimization method for medical information.
[0095] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can be in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams according to the methods, devices (systems) and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The functions specified in one or more flows and / or blocks
[0097] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0099] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0100] The memory can include non-persistent memory and / or volatile memory, e.g., random access memory (RAM) and / or non-volatile memory, e.g., read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0101] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
[0102] It should also be noted that the terms "comprising", "comprises", "including", "includes" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0103] The above embodiments of the present application are only used to illustrate the technical solutions of the present application, and not intended to limit the present application. Although the present application has been described in detail, it should be understood that those skilled in the art can make various modifications and changes without departing from the spirit and scope of the present application. Any modification, equivalent replacement, improvement, and the like made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A self-adaptive extraction and optimization method for medical information, characterized in that: The adaptive extraction optimization method comprises: Based on the original prompt words, performing structured extraction on multiple medical documents in the first medical field to obtain initial structured results; Extract multiple medical terms from the original medical text based on the term base; screening out key terms from the plurality of medical terms; determining a prompt segment for each first medical field according to a retention of each key term in the initial structured results; generating optimized prompt words according to all prompt segments and the original prompt words; Based on the optimized prompt words, the plurality of medical documents in the first medical field are re-structured and extracted to obtain new structured results.
2. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The step of determining a prompt segment for each first medical field according to a retention status of each key term in the initial structured results comprises: Determining completeness scores corresponding to missing terms and all key terms in the plurality of key terms according to a retention status of each key term in the initial structured results, wherein the missing terms refer to key terms that do not exist in the initial structured results; Determine the second medical field to which each missing term belongs and determine a composite score for each second medical field; Normalizing the comprehensive score of each second medical field, and determining the processed result as the field weight value of each second medical field; A prompt segment for each second medical field is determined according to a field weight value of each second medical field.
3. The adaptive extraction and optimization method for medical information according to claim 2, characterized in that: The composite score for each secondary medical area is determined to include: determining a domain loss rate for each second medical field based on the number of missing terms included in each second medical field; For each second medical field, determining an average importance value of the second medical field according to the number of missing terms included in the second medical field and the importance score of each missing term included in the second medical field; The comprehensive score of each second medical field was determined based on the field loss rate and the average value of importance of each second medical field.
4. The adaptive extraction and optimization method for medical information according to claim 3, characterized in that: The adaptive extraction optimization method further comprises: After determining the composite score for each second medical field, determine the mean score and standard deviation of all composite scores; Determining a marking threshold for field screening according to the score mean, the score standard deviation, and a first adjustment parameter; The second medical field with the comprehensive score lower than the marking threshold is marked as a weak field.
5. The adaptive extraction and optimization method for medical information according to claim 4, characterized in that: The adaptive extraction optimization method further comprises: After marking the second medical field having the comprehensive score lower than the marking threshold as a weak field, determining a prompt word corresponding to the weak field; For any pre-set prompt segment, when fine-tuning the pre-set prompt segment, prompt words corresponding to the weak field are added to the pre-set prompt segment, and the missing terms are combined to obtain an updated prompt segment.
6. The adaptive extraction and optimization method for medical information according to claim 2, characterized in that: Determining the missing terms in the plurality of key terms and the completeness scores corresponding to all key terms according to the retention status of each key term in the initial structured result includes: For each key term, if the key term exists in the initial structured result, determining a matching degree between the key term and the initial structured result as a first value; For each key term, if the key term does not exist in the initial structured result, determining a matching degree between the key term and the initial structured result as a second value; The completeness scores corresponding to all key terms are determined according to the matching degree and importance score of each key term with the initial structured result.
7. The adaptive extraction and optimization method for medical information according to claim 2, characterized in that: Determining a prompt segment for each second medical field according to the field weight value of each second medical field includes: For any second medical field, when the field weight value of the second medical field is greater than the first preset weight value, determining the prompt segment of the second medical field as a detailed prompt segment; For any second medical field, when the field weight value of the second medical field is greater than the second preset weight value and less than or equal to the first preset weight value, determining the prompt segment of the second medical field as a standard prompt segment; For any second medical field, when the field weight value of the second medical field is less than or equal to the second preset weight value, the prompt segment of the second medical field is determined as the basic prompt segment.
8. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The adaptive extraction optimization method further comprises: After obtaining the new structured result, re-determining the missing terms in the plurality of key terms and the completeness scores corresponding to all key terms according to the retention status of each key term in the new structured result; In the case that the re-determined completeness score is greater than the preset improvement threshold, the optimization is accepted and the new structured result is used as the final extraction result for the medical documents in the multiple first medical fields.
9. The adaptive extraction and optimization method for medical information according to claim 8, characterized in that: The adaptive extraction optimization method further comprises: When the re-determined completeness score is less than or equal to the preset improvement threshold, re-determining the prompt segment for each first medical field according to the retention of each key term in the new structured result; generating an optimized prompt word again according to all the newly determined prompt segments and the original prompt word; Based on the regenerated optimized prompt words, re-performing structured extraction on the plurality of medical documents in the first medical field to obtain new structured results; Until the latest determined completeness score is greater than the preset improvement threshold, the optimization is accepted and the latest structured result is used as the final extraction result for the multiple medical documents in the first medical field.
10. The adaptive extraction and optimization method for medical information according to claim 8 or 9, characterized in that: The preset boost threshold is a preset target value, or the preset boost threshold is the product of a completeness score determined according to the retention of each key term in the initial structured result and a preset boost coefficient.
11. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The adaptive extraction optimization method further comprises: After obtaining new structured results, update the optimization times for the prompt word; When the number of optimizations is less than the preset number of updates, re-determining the prompt segment for each first medical field according to the retention of each key term in the new structured result; generating an optimized prompt word again according to all the newly determined prompt segments and the original prompt word; Based on the regenerated optimized prompt words, re-performing structured extraction on the plurality of medical documents in the first medical field to obtain new structured results; Until the number of optimizations is greater than or equal to the preset number of updates, the optimization is accepted, and the latest structured result is used as the final extraction result for the multiple medical documents in the first medical field.
12. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The step of generating the optimized prompt word based on all the prompt segments and the original prompt word further includes: determining missing terms among a plurality of key terms that are not included in the initial structured results; Based on the importance score corresponding to each missing term, multiple missing terms with higher scores are selected as reminder terms; All the prompt segments are combined with the original prompt word, and the reminder term is added to generate an optimized prompt word.
13. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The key terms screened out from the plurality of medical terms include: determining an importance score for each medical term according to the number of occurrences of each medical term in the original medical text; Determine the screening threshold based on the importance scores of all medical terms; Medical terms with the importance scores higher than the screening threshold among the plurality of medical terms are determined as key terms.
14. The adaptive extraction and optimization method for medical information according to claim 13, characterized in that: Determining the importance score of each medical term according to the number of occurrences of each medical term in the original medical text includes: Determine a medical specificity score for each medical term; For each medical term, determining the number of documents in the plurality of first medical fields in which the medical term appears; determining a total number of tokens in the original medical text; For each medical term, an importance score of each medical term is determined based on the number of documents of the medical term, the medical specificity score, the total number of word units, the total number of documents included in all first medical fields, and the number of times the medical term appears in the original medical text.
15. The adaptive extraction and optimization method for medical information according to claim 13, characterized in that: Determining the screening threshold based on the importance scores of all medical terms includes: The mean and standard deviation of importance scores were determined based on the importance scores of all medical terms; A screening threshold is determined according to the average value, the standard deviation and the second adjustment parameter of the importance scores.
16. The adaptive extraction and optimization method for medical information according to claim 1, characterized in that: The adaptive extraction optimization method further comprises: After each new structured result is obtained, a corresponding evaluation report is generated based on the completeness scores corresponding to all key terms obtained from the latest structured result, the missing terms, and the importance score of each key term.
17. An adaptive extraction and optimization device for medical information, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the adaptive extraction optimization method for medical information according to any one of claims 1 to 16 when executing the instructions.
18. A machine-readable storage medium, characterized in that The machine-readable storage medium stores instructions for causing a machine to execute the adaptive extraction optimization method for medical information according to any one of claims 1 to 16.