Medical entity recognition and knowledge base alignment method for rare disease scenarios
Patent Information
- Application Number
- CN202610795112.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-08-28
AI Technical Summary
[0005]鉴于上述的分析,本发明实施例旨在提供一种面向罕见病场景的医疗实体识别与知识库对齐方法,用以解决现有医学实体识别中罕见病识别能力弱、误匹配问题严重、匹配策略单一、知识库对齐困难以及缺乏可解释性的问题
本发明提供了面向罕见病场景的医疗实体识别与知识库对齐方法,通过对所述医疗文本进行语义解析得到候选实体名称列表,再将候选实体名称列表输入预先构建的医学标准术语知识图谱,采用四级级联匹配策略进行结构化验证实现了医疗实体识别与知识库对齐,解决了现有医疗实体识别技术中罕见病识别能力弱、误匹配严重、知识库对齐困难及缺乏可解释性的问题,在确保高准确率的前提下,显著提升了对各类医疗实体尤其是罕见病等长尾实体的召回率;输出完整的匹配路径、匹配置信度及多因子得分详情,决策过程透明可追溯,极大便利了医疗场景下的人工复核与质量管控;级联容错策略与原文回退机制能够自适应处理拼写变异、非标准缩写及口语化描述,在不同数据质量上均保持稳定性能,具备强大的实用化能力。
Smart Images

