Medical record information extraction method based on semantic anchor point and structural time sequence analysis
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DALIAN MEDICAL UNIVERSITY
- Filing Date
- 2026-06-08
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]现有技术中,病历信息提取方法大多采用关键词匹配、规则抽取或简单语义分析方式实现医学实体识别与关系提取,但由于病历文本存在大量医学缩写、上下文关联、时间顺序交叉及语义歧义等情况,容易出现实体边界识别不准确、路径关系混乱以及时间语义冲突等问题
Smart Images

Figure CN122531604A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to a method for extracting medical record information based on semantic anchors and structural temporal analysis. Background Technology
[0002] With the continuous advancement of medical informatization, a large amount of medical record data is stored and circulated in electronic text format. Medical record texts typically contain various medical semantic content, including patient symptom descriptions, treatment processes, examination results, medication records, and time information. They are characterized by large data volumes, complex expression formats, and strong semantic relationships. How to accurately extract key medical information from unstructured medical record texts and form structured semantic data has become an important research direction in the field of medical information processing.
[0003] In existing technologies, most medical record information extraction methods employ keyword matching, rule extraction, or simple semantic analysis to achieve medical entity recognition and relationship extraction. However, due to the presence of numerous medical abbreviations, contextual relationships, overlapping time sequences, and semantic ambiguities in medical record texts, problems such as inaccurate entity boundary recognition, confused path relationships, and temporal semantic conflicts easily arise. Furthermore, existing methods lack a unified verification mechanism for the association between temporal and entity relationships in medical records, making it difficult to achieve a structured expression of complex medical record semantics. This results in low consistency and accuracy of the final generated data, impacting subsequent medical analysis and assisted diagnostic applications. Summary of the Invention
[0004] This application provides a method for extracting medical record information based on semantic anchors and structural temporal parsing. It adopts a combination of semantic anchor positioning, clinical semantic pattern matching, knowledge graph path encoding, and temporal constraint reasoning to achieve structured extraction and consistency verification of medical entities, entity relationships, and temporal semantic information in medical record texts. This improves the accuracy of semantic parsing of complex medical records, the consistency of temporal associations, and the efficiency of structured information extraction.
[0005] This application provides a method for extracting medical record information based on semantic anchors and structural temporal analysis, including: constructing a semantic anchor table; performing initial medical entity matching on the medical record text to generate a candidate entity set; performing semantic clustering on the candidate entities based on a word vector clustering model to obtain clustered semantic clusters; and performing consistency determination on the semantic clusters using a boundary voting mechanism to generate a stable semantic anchor set; constructing a clinical semantic pattern library, which includes historical medical record semantic structure templates; extracting text semantic features using a BERT model; generating a semantic weight distribution based on a multi-head attention mechanism; mapping the semantic weights to a semantic slot structure to generate pattern matching result data; and constructing a medical knowledge graph path structure, calculating the edit distance of candidate semantic paths, and combining a graph search algorithm to process the path set. The system performs scoring and ranking, selects the optimal semantic path as the entity relation expression path, and generates path encoding results. It parses the hierarchical structure of the medical record text titles, generates a document structure tree, extracts time expression information, and performs standardization processing to construct time semantic sequence data. Based on deductive rules, it performs constraint reasoning on the time semantic sequence data, and combines the path encoding results to perform consistency verification of semantic information at different time nodes, generating a structured semantic representation with time order constraints. It summarizes the stable semantic anchor set, pattern matching results, path encoding results, and time-constrained semantic representation, performs consistency verification and conflict correction on information from different sources according to preset rules, and classifies the processed results into entity information, relation information, and time information, outputting structured medical record data. Attached Figure Description
[0006] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments of the present invention will be briefly described below. Flowcharts are used in this application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from these processes.
[0007] Figure 1 This is a flowchart illustrating the medical record information extraction method based on semantic anchors and structural temporal analysis provided in this application embodiment. Detailed Implementation
[0008] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below.
[0009] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application will be provided in conjunction with the accompanying drawings. The described embodiments should not be considered as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0010] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" can be the same or different subsets of all possible embodiments and can be combined with each other without conflict. The terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only.
[0011] This application provides a method for extracting medical record information based on semantic anchors and structural temporal parsing, such as... Figure 1 As shown, the method includes: S1: Construct a semantic anchor table, perform initial medical entity matching on the medical record text to generate a candidate entity set, perform semantic clustering on the candidate entities based on the word vector clustering model to obtain clustered semantic clusters, and combine the boundary voting mechanism to determine the consistency of the semantic clusters to generate a stable semantic anchor set.
[0012] Furthermore, step S1 of this application also includes: S11. Perform medical entity scanning on the input medical record text, and perform initial identification of entities in the text based on preset medical vocabulary rules to generate a candidate entity set; S12. Construct a semantic anchor table, which stores medical entities and their corresponding semantic label information, and maps the candidate entities to the corresponding semantic categories in the semantic anchor table; S13. Perform semantic vector representation on the candidate entity set, and perform clustering processing on the candidate entities based on semantic similarity calculation to form multiple clustered semantic clusters; S14. Perform boundary judgment processing on the clustered semantic clusters, and correct the boundaries of the semantic clusters through a multi-rule boundary judgment mechanism to obtain an optimized semantic cluster structure; S15. Perform consistency voting calculation on the optimized semantic clusters, and select effective semantic clusters based on the comprehensive consistency score of multiple judgment results, and generate a stable semantic anchor set.
[0013] Specifically, the process involves acquiring electronic medical record text data and performing word segmentation, text standardization, and special symbol cleaning on the text. Subsequently, medical terms in the medical record text are scanned and identified based on pre-defined medical vocabulary rules. These rules include rules for disease names, symptom descriptions, drug names, examination items, body parts, and numerical indicators. Potential medical entities in the medical record text are initially identified through word matching, contextual location recognition, and part-of-speech constraints, generating a candidate entity set. A semantic anchor table is pre-constructed, including information such as medical entity identifiers, entity names, entity types, semantic tags, and associated semantic categories. Entity types may include disease entities, drug entities, examination entities, time entities, and treatment entities. The entity content in the candidate entity set is matched and mapped to the semantic anchor table, assigning each candidate entity a corresponding semantic category label for subsequent semantic clustering and relationship analysis. Finally, semantic vector transformation is performed on the candidate entities, mapping different medical entities to corresponding vector feature representations. Subsequently, clustering analysis is performed based on the semantic similarity between entities, aggregating entities with similar medical semantic features to form semantic clusters. For example, entities with similar clinical semantics, such as "chest tightness," "chest pain," and "difficulty breathing," are grouped into the same semantic cluster, thereby improving the stability of subsequent semantic association analysis. Entity boundaries within the clustered semantic clusters are detected and analyzed. Since medical record texts may contain overlapping, truncated, or expanded entities, the system employs a multi-rule boundary judgment mechanism to correct the semantic cluster boundaries. This boundary judgment mechanism includes word length constraint rules, part-of-speech continuity rules, context association rules, and medical terminology integrity rules. Boundary correction reduces the bias in medical entity boundary recognition and improves the integrity and accuracy of the semantic cluster structure. Consistency voting analysis is performed on the optimized semantic clusters, and the same semantic cluster is comprehensively scored based on multiple semantic judgment results. These judgment results may include semantic category matching results, context association results, boundary integrity results, and entity stability results. Based on the comprehensive consistency score, effective semantic clusters that meet the preset threshold requirements are selected and identified as a stable set of semantic anchors for subsequent clinical semantic pattern matching, knowledge graph path construction, and time-series semantic analysis.
[0014] S2: Construct a clinical semantic pattern library, which includes historical medical record semantic structure templates. Use the BERT model to extract text semantic features, generate semantic weight distribution based on multi-head attention mechanism, map semantic weights to semantic slot structure, and generate pattern matching result data.
[0015] Specifically, based on historical electronic medical record data, statistical analysis and structural summarization are performed to extract representative semantic structure patterns and form a clinical semantic pattern library. The semantic structure templates include at least the chief complaint template, present illness history template, past medical history template, examination result template, and diagnostic conclusion template, used to describe the standardized expression of different semantic paragraphs in the medical record text. Semantic encoding processing is performed on the medical record text, transforming the words, phrases, and contextual information in the text into semantic representations to generate corresponding semantic feature representations, reflecting the overall semantic information and local semantic relationships of the medical record text. A multi-head attention mechanism is used to perform association analysis on the semantic features of the medical record text, calculating the association strength between different semantic units and generating corresponding semantic weight distribution results, used to represent the importance and influence weight of different semantic information in the current medical record text. The semantic weight distribution results are matched and mapped with the semantic slot structure in the clinical semantic pattern library, assigning different semantic units to corresponding semantic slots. These semantic slots represent fixed semantic roles in the medical record text, such as symptom slots, time slots, examination slots, and diagnosis slots, thereby achieving a standardized expression of the medical record's semantic structure. Pattern matching result data is generated based on the filling status of the semantic slot structure. This data characterizes the degree of matching and structural consistency between the current medical record text and the clinical semantic pattern library, providing structured input data support for subsequent knowledge graph path construction and semantic fusion analysis.
[0016] S3. Construct a path structure for a medical knowledge graph, calculate the edit distance of candidate semantic paths, score and sort the path set using a graph search algorithm, select the optimal semantic path as the entity relation expression path, and generate path encoding results.
[0017] Furthermore, step S3 of this application also includes: S31. Construct a medical knowledge graph path structure based on medical entities and their relationship information, wherein the path structure is used to represent multi-hop associations between entities; S32. Generate multiple candidate semantic paths in the medical knowledge graph based on the set of semantic anchors and pattern matching results, wherein the candidate semantic paths are used to represent combinations of association paths between different entities; S33. Calculate the edit distance of the candidate semantic paths, and calculate the path similarity value between the candidate semantic paths based on the edit distance results, wherein the formula for calculating the path similarity value is: ;in, Candidate semantic paths With candidate semantic paths Path similarity values between Candidate semantic paths With candidate semantic paths Edit distance between Candidate semantic paths The number of path nodes included. Candidate semantic paths The number of path nodes included. Candidate semantic paths With candidate semantic paths S34. Given a large number of path nodes, determine the degree of structural difference between candidate semantic paths based on the calculated path similarity value; S35. Perform traversal analysis on candidate semantic paths based on graph search algorithm, and give a comprehensive score to each candidate path in combination with the path similarity value. Sort the candidate semantic paths according to the score results to obtain a path priority sequence; S36. Select the semantic path with the highest score from the path priority sequence as the optimal semantic path, generate entity relation expression path based on the optimal semantic path, and output the path encoding result.
[0018] Furthermore, step S32 of this application also includes: S32-1. Determine the starting entity node set for path generation based on the semantic anchor point set, and determine the target entity node set based on the pattern matching results; S32-2. Perform semantic constraint screening on the relationship between the starting entity nodes and the target entity nodes, and filter out node pairs that do not meet the conditions based on preset entity type rules and relationship constraint rules to obtain a set of valid node pairs; S32-3. Based on the medical knowledge graph structure, expand the adjacency relationship of the valid node pairs, and generate an initial path set according to the entity connection relationship in the graph; S32-4. Perform multi-hop path splicing on the initial path set to generate a set of candidate semantic paths containing different numbers of hops; S32-5. Perform structural validity verification on the candidate semantic paths, including path connectivity verification and loop path detection, and eliminate invalid and duplicate paths; S32-6. Perform preliminary sorting and screening of the candidate semantic paths based on path length constraints and node matching strength, and retain the set of candidate paths with higher priority.
[0019] Furthermore, step S34 of this application also includes: S34-1. Initialize the candidate semantic path set by traversing the medical knowledge graph to determine the starting point and depth constraints of the path search; S34-2. Limit the graph search process based on preset constraints, including at least path length constraints, node type constraints, and relation type constraints, to avoid invalid path expansion; S34-3. Extract structural features from the traversed candidate semantic paths, including at least node sequence features, path length features, and relation connection features; S34-4. Combine the path similarity values output in S33 to perform consistency matching on the path structural features to obtain the path similarity fusion result; S34-5. Construct a multi-factor scoring mechanism based on the path similarity fusion result to calculate the score of the candidate semantic paths, including at least a path similarity factor, a path length penalty factor, and a structural consistency factor; S34-6. Normalize the scoring results of the candidate semantic paths, and sort the candidate semantic paths according to the normalized scoring results to generate a path priority sequence.
[0020] Furthermore, step S35 of this application also includes: S35-1. Obtain the path priority sequence output by S34 and perform structured parsing on the candidate semantic paths and their scoring results in the sequence; S35-2. Perform preliminary screening of the candidate semantic paths in the path priority sequence based on a preset scoring threshold to obtain a set of candidate paths that meet the minimum scoring condition; S35-3. Compare and analyze the candidate path set after preliminary screening. When there are multiple high-scoring paths that meet the conditions, perform the final selection based on the path length priority rule to determine the unique optimal semantic path; S35-4. Perform structural normalization processing on the optimal semantic path, unify the path node sequence into a standard entity relationship expression format, and compress and optimize redundant nodes in the path; S35-5. Generate an entity relationship mapping structure based on the normalized optimal semantic path to determine the association type and connection direction between entities; S35-6. Based on the preset path encoding rules, convert the entity relationship mapping structure into a standard path encoding result for subsequent structured storage and retrieval; S35-7. Output the path encoding result and store it in the structured medical record data set for subsequent semantic analysis and information fusion steps.
[0021] Specifically, a medical knowledge graph path structure is constructed, and candidate semantic paths are generated based on the semantic anchor set and pattern matching results. The optimal semantic path is determined and the path encoding is output through path similarity calculation and graph search scoring and ranking, thereby achieving a structured expression of medical entity relationships. The knowledge graph structure is constructed based on the entity nodes and their relational edges stored in the medical knowledge base. Entity nodes represent medical entities such as diseases, symptoms, drugs, examinations, and treatments, while relational edges represent semantic associations between entities, such as "cause," "accompanying," "used for treatment," and "indicated by examination results." A multi-hop path structure is formed through graph structure modeling to express indirect associations between different medical entities. Using the semantic anchor set generated in S1 and the pattern matching results generated in S2 as input, the starting entity node and target entity node are determined in the medical knowledge graph, and multiple candidate paths are generated based on the connection relationships between nodes. The candidate semantic path is a combination of paths formed by sequentially connecting multiple entity nodes and relational edges, used to describe possible semantic association links between different entities. Structural difference analysis is performed on any two candidate semantic paths. The degree of path structural change is characterized by calculating the edit distance between the path node sequences, and the path similarity value is further calculated using the following formula: ;in, Candidate semantic paths With candidate semantic paths Path similarity values between Candidate semantic paths With candidate semantic paths Edit distance between Candidate semantic paths The number of path nodes included. Candidate semantic paths The number of path nodes included. Candidate semantic paths With candidate semantic paths A relatively large number of path nodes are used, based on the calculated path similarity value, to characterize the degree of structural difference between different candidate semantic paths. The higher the path similarity value, the more similar the structures of the two paths are. A graph search algorithm is used to traverse and analyze the candidate semantic paths, and a comprehensive score is given to each candidate path based on the path similarity value. The candidate semantic paths are then sorted according to the score results to obtain a path priority sequence. Specifically, a global traversal analysis of the candidate semantic paths is performed based on the graph search algorithm, and the consistency of the path structure is evaluated based on the path similarity value. A multi-factor comprehensive scoring mechanism is constructed to calculate the score of each candidate semantic path, and the paths are sorted in descending order according to the score results to generate a path priority sequence for subsequent optimal path selection. The semantic path with the highest score in the path priority sequence is selected as the optimal semantic path. An entity relation expression path is generated based on the optimal semantic path, and the path encoding result is output. Specifically, the system determines the candidate semantic path with the highest score from the path priority sequence as the optimal semantic path, generates an entity relation expression structure based on the optimal semantic path, and performs structured encoding processing on the entity nodes and relation edges in the path to form a standardized path encoding result for subsequent use by the semantic fusion and temporal reasoning modules.
[0022] Furthermore, entity nodes with clear semantic categories are extracted from the semantic anchor point set generated in S1 as the starting entity node set. Simultaneously, the corresponding target entity node set is determined by combining the pattern matching results generated in S2. This set is used to construct the start and end point constraints for path search, thereby limiting the semantic scope of path generation. The combination relationships between the starting and target nodes are filtered according to preset entity type rules and relationship constraint rules. The entity type rules constrain entity category matching relationships, and the relationship constraint rules constrain the allowed semantic relationship types between entities, thus filtering out node pairs that do not conform to medical semantic logic, resulting in a set of valid node pairs. Path expansion is performed on the valid node pairs based on the adjacency relationships in the medical knowledge graph. By traversing the direct connections between nodes, an initial path set composed of multiple entity nodes and relation edges is gradually generated to describe the basic semantic connection links between nodes. Multi-hop expansion processing is performed on the paths in the initial path set, generating a candidate semantic path set containing 2-hop, 3-hop, and multi-hop structures through path concatenation. This set is used to express the indirect semantic association relationships between entities at different levels. The generated candidate semantic paths undergo structural validity testing, including representing them as node sequences and verifying connectivity between adjacent nodes based on a medical knowledge graph. Simultaneously, the path node sequences are traversed to detect duplicate nodes or cyclic access structures. Candidate semantic paths that do not satisfy continuous node connectivity or contain duplicate or cyclic structures are deemed invalid and removed, ensuring the structural validity and uniqueness of the candidate semantic paths. Paths that are too long or too short are filtered according to preset path length constraints, and preliminary scoring and ranking of candidate paths are performed based on node matching strength. Node matching strength characterizes the degree of matching between entity nodes and semantic anchors and pattern matching results within the path, thus retaining a set of candidate semantic paths that meet the conditions and have higher priority, providing optimized input data for subsequent path similarity calculation and comprehensive scoring.
[0023] Furthermore, pairwise matching is performed on the combination relationships between the starting set of entity nodes and the target set of entity nodes to generate a candidate node pair set. Subsequently, the candidate node pairs are filtered based on preset entity type rules and relationship constraint rules. The entity type rules limit the semantic type matching relationship between the starting node and the target node; for example, a symptom entity can be associated with a disease entity, and a drug entity can be associated with a treatment entity. The relationship constraint rules limit the allowed semantic relationship types between nodes; for example, "causing relationship," "treatment relationship," and "accompanying relationship." Through this constraint filtering, node combinations that do not conform to medical semantic logic are eliminated, resulting in a valid node pair set. Based on the medical knowledge graph structure, the adjacency relationships of the starting node in the valid node pairs are expanded. The adjacency relationship expansion process includes: traversing layer by layer along the entity relationship edges in the knowledge graph, centered on the starting node, to obtain directly connected adjacent nodes, and incorporating the relationship edges between nodes into the path structure, thus forming a basic path segment composed of "node-relationship-node." By combining and expanding the path segments, an initial path set is generated to express the basic semantic connection relationship between the starting node and the target node. Based on the initial path set, multi-hop expansion is performed according to path connection rules. Multi-hop path concatenation refers to sequentially concatenating multiple path segments according to node sharing relationships, ensuring that the terminating node of the previous segment matches the starting node of the next segment, thus forming a continuous path structure. By controlling the range of path hop counts, paths of different lengths are combined to generate a candidate semantic path set containing 2-hop, 3-hop, and multi-hop path structures, used to characterize the indirect semantic relationships between medical entities at different levels. The candidate semantic path set undergoes structural validity checks to ensure the reachability and structural rationality of the paths within the knowledge graph. The structural validity verification includes at least the following: path connectivity verification: determining whether there are corresponding relational edges connecting any adjacent nodes in the candidate semantic path within the medical knowledge graph. If no connection exists, the path is determined to be a disconnected path; cyclic path detection: performing access marking processing on the path node sequence. If nodes in the path are repeatedly accessed and form a closed loop structure, it is determined to be a cyclic path. For candidate semantic paths that do not meet the connectivity condition or have cyclic structures, the system removes them and deduplicates duplicate path structures, thereby obtaining a set of structurally valid candidate semantic paths. The set of structurally valid candidate semantic paths is then preliminarily sorted and filtered. Path length constraints are used to limit the reasonable range of the number of path nodes, avoiding the generation of excessively short or long path structures; node matching strength is used to characterize the semantic consistency between entity nodes in the path and the set of semantic anchor points and pattern matching results.Candidate semantic paths are comprehensively scored based on path length and node matching strength, and sorted according to the scoring results. The set of candidate semantic paths with higher priority is retained as the input data basis for subsequent path similarity calculation, graph search scoring and optimal path selection.
[0024] Furthermore, a graph search-based traversal analysis is performed on the candidate semantic path set, and a multi-factor scoring mechanism is constructed by combining path structure features and path similarity information to achieve comprehensive evaluation and ranking of candidate semantic paths, thereby generating a path priority sequence and providing a basis for optimal semantic path selection. Based on a medical knowledge graph, the candidate semantic path set generated by S32 is traversed and initialized to determine the starting node set for path search, and a search depth constraint range is set based on preset rules. The starting node is determined by the set of semantic anchor points and pattern matching results, used to limit the initial range of path search; the search depth constraint limits the maximum expansion level of the path in the graph structure to avoid computational redundancy and semantic deviation caused by excessive path expansion. During the graph search process, preset constraints are introduced to limit path expansion behavior, thereby improving the semantic effectiveness of path generation. The constraints include at least the following: path length constraint: used to limit the range of the number of nodes in the candidate semantic path, avoiding the generation of excessively short or long path structures; node type constraint: used to limit the types of medical entities allowed in the path, such as disease entities, symptom entities, drug entities, and examination entities; relation type constraint: used to limit the types of semantic relations allowed in the path, such as "causing relation," "treatment relation," and "accompanying relation." Through the above constraint mechanism, meaningless path extensions can be effectively filtered out, improving the quality of candidate paths. Structural features are extracted from the candidate semantic paths obtained during the graph search process to characterize the path's structural attributes. The structural features include at least: node sequence features, used to characterize the arrangement order of entity nodes in the path; path length features, used to characterize the number of nodes and hop count information contained in the path; and relation connection features, used to characterize the semantic relation types and connection methods between nodes in the path. Structural feature extraction provides a quantitative basis for subsequent path scoring calculation. The structural features of the candidate semantic paths are fused and matched in conjunction with the path similarity value output by S33. The path similarity value characterizes the degree of structural difference between different candidate semantic paths. The system fuses this similarity information with structural features to generate a path similarity fusion result, which comprehensively reflects the structural consistency and semantic similarity between paths. A multi-factor scoring mechanism is constructed based on the path similarity fusion result to calculate a comprehensive score for candidate semantic paths, thereby quantitatively evaluating the semantic rationality and structural effectiveness of the candidate semantic paths. The formula for calculating the comprehensive score is as follows: ;in, Candidate semantic paths The overall score, For the first Candidate semantic paths, The path similarity factor is used to characterize the degree of matching between the current candidate semantic path and the target semantic path, and its value is calculated in step S33. The structural consistency factor is used to characterize the degree of matching between the node types, relation types, and path structure in the candidate semantic path and the preset semantic constraints. This is a path length penalty factor, used to characterize the impact of the candidate semantic path length. The path length penalty factor can be characterized by the number of nodes in the candidate semantic path or the number of path hops. 、 and The weights are for the path similarity factor, the structural consistency factor, and the path length penalty factor. These weights are all determined based on statistical analysis of historical medical semantic path samples. Specifically, the system constructs a set of historical candidate semantic path samples, each corresponding to a path quality evaluation result. This evaluation result is determined by manual annotation or previous clinical validation results and is used to characterize the semantic correctness and structural rationality of the path. During the weight determination process, the influence of each evaluation factor on the path quality results is analyzed: for the path similarity factor, its contribution to the path selection result is determined by statistically analyzing its frequency and trend in high-quality path samples; for the structural consistency factor, its influence on path quality is determined by analyzing the correspondence between the consistency between the path structure and medical semantic constraints and path quality; for the path length penalty factor, its inhibitory effect on path quality is determined by analyzing the correlation between changes in path length and a decline in path quality. Based on the above statistical analysis results, the influence of each evaluation factor is normalized to determine the weights of the path similarity factor, structural consistency factor, and path length penalty factor. This ensures that the contribution ratios of these three factors in the overall scoring system meet a unified constraint. The scoring results of candidate semantic paths are then normalized to eliminate the influence of differences in the dimensions of different scoring factors, ensuring that the scoring results are within a uniform numerical range. Subsequently, the candidate semantic paths are ranked based on the normalized scoring results, generating a path priority sequence from high to low scores. This determines the priority relationship between different candidate semantic paths and provides an input basis for the subsequent optimal semantic path selection step.
[0025] Furthermore, the optimal semantic path is selected and determined based on the path priority sequence, and the optimal semantic path is subjected to structural normalization and encoding transformation to generate standardized path encoding results, providing unified data output for subsequent structured medical record construction and semantic fusion analysis. The path priority sequence output in S34 is obtained, and the candidate semantic paths and their corresponding scoring results in the sequence are structurally parsed. The structural parsing process includes splitting and standardizing the storage of path identifier information, path node sequence information, and path score values, so that each candidate semantic path is expressed in the form of a "path structure data unit," thus providing a unified data format for subsequent screening and comparative analysis. The candidate semantic paths in the path priority sequence are screened based on a preset scoring threshold, where the preset scoring threshold is used to limit the minimum effective scoring standard for candidate paths. Only candidate semantic paths with scores greater than or equal to the threshold are retained, forming a preliminary candidate path set, thereby eliminating low-quality or low-relevance path structures. When there are multiple candidate semantic paths in the preliminary candidate path set that meet the scoring threshold condition, the optimal semantic path is determined based on the comprehensive score value calculated in step S34. The method for determining the optimal semantic path is as follows: ,in, For the optimal semantic path, The first in the candidate semantic path set Path, This is the set of candidate semantic paths after initial screening. The comprehensive score of the candidate semantic path calculated in step S34. This indicates that the candidate semantic path with the highest comprehensive score is selected. When multiple candidate semantic paths have the same score or their scores differ within a preset tolerance range, a secondary judgment is made based on the path length priority rule. The candidate semantic path with fewer nodes and a more compact structure is prioritized to determine the unique optimal semantic path. The determined optimal semantic path undergoes structural normalization, converting the node sequence in the path into a standardized entity relation expression format. This standard entity relation expression format is used to uniformly describe the semantic relationship structure between medical entities. Redundant nodes in the path are compressed and optimized, such as deleting duplicate nodes, merging equivalent nodes, or simplifying invalid intermediate nodes, thereby improving the compactness and clarity of the path structure. An entity relation mapping structure is generated based on the normalized optimal semantic path. This entity relation mapping structure clearly represents the relationship type and connection direction between medical entities in the path, such as "symptom → disease," "drug → treatment goal," and "examination → diagnosis result," thus converting the path structure from a node sequence form to a semantic relation graph structure. The entity relation mapping structure is then encoded and converted based on preset path encoding rules. The path encoding rules are used to map entity node identifiers, relationship types, and connection directions into a unified format of encoded expressions, thereby generating standard path encoding results. This gives the path information structured characteristics that allow for storage, retrieval, and retrieval. The generated path encoding results are output and stored in a structured medical record dataset. This structured medical record dataset is used to uniformly store structured medical record information after semantic parsing, path construction, and time-series reasoning processing. The structured medical record information includes medical entity anchor data, entity relationship path encoding data, and time sequence constraint data. The medical entity anchor data represents stable medical entities in the medical record text, the entity relationship path encoding data represents the semantic association path structure between entities, and the time sequence constraint data represents the temporal sequence relationship between different medical events. This facilitates subsequent semantic analysis, knowledge fusion, assisted diagnostic reasoning, and data retrieval processing, thereby forming a complete semantic structured processing chain for medical records.
[0026] S4: Parse the hierarchical structure of medical record text titles, generate a document structure tree, extract time expression information and perform standardization processing to construct time semantic sequence data.
[0027] Specifically, the system performs structured parsing and standardization of the title hierarchy and time information of medical record texts. By constructing a document structure tree and a temporal semantic sequence, it achieves an ordered expression of medical record texts in the time dimension, providing basic data support for subsequent temporal reasoning and consistency verification. The input medical record text undergoes structural parsing to identify title hierarchy information, including structural units such as first-level titles, second-level titles, and multi-level subheadings. The title hierarchy reflects the organizational structure of the medical record text, such as different levels of medical content modules like "chief complaint," "present illness," "past medical history," "auxiliary examinations," and "diagnosis results." The system divides the medical record text into different semantic paragraphs by recognizing title identifiers, line breaks, and formatting features, and establishes corresponding hierarchical relationships. Based on the parsed title hierarchy, a document structure tree for the medical record text is constructed. This document structure tree represents different semantic paragraphs in the form of nodes, with each node corresponding to a medical record text module. The parent-child relationship between nodes represents the hierarchical relationship between title levels, thus forming a tree-like data organization form to achieve structured expression of the medical record text. The process involves identifying and extracting time information from medical record texts to obtain time expression information, including specific dates, relative time expressions, time period descriptions, and event sequence descriptions, such as "May 2024," "3 days before admission," and "2 days post-surgery." A combination of rule matching and contextual semantic recognition is used to extract time-related content from the text, forming a raw time expression set. The extracted time expression information is then standardized, converting different forms of time expressions into a unified standard time format. Standardization includes absolute time conversion and relative time normalization; for example, "2 days post-surgery" is converted into a relative time node representation based on the surgery time, and unstructured time descriptions are uniformly mapped to standard timestamps or time interval representations, thus eliminating inconsistencies in time expression. Based on the document structure tree and the standardized time expression information, time semantic sequence data is constructed. This data represents the chronological order and dependencies of different medical events in the medical record text, and the semantic events are sorted and organized chronologically to form a structured sequence representation with time constraints. Through the above processing, the medical record text achieves a unified expression in both structural and temporal dimensions, providing basic input data for subsequent temporal reasoning and path consistency verification based on deductive rules.
[0028] S5: Based on the deductive rules, perform constraint reasoning on the time semantic sequence data, and combine the path encoding results to perform consistency verification on the semantic information of different time nodes, generating a structured semantic representation with time order constraints.
[0029] Furthermore, step S5 of this application also includes: S51. Obtain the time semantic sequence data output by S4, and standardize the time expression to a preset time format, forming a standard time semantic sequence; S52. Construct a preset deduction rule base, perform rule matching on the standard time semantic sequence, and filter out the time constraint rule set corresponding to the current medical record semantics; S53. Perform sequential reasoning processing on the time semantic sequence based on the time constraint rule set to determine the chronological relationship and constraint relationship between different time nodes; S54. Associate and match the path encoding result generated by S3 with the time sequence constraint result, perform consistency verification on the entity relationship path under different time nodes, and identify time conflicts or path conflicts; S55. Correct the detected time conflicts or semantic inconsistencies, adjust according to the time priority rule or path consistency rule, and generate a consistent optimized semantic result; S56. Based on the processed time sequence constraint result and consistency verification result, generate a structured semantic representation with time sequence constraints, and output it for use in subsequent fusion steps.
[0030] Furthermore, step S54 of this application also includes: S54-1. Obtain the path encoding result and time sequence constraint result output by S3, and perform structured parsing on the two types of data, uniformly converting them into a node-relationship-time ternary representation structure; S54-2. Based on entity identification information, align and match the entity nodes in the path encoding result with the time nodes in the time sequence constraint to establish an entity-time correspondence; S54-3. Based on the alignment result, construct entity relationship path mapping relationships under different time nodes to form a path distribution structure in the time dimension; S54-4. Extract time-path coupling features from the association relationship between time nodes and entity relationship paths. The coupling features include at least time sequence matching features, path causal consistency features, and event evolution continuity features; S54-5. Based on the consistency features, determine the consistency of entity relationship paths under different time nodes and calculate the consistency score between time nodes and entity relationship paths. The formula for calculating the consistency score is: Time ;in, Time Time node Entity Relationship Path Consistency score between them For the first Each time point For the entity relationship path corresponding to the time node, For the first Consistency feature value For the first The weight coefficients corresponding to the consistency features of items This represents the total number of consistency features participating in the consistency computation. This is the weighted sum of each consistency feature value and its corresponding weight coefficient. The sum of the weight coefficients corresponding to all consistency features; the degree of matching consistency between entity relationship paths at different time points is determined based on the calculated consistency score.
[0031] Furthermore, step S55 of this application also includes: S55-1. Obtain time conflict and semantic inconsistency result data, and perform structured parsing on the result data to extract the time nodes, entity nodes, and entity relationship path information corresponding to the conflicts; S55-2. Classify the identified conflicts, including at least time conflicts, path conflicts, and semantic conflicts, and mark the conflict type identifiers respectively; S55-3. Call the preset conflict correction rule library, and match the corresponding conflict correction rules based on the conflict type. The conflict correction rules include at least time priority rules, path consistency rules, and semantic preservation rules; S55-4. Determine the conflict processing priority according to the conflict type and scope of impact. When there are multiple conflicts, sort them according to the rule that time priority is higher than path consistency priority; S55-5. Adjust the conflict data based on the matched conflict correction rules, including time node adjustment, path replacement, or semantic remapping operations, and generate correction candidate results; S55-6. Perform consistency evaluation processing on the correction candidate results. When the consistency evaluation result meets the preset threshold requirements, determine the corrected candidate result as the final consistency optimized semantic result, and store the final consistency optimized semantic result as the output result of the current step.
[0032] Specifically, the system performs constraint reasoning on temporal semantic sequence data based on deductive rules, and combines path encoding results to perform consistency verification and correction processing on entity semantic information at different time nodes, thereby generating a structured semantic representation with temporal order constraints. This provides a reliable data foundation for subsequent multi-source semantic fusion and structured analysis of medical records. The system acquires the temporal semantic sequence data output by S4 and performs unified standardization processing on its time expressions. Standardization processing includes converting different forms of time expressions into preset time formats or time interval representations. For example, relative time expressions, natural language time descriptions, and unstructured time information are converted into standard timestamp representations, thereby forming a standard temporal semantic sequence and ensuring that time information is processed and compared on a unified scale. A preset deductive rule library is constructed to store time constraint rule sets under different medical scenarios. Time constraint rules include at least diagnosis and treatment process sequence rules, disease progression logic rules, and event dependency relationship rules. The system matches and filters the deductive rule library based on the standard temporal semantic sequence to determine the time constraint rule set corresponding to the current medical record semantic scenario for subsequent reasoning analysis. The system then performs sequential reasoning processing on the temporal semantic sequence based on the time constraint rule set. The sequential reasoning process is used to determine the chronological and dependency relationships between different time points, such as determining the logical order of "admission—examination—diagnosis—treatment," and identifying the preconditions and causal constraints between time points, thereby constructing a temporal semantic sequence structure with constraints. The path encoding results generated by S3 are matched with the temporal order constraint results output by S53. The path encoding results represent the semantic relationship path structure between medical entities, while the temporal order constraint results represent the temporal chronological and constraint relationships between different medical events. Based on the entity-time correspondence, the system performs joint analysis on the association between entity relationship paths and temporal order constraints, verifying whether the semantic logic expressed by the entity relationship paths is consistent with the temporal order constraints. Specifically, the system combines temporal order matching features, path causal consistency features, and event evolution continuity features to perform consistency analysis on entity relationship paths at different time points. When a contradiction is detected between the causal, evolutionary, or associative relationships in the entity relationship path and the temporal order constraints—for example, if the order of causal events represented in the path is inconsistent with the chronological order of time nodes—a temporal or path conflict is determined, and the conflict information is marked and output for subsequent conflict correction processing. Based on the processed temporal order constraint results and consistency verification results, a structured semantic representation with temporal order constraints is generated. This structured semantic representation is used to uniformly describe the evolutionary relationships and semantic associations of different medical entities in the medical record along the temporal dimension, and is output in a structured form for subsequent semantic fusion, path optimization, and structured data storage processing of medical records, thereby forming a complete temporal order constraint semantic expression result.
[0033] Furthermore, the path encoding results are correlated and matched with the time sequence constraint results, and consistency analysis of entity relationship paths at different time points is performed under a unified semantic representation framework. This provides basic data support for subsequent consistency score calculation, conflict identification, and semantic optimization. Specifically, the path encoding results output by S3 and the time sequence constraint results generated by S53 are first obtained, and the two types of data are processed through structured parsing. The path encoding results are used to describe the semantic association paths between medical entities, and the time sequence constraint results are used to describe the temporal sequence and dependency relationships between medical events. To achieve a unified representation of data from different sources, the system standardizes and transforms the entity node information and relationship connection information in the path encoding results with the time node information in the time sequence constraint results, constructing a "node-relationship-time" ternary representation structure. Nodes represent medical entity objects, relationships represent the semantic association relationships between entities, and time represents the occurrence time or time interval corresponding to the entity relationship. By constructing a unified data representation structure, semantic information from different sources can be correlated and analyzed under the same semantic framework. Subsequently, based on entity identification information, the system performs alignment and matching processing on the entity nodes in the path encoding results and the time nodes in the time sequence constraint results. Entity identification information is used to uniquely identify medical entity objects in medical records, such as disease entities, symptom entities, examination entities, or treatment entities. The system establishes a correspondence between entity nodes and time nodes through entity identifier consistency comparison, entity name mapping, and entity attribute matching, thereby determining the semantic expression range of entities at different time nodes and achieving a unified association between path semantic information and time semantic information. After completing entity-time alignment, the system constructs entity relationship path mapping relationships at different time nodes based on the alignment results. Specifically, entity nodes involved at the same time node and their corresponding relationship paths are associated and organized to form a mapping structure between time nodes and entity relationship paths. Through the above processing, the distribution state of entity relationship paths under different time node conditions can be obtained, thus forming a path distribution structure in the time dimension. The path distribution structure can reflect the evolution process of medical entity relationships over time, providing a data foundation for subsequent time-series consistency analysis. Furthermore, the system performs time-path coupling feature extraction processing on the association relationship between time nodes and entity relationship paths to characterize the degree of matching between time constraint results and entity relationship paths. The time-path coupling features include at least time sequence matching features, path causal consistency features, and event evolution continuity features. Among them, the time sequence matching feature is used to characterize the degree of matching between the order of events in the entity relationship path and the temporal sequence in the temporal semantic sequence.For example, when the sequence of diagnosis and treatment processes described in the path matches the actual sequence of events in the time series, the time sequence matching degree is considered high; conversely, when there is a time reversal or logical contradiction, the corresponding matching degree is reduced. The path causal consistency feature is used to characterize the consistency between the causal relationship in the entity relationship path and the time evolution process. For example, when there is a causal relationship in the path such as disease causing symptoms, examination supporting diagnosis, or treatment improving the condition, the system further analyzes whether the occurrence time of the corresponding events satisfies the causal sequence logic to evaluate the matching degree between the path causal relationship and the time sequence. The event evolution continuity feature is used to characterize the degree of development continuity of the same medical event or related events at different time points. The system combines time interval information and changes in entity relationship paths to perform continuity analysis on the development process of events. When the changes in the entity state between adjacent time points conform to the disease progression pattern, the continuity is judged to be high; when there are abnormal jumps, logical breaks, or missing key events, the corresponding continuity evaluation result is reduced. Through the above time-path coupling feature extraction processing, a joint semantic feature set integrating the time dimension and the path dimension is constructed, providing a feature foundation for subsequent consistency score calculation, time conflict identification, and path conflict identification. Based on consistency features, the consistency of entity relationship paths at different time points is determined, and a consistency score between the time point and the entity relationship path is calculated. The formula for calculating the consistency score is: Time ;in, Time Time node Entity Relationship Path Consistency score between them For the first Each time point For the entity relationship path corresponding to the time node, For the first Consistency feature value For the first The weight coefficients corresponding to the consistency features of items This represents the total number of consistency features participating in the consistency computation. This is the weighted sum of each consistency feature value and its corresponding weight coefficient. This is the sum of the weight coefficients corresponding to all consistency features. Based on the calculated consistency score, the degree of matching consistency between entity relationship paths at different time points is determined. When the consistency score is lower than a preset threshold, it is judged as a time conflict or path conflict, providing a basis for subsequent correction processing.
[0034] Furthermore, structured conflict analysis and correction are performed on the time conflict and semantic inconsistency results output by S54. Through conflict classification, rule matching, priority ranking, and consistency evaluation, adaptive repair of multiple types of semantic conflicts is achieved, thereby generating consistent and optimized semantic results. The time conflict and semantic inconsistency result data output by S54 are acquired and subjected to structured parsing. The structured parsing process extracts key conflict-related elements, including time node information, entity node information, and entity relationship path information, thereby converting unstructured conflict descriptions into computable structured conflict units, providing a data foundation for subsequent classification and correction. The identified conflicts are classified. The conflict types include at least time conflicts, path conflicts, and semantic conflicts, where: time conflicts indicate logical inconsistencies or temporal contradictions between different time nodes; path conflicts indicate inconsistencies between the entity relationship path structure and graph structure constraints; and semantic conflicts indicate inconsistencies between entity semantic relationships and contextual semantic expressions. Corresponding conflict type identifiers are assigned to different conflict types. A preset conflict correction rule library is invoked to perform rule matching processing on different conflict types. The conflict correction rule base stores processing strategies for different conflict scenarios, including at least: time priority rules to ensure the priority of time sequence constraints; path consistency rules to ensure the rationality of entity relationship path structures; and semantic preservation rules to preserve the consistency of original semantic information as much as possible. Conflicts are prioritized according to their type and scope of influence. The scope of influence characterizes the degree of impact of the conflict on the overall semantic structure, such as whether it affects the timeline or core entity relationships. When multiple conflicts coexist, the system sorts them according to preset priority rules, with time conflicts having a higher priority than path and semantic conflicts to ensure that time-semantic consistency is prioritized. Conflict data is adjusted based on the conflict correction rules obtained through matching. The adjustment process includes at least: time node adjustment to correct inconsistencies in time sequence; path replacement to reconstruct unreasonable entity relationship paths; and semantic remapping to adjust the semantic relationships between entities. A set of correction candidate results is generated through processing, thereby achieving unified repair of multiple types of conflicts. Consistency evaluation is performed on the correction candidate results. The final consistency optimization semantic results are used for subsequent structured medical record data fusion and semantic analysis processing, thereby ensuring the overall consistency and logical integrity of the semantic expression of medical records.
[0035] S6: Summarize the stable semantic anchor set, pattern matching results, path encoding results, and time-constrained semantic representations. Perform consistency verification and conflict correction on information from different sources according to preset rules. Classify the processed results into entity information, relational information, and time information, and output structured medical record data.
[0036] Specifically, the multi-source structured semantic results generated in the preceding steps are aggregated and merged, and consistency verification and conflict correction are performed under unified rule constraints. Finally, the medical record information is categorized and organized according to entity information, relational information, and temporal information, thus forming standardized structured medical record data. Specifically, the stable semantic anchor set generated in S1, the pattern matching results generated in S2, the path encoding results generated in S3, and the temporal constraint semantic representation generated in S5 are aggregated. Data from different sources correspond to different semantic levels: the stable semantic anchor set represents the core medical entity information in the medical record text; the pattern matching results represent the clinical semantic structure and semantic slot matching relationship; the path encoding results represent the relationship path structure between medical entities; and the temporal constraint semantic representation represents the temporal sequence and constraint relationships between medical events. A global semantic information set is constructed by uniformly aggregating the multi-source results. Consistency verification is performed on the aggregated multi-source semantic information based on preset consistency rules. Consistency verification is used to detect semantic conflicts or structural inconsistencies between data from different sources, such as mismatches between entity anchors and path encoding results, or inconsistencies between temporal constraints and path relationships. When inconsistencies are detected, the corresponding semantic units are marked as conflicting data, providing a basis for subsequent correction processing. The detected conflicting data undergoes correction processing, including entity information alignment correction, relational path adjustment, and temporal semantic consistency adjustment. This realigns semantic data from different sources under unified rule constraints, eliminating structural conflicts and semantic inconsistencies, and generating a consistent optimized semantic result set. The corrected semantic result set is then categorized. Based on semantic attributes, the information is divided into three categories: entity information, representing medical entities and their attribute descriptions; relational information, representing semantic relationships and path structures between entities; and temporal information, representing the temporal sequence and constraint relationships of medical events. Through classification and recombination, different types of semantic information are structurally decoupled and categorized. Based on the categorized entity information, relational information, and temporal information, structured medical record data is generated. This structured medical record data is organized in a unified data structure to support subsequent medical record retrieval, semantic analysis, and auxiliary diagnostic processing. It is also stored and retrieved as the final output of this method, thus completing the conversion process from unstructured medical record text to structured medical semantic data.
[0037] This application's embodiments construct an entity-relationship-time integrated structured semantic processing model for medical record text by integrating a multi-layered semantic parsing method that combines semantic anchor point localization, clinical semantic pattern matching, medical knowledge graph path construction, and temporal semantic constraint reasoning. This model enables automatic extraction, semantic alignment, path reasoning, and temporal consistency verification of unstructured medical record information, thereby generating highly consistent and structured standard medical record data and improving the accuracy of medical record information parsing and the completeness of semantic expression. Specifically, this application first obtains the input medical record text and preprocesses and parses its structure. By identifying the title hierarchy and semantic paragraph boundaries in the text, the unstructured medical record content is divided into document structure units with hierarchical relationships. Subsequently, in the semantic parsing stage, a semantic anchor point construction mechanism is introduced to initially identify and semantically map medical entities in the medical record text, forming a candidate entity set. Based on semantic similarity calculation and cluster analysis, the candidate entities are merged to generate a stable set of semantic anchor points, thereby achieving a preliminary standardized expression of medical entity information. Building upon this foundation, a clinical semantic pattern library is further constructed. Semantic structure templates are extracted from historical medical record data, and an attention mechanism is used to weight and express textual semantic features, achieving matching and slot mapping between medical record semantic patterns and current text content, generating preliminary semantic structuring results. In the relational reasoning stage, this application constructs an entity relational path structure based on a medical knowledge graph. Using a set of semantic anchor points and pattern matching results as input, a candidate semantic path set is generated in the knowledge graph. Path expansion and multi-hop splicing are used to characterize the complex relationships between entities. Furthermore, the candidate semantic paths undergo structural legality verification and constraint screening, eliminating invalid paths that do not meet connectivity and cyclic constraints. The candidate paths are then ranked based on path similarity calculation and a multi-factor scoring mechanism to determine the optimal semantic path, achieving optimized expression of semantic relationships between medical entities. In the time-series processing stage, this application extracts and standardizes the time-expression information in medical record texts, mapping different forms of time expressions into a unified standard time semantic sequence. Based on deductive rules, it performs constrained reasoning on the time sequence to determine the chronological and dependent relationships between medical events. Simultaneously, it correlates and matches the time constraint results with the path encoding results, performs consistency checks on entity relationship paths at different time points, identifies time conflicts and semantic inconsistencies, and performs adaptive correction processing through a conflict correction rule base, thereby achieving consistent fusion between the time dimension and semantic paths. Finally, this application performs multi-source fusion and consistency checks on the stable semantic anchor set, path encoding results, and time-constrained semantic results, and organizes them according to entity information, relationship information, and time information to generate structured medical record data. This achieves a complete transformation of medical record text from unstructured to structured semantic representation, significantly improving the accuracy, consistency, and usability of medical record information parsing.
[0038] In summary, this application constructs a multi-layered collaborative processing method that integrates semantic anchor construction, clinical semantic pattern matching, medical knowledge graph path reasoning, and temporal semantic constraint reasoning. This method not only significantly improves the accuracy and semantic consistency of structured parsing of medical record information but also enhances the joint expression capability of complex medical semantic relationships and temporal information. As a result, it achieves highly reliable conversion and unified output of medical record text into standard structured medical record data.
[0039] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application. In some cases, the actions or steps described in this application can be performed in a different order than that shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for extracting medical record information based on semantic anchors and structural temporal parsing, characterized in that, The method includes: S1. Construct a semantic anchor table, perform initial medical entity matching on the medical record text, generate a candidate entity set, perform semantic clustering on the candidate entities based on the word vector clustering model, obtain clustered semantic clusters, and combine the boundary voting mechanism to determine the consistency of the semantic clusters to generate a stable semantic anchor set. S2. Construct a clinical semantic pattern library, which includes historical medical record semantic structure templates. Use the BERT model to extract text semantic features, generate semantic weight distribution based on multi-head attention mechanism, map semantic weights to semantic slot structure, and generate pattern matching result data. S3. Construct a path structure for a medical knowledge graph, calculate the edit distance of candidate semantic paths, score and rank the path set using a graph search algorithm, select the optimal semantic path as the entity relation expression path, and generate path encoding results. S4. Parse the hierarchical structure of the medical record text title, generate a document structure tree, extract time expression information and perform standardization processing, and construct time semantic sequence data; S5. Based on the deductive rules, perform constraint reasoning on the time semantic sequence data, and combine the path encoding results to perform consistency verification on the semantic information of different time nodes, generating a structured semantic representation with time order constraints. S6. Summarize the stable semantic anchor set, pattern matching results, path encoding results and time-constrained semantic representations, perform consistency verification and conflict correction on information from different sources according to preset rules, classify the processed results into entity information, relational information and time information respectively, and output structured medical record data.
2. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 1, characterized in that, A semantic anchor table is constructed, and initial medical entity matching is performed on the medical record text to generate a candidate entity set. Semantic clustering is then performed on the candidate entities based on a word vector clustering model to obtain clustered semantic clusters. A boundary voting mechanism is used to determine the consistency of these semantic clusters, generating a stable set of semantic anchor points, including: S11. Perform medical entity scanning on the input medical record text, and perform initial recognition of entities in the text based on preset medical vocabulary rules to generate a candidate entity set; S12. Construct a semantic anchor table, which is used to store medical entities and their corresponding semantic label information, and map the candidate entities to the corresponding semantic categories in the semantic anchor table; S13. The candidate entity set is represented by semantic vectors, and the candidate entities are clustered based on semantic similarity calculation to form multiple clustered semantic clusters; S14. Perform boundary determination processing on the clustered semantic clusters, and correct the boundaries of the semantic clusters through a multi-rule boundary determination mechanism to obtain an optimized semantic cluster structure. S15. Perform consistency voting calculation on the optimized semantic clusters, filter the effective semantic clusters based on the comprehensive consistency score of multiple judgment results, and generate a stable set of semantic anchor points.
3. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 1, characterized in that, A path structure for a medical knowledge graph is constructed. Edit distances are calculated for candidate semantic paths. A graph search algorithm is used to score and rank the path set, and the optimal semantic path is selected as the entity relation expression path. Path encoding results are generated, including: S31. Construct a medical knowledge graph path structure based on medical entities and their relationship information, wherein the path structure is used to represent multi-hop association relationships between entities; S32. Based on the set of semantic anchors and the pattern matching results, generate multiple candidate semantic paths in the medical knowledge graph. The candidate semantic paths are used to represent the combination of association paths between different entities. S33. Calculate the edit distance for the candidate semantic paths, and calculate the path similarity value between the candidate semantic paths based on the edit distance result. The formula for calculating the path similarity value is as follows: ; in, Candidate semantic paths With candidate semantic paths Path similarity values between Candidate semantic paths With candidate semantic paths Edit distance between Candidate semantic paths The number of path nodes included. Candidate semantic paths The number of path nodes included. Candidate semantic paths With candidate semantic paths The number of path nodes is relatively large, and the degree of structural difference between candidate semantic paths is determined based on the calculated path similarity value; S34. Based on the graph search algorithm, the candidate semantic paths are traversed and analyzed, and the path similarity value is combined to give a comprehensive score to each candidate path. The candidate semantic paths are sorted according to the score results to obtain the path priority sequence. S35. Select the semantic path with the highest score from the path priority sequence as the optimal semantic path, generate an entity relationship expression path based on the optimal semantic path, and output the path encoding result.
4. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 3, characterized in that, Based on the semantic anchor set and pattern matching results, multiple candidate semantic paths are generated in the medical knowledge graph. These candidate semantic paths represent combinations of association paths between different entities, including: S32-1. Determine the starting entity node set for path generation based on the semantic anchor point set, and determine the target entity node set based on the pattern matching result; S32-2. Perform semantic constraint filtering on the relationship between the starting entity node and the target entity node. Filter out node pairs that do not meet the conditions based on the preset entity type rules and relationship constraint rules to obtain a set of valid node pairs. S32-3. Based on the medical knowledge graph structure, expand the adjacency relationship of effective node pairs and generate an initial path set according to the entity connection relationship in the graph; S32-4. Perform multi-hop path concatenation on the initial path set to generate a candidate semantic path set containing different numbers of hops; S32-5. Perform structural validity verification on candidate semantic paths, including path connectivity verification and loop path detection, and eliminate invalid and duplicate paths. S32-6. Based on path length constraints and node matching strength, perform preliminary sorting and screening of candidate semantic paths, and retain the set of candidate paths with higher priority.
5. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 3, characterized in that, A graph search algorithm is used to traverse and analyze candidate semantic paths, and a comprehensive score is given to each candidate path based on path similarity values. The candidate semantic paths are then ranked according to the scoring results to obtain a path priority sequence, including: S34-1. Based on the medical knowledge graph, the candidate semantic path set is traversed and initialized to determine the starting point and depth constraint range of the path search. S34-2. The graph search process is restricted based on preset constraints, which include at least path length constraints, node type constraints, and relation type constraints, in order to avoid invalid path expansion. S34-3. Extract structural features from the candidate semantic paths obtained by traversal. The structural features include at least node sequence features, path length features, and relational connection features. S34-4. Combining the path similarity values output by S33, perform consistency matching processing on the path structure features to obtain the path similarity fusion result; S34-5. Construct a multi-factor scoring mechanism based on the path similarity fusion result to calculate the score of candidate semantic paths. The multi-factor includes at least a path similarity factor, a path length penalty factor, and a structural consistency factor. S34-6. Normalize the scoring results of the candidate semantic paths, sort the candidate semantic paths according to the normalized scoring results, and generate a path priority sequence.
6. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 3, characterized in that, The semantic path with the highest score is selected from the path priority sequence as the optimal semantic path. An entity relation representation path is generated based on this optimal semantic path, and the path encoding result is output, including: S35-1. Obtain the path priority sequence output by S34, and perform structured parsing on the candidate semantic paths and their scoring results in the sequence; S35-2. Based on a preset scoring threshold, preliminary screening is performed on the candidate semantic paths in the path priority sequence to obtain a set of candidate paths that meet the minimum scoring condition. S35-3. Compare and analyze the candidate path set after the initial screening. When there are multiple high-scoring paths that meet the conditions, perform the final selection based on the path length priority rule to determine the unique optimal semantic path. S35-4. Perform structural normalization on the optimal semantic path, unify the path node sequence into a standard entity relation expression format, and compress and optimize redundant nodes in the path. S35-5. Generate an entity relationship mapping structure based on the normalized optimal semantic path, and determine the association type and connection direction between entities; S35-6. Based on the preset path encoding rules, the entity relationship mapping structure is converted into a standard path encoding result for subsequent structured storage and retrieval. S35-7. Output the path encoding result and store it in the structured medical record data set for subsequent semantic analysis and information fusion steps.
7. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 1, characterized in that, Based on deductive rules, constraint reasoning is performed on the temporal semantic sequence data. The consistency of semantic information at different time points is verified by combining path encoding results, generating a structured semantic representation with temporal order constraints, including: S51. Obtain the time semantic sequence data output by S4, and standardize the time expression to a preset time format to form a standard time semantic sequence. S52. Construct a preset deduction rule library, perform rule matching on standard time semantic sequences, and filter out the set of time constraint rules corresponding to the semantics of the current medical record. S53. Based on the set of time constraint rules, perform sequential reasoning processing on the time semantic sequence to determine the sequential relationship and constraint relationship between different time nodes; S54. Associate and match the path encoding results generated in S3 with the time sequence constraint results, perform consistency verification on the entity relationship paths under different time nodes, and identify time conflicts or path conflicts. S55. Correct the detected time conflicts or semantic inconsistencies by adjusting them according to the time priority rule or path consistency rule, and generate consistent and optimized semantic results. S56. Based on the processed time sequence constraint results and consistency verification results, generate a structured semantic representation with time sequence constraints and output it for use in subsequent fusion steps.
8. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 7, characterized in that, The path encoding results generated by S3 are correlated and matched with the time sequence constraint results. Consistency checks are performed on entity relationship paths at different time points to identify time conflicts or path conflicts, including: S54-1. Obtain the path encoding result and time sequence constraint result output by S3, and perform structured parsing on the two types of data, uniformly converting them into a node-relationship-time ternary representation structure; S54-2. Based on entity identification information, align and match the entity nodes in the path coding results with the time nodes in the time sequence constraints to establish an entity-time correspondence. S54-3. Based on the alignment results, construct the entity relationship path mapping relationship under different time nodes to form a path distribution structure in the time dimension; S54-4. Extract time-path coupling features from the association between time nodes and entity relationship paths. The coupling features include at least time sequence matching features, path causal consistency features, and event evolution continuity features. S54-5. Based on consistency features, determine the consistency of entity relationship paths at different time points, and calculate the consistency score between the time point and the entity relationship path. The formula for calculating the consistency score is as follows: ; in, Time node Entity Relationship Path Consistency score between them For the first Each time point For the entity relationship path corresponding to the time node, For the first Consistency feature value For the first The weight coefficients corresponding to the consistency features of items This represents the total number of consistency features participating in the consistency computation. This is the weighted sum of each consistency feature value and its corresponding weight coefficient. This is the sum of the weight coefficients corresponding to all consistency features; The consistency score obtained from the calculation determines the degree of matching consistency between entity relationship paths at different time points.
9. The method for extracting medical record information based on semantic anchors and structural temporal parsing as described in claim 7, characterized in that, Detected time conflicts or semantic inconsistencies are corrected by adjusting the results according to time priority rules or path consistency rules, generating consistent and optimized semantic results, including: S55-1. Obtain the result data of time conflict and semantic inconsistency, and perform structured parsing on the result data to extract the time node, entity node and entity relationship path information corresponding to the conflict. S55-2. Classify the identified conflicts, including at least time conflicts, path conflicts and semantic conflicts, and mark each conflict type with an identifier. S55-3. Call the preset conflict correction rule library and match the corresponding conflict correction rule based on the conflict type. The conflict correction rule includes at least time priority rule, path consistency rule and semantic preservation rule. S55-4. Determine the priority of conflict handling based on the type and scope of the conflict. When there are multiple conflicts, sort them according to the rule that time priority is higher than path consistency priority. S55-5. Based on the conflict correction rules obtained from the matching, the conflict data is adjusted and processed, including time node adjustment, path replacement or semantic remapping operations, and correction candidate results are generated. S55-6. Perform consistency evaluation on the corrected candidate results. When the consistency evaluation result meets the preset threshold requirement, determine the corrected candidate results as the final consistency optimized semantic results, and store the final consistency optimized semantic results as the output results of the current step.