Figure CN122658693A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical data processing technology, and in particular to a method for medical entity recognition and knowledge base alignment for rare disease scenarios. Background Technology
[0002] Medical entity recognition is a key technology for automatically extracting and standardizing medical terms (such as diseases, drugs, and examinations) from free text clinical records (such as medical records and diagnostic reports). It is a prerequisite for building a standardized medical knowledge base and realizing clinical decision support and data analysis.
[0003] With the development of technology, various technical approaches have emerged in this field, but all have significant limitations. First, traditional dictionary-based matching methods rely on pre-built terminology databases, matching through string scanning and similarity calculation. This method not only struggles to cover the complex and varied aliasing systems of rare diseases but also completely lacks contextual understanding, making it highly prone to mismatches and misidentifications. Second, while named entity recognition models based on deep learning (such as BiLSTM-CRF and BERT) can learn contextual features, their performance drops sharply when recognizing long-tail entities (such as rare diseases) that appear infrequently in the training data. Furthermore, their output only includes entity type and boundaries, requiring additional entity linking steps to map to a standard knowledge base, making the process cumbersome and prone to error accumulation. Third, while generative methods based on large language models show potential in zero-shot learning, their inherent "illusion" problem may lead to fabrication or misinterpretation of entity information, and their output lacks terminology standardization constraints, failing to meet the stringent requirements for consistency and accuracy in medical data governance. Finally, the existing hybrid approach of “identification-linking” two stages, although intended to combine the advantages of each, still generally relies on simple string similarity strategies in the key entity linking linking stage. It fails to deeply integrate semantic and contextual information for accurate disambiguation and is not capable of distinguishing entities with similar names but different natures. The overall process is difficult to achieve a good balance between precision and recall.
[0004] In summary, existing technologies still suffer from weak rare disease identification capabilities, serious mismatch problems, limited matching strategies, difficulties in knowledge base alignment, and a lack of interpretability. These issues severely restrict the practical application of medical text information extraction, especially in the fields of precision medicine and rare disease diagnosis and treatment. Summary of the Invention
[0005] Based on the above analysis, the embodiments of the present invention aim to provide a medical entity recognition and knowledge base alignment method for rare disease scenarios, in order to solve the problems of weak rare disease recognition capability, serious mismatch problem, single matching strategy, difficulty in knowledge base alignment and lack of interpretability in existing medical entity recognition.
[0006] This invention provides a method for medical entity recognition and knowledge base alignment in rare disease scenarios, comprising the following steps: The process involves acquiring the medical text to be processed, performing semantic parsing on the medical text to identify drug entities and disease entities, and obtaining a candidate entity name list based on the identified entities; wherein, the candidate entity name list includes the original identified name, the normalized name, and the alias set; The candidate entity name list is input into a pre-constructed medical standard terminology knowledge graph, and a four-level cascaded matching strategy is used for structured verification, including: for the current candidate entity, matching is performed sequentially starting from the first-level strategy. If the current-level strategy successfully matches the entity name in the knowledge base, the matching result is output and subsequent matching is terminated; otherwise, the next-level strategy is entered. The matching result includes the entity name in the knowledge base and its standard code, the matching confidence, and the matching path information.
[0007] Furthermore, based on the structured prompting engineering, a large language model is invoked to perform semantic parsing on the medical text, identifying drug entities and disease entities. Then, based on the identified entities, normalization processing and the generation of an alias set are performed to obtain a list of candidate entity names. The structured prompting engineering sequentially includes a context constraint module, an example guidance module, and an output constraint module. The context constraint module is used to define the role of the large language model, extraction rules, normalization rules, and alias generation rules. The example guidance module is used to provide a small number of sample examples that distinguish between disease diagnosis and symptom description, a list of common dosage form suffixes, and rare disease alias templates. The output constraint module is used to specify the output format, including the original identified name, normalized name, and alias set for each drug entity and disease entity.
[0008] Furthermore, the standardization rules include removing dosage form suffixes and spelling correction; specifically, they include: The dosage form suffixes are removed from the list of common dosage form suffixes to obtain the entity name after suffix removal; the name after this step is used as the entity name after suffix removal, regardless of whether the suffix was actually removed. Obtain the standard name with the smallest edit distance in the medical standard terminology knowledge graph after removing the suffix. If the edit distance is less than or equal to its relative edit distance threshold, correction is allowed and the standard name is used as the correction result. At the same time, if the edit distance is greater than the set fixed edit distance threshold, correction is abandoned and the entity name after removing the suffix remains unchanged.
[0009] Furthermore, the medical standard terminology knowledge graph is an index database built on Elasticsearch. The index includes standard name fields, synonym fields, entity standard encoding fields, rare disease marker fields and prevalence fields, and semantic vector fields. The four-level cascaded matching strategy includes, in descending order of priority, a first-level exact matching strategy, a second-level synonym matching strategy, a third-level strict fuzzy matching strategy, and a fourth-level original text backtracking matching strategy.
[0010] Furthermore, the first-level precise matching strategy includes: performing standardized preprocessing on the normalized names and original identified names in the candidate entity name list, and then performing term query and match_phrase query on the standard name field of the medical standard terminology knowledge graph; if a match is found, the matching result is output; wherein, the matching confidence is set to 1.0 and the matching path marker is set to precise matching.
[0011] Furthermore, the second-level synonym matching strategy includes: based on the candidate entity name list, performing term and match queries on the synonym field in the medical standard terminology knowledge graph; if a match is found, outputting the matching result, wherein the matching confidence is set to 0.90 or 0.95, and the matching path is set to synonym matching.
[0012] Furthermore, the third-level strict fuzzy matching strategy includes: Each name in the normalized name and alias set of the candidate entity name list is used as a candidate entity name, and the candidate target name set of each candidate entity name in the medical standard terminology knowledge graph is obtained. Based on each candidate entity name and each candidate target name in its set of candidate target names, a multi-factor comprehensive similarity score is obtained between each candidate entity name and each candidate target name. The maximum value of the multi-factor comprehensive similarity score between all candidate entity names and all candidate target names is selected. If the maximum value is greater than or equal to the preset similarity threshold, it is determined to be a hit. The candidate target name corresponding to the maximum value is taken as the hit entity name, and the matching result is output. The matching confidence is set according to the linear mapping of the score, and the matching path is set to strict fuzzy matching.
[0013] Furthermore, the multi-factor comprehensive similarity score Represented as: ; In the formula, , , , These represent the string similarity, semantic similarity, length penalty factor, and rare disease weighting factor between the current candidate entity name and its corresponding current candidate target name, respectively. , , , These represent the weight coefficients for string similarity, semantic similarity, length penalty factor, and rare disease weighting factor, respectively.
[0014] Furthermore, the rare disease weighting factor Determined in the following ways: If the candidate target name has both a rare disease marker and an Orphanet ID, then ; If the candidate target name has a rare disease marker but does not have an Orphanet ID, then ; If the candidate target name does not have a rare disease marker and does not have an Orphanet ID, then ; Specifically, the system determines whether candidate target names have a rare disease marker and an Orphanet ID based on the rare disease marker and prevalence fields in the medical standard terminology knowledge graph.
[0015] Furthermore, the fourth-level original text rollback strategy includes: The original entity strings are extracted from the medical text to be processed. After format cleaning, exact matching, phrase matching and loose fuzzy matching are performed in sequence to obtain the names of the matched entities. The matching entity name is verified, including length ratio verification and character overlap rate verification. Based on the verified matching entity names, the matching results are output. The matching confidence is set based on the search score normalization and dynamic correction. The matching path is set to original text back-matching and a manual review mark is attached.
[0016] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: This invention provides a method for medical entity recognition and knowledge base alignment in rare disease scenarios. It obtains a candidate entity name list by semantically parsing the medical text, then inputs this list into a pre-constructed medical standard terminology knowledge graph. A four-level cascaded matching strategy is used for structured verification to achieve medical entity recognition and knowledge base alignment. This solves the problems of weak rare disease recognition capability, serious mismatches, difficulty in knowledge base alignment, and lack of interpretability in existing medical entity recognition technologies. While ensuring high accuracy, it significantly improves the recall rate for various medical entities, especially long-tail entities such as rare diseases. It outputs complete matching paths, matching confidence, and multi-factor score details, making the decision-making process transparent and traceable, greatly facilitating manual review and quality control in medical scenarios. The cascaded fault-tolerance strategy and original text rollback mechanism can adaptively handle spelling variations, non-standard abbreviations, and colloquial descriptions, maintaining stable performance across different data quality levels and possessing strong practical application capabilities.
[0017] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from the description and drawings, which are particularly pointed out. Attached Figure Description
[0018] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0019] Figure 1 This is a flowchart illustrating the medical entity recognition and knowledge base alignment method for rare disease scenarios provided in an embodiment of the present invention. Detailed Implementation
[0020] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0021] A specific embodiment of the present invention discloses a method for medical entity recognition and knowledge base alignment in rare disease scenarios, such as... Figure 1 As shown, it includes the following steps: S1. Obtain the medical text to be processed, perform semantic parsing on the medical text, identify drug entities and disease entities, and obtain a candidate entity name list based on the identified entities; wherein, the candidate entity name list includes the original identified name, the normalized name and the alias set.
[0022] Specifically, medical texts include medical information recorded in free text form in clinical practice, including electronic medical records (unstructured fields such as chief complaint, present medical history, and diagnostic records), clinical documents (outpatient medical records, discharge summaries, etc.), and the textual descriptions of examination reports.
[0023] During implementation, a large language model is invoked based on the structured prompting project to perform semantic parsing on the medical text, identify drug entities and disease entities, and then perform normalization processing and generate an alias set based on the identified entities to obtain a list of candidate entity names. The structured prompting project sequentially includes a context constraint module, an example guidance module, and an output constraint module. The context constraint module is used to define the role of the large language model, extraction rules, normalization rules, and alias generation rules. The example guidance module is used to provide a small number of sample examples that distinguish between disease diagnosis and symptom description, a list of common dosage form suffixes, and rare disease alias templates. The output constraint module is used to specify the output format, including the original identified name, normalized name, and alias set for each drug entity and disease entity.
[0024] Specifically, the large language models used include DeepSeek-Chat, OpenAI GPT-4, AnthropicClaude, or locally deployed open-source models (such as Llama-3-Medical and ChatGLM-Med).
[0025] It should be noted that this embodiment does not improve or train the large language model itself, but achieves deep semantic understanding through structured prompting engineering. The prompting engineering method does not require model fine-tuning and utilizes the zero-shot learning capability of the large language model to achieve semantic understanding in a specific domain.
[0026] In practice, the context constraint module limits the role of the large language model to that of a medical information extraction expert; the extraction rules limit the extraction to only drug names and disease names, excluding symptoms, signs and examination items, and prohibits the creation of entities.
[0027] In practice, the standardization rules include removing dosage form suffixes and spelling correction; specifically, they include: The dosage form suffixes are removed from the list of common dosage form suffixes to obtain the entity name after suffix removal; the name after this step is used as the entity name after suffix removal, regardless of whether the suffix was actually removed. Obtain the standard name with the smallest edit distance in the medical standard terminology knowledge graph after removing the suffix. If the edit distance is less than or equal to its relative edit distance threshold, correction is allowed and the standard name is used as the correction result. At the same time, if the edit distance is greater than the set fixed edit distance threshold, correction is abandoned and the entity name after removing the suffix remains unchanged.
[0028] Specifically, relative edit distance threshold Represented as: , In the formula, This indicates the length of the entity name after removing the suffix. This indicates rounding down. In the character length calculation, one Chinese character counts as 1, and one English letter counts as 1.
[0029] Specifically, the fixed editing distance threshold is set empirically to balance error correction tolerance and accuracy. Preferably, the fixed editing distance threshold is set to 3, which can cover most common spelling errors while avoiding miscorrecting correct but obscure terms as other standard names.
[0030] Specifically, the medical standard terminology knowledge graph is an indexed database built on Elasticsearch. The index includes standard name fields (including exact match subfields `standard_name.keyword` and `standard_name.text`), synonym fields (including exact match subfields `synonyms.keyword` and `synonyms.text`), entity standard encoding fields (`entity_id`), rare disease marker fields (`is_rare_disease`) and prevalence fields (`orphanet_id`), and semantic vector fields (`omim_id`). Its data sources include: ICD-10, ICD-11, Orphanet (containing 9000+ rare diseases), OMIM, the Chinese Disease Ontology Database, the National Drug Standards Database, WHOATC classification, and the Chinese Pharmacopoeia.
[0031] It should be noted that the synonym index, i.e., the synonym field (including the exact match subfield synonyms.keyword and the text match subfield synonyms.text), is sourced from disease alias fields in ICD-10 / ICD-11, the Synonym field in Orphanet, the generic name, trade name, and chemical name mapping relationship in the drug database, as well as long-tail entity aliases generated with the assistance of a large language model and manually reviewed.
[0032] In practice, the alias generation rules include: The number of aliases generated for each disease entity is limited to a first preset number, and the number of aliases generated for each drug entity is limited to a second preset number. The output is limited to an alias confidence score for each alias, and only aliases with confidence scores greater than or equal to the first alias confidence threshold are retained to form the alias set; Based on the entity type, the alias generation dimension is dynamically selected. For disease entities, the alias generation includes Chinese and English translations, academic names and common names, full names and abbreviations, and disease subtypes and superordinate classes. For rare disease entities, gene symbols, OMIM numbers or protein names are generated in addition. For drug entities, generic names and trade names, chemical names or common abbreviations are generated.
[0033] Specifically, the first quantity, the second quantity, and the first alias confidence threshold are set based on empirical trade-offs. Preferably, the first quantity is set to 5, which can cover common variants without significantly increasing computational overhead; the second quantity is set to 2, since drug entity aliases are relatively standardized and few in number, setting 2 is sufficient to cover trade names or chemical names; the first alias confidence threshold is set to 0.6, as a low threshold, to filter obviously unreliable noisy aliases, while retaining candidates with moderate confidence.
[0034] For example, the prompt words for the context constraint module in the structured prompting project are: "You are a professional medical information extraction expert. Please extract drug and disease entities from the following medical text."
[0035] Extraction Rules 1. Extract only the drug name (based on the National Drug Standards Database) and the disease name (based on the ICD-10 / Orphanet standard).
[0036] 2. Do not extract symptoms (such as 'fever', 'cough'), signs (such as 'high blood pressure'), or test items (such as 'complete blood count').
[0037] 3. Do not fabricate entities; only extract content that explicitly appears in the text.
[0038] [Standardization Rules] 4. For pharmaceutical products, remove the dosage form suffix at the end (see the list of suffixes below). For example, "hydrocortisone tablets" → "hydrocortisone".
[0039] 5. Spell Correction: Correction is allowed only when the edit distance is ≤ the dynamic threshold (max(2, floor(0.2×word length)) and does not exceed half the word length). If the minimum edit distance between the corrected name and the standard name in the knowledge base is > 3, the correction is abandoned and the original text is retained.
[0040] Alias Generation Rules 6. Each disease entity can generate a maximum of 5 aliases, and each drug entity can generate a maximum of 2 aliases.
[0041] 7. Output the confidence score (0-1) for each alias.
[0042] 8. Alias Dimension: Generate Chinese-English translations, common names, abbreviations, and subtypes for disease entities; additionally generate gene symbols, OMIM numbers, and protein names for rare diseases; generate trade names, chemical names, and common abbreviations for drug entities.
[0043] 9. Do not generate aliases that are exactly the same as the normalized name or differ only in capitalization / punctuation. In practical implementation, the example bootstrapping module includes: Provide a small sample of examples that distinguish between disease diagnosis and symptom description. The small sample of examples includes at least one set of negative examples containing symptom description and one set of positive examples containing disease diagnosis. A list of reference terms is provided, including a list of dosage form suffixes, a list of reference standard names, and a template of alternative names for rare diseases.
[0044] In practice, a list of common dosage form suffixes and templates for rare disease aliases are extracted from a medical standard terminology knowledge graph. Specifically, based on a set periodic query of the drug standard names in the knowledge base, high-frequency suffixes (such as "tablets," "capsules," "injection," "granules," "ointment," "sustained-release tablets," etc.) are extracted, and a list is generated after deduplication. Several typical rare diseases are selected, and their alias types (such as "gene symbol," "OMIM number," "protein name") are extracted as examples for generating aliases.
[0045] Specifically, suffixes with a frequency greater than or equal to 2 are designated as high-frequency suffixes. This not only filters out occasional spelling errors or noise but also allows for the timely capture of genuine new dosage form suffixes.
[0046] For example, the prompt words in the example guide module of the structured prompt project are: Example Text: "The patient presents with adrenocortical insufficiency." Output: No disease entities are extracted.
[0047] Text: "The patient was diagnosed with adrenocortical insufficiency." Output: Disease entity "Adrenocortical insufficiency".
[0048] Text: "hydrocortisone tablets" → Normalized to: "hydrocortisone" (remove the suffix "tablets").
[0049] [List of Dosage Form Suffixes] Tablets, capsules, injections, granules, ointments, sustained-release tablets, effervescent tablets [Rare Disease Alias Template (Example)] Common alternative names for "21-hydroxylase deficiency" include: 21-OHD (abbreviation), CYP21A2 deficiency (gene), congenital adrenal hyperplasia type 21 (subtype), and Congenital Adrenal Hyperplasia. In practical implementation, the output constraint module includes: Define the structure of the output object in JSON format, including arrays of drug entities and arrays of disease entities. Each entity array contains elements including an original identification name field, a normalized name field, and an alias array field. Natural language instructions require large language models to strictly adhere to the defined JSON Schema output, prohibiting the output of unstructured text or additional fields.
[0050] For example, the prompt words for the output constraint module in the structured prompting project are: Please strictly adhere to the following JSON format for output, and do not output any explanatory text or Markdown: { "drugs": [ { "name": "Original Identifier Name", "normalized": "normalized name", "aliases": [], } ], "diseases": [ { "name": "Original Identifier Name", "normalized": "normalized name", "aliases": [ {"value": "Alias 1", "confidence": 0.95, "type": "abbreviation"}, {"value": "Alias 2", "confidence": 0.90, "type": "gene"} ], } ] } If a category has no entities, output an empty list []. It should be noted that the context constraint module, example guidance module, and output constraint module should be assembled into the final prompt word in the following order: first, input the context constraint module; second, input the example guidance module; third, input the medical text to be processed; and finally, input the output constraint module.
[0051] Preferably, if the length of the medical text exceeds a preset first length threshold, it is segmented into sentences or paragraphs, processed separately, and then the recognition results are merged.
[0052] Specifically, the first length threshold is set according to the context window of the large language model, preferably 80% of the context window of the large language model.
[0053] Preferably, after obtaining the candidate entity name list in step S1, the method further includes: Parse the output of the large language model and verify whether it conforms to the preset JSON Schema; if parsing fails, lower the temperature parameter of the large language model and retry once; if the retry still fails, record the error and trigger a manual alarm.
[0054] Understandably, by constructing complete compound prompt words, entity recognition, normalization, and alias generation can be completed simultaneously in a single large language model call, avoiding the overhead of multiple API calls and maintaining contextual coherence.
[0055] S2. Input the list of candidate entity names into a pre-constructed medical standard terminology knowledge graph, and perform structured verification using a four-level cascaded matching strategy, including: for the current candidate entity, matching is performed sequentially starting from the first-level strategy. If the current-level strategy successfully matches the entity name in the knowledge base, the matching result is output and subsequent matching is terminated; otherwise, the next-level strategy is entered. The matching result includes the entity name in the knowledge base and its standard code, the matching confidence, and the matching path information.
[0056] In implementation, the four-level cascading matching strategy includes, in descending order of priority, a first-level precise matching strategy, a second-level synonym matching strategy, a third-level strict fuzzy matching strategy, and a fourth-level original text fallback matching strategy.
[0057] In practice, the first-level exact matching strategy includes: after standardizing and preprocessing the normalized names and original identified names in the candidate entity name list, performing term queries and match_phrase queries on the standard name field of the medical standard terminology knowledge graph; if a match is found, the matching result is output; the matching confidence is set to 1.0, and the matching path marker is set to exact match. It can be understood that if the first-level exact matching strategy succeeds, setting the matching confidence to 1.0 indicates that the normalized alignment of the entity is completely reliable.
[0058] Specifically, in the first-level precise matching strategy, the normalized names in the candidate entity names are preprocessed and matched first; if no normalized name is matched, the original identified name is used for preprocessing and matching. If the first-level precise matching strategy does not match any knowledge base entities, the current candidate name list is passed to the second-level synonym matching strategy as is, and the reason for the first-level failure is recorded.
[0059] Specifically, the standardization preprocessing includes: unifying spaces, removing redundant spaces such as leading and trailing spaces and consecutive spaces; unifying punctuation, converting Chinese punctuation to English punctuation to fit the standard format in the knowledge base; and removing meaningless modifiers, such as deleting generic terms like "medicine" and "disease," such as "medicine" in "medicine hydrocortisone."
[0060] Specifically, performing term queries and match_phrase queries on the standard name field of the medical standard terminology knowledge graph includes: First, perform a term query on the standard name field of the medical standard terminology knowledge graph, and set the case_insensitive parameter to true to ignore case differences; If the term query does not find a match, a match_phrase query is performed on the standard name field, with the slop parameter set to 0 to ensure that there are no gaps between the query terms. Furthermore, when performing term queries and match_phrase queries, a multi_match query is used to simultaneously retrieve the standard name field, generic name field, and trade name field from the medical standard terminology knowledge graph.
[0061] In practice, the second-level synonym matching strategy includes: based on the candidate entity name list, performing term and match queries on the synonym field in the medical standard terminology knowledge graph; if a match is found, the matching result is output, where the matching confidence is set to 0.90 or 0.95, and the matching path is set to synonym matching.
[0062] Specifically, based on the list of candidate entity names, term queries and match queries are performed on the synonym field in the medical standard terminology knowledge graph, including: Using the canonicalized names from the candidate entity name list, perform a term query on the exact match subfield (synonyms.keyword) of the synonym field in the medical standard terminology knowledge graph; if no match is found, then... Using each alias in the alias set, perform a match query sequentially on the text matching subfield (synonyms.text) of the synonym field in the medical standard terminology knowledge graph; if no match is found, then... Using the original identified name, perform a term query on the exact match subfield (synonyms.keyword) of the synonym field in the medical standard terminology knowledge graph; if no match is found, then... Perform a match query on the text matching subfield (synonyms.text) of the synonyms field in the medical standard terminology knowledge graph; If the second-level synonym matching strategy fails to match any knowledge base entity, the current list of candidate names is passed to the third-level strict fuzzy matching strategy, and the reason for the second-level failure is recorded.
[0063] Specifically, the matching confidence is set to 0.95 when the normalized name matches the exact match subfield; the matching confidence is set to 0.90 when an alias in the alias set matches the text match subfield; and the matching confidence is 0.95 when the original identified name matches the exact match subfield and 0.90 when it matches the text match subfield.
[0064] More specifically, when performing a term query on the synonyms.keyword field, the boost weight is set to 2.0; when performing a match query on the synonyms text field, the boost weight is set to 1.0. Understandably, in synonym matching, the exact match results from the synonyms.keyword field are more reliable and have a lower risk of false matches, hence the higher boost weight (2.0) is given priority; while the word segmentation matching of the synonyms.text field may introduce noise or partial matches, so a lower weight (1.0) is set to reduce its priority.
[0065] Specifically, the second-level synonym matching strategy supports a maximum of two hops for extended synonym queries; that is, when a synonym entry is matched, the synonym value of that entry is obtained as a new query term to continue matching, and only two hops are performed to prevent semantic drift.
[0066] For example, when “CAH” is entered, the first hop finds the synonym “Congenital Adrenal Hyperplasia”, the second hop finds “Congenital Adrenal Hyperplasia”, and finally returns the complete set of synonyms. It supports extended queries of up to two hops to control semantic drift.
[0067] Preferably, if the second-level synonym matching strategy is successful, the output matching results also include: the type of synonym matched (such as abbreviation, gene name, subtype, etc.) and the synonym extension path (if there is an extension query).
[0068] In practice, the third-level strict fuzzy matching strategy includes: Each name in the normalized name and alias set of the candidate entity name list is used as a candidate entity name, and the candidate target name set of each candidate entity name in the medical standard terminology knowledge graph is obtained. Based on each candidate entity name and each candidate target name in its set of candidate target names, a multi-factor comprehensive similarity score is obtained between each candidate entity name and each candidate target name. The maximum value of the multi-factor comprehensive similarity score between all candidate entity names and all candidate target names is selected. If the maximum value is greater than or equal to the preset similarity threshold, it is determined to be a hit. The candidate target name corresponding to the maximum value is taken as the hit entity name, and the matching result is output. The matching confidence is set according to the linear mapping of the score, and the matching path is set to strict fuzzy matching.
[0069] Specifically, if the maximum value of the multi-factor comprehensive similarity score is less than the preset similarity threshold, it is determined as a miss, and the current candidate entity name list is passed to the fourth-level original text fallback strategy, and the reason for the miss is recorded.
[0070] Understandably, even if the normalized name fails to match due to excessive error correction, the third-level strict fuzzy matching strategy can still match the target name in the knowledge base with a higher character similarity of an alias (such as an English abbreviation).
[0071] Specifically, by utilizing fuzzy or match queries of the medical standard terminology knowledge graph, the top K candidate target names most similar to the candidate entity names are quickly retrieved from the medical standard terminology knowledge graph, resulting in a set of candidate target names. Here, K is set to 20, which ensures sufficient candidate target entity names are retrieved to guarantee matching accuracy while keeping the computational cost of subsequent multi-factor similarity calculations within an acceptable range.
[0072] Specifically, multi-factor comprehensive similarity score Represented as: ; In the formula, , , , These represent the string similarity, semantic similarity, length penalty factor, and rare disease weighting factor between the current candidate entity name and its corresponding current candidate target name, respectively. , , , These represent the weight coefficients for string similarity, semantic similarity, length penalty factor, and rare disease weighting factor, respectively.
[0073] More specifically, the weighting coefficients are set based on experimental optimization of each factor's contribution to matching accuracy. For example, in this embodiment, , , , The values are set to 0.4, 0.35, 0.15, and 0.1 respectively. This setting takes into account that string similarity is the basis for matching reliability, semantic similarity provides a deeper understanding, length penalty prevents false matches, and rare disease weighting improves the priority of long-tail entities.
[0074] More specifically, string similarity Based on Levenshtein edit distance calculation, it is expressed as: ; In the formula, Indicates the candidate entity name, Indicates the name of the candidate target. Indicates the character length of the candidate entity name. Indicates the length of the candidate target name in characters. Indicates the Levenshtein edit distance. This indicates taking the maximum value. More specifically, semantic similarity The candidate entity name and candidate target name are encoded into semantic vectors by using a medical pre-trained BERT model, and the cosine similarity between the two is used as the semantic similarity. The semantic vector of the candidate target name is pre-calculated offline and stored in the medical standard terminology knowledge graph, while the semantic vector of the candidate entity name is calculated in real time.
[0075] More specifically, length penalty factor Represented as: ; in, ; In the formula, This indicates the ratio of the length of the candidate entity name to the length of the candidate target name. This indicates taking the minimum value.
[0076] Understandably, the length penalty factor can accommodate common 1-2 word dosage form / disease suffix differences, such as "hydrocortisone" and "hydrocortisone tablets". No penalty; allows for smooth transitions, avoiding hard boundaries; and can prevent mismatches with excessively large length differences, such as "nephritis" (2 characters) and "acute exacerbation of chronic glomerulonephritis" (13 characters). Complete punishment.
[0077] More specifically, rare disease weighting factor Determined in the following ways: If the candidate target name has both a rare disease marker and an Orphanet ID, then ; If the candidate target name has a rare disease marker but does not have an Orphanet ID, then ; If the candidate target name does not have a rare disease marker and does not have an Orphanet ID, then ; Specifically, the rare disease marker and Orphanet ID of the candidate target name are determined based on the rare disease marker field and the prevalence field in the medical standard terminology knowledge graph.
[0078] It is understandable that if the rare disease marker field in the medical standard terminology knowledge graph is "true", it means that the disease has a rare disease marker. If the prevalence field contains an Orphanet ID, it means that the disease has an Orphanet ID.
[0079] Specifically, the similarity threshold is set as follows: If the candidate target name has a rare disease marker, the preset similarity threshold is dynamically calculated based on the prevalence rate in the Orphanet database; otherwise, the similarity threshold is set to 0.75.
[0080] Understandably, setting a similarity threshold of 0.75 when there are no rare disease markers is a balance point between recall and precision obtained through experiments, which can effectively filter out false matches caused by entities that are similar in string or semantics but are essentially different.
[0081] More specifically, if the prevalence rate is not found in the Orphanet database, the similarity threshold is set to 0.65; otherwise, the similarity threshold is dynamically calculated based on the prevalence rate in the Orphanet database. Represented as: ; In the formula, This indicates the number of patients per 100,000 people.
[0082] Understandably, through multi-dimensional similarity verification—including string, semantic, and length penalties, as well as weighted similarity for rare diseases and dynamic threshold adjustment—erroneous links caused by name similarity were effectively suppressed, and the overall mismatch rate was strictly controlled. For rare diseases, a dynamic threshold reduction and weighting factor increase were designed to accurately capture rare disease names and their diverse expressions, solving the long-tail distribution problem in medical entity recognition.
[0083] Specifically, the matching confidence is set based on the score linear mapping. Represented as: ; In the formula, This represents the maximum value of the multi-factor comprehensive similarity score.
[0084] Understandably, the matching confidence set according to the linear mapping of scores makes the lower limit of the matching confidence for rare diseases reasonably decrease as the similarity threshold decreases, from 0.85 to 0.80, but the upper limit for perfect matching is uniformly 0.95. This improves the recall rate of rare diseases while prompting attention to matching results with higher uncertainty through a lower matching confidence.
[0085] In specific implementation, the fourth-level original text rollback strategy includes: The original entity strings are extracted from the medical text to be processed. After format cleaning, exact matching, phrase matching and loose fuzzy matching are performed in sequence to obtain the names of the matched entities. The matching entity name is verified, including length ratio verification and character overlap rate verification. Based on the verified matching entity names, the matching results are output. The matching confidence is set based on the search score normalization and dynamic correction. The matching path is set to original text back-matching and a manual review mark is attached.
[0086] It should be noted that obtaining the original entity string is based on obtaining entity boundary information in the S1 stage, or by extracting it from the original medical text through existing text localization methods such as dictionary matching and pattern matching. This process can be obtained using existing technologies, and will not be elaborated here.
[0087] Specifically, format cleaning includes: removing extra spaces at the beginning, end, and in the middle of the original entity string, and converting Chinese punctuation marks to English punctuation marks.
[0088] Specifically, exact matching, phrase matching, and loose fuzzy matching are performed sequentially to obtain the matched entity names, including: Use term query or match_phrase query on the standard name field of the medical standard terminology knowledge graph; if no match is found, perform phrase matching; if no phrase matching is found, perform loose fuzzy matching; where loose fuzzy matching allows an edit distance of no more than 2.
[0089] Specifically, the matching confidence is based on retrieval score normalization and dynamic correction settings. Represented as: ; In the formula, This represents the matching confidence score obtained by normalizing the search scores. Indicates the text quality factor. This represents the query confidence factor.
[0090] More specifically, the matching confidence is obtained by normalizing the retrieval scores. Represented as: ; In the formula, This represents the relevance score of the match between the currently matched entity name and the original entity string. This represents the maximum relevance score of the match between all matched entity names and the original entity string. Specifically, the relevance score between the matched entity names and the query term is calculated using the BM25 algorithm based on a medical standard terminology knowledge graph.
[0091] More specifically, text quality factor Represented as: ; In the formula, This represents the edit distance between the original entity string and its corresponding normalized name.
[0092] More specifically, query confidence factor Represented as: ; In the formula, This represents the second-largest relevance score of the match between all hit entity names and the original entity string.
[0093] Specifically, the length ratio check is set to a ratio of the original entity string length to the length of the matched entity name greater than or equal to 0.5; the character overlap rate check is set to a ratio of the common characters between the original entity string and the matched entity name greater than or equal to 70%. Understandably, setting the length ratio to be greater than or equal to 0.5 prevents short strings (such as "nephritis") from mismatching with excessively long knowledge base entities (such as "acute exacerbation of chronic glomerulonephritis"), and setting the character overlap rate to be greater than or equal to 70% ensures that candidate names and knowledge base entities share enough core characters, excluding semantically irrelevant accidental matches.
[0094] Specifically, if none of the four-level cascaded matching strategies are matched, the candidate entity is marked as "llm_unmapped", and the original text, normalized text, and reason for non-match are retained for manual review.
[0095] Understandably, the first three strategies all use candidate entity names that have been normalized by the large language model for matching. However, the normalization process of the large language model itself may introduce errors (such as modifying correct terms to non-existent expressions, over-correction, etc.). To prevent matching failures due to errors in the processing of the large language model, when none of the first three strategies are successful, the original input text that has not been processed by the large language model is extracted for matching, which effectively prevents the loss of correct recognition results due to over-reliance on the large language model.
[0096] Understandably, a four-level cascaded matching strategy is employed, attempting matching layer by layer from the most stringent to a relatively lenient approach. This maximizes recall while maintaining high accuracy, adapting to input data of varying quality. Each level has a different level of matching stringency, and by setting a corresponding matching confidence level for each level, the reliability of the matching results at that level is quantified. This design ensures efficient automated processing while allowing for manual intervention in boundary cases that cannot be handled automatically.
[0097] Compared with existing technologies, the medical entity recognition and knowledge base alignment method for rare disease scenarios provided in this embodiment obtains a candidate entity name list by semantically parsing the medical text, and then inputs the candidate entity name list into a pre-constructed medical standard terminology knowledge graph. A four-level cascaded matching strategy is used for structured verification to achieve medical entity recognition and knowledge base alignment. This solves the problems of weak rare disease recognition capability, serious mismatches, difficulty in knowledge base alignment, and lack of interpretability in existing medical entity recognition technologies. While ensuring high accuracy, it significantly improves the recall rate for various medical entities, especially long-tail entities such as rare diseases. It outputs complete matching paths, matching confidence, and multi-factor score details, making the decision-making process transparent and traceable, which greatly facilitates manual review and quality control in medical scenarios. The cascaded fault tolerance strategy and original text rollback mechanism can adaptively handle spelling variations, non-standard abbreviations, and colloquial descriptions, maintaining stable performance across different data quality levels and possessing strong practicality.
[0098] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0099] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for medical entity recognition and knowledge base alignment in rare disease scenarios, characterized in that, Includes the following steps: The process involves acquiring the medical text to be processed, performing semantic parsing on the medical text to identify drug entities and disease entities, and obtaining a candidate entity name list based on the identified entities; wherein, the candidate entity name list includes the original identified name, the normalized name, and the alias set; The candidate entity name list is input into a pre-constructed medical standard terminology knowledge graph, and a four-level cascaded matching strategy is used for structured verification, including: for the current candidate entity, matching is performed sequentially starting from the first-level strategy. If the current-level strategy successfully matches the entity name in the knowledge base, the matching result is output and subsequent matching is terminated; otherwise, the next-level strategy is entered. The matching result includes the entity name in the knowledge base and its standard code, the matching confidence, and the matching path information.
2. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 1, characterized in that, The structured suggestion engineering method invokes a large language model to perform semantic parsing on the medical text, identifying drug entities and disease entities. Based on the identified entities, it then performs normalization processing and generates an alias set to obtain a list of candidate entity names. The structured suggestion engineering method sequentially includes a context constraint module, an example guidance module, and an output constraint module. The context constraint module defines the role of the large language model, extraction rules, normalization rules, and alias generation rules. The example guidance module provides a small number of sample examples to distinguish between disease diagnosis and symptom description, a list of common dosage form suffixes, and rare disease alias templates. The output constraint module specifies the output format, including the original identified name, normalized name, and alias set for each drug entity and disease entity.
3. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 2, characterized in that, The standardization rules include removing dosage form suffixes and spelling correction; Specifically, it includes: The dosage form suffixes are removed from the list of common dosage form suffixes to obtain the entity name after suffix removal; the name after this step is used as the entity name after suffix removal, regardless of whether the suffix was actually removed. Obtain the standard name with the smallest edit distance in the medical standard terminology knowledge graph after removing the suffix. If the edit distance is less than or equal to its relative edit distance threshold, correction is allowed and the standard name is used as the correction result. At the same time, if the edit distance is greater than the set fixed edit distance threshold, correction is abandoned and the entity name after removing the suffix remains unchanged.
4. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 1, characterized in that, The medical standard terminology knowledge graph is an index database built on Elasticsearch. The index includes standard name fields, synonym fields, entity standard encoding fields, rare disease marker fields and prevalence fields, and semantic vector fields. The four-level cascaded matching strategy includes, in descending order of priority, a first-level exact matching strategy, a second-level synonym matching strategy, a third-level strict fuzzy matching strategy, and a fourth-level original text backtracking matching strategy.
5. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 4, characterized in that, The first-level precise matching strategy includes: performing standardized preprocessing on the normalized names and original identified names in the candidate entity name list, and then performing term query and match_phrase query on the standard name field of the medical standard terminology knowledge graph; if a match is found, the matching result is output; wherein, the matching confidence is set to 1.0 and the matching path marker is set to precise matching.
6. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 5, characterized in that, The second-level synonym matching strategy includes: based on the candidate entity name list, performing term and match queries on the synonym field in the medical standard terminology knowledge graph; if a match is found, the matching result is output, wherein the matching confidence is set to 0.90 or 0.95, and the matching path is set to synonym matching.
7. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 6, characterized in that, The third-level strict fuzzy matching strategy includes: Each name in the normalized name and alias set of the candidate entity name list is used as a candidate entity name, and the candidate target name set of each candidate entity name in the medical standard terminology knowledge graph is obtained. Based on each candidate entity name and each candidate target name in its set of candidate target names, a multi-factor comprehensive similarity score is obtained between each candidate entity name and each candidate target name. The maximum value of the multi-factor comprehensive similarity score between all candidate entity names and all candidate target names is selected. If the maximum value is greater than or equal to the preset similarity threshold, it is determined to be a hit. The candidate target name corresponding to the maximum value is taken as the hit entity name, and the matching result is output. The matching confidence is set according to the linear mapping of the score, and the matching path is set to strict fuzzy matching.
8. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 7, characterized in that, The multi-factor comprehensive similarity score Represented as: ; In the formula, , , , These represent the string similarity, semantic similarity, length penalty factor, and rare disease weighting factor between the current candidate entity name and its corresponding current candidate target name, respectively. , , , These represent the weight coefficients for string similarity, semantic similarity, length penalty factor, and rare disease weighting factor, respectively.
9. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 8, characterized in that, The rare disease weighting factor Determined in the following ways: If the candidate target name has both a rare disease marker and an Orphanet ID, then ; If the candidate target name has a rare disease marker but does not have an Orphanet ID, then ; If the candidate target name does not have a rare disease marker and does not have an Orphanet ID, then ; Specifically, the system determines whether candidate target names have a rare disease marker and an Orphanet ID based on the rare disease marker and prevalence fields in the medical standard terminology knowledge graph.
10. The method for medical entity recognition and knowledge base alignment for rare disease scenarios according to claim 8, characterized in that, The fourth-level original text rollback strategy includes: The original entity strings are extracted from the medical text to be processed. After format cleaning, exact matching, phrase matching and loose fuzzy matching are performed in sequence to obtain the names of the matched entities. The matching entity name is verified, including length ratio verification and character overlap rate verification. Based on the verified matching entity names, the matching results are output. The matching confidence is set based on the search score normalization and dynamic correction. The matching path is set to original text back-matching and a manual review mark is attached.
