Doctor-patient conversation intelligent medical record automatic generation method and system based on semantic understanding

By mapping doctor-patient dialogue data to a medical knowledge graph, a multi-layer semantic association network and a time constraint graph are constructed, which solves the problem of insufficient semantic understanding in the automatic generation of medical records in existing technologies, realizes the standardized generation of medical records, and improves the accuracy and efficiency of medical records.

CN122087060BActive Publication Date: 2026-07-21NEWLINK TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NEWLINK TECH INC
Filing Date
2026-02-26
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing automatic medical record generation technologies are insufficient in understanding the complex context of doctor-patient dialogues and in-depth analysis of the temporal relationships of clinical information. They struggle to accurately capture implicit medical information and semantic connections, cannot handle information conflicts, and lack assessment of the completeness and consistency of medical record content.

Method used

Using semantic understanding methods, doctor-patient dialogue data is mapped to a pre-built medical knowledge graph, a multi-layer semantic association network is constructed, homologous semantic fragments are identified, a time constraint graph is constructed and consistency scoring is performed, missing information is filled in, and finally a standardized electronic medical record is generated.

Benefits of technology

It improves the accuracy and logical integrity of medical record generation, reduces the workload of doctors, and improves the efficiency and quality of medical record writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122087060B_ABST
    Figure CN122087060B_ABST
Patent Text Reader

Abstract

The application provides a doctor-patient conversation intelligent medical record automatic generation method and system based on semantic understanding, relates to the technical field of medical information processing, and comprises the following steps: obtaining doctor-patient conversation data, performing semantic analysis and mapping to a medical knowledge graph, constructing a multi-layer semantic association network to identify homologous semantic fragments, constructing a time constraint graph to eliminate conflict elements, identifying missing elements and performing consistency verification to generate an electronic medical record. The accuracy, completeness and consistency of the medical record generation can be improved, the workload of doctors can be reduced, and the clinical information processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical information processing technology, and in particular to an intelligent method and system for automatically generating medical records based on semantic understanding of doctor-patient dialogue. Background Technology

[0002] With the rapid development of medical informatization, electronic medical records, as crucial documents recording patient treatment processes, have become an indispensable component of the modern healthcare system. Traditional medical record recording methods primarily rely on manual entry by doctors during or after treatment, which not only consumes a significant amount of doctors' time but also easily leads to inconsistent record quality due to subjective factors. In recent years, automated medical record generation methods based on artificial intelligence technology have gradually emerged, aiming to improve doctors' work efficiency and the quality of medical records by analyzing doctor-patient dialogue, automatically extracting clinical information, and generating standardized electronic medical records.

[0003] Existing automatic medical record generation technologies are mainly based on keyword matching and shallow semantic analysis. They identify medical entities and relationships in doctor-patient dialogues through preset templates, and then generate medical record content. However, in practical applications, existing technologies have limited ability to understand complex contexts in dialogues, making it difficult to accurately capture implicit medical information and semantic relationships in dialogues. They also lack the ability to deeply analyze the temporal relationships of clinical information, making it difficult to distinguish between different periods of symptoms and changes in the condition described by patients. Furthermore, they cannot handle information conflicts that may occur in doctor-patient dialogues, nor can they assess the completeness and consistency of extracted clinical information. They also have difficulty identifying and supplementing clinically necessary information elements that are not explicitly mentioned in the dialogue. Summary of the Invention

[0004] This invention provides a method and system for automatically generating intelligent medical records based on semantic understanding of doctor-patient dialogue, which can at least solve some of the problems existing in the prior art.

[0005] A first aspect of this invention provides a method for automatically generating intelligent medical records based on semantic understanding of doctor-patient dialogue, comprising:

[0006] Obtain doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in a pre-constructed medical knowledge graph to obtain semantically annotated discourse sequences;

[0007] Calculate the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Identify homologous semantic fragments based on the multi-layer semantic association network, construct complete clinical elements based on the homologous semantic fragments, and extract structural clinical information representations.

[0008] Based on the structured clinical information representation, a time constraint graph is constructed and the time position of each clinical element is marked to obtain a time series annotation graph. The time series annotation graph is analyzed to identify conflicting element pairs and extract the corresponding medical logical features. Based on the medical logical features and the medical knowledge graph, a verification score is obtained to obtain a consistency score. Based on the consistency score, the retained expressions are selected and updated to obtain the resolved clinical information representation.

[0009] Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, the missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Based on the list of missing elements, the candidate positions are inferred by tracing back to the semantically labeled discourse sequence and consistency verification is performed. Based on the verification results, an electronic medical record document is generated by mapping with a preset medical record document template.

[0010] In one alternative implementation,

[0011] The process involves acquiring doctor-patient dialogue data, performing semantic parsing to obtain medical entities, and mapping them to corresponding concept nodes in a pre-constructed medical knowledge graph. This results in a semantically annotated discourse sequence, including:

[0012] Doctor-patient dialogue data is obtained from a medical information system. Each utterance fragment in the doctor-patient dialogue data is segmented into words and part-of-speech features are extracted to obtain a part-of-speech tagging sequence. Named entity boundaries are identified based on the part-of-speech tagging sequence and candidate medical entities are extracted. The similarity between the context semantic vector corresponding to the candidate medical entity and the semantic vector corresponding to the candidate node in the pre-constructed medical knowledge graph is calculated to obtain the mapping score distribution. The candidate node with the highest mapping score is selected as the mapping target corresponding to the candidate medical entity, marked as a concept node, and a mapping relationship between the candidate medical entity and the concept node is established.

[0013] Based on the mapping relationship, the attribute information and association relationship of concept nodes in the medical knowledge graph are extracted. The attribute information and association relationship are attached to the corresponding candidate medical entities to obtain semantically enhanced medical entities. Based on the order of appearance of the semantically enhanced medical entities in the dialogue data, a semantically annotated discourse sequence is constructed.

[0014] In one alternative implementation,

[0015] Calculating the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encoding the contextual semantic features of each position, and constructing a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength includes:

[0016] Extract the word vector of the semantically enhanced medical entity corresponding to each position in the semantically annotated discourse sequence and the embedding vector of the concept node corresponding to the semantically enhanced medical entity. Concatenate the word vector and the embedding vector and perform a linear transformation to obtain the query representation. Generate the key-value pair representation of the previous position corresponding to the current position. Calculate the dot product of the query representation and the key-value pair representation to obtain the semantic dependency strength. Repeat the calculation to obtain the dependency strength matrix.

[0017] Extract semantically enhanced medical entities within a preset window range before and after each position in the semantically labeled discourse sequence and solve for the fusion vector. Perform bidirectional cyclic encoding on the fusion vector to obtain the context semantic vector. Calculate the hierarchical distance between the concept node and the parent and child nodes in the medical knowledge graph to obtain a hierarchical association graph. Weightedly fuse the context semantic vector and the hierarchical distance to obtain a hierarchical enhanced semantic vector. Filter the preceding positions in the dependency strength matrix with semantic dependency strength higher than a preset threshold to obtain a set of strongly dependent preceding positions. Calculate the cosine similarity between the hierarchical enhanced semantic vector at the current position and the hierarchical enhanced semantic vectors at the preceding positions in the set of strongly dependent preceding positions to obtain a semantic consistency score. Update the hierarchical association graph based on the semantic consistency score to obtain a multi-layer semantic association network.

[0018] In one alternative implementation,

[0019] Based on the aforementioned multi-layer semantic association network, homologous semantic segments are identified. Based on these homologous semantic segments, complete clinical elements are constructed, and structural clinical information representations are extracted, including:

[0020] The concept nodes in the multi-layer semantic association network are traversed and the corresponding semantic association edges are extracted. The concept nodes connected by the semantic association edges are obtained and the semantic distance between the concept nodes is calculated in the medical knowledge graph. Concept nodes with semantic distances less than a preset distance threshold are filtered and a candidate homologous node set is constructed. The position index of the semantically enhanced medical entity corresponding to each candidate homologous node in the candidate homologous node set is extracted in the semantically labeled discourse sequence. It is determined whether the interval between the position indices is less than a preset interval threshold. If so, the current candidate homologous node and the corresponding semantically enhanced medical entity are classified as homologous semantic fragments.

[0021] The attribute types of the concept nodes corresponding to each semantically enhanced medical entity in the homologous semantic fragments are extracted in the medical knowledge graph. According to the attribute types, a predefined clinical element template is matched, and the semantically enhanced medical entities in the homologous semantic fragments are filled into the corresponding slots according to the attribute types. The filling completeness of each slot in the clinical element template is detected. When there are unfilled slots, concept nodes that are semantically related to the filled slots are retrieved from the multi-layer semantic association network. The corresponding semantically enhanced medical entities are extracted and added to the unfilled slots to form complete clinical elements. The structural clinical information representation is extracted based on the complete clinical elements.

[0022] In one alternative implementation,

[0023] Based on the structural clinical information representation, a time constraint graph is constructed and the time position of each clinical element is labeled to obtain a time-series annotation graph. Analyzing the time-series annotation graph to identify conflicting element pairs and extracting the corresponding medical logical features includes:

[0024] The semantically labeled discourse sequence fragments corresponding to complete clinical elements in the structured clinical information representation are parsed and the corresponding time expressions are extracted and converted to obtain standard timestamps. If no time expression exists, the relative temporal relationship is inferred based on the position index corresponding to the semantically labeled discourse sequence fragments. The complete clinical elements are used as nodes in the temporal constraint graph, and the standard timestamps or the relative temporal relationships are used as time attributes. Directed edges are established for the causal dependencies between different slots in the complete clinical elements. The time attributes are labeled to the nodes to obtain the temporal annotation graph.

[0025] The time difference between each pair of nodes in the temporal annotation graph is calculated. When the time difference violates the preset temporal constraint rules in the medical knowledge graph, the current pair of nodes is marked as a candidate conflicting element pair. The semantic path of the concept node corresponding to the semantically enhanced medical entity in the complete clinical element corresponding to the candidate conflicting element pair is retrieved in the medical knowledge graph. The connectivity strength of the semantic path is calculated. When the connectivity strength is lower than a preset connectivity threshold, it is confirmed as a conflicting element pair. The node centrality feature corresponding to the conflicting element pair is calculated. The medical logical feature is obtained by combining the query vector of the complete clinical element corresponding to the conflicting element pair with the time difference.

[0026] In one alternative implementation,

[0027] A consistency score is obtained by verifying and scoring based on the medical logical features and the medical knowledge graph. Based on the consistency score, the retained representations are selected and updated to obtain the resolved clinical information representation, including:

[0028] Extract the node centrality feature and time difference from the medical logical features. Retrieve medical rules based on the complete clinical elements corresponding to the conflicting element pairs. Extract the causal and temporal constraints from the medical rules. Match the node centrality feature with the causal constraints to obtain the causal matching degree. Match the time difference with the temporal constraints to obtain the temporal matching degree. Perform a weighted fusion of the causal matching degree and the temporal matching degree to obtain the rule matching score. Calculate the semantic similarity between the query vector corresponding to the complete clinical element and the embedding vector of the concept node. Combine the rule matching score to obtain the consistency score of the conflicting element pairs.

[0029] Determine whether the consistency score is greater than a preset consistency threshold. If it is, then the complete clinical element corresponding to the preceding node in the conflicting element pair is taken as the retained clinical element. Otherwise, the complete clinical element corresponding to the following node in the conflicting element pair is taken as the retained clinical element. Obtain the semantically annotated discourse sequence fragment corresponding to the retained clinical element as the retained expression. Concatenate the query vectors of the semantically enhanced medical entities filled in each slot of the retained clinical element according to the slot order in the clinical element template and update the vector representation corresponding to the retained clinical element. Repeat the process until all conflicting element pairs are processed to obtain the resolved clinical information representation.

[0030] In one alternative implementation,

[0031] Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Candidate positions are inferred from the semantically annotated discourse sequence based on the list of missing elements and consistency verification is performed. Electronic medical record documents are generated by mapping the verification results to a preset medical record document template, including:

[0032] Extract the semantically enhanced medical entities contained in the complete clinical elements in the dissolved clinical information representation, obtain the concept nodes corresponding to the semantically enhanced medical entities in the medical knowledge graph, and determine the set of necessary attributes by analyzing attribute dependencies. Compare the attributes contained in the complete clinical elements with the set of necessary attributes to identify missing attributes. Combine the identifiers of the complete clinical elements to form missing elements. Repeatedly identify and summarize to obtain a list of missing elements.

[0033] The position range of the complete clinical element corresponding to the missing element in the semantically labeled discourse sequence is obtained. The position range is expanded forward and backward by a preset window length to obtain an expanded range. Unlabeled discourse fragments within the expanded range are extracted and the semantic matching degree with the medical entity type corresponding to the missing element is calculated. The position corresponding to the maximum semantic matching degree is taken as a candidate position. The discourse fragments at the candidate positions are identified as medical entities and mapped to the medical knowledge graph to obtain supplementary semantically enhanced medical entities. The consistency between the supplementary semantically enhanced medical entities and the medical entity type corresponding to the missing element is verified. The verified supplementary semantically enhanced medical entities are filled into the missing attribute positions in the dissolved clinical information representation to obtain the complete clinical information representation.

[0034] The complete clinical information is mapped to the field slots of the preset medical record document template to obtain an electronic medical record document.

[0035] A second aspect of this invention provides an intelligent automatic medical record generation system based on semantic understanding for doctor-patient dialogue, comprising:

[0036] The semantic mapping module is used to acquire doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in the pre-built medical knowledge graph to obtain semantically annotated discourse sequences.

[0037] The network construction module is used to calculate the semantic dependency strength between each position and the preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Based on the multi-layer semantic association network, homologous semantic fragments are identified, and complete clinical elements are constructed based on the homologous semantic fragments and structural clinical information representations are extracted.

[0038] The temporal resolution module is used to construct a temporal constraint graph based on the structured clinical information representation and mark the time position of each clinical element to obtain a temporal annotation graph. It analyzes the temporal annotation graph to identify conflicting element pairs and extracts the corresponding medical logical features. It performs verification scoring based on the medical logical features and the medical knowledge graph to obtain a consistency score. Based on the consistency score, it selects the retained expressions and updates them to obtain the resolved clinical information representation.

[0039] The completion generation module is used to identify and resolve missing attributes in clinical information representation based on the attribute dependency relationship of concept nodes in the medical knowledge graph to obtain a list of missing elements. Based on the list of missing elements, it backtracks to the semantically labeled discourse sequence to infer candidate positions and performs consistency verification. Based on the verification results, it maps and generates electronic medical record documents with preset medical record document templates.

[0040] A third aspect of the present invention provides an electronic device, comprising:

[0041] A processor and a memory for storing processor-executable instructions, wherein the processor is configured to invoke instructions stored in the memory to perform the aforementioned method.

[0042] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0043] In this invention, semantically annotated discourse sequences are obtained by mapping doctor-patient dialogue data to concept nodes in a pre-constructed medical knowledge graph, which improves the accuracy of medical entity recognition. A multi-layer semantic association network is constructed, and by calculating the semantic dependency strength and combining the hierarchical relationship between concept nodes, the problems of scattered information and complex semantic associations in doctor-patient dialogue are effectively solved. It can accurately identify homologous semantic fragments and construct complete clinical elements. By identifying missing attributes and performing backtracking inference through the attribute dependency relationship of concept nodes in the knowledge graph, the generated medical record documents are more complete and conform to medical standards. It realizes the automatic conversion process from unstructured doctor-patient dialogue to standardized electronic medical records, reduces the paperwork burden of doctors, improves the efficiency of medical record writing, and ensures the medical accuracy and logical integrity of medical record content. Attached Figure Description

[0044] Figure 1 This is a flowchart illustrating the intelligent automatic medical record generation method based on semantic understanding for doctor-patient dialogue, as described in an embodiment of the present invention.

[0045] Figure 2 This is a flowchart illustrating the consistency scoring process between medical logical features and medical knowledge graphs in the intelligent automatic medical record generation method for doctor-patient dialogue based on semantic understanding, as described in an embodiment of the present invention. Detailed Implementation

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

[0047] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0048] Figure 1This is a flowchart illustrating the intelligent automatic medical record generation method based on semantic understanding for doctor-patient dialogue, as described in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0049] Obtain doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in a pre-constructed medical knowledge graph to obtain semantically annotated discourse sequences;

[0050] Calculate the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Identify homologous semantic fragments based on the multi-layer semantic association network, construct complete clinical elements based on the homologous semantic fragments, and extract structural clinical information representations.

[0051] Based on the structured clinical information representation, a time constraint graph is constructed and the time position of each clinical element is marked to obtain a time series annotation graph. The time series annotation graph is analyzed to identify conflicting element pairs and extract the corresponding medical logical features. Based on the medical logical features and the medical knowledge graph, a verification score is obtained to obtain a consistency score. Based on the consistency score, the retained expressions are selected and updated to obtain the resolved clinical information representation.

[0052] Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, the missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Based on the list of missing elements, the candidate positions are inferred by tracing back to the semantically labeled discourse sequence and consistency verification is performed. Based on the verification results, an electronic medical record document is generated by mapping with a preset medical record document template.

[0053] In one alternative implementation,

[0054] The process involves acquiring doctor-patient dialogue data, performing semantic parsing to obtain medical entities, and mapping them to corresponding concept nodes in a pre-constructed medical knowledge graph. This results in a semantically annotated discourse sequence, including:

[0055] Doctor-patient dialogue data is obtained from a medical information system. Each utterance fragment in the doctor-patient dialogue data is segmented into words and part-of-speech features are extracted to obtain a part-of-speech tagging sequence. Named entity boundaries are identified based on the part-of-speech tagging sequence and candidate medical entities are extracted. The similarity between the context semantic vector corresponding to the candidate medical entity and the semantic vector corresponding to the candidate node in the pre-constructed medical knowledge graph is calculated to obtain the mapping score distribution. The candidate node with the highest mapping score is selected as the mapping target corresponding to the candidate medical entity, marked as a concept node, and a mapping relationship between the candidate medical entity and the concept node is established.

[0056] Based on the mapping relationship, the attribute information and association relationship of concept nodes in the medical knowledge graph are extracted. The attribute information and association relationship are attached to the corresponding candidate medical entities to obtain semantically enhanced medical entities. Based on the order of appearance of the semantically enhanced medical entities in the dialogue data, a semantically annotated discourse sequence is constructed.

[0057] Data on doctor-patient dialogues is obtained from medical information systems. This data can come from various channels, including outpatient clinics, inpatient clinics, and remote consultations. It includes content such as doctors asking about symptoms, patients describing their condition, and doctors explaining diagnostic results. For example, a dialogue segment describing a patient's cough and fever (reaching a maximum temperature of 38.5℃ for the past three days) can be processed.

[0058] Each utterance fragment in the acquired doctor-patient dialogue data was segmented into words. The segmentation process used a medical-specific word segmentation dictionary combined with a conditional random field model, and simultaneously extracted part-of-speech features to obtain a part-of-speech tagging sequence. For the aforementioned example, the segmentation and part-of-speech tagging results are: "patient / noun description / verb near / adjective three days / time word appears / verb cough / noun, / punctuation accompanied / verb fever / noun symptoms / noun, / punctuation body temperature / noun highest / adjective reaches / verb 38.5 / numeral ℃ / quantifier, / punctuation absent / verb obvious / adjective sputum / noun".

[0059] Named entity boundary identification and candidate medical entity extraction based on part-of-speech tagging sequence is performed using a bidirectional long short-term memory network combined with conditional random fields. The part-of-speech tagging sequence is input as a feature into the model to identify the boundaries of medical entities. For the identified entities, labels are assigned such as symptom onset, symptom interior, sign onset, and sign interior. In the aforementioned example, the identified candidate medical entities include "cough" (symptom), "fever" (symptom), "body temperature 38.5℃" (sign), and "sputum" (symptom).

[0060] The similarity between the contextual semantic vector of a candidate medical entity and the semantic vector of a candidate node in a pre-constructed medical knowledge graph is calculated to obtain a mapping score distribution. A context-aware encoder then extracts the semantic vector of the candidate medical entity. For example, for the entity "cough," considering its context in the dialogue "coughing has occurred in the last three days," its contextual semantic vector is extracted. The medical knowledge graph contains various medical concept nodes, such as symptoms, diseases, and drugs, each with a corresponding pre-calculated semantic vector. The similarity between two vectors is calculated using cosine similarity to obtain a mapping score. For example, for the entity "cough," there may be multiple related nodes in the knowledge graph such as "cough," "dry cough," and "wet cough." The similarity calculation yields a mapping score distribution such as {cough: 0.92, dry cough: 0.73, wet cough: 0.67}.

[0061] The candidate node with the highest mapping score is selected as the mapping target corresponding to the candidate medical entity, marked as a concept node, and a mapping relationship is established between the candidate medical entity and the concept node. In the aforementioned example, for the entity "cough", the "cough" node with the highest score (score 0.92) is selected as the mapping target; for "fever", it is mapped to the "fever" node in the knowledge graph; for "body temperature 38.5℃", it is mapped to the "fever" node and marked with a specific value; for "sputum", since the context mentions "no obvious sputum", it is mapped to the "no sputum" or "little sputum" node.

[0062] Based on the established mapping relationships, attribute information and associations of concept nodes in the medical knowledge graph are extracted. Each concept node in the medical knowledge graph contains rich attribute information and associations. For example, for the concept node "cough," attribute information includes symptom type, common causes, and characteristic manifestations; associations include potentially related diseases such as "cold," "bronchitis," and "pneumonia," and related symptoms such as "fever" and "sore throat." This information is extracted as the basis for semantic enhancement.

[0063] Attribute information and relationships are attached to the corresponding candidate medical entities to obtain semantically enhanced medical entities. Attribute information and relationships extracted from the knowledge graph are added to the identified medical entities to form semantically enhanced medical entities. For example, for the entity "cough," the enhanced information includes its definition in the knowledge graph, its classification (e.g., "respiratory symptoms"), and potentially related diseases. For "body temperature 38.5℃," the enhanced information includes its corresponding fever level ("moderate fever") and clinical significance.

[0064] Based on the order in which semantically enhanced medical entities appear in the dialogue data, a semantically annotated discourse sequence is constructed. The identified and enhanced medical entities are reorganized according to their order of appearance in the original dialogue to form a semantically annotated discourse sequence. For the example dialogue, the annotated sequence is: "The patient describes experiencing [cough] {symptoms: respiratory symptoms; possible diseases: cold, bronchitis, pneumonia} for the past three days, accompanied by [fever] {symptoms: systemic symptoms; severity: moderate}, [highest body temperature reaching 38.5℃] {signs: fever; severity: moderate; clinical significance: sign of infectious disease}, with no obvious [sputum] {symptoms: respiratory symptoms; characteristics: none or small amount}."

[0065] In this embodiment, by segmenting the discourse fragments in the doctor-patient dialogue and combining them with part-of-speech features for joint modeling, the boundary recognition of medical entities can dynamically determine the entity range based on the contextual grammatical structure. This effectively reduces the impact of colloquial expressions and incomplete descriptions on the accuracy of entity recognition, and improves the robustness of medical entity recognition in real clinical dialogue scenarios. By calculating the similarity between the contextual semantic vector of the candidate medical entity and the semantic vector of the concept node in the medical knowledge graph and completing the optimal mapping, the entity semantic disambiguation capability and cross-expression consistency are improved. The attribute information and relational information associated with the concept node in the knowledge graph are attached to the corresponding medical entity, realizing the explicit completion of the implicit medical knowledge in the original dialogue, and significantly improving the semantic information density and reasonability of the dialogue data.

[0066] In one alternative implementation,

[0067] Calculating the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encoding the contextual semantic features of each position, and constructing a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength includes:

[0068] Extract the word vector of the semantically enhanced medical entity corresponding to each position in the semantically annotated discourse sequence and the embedding vector of the concept node corresponding to the semantically enhanced medical entity. Concatenate the word vector and the embedding vector and perform a linear transformation to obtain the query representation. Generate the key-value pair representation of the previous position corresponding to the current position. Calculate the dot product of the query representation and the key-value pair representation to obtain the semantic dependency strength. Repeat the calculation to obtain the dependency strength matrix.

[0069] Extract semantically enhanced medical entities within a preset window range before and after each position in the semantically labeled discourse sequence and solve for the fusion vector. Perform bidirectional cyclic encoding on the fusion vector to obtain the context semantic vector. Calculate the hierarchical distance between the concept node and the parent and child nodes in the medical knowledge graph to obtain a hierarchical association graph. Weightedly fuse the context semantic vector and the hierarchical distance to obtain a hierarchical enhanced semantic vector. Filter the preceding positions in the dependency strength matrix with semantic dependency strength higher than a preset threshold to obtain a set of strongly dependent preceding positions. Calculate the cosine similarity between the hierarchical enhanced semantic vector at the current position and the hierarchical enhanced semantic vectors at the preceding positions in the set of strongly dependent preceding positions to obtain a semantic consistency score. Update the hierarchical association graph based on the semantic consistency score to obtain a multi-layer semantic association network.

[0070] The semantically annotated discourse sequence extracts the word vectors of the semantically enhanced medical entity and the embedding vectors of the corresponding concept nodes for each position. The word vectors are obtained through a pre-trained medical domain word embedding model with a dimension of 300; the concept node embedding vectors are obtained through knowledge graph embedding methods such as the transpose relation model with a dimension of 200. For example, for the semantically enhanced medical entity "cough", its word vector and the embedding vector of the corresponding concept node "cough" are extracted.

[0071] The extracted word vectors and embedding vectors are concatenated and a linear transformation is applied to obtain the query representation. The linear transformation is implemented using a weight matrix, which is obtained through supervised learning from a medical text corpus. For the entity "cough," the 300-dimensional word vector and the 200-dimensional embedding vector are concatenated to form a 500-dimensional vector, and after a linear transformation, a 256-dimensional query representation is obtained.

[0072] Generate key-value pair representations of the preceding positions for the current position. The key and value representations are obtained through similar linear transformations, differing only in the use of different weight matrices. For position A, the corresponding key and value representations are generated for the preceding position B, also with a dimension of 256.

[0073] The semantic dependency strength is obtained by calculating the dot product of the query representation and the key-value pair representation. For the query representation at position A and the key representation at the preceding position B, the dot product is calculated and scaled to obtain the dependency strength. This calculation is repeated for all position pairs to construct an n×n dependency strength matrix, where n is the sequence length. Taking the doctor-patient dialogue "The patient has had a cough and fever for the past three days" as an example, the dependency strength of "fever" on "cough" is calculated to be 0.82.

[0074] The semantically enhanced medical entities are extracted from each position in the semantically annotated discourse sequence within a predefined window. The window size is set to 5, meaning that semantically enhanced medical entities are considered from 5 positions before and after the current position. A weighted average is calculated for the semantic representations of these entities, with the weights determined inversely proportional to their distance from the current position; closer entities have higher weights. The resulting fusion vector comprehensively considers local contextual information.

[0075] The fused vector is bidirectionally recurrently encoded to obtain the context semantic vector. A bidirectional gated recurrent unit network is used, with the input being the fused vector sequence. 128-dimensional hidden states are used in both the forward and backward directions, and the resulting concatenation yields a 256-dimensional context semantic vector.

[0076] The hierarchical distance between concept nodes and their parent and child nodes in the medical knowledge graph is calculated to obtain a hierarchical relationship graph. For each concept node, all its directly connected parent and child nodes are extracted from the medical knowledge graph, and the hierarchical distance between the nodes is calculated. The hierarchical distance is calculated using the shortest path algorithm. For example, the hierarchical distance between "cough" and its parent node "respiratory symptoms" is 1, the hierarchical distance between "cough" and "dry cough" is 1, and the hierarchical distance between "cold" and "common cold" is 2.

[0077] A weighted fusion of the context semantic vector and the hierarchical distance yields a hierarchical enhanced semantic vector. For the concept node corresponding to position A, the context semantic vector is fused with the hierarchical distance information of that node. An attention mechanism is used in the fusion process; concept nodes with smaller hierarchical distances receive higher attention weights. The fused vector is a 256-dimensional hierarchical enhanced semantic vector.

[0078] The set of strong dependency predecessor positions is obtained by filtering the dependency strength matrix and selecting predecessor positions whose semantic dependency strength is higher than a preset threshold. The preset threshold is set to 0.6. For position A, all predecessor positions B are traversed. If the dependency strength is greater than 0.6, position B is added to the set of strong dependency predecessor positions.

[0079] Calculate the cosine similarity between the hierarchical enhanced semantic vector at the current position and the hierarchical enhanced semantic vectors at previous positions in the strongly dependent preceding position set to obtain the semantic consistency score. For the hierarchical enhanced semantic vector at position A, calculate the cosine similarity between it and the hierarchical enhanced semantic vector at each position B in the strongly dependent preceding position set. Take the average value as the semantic consistency score for position A.

[0080] The hierarchical association graph is updated based on the semantic consistency score to obtain a multi-layer semantic association network. For each pair of positions A and B with a strong dependency, if their semantic consistency score exceeds the threshold of 0.7, a connecting edge is added to the hierarchical association graph, and the weight of the edge is set to the semantic consistency score.

[0081] For example, taking a patient's description of "having a cough and fever for the past three days, with a body temperature of 38.5℃, and experiencing some relief after taking ibuprofen" as an example, the constructed multi-layer semantic association network contains the following relationships: the association weight between "cough" and "fever" is 0.85; the association weight between "fever" and "body temperature 38.5℃" is 0.92; the association weight between "ibuprofen" and "fever" is 0.78; and the association weight between "symptom relief" and "ibuprofen" is 0.81.

[0082] In this embodiment, by jointly representing the word vectors of semantically enhanced medical entities with the embedding vectors of their corresponding concept nodes and using them to calculate the semantic dependency strength, the measurement of semantic dependency is no longer limited to the surface similarity of the text. This allows for a more accurate identification of the real medical semantic dependencies between discourses, reducing the probability of dependency misjudgment. By fusing the semantically enhanced medical entities of preceding and following discourses within a preset window and performing bidirectional context encoding, the semantic representation of the current position simultaneously includes the preceding and following contextual information, effectively alleviating the semantic bias problem caused by unidirectional modeling. By introducing the hierarchical relationship of concept nodes in the medical knowledge graph and incorporating the parent-child hierarchical distance between concepts into the semantic representation, it is possible to distinguish the degree of proximity of different semantic associations at the medical level, enhancing the medical rationality and interpretability of semantic association modeling.

[0083] In one alternative implementation,

[0084] Based on the aforementioned multi-layer semantic association network, homologous semantic segments are identified. Based on these homologous semantic segments, complete clinical elements are constructed, and structural clinical information representations are extracted, including:

[0085] The concept nodes in the multi-layer semantic association network are traversed and the corresponding semantic association edges are extracted. The concept nodes connected by the semantic association edges are obtained and the semantic distance between the concept nodes is calculated in the medical knowledge graph. Concept nodes with semantic distances less than a preset distance threshold are filtered and a candidate homologous node set is constructed. The position index of the semantically enhanced medical entity corresponding to each candidate homologous node in the candidate homologous node set is extracted in the semantically labeled discourse sequence. It is determined whether the interval between the position indices is less than a preset interval threshold. If so, the current candidate homologous node and the corresponding semantically enhanced medical entity are classified as homologous semantic fragments.

[0086] The attribute types of the concept nodes corresponding to each semantically enhanced medical entity in the homologous semantic fragments are extracted in the medical knowledge graph. According to the attribute types, a predefined clinical element template is matched, and the semantically enhanced medical entities in the homologous semantic fragments are filled into the corresponding slots according to the attribute types. The filling completeness of each slot in the clinical element template is detected. When there are unfilled slots, concept nodes that are semantically related to the filled slots are retrieved from the multi-layer semantic association network. The corresponding semantically enhanced medical entities are extracted and added to the unfilled slots to form complete clinical elements. The structural clinical information representation is extracted based on the complete clinical elements.

[0087] The concept nodes in the multi-layer semantic association network are traversed and the corresponding semantic association edges are extracted. For example, in a multi-layer semantic association network constructed from the patient's description of "coughing for the past three days, accompanied by a lot of yellow phlegm, which is more pronounced at night, and accompanied by a low-grade fever", the concept node "cough" is traversed and the semantic association edges associated with it are extracted to obtain association edges such as "cough-a lot of phlegm" and "cough-worsening at night".

[0088] Obtain the concept nodes connected by semantically related edges and calculate the semantic distance between nodes in the medical knowledge graph. The semantic distance is determined by calculating the path length of the concept nodes in the medical knowledge graph. For example, the semantic distance between "cough" and "excessive phlegm" is 1.2, and the semantic distance between "cough" and "fever" is 2.5.

[0089] Filter concept nodes whose semantic distance is less than a preset distance threshold to construct a candidate homologous node set. Set the preset distance threshold to 2.0. For the "cough" node, concept nodes whose semantic distance to the "cough" node is less than 2.0 include "excessive phlegm", "yellow phlegm", and "worsening at night". Add these nodes to the candidate homologous node set.

[0090] Extract the position index of the semantically enhanced medical entity corresponding to each candidate homologous node in the set of candidate homologous nodes in the semantically labeled discourse sequence. For example, the position index of "cough" is 3, the position index of "excessive phlegm" is 5, the position index of "yellow phlegm" is 7, and the position index of "worsens at night" is 10.

[0091] The system determines whether the interval between location indices is less than a preset interval threshold. The preset interval threshold is set to 8, and the difference in location indices between candidate homologous nodes is calculated. The index interval between "cough" and "excessive phlegm" is 2, which is less than the preset interval threshold of 8; the index interval between "cough" and "yellow phlegm" is 4, which is less than the preset interval threshold of 8; and the index interval between "cough" and "worsens at night" is 7, which is less than the preset interval threshold of 8. Therefore, the semantically enhanced medical entities "cough," "excessive phlegm," "yellow phlegm," and "worsens at night" are grouped into the same homologous semantic segment.

[0092] Extract the attribute type of the concept node corresponding to each semantically enhanced medical entity in the homologous semantic fragment in the medical knowledge graph. For the aforementioned homologous semantic fragment, query the medical knowledge graph to obtain the attribute type of each entity: "cough" belongs to the "symptom" type, "excessive phlegm" belongs to the "symptom feature" type, "yellow phlegm" belongs to the "symptom feature" type, and "worsens at night" belongs to the "time feature" type.

[0093] Predefined clinical element templates are matched based on attribute type. For homologous semantic fragments related to "cough", the "respiratory symptoms" template is matched, which includes slots for "main symptoms", "symptom characteristics", "time characteristics", "severity", "relief factors" and "aggravation factors".

[0094] Semantically enhanced medical entities from the same semantic fragment are filled into the corresponding slots according to their attribute types. "Cough" is filled into the "Main Symptom" slot, "Excessive Sputum" and "Yellow Sputum" are filled into the "Symptom Characteristics" slot, and "Worsening at Night" is filled into the "Time Characteristics" and "Aggravating Factors" slots.

[0095] The completeness of the filling of each slot in the clinical element template was checked. During the filling process, it was found that the "severity" and "relief factors" slots were not yet filled and needed to be further supplemented. When there were unfilled slots, concept nodes that were semantically related to the filled slots were retrieved from the multi-layer semantic association network. Other concept nodes that were semantically related to "cough" were retrieved, and it was found that the patient description also mentioned "frequent cough" and "improvement after taking medication". These two semantically enhanced medical entities are related to "severity" and "relief factors", respectively.

[0096] Extract the corresponding semantically enhanced medical entities and fill them into the unfilled slots to form complete clinical elements. Fill "frequent cough" into the "severity" slot and "improvement after medication" into the "relief factor" slot to form complete clinical elements. The complete clinical elements are: {Main symptom: "cough", symptom characteristics: ["excessive sputum", "yellow sputum"], time characteristics: "worsened at night", severity: "frequent", relief factor: "improved after medication", aggravation factor: "night"}.

[0097] Structured clinical information representation is obtained based on the extraction of complete clinical elements. For the entire content of the patient's description, each semantic segment is processed sequentially using the aforementioned method to obtain a structured clinical information representation containing multiple complete clinical elements. In addition to the aforementioned "cough"-related clinical elements, "fever"-related clinical elements are also extracted: {Main symptom: "fever", symptom characteristic: "low-grade fever", time characteristic: "last three days", severity: "mild", relieving factor: "unknown", aggravating factor: "unknown"}.

[0098] For another patient's description of "persistent right abdominal pain for three days, aggravated by pressure, no diarrhea, but nausea and vomiting, and inability to eat," the same processing procedure was used to extract clinical elements related to "abdominal pain": {Main symptom: "right abdominal pain", symptom characteristics: ["persistent", "aggravated by pressure"], time characteristics: "three days", severity: "moderate", relief factors: "unknown", aggravating factors: "pressure"}; and clinical elements related to "digestive system symptoms": {Main symptom: ["nausea", "vomiting"], symptom characteristics: "loss of appetite", time characteristics: "unknown", severity: "unknown", relief factors: "unknown", aggravating factors: "unknown"}. In addition, "diarrhea" was identified as a negative symptom from the multi-layer semantic association network and marked as a symptom not present in the patient.

[0099] In this embodiment, by combining semantic association edges and semantic distance in the medical knowledge graph to perform dual screening of concept nodes in a multi-layer semantic association network, the erroneous merging of semantically related but medically different concepts is effectively avoided, improving the accuracy and medical rationality of the segmentation of homologous semantic fragments. The introduction of dialogue position interval constraints ensures that the aggregation of homologous concepts simultaneously conforms to the temporal continuity characteristics of doctor-patient communication, enabling the stable merging of medical information expressed in multiple rounds under the same diagnostic and treatment context, reducing the mis-aggregation of cross-topic or cross-stage information, and enhancing the consistency of homologous semantic fragments in the actual clinical context. By mapping medical entities in homologous semantic fragments to predefined clinical element templates according to the attribute type of concept nodes, the standardization and reusability of clinical information extraction results are significantly improved.

[0100] In one alternative implementation,

[0101] Based on the structural clinical information representation, a time constraint graph is constructed and the time position of each clinical element is labeled to obtain a time-series annotation graph. Analyzing the time-series annotation graph to identify conflicting element pairs and extracting the corresponding medical logical features includes:

[0102] The semantically labeled discourse sequence fragments corresponding to complete clinical elements in the structured clinical information representation are parsed and the corresponding time expressions are extracted and converted to obtain standard timestamps. If no time expression exists, the relative temporal relationship is inferred based on the position index corresponding to the semantically labeled discourse sequence fragments. The complete clinical elements are used as nodes in the temporal constraint graph, and the standard timestamps or the relative temporal relationships are used as time attributes. Directed edges are established for the causal dependencies between different slots in the complete clinical elements. The time attributes are labeled to the nodes to obtain the temporal annotation graph.

[0103] The time difference between each pair of nodes in the temporal annotation graph is calculated. When the time difference violates the preset temporal constraint rules in the medical knowledge graph, the current pair of nodes is marked as a candidate conflicting element pair. The semantic path of the concept node corresponding to the semantically enhanced medical entity in the complete clinical element corresponding to the candidate conflicting element pair is retrieved in the medical knowledge graph. The connectivity strength of the semantic path is calculated. When the connectivity strength is lower than a preset connectivity threshold, it is confirmed as a conflicting element pair. The node centrality feature corresponding to the conflicting element pair is calculated. The medical logical feature is obtained by combining the query vector of the complete clinical element corresponding to the conflicting element pair with the time difference.

[0104] This method parses semantically annotated discourse sequences corresponding to complete clinical elements in structured clinical information representations, extracts the time expressions within them, and converts them into standard timestamps. For example, in a patient's description, "I started having a fever last Friday, with a temperature of 38.5℃, and started coughing yesterday afternoon," the time expressions "last Friday" and "yesterday afternoon" are identified. Assuming the current date is Wednesday, June 15, 2022, "last Friday" is converted to the standard timestamp "2022-06-10 00:00:00," and "yesterday afternoon" is converted to the standard timestamp "2022-06-14 14:00:00."

[0105] If no explicit temporal expression exists in the complete clinical element, the relative temporal relationship is inferred based on the position index corresponding to the semantically labeled discourse sequence fragment. In the patient's description, "After taking the medication, the headache lessened, but I still feel a bit nauseous," although there is no explicit temporal expression, the position index suggests that "headache lessening" occurred after "taking the medication," and "nausea" and "headache lessening" coexisted. In this case, relative temporal relationships are assigned to these events: taking medication (t0) → headache lessening (t0+Δt1), nausea (t0+Δt1), where Δt1 represents the relative time interval.

[0106] Complete clinical elements are used as nodes in the time constraint graph, and standard timestamps or relative temporal relationships are used as time attributes. For the patient's description "Coughing started three days ago, fever appeared last night, and body temperature was 38.2℃ this morning," a time constraint graph with three nodes is constructed: Node 1 is {Main symptom: "Cough", timestamp: "2022-06-12 00:00:00"}, Node 2 is {Main symptom: "Fever", timestamp: "2022-06-14 20:00:00"}, and Node 3 is {Symptom characteristic: "Body temperature 38.2℃", timestamp: "2022-06-15 08:00:00"}.

[0107] Establish causal dependencies between different slots in a complete clinical element and construct directed edges. In the clinical element {Main Symptom: "Abdominal Pain", Symptom Characteristic: "Severe", Aggravating Factor: "Diet"}, identify a causal relationship between "Diet" and "Abdominal Pain" and construct a directed edge from "Diet" to "Abdominal Pain" with the attribute "Aggravation". Similarly, for the clinical element {Main Symptom: "Headache", Symptom Characteristic: "Throbbing", Relief Factor: "Rest"}, construct a directed edge from "Rest" to "Headache" with the attribute "Relief".

[0108] The temporal attribute is labeled to the nodes to obtain a temporal sequence annotation graph. For example, for a patient's description "the patient experienced abdominal pain after eating at 9:00 AM, the pain was relieved after taking painkillers at 11:00 AM, and the abdominal pain worsened after eating again at 4:00 PM", the constructed temporal sequence annotation graph contains the following nodes: Eating 1 (09:00) → Abdominal Pain 1 (09:30) → Taking Medication (11:00) → Pain Relief (11:30) → Eating 2 (16:00) → Abdominal Pain 2 (16:30). Among them, directed edges establish a "cause" relationship between Eating 1 and Abdominal Pain 1, and between Eating 2 and Abdominal Pain 2, and directed edges establish a "relief" relationship between Taking Medication and Pain Relief.

[0109] Calculate the time difference between each pair of nodes in the time-series annotation graph. For the time-series annotation graph constructed from the aforementioned patient descriptions, calculate the time difference between each pair of nodes: eating 1 → abdominal pain 1 is 30 minutes, abdominal pain 1 → medication is 90 minutes, medication → pain relief is 30 minutes, pain relief → eating 2 is 270 minutes, and eating 2 → abdominal pain 2 is 30 minutes.

[0110] When the time difference violates the preset temporal constraints in the medical knowledge graph, the current node pair is marked as a candidate conflicting element pair. A query in the medical knowledge graph reveals that the duration of action of common painkillers is typically 4-6 hours. In the aforementioned example, the time interval from taking the medication to eating 2 is 300 minutes (5 hours), which is within the effective time range. However, abdominal pain 2 occurs rapidly after eating 2, conflicting with the pain relief effect of the painkiller. Therefore, (pain relief, abdominal pain 2) is marked as a candidate conflicting element pair.

[0111] The semantic paths of the concept nodes corresponding to the semantically enhanced medical entities in the complete clinical elements of the candidate conflicting element pairs are retrieved in the medical knowledge graph. For the candidate conflicting element pair (pain relief, abdominal pain 2), the semantic path between "pain relief" and "abdominal pain" is queried in the medical knowledge graph, and the path is obtained as follows: pain relief → pain symptoms → abdominal symptoms → abdominal pain.

[0112] Calculate the connectivity strength of the semantic path. The connectivity strength is calculated using the path length and the weights of the edges along the path. For the path "pain relief → pain symptoms → abdominal symptoms → abdominal pain", the path length is 3, and the weights of each edge are 0.9, 0.7, and 0.8, respectively. The overall connectivity strength is calculated to be 0.42.

[0113] When the connectivity strength is lower than a preset connectivity threshold, it is identified as a conflicting element pair. The preset connectivity threshold is set to 0.5. Since the aforementioned connectivity strength of 0.42 is less than the threshold of 0.5, (pain relief, abdominal pain 2) is identified as a conflicting element pair.

[0114] Calculate the centrality of conflicting elements with respect to their corresponding nodes. Use degree centrality and proximity centrality to calculate the importance of nodes in the time-series annotation graph. For the node "Pain Relief," its degree centrality is 2 and its proximity centrality is 0.6; for the node "Abdominal Pain 2," its degree centrality is 1 and its proximity centrality is 0.4.

[0115] The medical logical features are obtained by combining the query vectors of the corresponding complete clinical elements for conflicting element pairs with the time difference. For the conflicting element pair (pain relief, abdominal pain 2), the corresponding complete clinical element query vector is extracted and combined with the node centrality feature and the time difference (300 minutes) to form a comprehensive feature vector. The medical logical features are then obtained by solving the feature fusion method.

[0116] In this embodiment, by uniformly parsing and converting the time expressions in the semantically annotated discourse sequence into standard timestamps, relative temporal relationships are inferred using discourse position indexes in the absence of explicit time information, reducing logical breaks caused by missing time information. Complete clinical elements are used as nodes and combined with the causal dependencies between slots to construct a temporal annotation graph, so that time information no longer exists in isolation, improving the overall ability to depict the evolution of clinical events. By comparing the time difference between node pairs with the preset temporal constraint rules in the medical knowledge graph, potential time anomalies that violate medical common sense or treatment procedures can be automatically identified, avoiding false positives and false negatives caused by judging solely by text order. The semantic path connectivity strength in the medical knowledge graph is introduced to perform secondary verification of candidate conflicts, effectively filtering out false conflicts caused by expression omissions or semantic similarities, thus improving the accuracy of medical logical conflict identification.

[0117] In one alternative implementation,

[0118] A consistency score is obtained by verifying and scoring based on the medical logical features and the medical knowledge graph. Based on the consistency score, the retained representations are selected and updated to obtain the resolved clinical information representation, including:

[0119] Extract the node centrality feature and time difference from the medical logical features. Retrieve medical rules based on the complete clinical elements corresponding to the conflicting element pairs. Extract the causal and temporal constraints from the medical rules. Match the node centrality feature with the causal constraints to obtain the causal matching degree. Match the time difference with the temporal constraints to obtain the temporal matching degree. Perform a weighted fusion of the causal matching degree and the temporal matching degree to obtain the rule matching score. Calculate the semantic similarity between the query vector corresponding to the complete clinical element and the embedding vector of the concept node. Combine the rule matching score to obtain the consistency score of the conflicting element pairs.

[0120] Determine whether the consistency score is greater than a preset consistency threshold. If it is, then the complete clinical element corresponding to the preceding node in the conflicting element pair is taken as the retained clinical element. Otherwise, the complete clinical element corresponding to the following node in the conflicting element pair is taken as the retained clinical element. Obtain the semantically annotated discourse sequence fragment corresponding to the retained clinical element as the retained expression. Concatenate the query vectors of the semantically enhanced medical entities filled in each slot of the retained clinical element according to the slot order in the clinical element template and update the vector representation corresponding to the retained clinical element. Repeat the process until all conflicting element pairs are processed to obtain the resolved clinical information representation.

[0121] Node centrality features and time differences are extracted from medical logical features. Taking a patient's description of "starting with a fever of 39℃ three days ago, the temperature dropped to 37.5℃ after taking antipyretics, but yesterday afternoon the fever returned to 40℃" as an example, the identified conflicting element pairs are (temperature dropped to 37.5℃, fever 40℃). The centrality features of the node "temperature dropped to 37.5℃" are extracted from the medical logical features, including a degree centrality of 2.5 and a proximity centrality of 0.68; the centrality features of the node "fever 40℃" are extracted, including a degree centrality of 1.8 and a proximity centrality of 0.52. The time difference of 36 hours is also extracted.

[0122] Medical rules are retrieved based on the complete clinical elements corresponding to the conflicting element pairs. For the aforementioned conflicting element pairs, medical rules related to "fever" and "antipyretics" are retrieved from the medical knowledge base. The retrieved rules include: "The duration of action of common antipyretics is 4-6 hours," "If the body temperature is lowered by antipyretics and the primary disease is not controlled without continued medication, fever may recur," and "If the body temperature rises again above the original temperature within a short period after the fever subsides, it suggests that the condition may be worsening."

[0123] Extract causal and temporal constraints from the medical rules. From the aforementioned rules, extract the following causal constraints: "antipyretic → decreased body temperature," "primary disease uncontrolled → recurrence of fever," "worsening condition → body temperature exceeding the original temperature." Extract the following temporal constraints: "duration of antipyretic effect: 4-6 hours," "time interval between recurrence of fever > duration of drug effect."

[0124] The causal matching degree is obtained by matching the node centrality features with the causal constraints. The matching degree between the node centrality feature "body temperature drops to 37.5℃" and the causal relationship "antipyretic medication → body temperature decreases" is calculated, with a score of 0.85; the matching degree between the node centrality feature "high fever 40℃" and the causal relationships "primary disease not controlled → fever recurrence" and "illness worsens → body temperature exceeds the original body temperature" is calculated, with scores of 0.78 and 0.92 respectively. The highest value of 0.92 is taken as the matching degree.

[0125] The time difference is matched with the temporal constraints to obtain the temporal matching degree. The time difference of 36 hours is matched with "duration of antipyretic effect 4-6 hours" and "interval of re-fever > duration of drug effect". 36 hours is much longer than the duration of drug effect 4-6 hours, which satisfies the constraint "interval of re-fever > duration of drug effect", and the temporal matching degree is 0.95.

[0126] The rule matching score is obtained by weighting and fusing the causal matching degree and the temporal matching degree. The weight of causal matching degree is set to 0.6, and the weight of temporal matching degree is set to 0.4. The weighted sum is calculated as: 0.6×0.92+0.4×0.95=0.932, and the rule matching score is 0.932.

[0127] Calculate the semantic similarity between the query vector corresponding to the complete clinical element and the embedding vector of the concept node. Extract the query vector of the complete clinical element "body temperature drops to 37.5℃", calculate the cosine similarity with the embedding vector of the concept node "body temperature decreases", and get 0.88; extract the query vector of the complete clinical element "high fever 40℃", calculate the cosine similarity with the embedding vectors of the concept nodes "recurrence of fever" and "body temperature rises", and get 0.91 and 0.94 respectively, and take the highest value of 0.94.

[0128] The consistency score of conflicting element pairs is obtained by combining the rule matching score. The rule matching score is weighted at 0.7, and the semantic similarity weight is set at 0.3. The weighted sum is calculated as: 0.7 × 0.932 + 0.3 × 0.94 = 0.9344, yielding a consistency score of 0.93.

[0129] Determine if the consistency score is greater than the preset consistency threshold. The consistency threshold is set to 0.8. The consistency score of the aforementioned conflicting element pair is 0.93, which is greater than the threshold of 0.8. Therefore, the complete clinical element "body temperature drops to 37.5℃" corresponding to the preceding node in the conflicting element pair is retained as the clinical element.

[0130] Obtain semantically annotated discourse sequence fragments corresponding to the retained clinical elements as retained expressions. Extract the fragment "body temperature dropped to 37.5℃ after taking antipyretics" from the semantically annotated discourse sequence as a retained expression.

[0131] The query vectors of semantically enhanced medical entities that fill each slot in the retained clinical elements are concatenated according to the slot order in the clinical element template, and the vector representation corresponding to the retained clinical elements is updated. The template for retained clinical elements is {symptom feature: "body temperature drops to 37.5℃", time feature: "after medication", relief factor: "antipyretic"}. The query vectors of the semantically enhanced medical entities corresponding to each slot are extracted, concatenated according to the slot order to form a new vector representation, and the vector representation of the retained clinical elements is updated.

[0132] Taking another patient's description, "The patient experienced recurrent diarrhea for three days. Symptoms improved after taking antidiarrheal medication this morning, but mild abdominal pain recurred after eating at noon, without diarrhea," as an example, the identified conflicting element pair is (symptom relief, abdominal pain). Node centrality features and temporal differences are extracted, medical rules are retrieved, constraint relationships are extracted, and the matching degree and consistency score are calculated to be 0.75, which is less than the preset threshold of 0.8. Therefore, the complete clinical element corresponding to the subsequent node "abdominal pain" is selected as the retained clinical element, and the expression "mild abdominal pain recurred after eating at noon, without diarrhea" is extracted and the vector representation is updated.

[0133] For the patient's description of "the patient started coughing a week ago with white sputum, the sputum turned yellow three days ago, and this morning there was blood in the sputum," a temporal change was identified rather than a conflict, with "white sputum" → "yellow sputum" → "blood in the sputum" forming a temporal evolution relationship. The calculated consistency score was 0.96, which is greater than the threshold, so all clinical elements were retained and marked as a temporal evolution relationship rather than a conflict relationship.

[0134] Repeat the aforementioned process until all conflicting element pairs have been processed, resulting in a resolved clinical information representation. For multiple conflicting element pairs identified in the original clinical information representation, a consistency score is calculated, and it is determined whether to retain the clinical element corresponding to the preceding or succeeding node. In the resolved clinical information representation, the logical and temporal relationships between the clinical elements remain consistent, providing a logically unified information foundation for the subsequent automatic generation of medical records.

[0135] In this embodiment, by jointly evaluating medical rule constraints, temporal logic features, and semantic representation, refined resolution and consistency reconstruction of clinical information conflicts are achieved. By introducing node centrality features and temporal differences as important references for conflict determination, conflict resolution is no longer based solely on the order of expression or a single temporal information, avoiding the accidental deletion or weakening of core clinical information and improving the global consistency of conflict handling results. By matching conflicting elements with corresponding medical rules and calculating causal matching degree and temporal matching degree respectively, the judgment process of each pair of conflicting elements is subject to clear medical knowledge constraints, effectively reducing the logical bias problems common in insufficient empirical rules or purely data-driven methods, and enhancing the medical interpretability of conflict resolution decisions. By weighted fusion of causal matching degree and temporal matching degree to form a rule matching score, and combined with semantic similarity to jointly calculate a consistency score, misjudgment caused by relying solely on text similarity or a single rule hit is effectively avoided.

[0136] Figure 2 This is a flowchart illustrating the consistency scoring process between medical logical features and medical knowledge graphs in the intelligent automatic medical record generation method for doctor-patient dialogue based on semantic understanding, as described in an embodiment of the present invention.

[0137] In one alternative implementation,

[0138] Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Candidate positions are inferred from the semantically annotated discourse sequence based on the list of missing elements and consistency verification is performed. Electronic medical record documents are generated by mapping the verification results to a preset medical record document template, including:

[0139] Extract the semantically enhanced medical entities contained in the complete clinical elements in the dissolved clinical information representation, obtain the concept nodes corresponding to the semantically enhanced medical entities in the medical knowledge graph, and determine the set of necessary attributes by analyzing attribute dependencies. Compare the attributes contained in the complete clinical elements with the set of necessary attributes to identify missing attributes. Combine the identifiers of the complete clinical elements to form missing elements. Repeatedly identify and summarize to obtain a list of missing elements.

[0140] The position range of the complete clinical element corresponding to the missing element in the semantically labeled discourse sequence is obtained. The position range is expanded forward and backward by a preset window length to obtain an expanded range. Unlabeled discourse fragments within the expanded range are extracted and the semantic matching degree with the medical entity type corresponding to the missing element is calculated. The position corresponding to the maximum semantic matching degree is taken as a candidate position. The discourse fragments at the candidate positions are identified as medical entities and mapped to the medical knowledge graph to obtain supplementary semantically enhanced medical entities. The consistency between the supplementary semantically enhanced medical entities and the medical entity type corresponding to the missing element is verified. The verified supplementary semantically enhanced medical entities are filled into the missing attribute positions in the dissolved clinical information representation to obtain the complete clinical information representation.

[0141] The complete clinical information is mapped to the field slots of the preset medical record document template to obtain an electronic medical record document.

[0142] This process extracts semantically enhanced medical entities from the complete clinical information representation. Taking a patient's description of "persistent cough for two weeks, yellow sputum, and fever of 38.5℃" as an example, it extracts semantically enhanced medical entities from the complete clinical elements, such as "cough," "yellow sputum," "fever," and "38.5℃." Each semantically enhanced medical entity contains entity text, entity type, and entity attributes. For example, the entity type for "cough" is "symptom," and its attributes include "duration: two weeks"; the entity type for "yellow sputum" is "symptom characteristics," and its attributes include "color: yellow"; the entity type for "fever" is "symptom," and its attributes include "body temperature: 38.5℃."

[0143] Obtain the corresponding concept nodes of semantically enhanced medical entities in the medical knowledge graph and determine the necessary attribute set by analyzing attribute dependencies. For example, query the "cough" concept node in the medical knowledge graph, analyze the corresponding attribute dependencies, and determine the necessary attribute set as {duration, nature, frequency, and cause}. The current complete clinical element only contains the attribute "duration: two weeks," lacking the nature, frequency, and cause attributes. Similarly, query the "fever" concept node, and determine the necessary attribute set as {body temperature, duration, pattern, and accompanying symptoms}. The current complete clinical element only contains the attribute "body temperature: 38.5℃," lacking the duration, pattern, and accompanying symptoms attributes.

[0144] The missing attributes are identified by comparing the attributes included in the complete clinical element with the set of required attributes. For the complete clinical element "cough", the missing attributes {nature, frequency, and trigger} are identified by comparing the existing attribute {duration} with the set of required attributes {duration, nature, frequency, and trigger}. For the complete clinical element "fever", the missing attributes {duration, nature, frequency, and trigger} are identified by comparing the existing attribute {body temperature} with the set of required attributes {body temperature, duration, pattern, and accompanying symptoms}.

[0145] Missing elements are constructed by combining the identifiers of complete clinical elements. For "cough," a missing element {symptom: "cough," nature: NULL, frequency: NULL, cause: NULL} is constructed; for "fever," a missing element {symptom: "fever," duration: NULL, pattern: NULL, accompanying symptoms: NULL} is constructed. The aforementioned identification process is repeated for all complete clinical elements in the resolved clinical information representation, and the missing element list is obtained by summarizing the results.

[0146] Obtain the position interval of the complete clinical element corresponding to the missing element in the semantically labeled discourse sequence. The position interval of the complete clinical element for "cough" in the semantically labeled discourse sequence is [2, 6], and the position interval of the complete clinical element for "fever" is [14, 18]. Expand the position interval forward and backward by a preset window length. Setting the preset window length to 10 words, the expanded interval for "cough" is [0, 16], and the expanded interval for "fever" is [4, 28].

[0147] Unlabeled discourse fragments within the extended interval were extracted, and semantic matching scores were calculated for the medical entity types corresponding to the missing elements. For the "nature" attribute in the missing element "cough," unlabeled discourse fragments such as "mainly dry cough" and "more pronounced at night" were extracted within the extended interval [0, 16], and semantic matching scores were calculated for the "cough nature" medical entity type. Using a pre-trained medical domain semantic similarity model, the semantic matching score for "mainly dry cough" was calculated to be 0.92, and the semantic matching score for "more pronounced at night" was 0.43. For the "frequency" attribute, the semantic matching score for the extracted fragment "more than ten times a day" was 0.88. For the "triggers" attribute, the semantic matching score for the extracted fragment "started after catching a cold" was 0.79.

[0148] The position corresponding to the maximum semantic matching degree is selected as the candidate position. The candidate position for the "nature" attribute corresponds to the fragment "mainly dry cough", the candidate position for the "frequency" attribute corresponds to the fragment "more than ten times a day", and the candidate position for the "cause" attribute corresponds to the fragment "started after catching a cold". Medical entity recognition is performed on the utterance fragments at the candidate positions and mapped to the medical knowledge graph to obtain supplementary semantically enhanced medical entities. Through medical entity recognition, the entity "dry cough" is identified from "mainly dry cough", with the type "cough nature"; the entity "more than ten times / day" is identified from "more than ten times a day", with the type "frequency"; and the entity "catching a cold" is identified from "started after catching a cold", with the type "cause". The entities are mapped to the medical knowledge graph to obtain the supplementary semantically enhanced medical entity {nature: "dry cough", frequency: "more than ten times / day", cause: "catching a cold"}.

[0149] Verify the consistency between the supplementary semantically enhanced medical entities and the corresponding medical entity types of the missing elements. For the supplementary semantically enhanced medical entity "cough," verify whether "dry cough" belongs to the "cough nature" type, whether "more than ten times / day" belongs to the "frequency" type, and whether "cold exposure" belongs to the "triggering factor" type. The consistency of types is confirmed by querying the medical knowledge graph, and the verification passes. The verified supplementary semantically enhanced medical entities are then filled into the missing attribute positions in the dissolved clinical information representation. The updated complete clinical element is {symptom: "cough," duration: "two weeks," nature: "dry cough," frequency: "more than ten times / day," triggering factor: "cold exposure"}. Similarly, the aforementioned process is performed on the missing element "fever," identifying and supplementing the missing attributes from the extended range.

[0150] Repeat the above completion process for all missing elements in the eliminated clinical information representation to obtain a complete clinical information representation. The complete clinical information representation includes comprehensive clinical elements such as symptoms, signs, past medical history, and family history, with the attribute information of each clinical element being fully supplemented and improved.

[0151] Electronic medical records are generated by mapping complete clinical information representations to field slots in a pre-defined medical record document template. The pre-defined template includes field slots for chief complaint, present illness, past medical history, personal history, family history, physical examination, auxiliary examinations, and diagnosis. Based on the type and attributes of each clinical element in the complete clinical information representation, it is mapped to the corresponding field slot. For example, symptom-related clinical elements are mapped to the "chief complaint" and "present illness" fields; past medical history-related clinical elements are mapped to the "past medical history" field; family medical history-related clinical elements are mapped to the "family history" field; and physical examination-related clinical elements are mapped to the "physical examination" field. For each field, text content conforming to the medical record format is generated based on medical narrative standards and the temporal logical relationship between clinical elements. For example, the "present illness" field might generate: "The patient developed a dry cough two weeks ago after catching a cold, occurring more than ten times a day, accompanied by yellow sputum. Recently, fever has developed, with a maximum temperature of 38.5℃." The generated electronic medical record documents are structurally complete, accurate in content, and logically coherent, meeting the requirements of clinical document standards.

[0152] In this embodiment, by analyzing the attribute dependencies of semantically enhanced medical entities in the medical knowledge graph and determining the necessary attribute set, the determination of the completeness of clinical elements has a clear medical semantic basis. This enables more accurate identification of key missing information that truly affects clinical use, improving the professionalism and reliability of missing element identification. By combining the position range of complete clinical elements in the dialogue and expanding the context before and after, potential supplementary information is actively searched in the real doctor-patient communication context, significantly improving the coverage of missing information discovery. By semantically matching unlabeled utterance fragments and locating the position most likely to carry missing medical information, and then performing medical entity identification and knowledge graph mapping, the completion process is constrained in terms of both semantic consistency and medical type consistency, reducing the risk of incorrect or cross-type completion and improving the accuracy and controllability of supplementary information.

[0153] A second aspect of this invention provides an intelligent automatic medical record generation system based on semantic understanding for doctor-patient dialogue, comprising:

[0154] The semantic mapping module is used to acquire doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in the pre-built medical knowledge graph to obtain semantically annotated discourse sequences.

[0155] The network construction module is used to calculate the semantic dependency strength between each position and the preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Based on the multi-layer semantic association network, homologous semantic fragments are identified, and complete clinical elements are constructed based on the homologous semantic fragments and structural clinical information representations are extracted.

[0156] The temporal resolution module is used to construct a temporal constraint graph based on the structured clinical information representation and mark the time position of each clinical element to obtain a temporal annotation graph. It analyzes the temporal annotation graph to identify conflicting element pairs and extracts the corresponding medical logical features. It performs verification scoring based on the medical logical features and the medical knowledge graph to obtain a consistency score. Based on the consistency score, it selects the retained expressions and updates them to obtain the resolved clinical information representation.

[0157] The completion generation module is used to identify and resolve missing attributes in clinical information representation based on the attribute dependency relationship of concept nodes in the medical knowledge graph to obtain a list of missing elements. Based on the list of missing elements, it backtracks to the semantically labeled discourse sequence to infer candidate positions and performs consistency verification. Based on the verification results, it maps and generates electronic medical record documents with preset medical record document templates.

[0158] A third aspect of the present invention provides an electronic device, comprising:

[0159] A processor and a memory for storing processor-executable instructions, wherein the processor is configured to invoke instructions stored in the memory to perform the aforementioned method.

[0160] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0161] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for intelligent automatic medical record generation based on semantic understanding of doctor-patient dialogue, characterized in that, include: Obtain doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in a pre-constructed medical knowledge graph to obtain semantically annotated discourse sequences; Calculate the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Identify homologous semantic fragments based on the multi-layer semantic association network, construct complete clinical elements based on the homologous semantic fragments, and extract structural clinical information representations. Based on the structured clinical information representation, a time constraint graph is constructed and the time position of each clinical element is marked to obtain a time series annotation graph. The time series annotation graph is analyzed to identify conflicting element pairs and extract the corresponding medical logical features. Based on the medical logical features and the medical knowledge graph, a verification score is obtained to obtain a consistency score. Based on the consistency score, the retained expressions are selected and updated to obtain the resolved clinical information representation. Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, the missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Based on the list of missing elements, the candidate positions are inferred by tracing back to the semantically labeled discourse sequence and consistency verification is performed. Based on the verification results, an electronic medical record document is generated by mapping with a preset medical record document template.

2. The method according to claim 1, characterized in that, The process involves acquiring doctor-patient dialogue data, performing semantic parsing to obtain medical entities, and mapping them to corresponding concept nodes in a pre-constructed medical knowledge graph. This results in a semantically annotated discourse sequence, including: Doctor-patient dialogue data is obtained from a medical information system. Each utterance fragment in the doctor-patient dialogue data is segmented into words and part-of-speech features are extracted to obtain a part-of-speech tagging sequence. Named entity boundaries are identified based on the part-of-speech tagging sequence and candidate medical entities are extracted. The similarity between the context semantic vector corresponding to the candidate medical entity and the semantic vector corresponding to the candidate node in the pre-constructed medical knowledge graph is calculated to obtain the mapping score distribution. The candidate node with the highest mapping score is selected as the mapping target corresponding to the candidate medical entity, marked as a concept node, and a mapping relationship between the candidate medical entity and the concept node is established. Based on the mapping relationship, the attribute information and association relationship of concept nodes in the medical knowledge graph are extracted. The attribute information and association relationship are attached to the corresponding candidate medical entities to obtain semantically enhanced medical entities. Based on the order of appearance of the semantically enhanced medical entities in the dialogue data, a semantically annotated discourse sequence is constructed.

3. The method according to claim 1, characterized in that, Calculating the semantic dependency strength between each position and its preceding position in the semantically annotated discourse sequence, encoding the contextual semantic features of each position, and constructing a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength includes: Extract the word vector of the semantically enhanced medical entity corresponding to each position in the semantically annotated discourse sequence and the embedding vector of the concept node corresponding to the semantically enhanced medical entity. Concatenate the word vector and the embedding vector and perform a linear transformation to obtain the query representation. Generate the key-value pair representation of the previous position corresponding to the current position. Calculate the dot product of the query representation and the key-value pair representation to obtain the semantic dependency strength. Repeat the calculation to obtain the dependency strength matrix. Extract semantically enhanced medical entities within a preset window range before and after each position in the semantically labeled discourse sequence and solve for the fusion vector. Perform bidirectional cyclic encoding on the fusion vector to obtain the context semantic vector. Calculate the hierarchical distance between the concept node and the parent and child nodes in the medical knowledge graph to obtain a hierarchical association graph. Weightedly fuse the context semantic vector and the hierarchical distance to obtain a hierarchical enhanced semantic vector. Filter the preceding positions in the dependency strength matrix with semantic dependency strength higher than a preset threshold to obtain a set of strongly dependent preceding positions. Calculate the cosine similarity between the hierarchical enhanced semantic vector at the current position and the hierarchical enhanced semantic vectors at the preceding positions in the set of strongly dependent preceding positions to obtain a semantic consistency score. Update the hierarchical association graph based on the semantic consistency score to obtain a multi-layer semantic association network.

4. The method according to claim 1, characterized in that, Based on the aforementioned multi-layer semantic association network, homologous semantic segments are identified. Based on these homologous semantic segments, complete clinical elements are constructed, and structural clinical information representations are extracted, including: The concept nodes in the multi-layer semantic association network are traversed and the corresponding semantic association edges are extracted. The concept nodes connected by the semantic association edges are obtained and the semantic distance between the concept nodes is calculated in the medical knowledge graph. Concept nodes with semantic distances less than a preset distance threshold are filtered and a candidate homologous node set is constructed. The position index of the semantically enhanced medical entity corresponding to each candidate homologous node in the candidate homologous node set is extracted in the semantically labeled discourse sequence. It is determined whether the interval between the position indices is less than a preset interval threshold. If so, the current candidate homologous node and the corresponding semantically enhanced medical entity are classified as homologous semantic fragments. The attribute types of the concept nodes corresponding to each semantically enhanced medical entity in the homologous semantic fragments are extracted in the medical knowledge graph. According to the attribute types, a predefined clinical element template is matched, and the semantically enhanced medical entities in the homologous semantic fragments are filled into the corresponding slots according to the attribute types. The filling completeness of each slot in the clinical element template is detected. When there are unfilled slots, concept nodes that are semantically related to the filled slots are retrieved from the multi-layer semantic association network. The corresponding semantically enhanced medical entities are extracted and added to the unfilled slots to form complete clinical elements. The structural clinical information representation is extracted based on the complete clinical elements.

5. The method according to claim 1, characterized in that, Based on the structural clinical information representation, a time constraint graph is constructed and the time position of each clinical element is labeled to obtain a time-series annotation graph. Analyzing the time-series annotation graph to identify conflicting element pairs and extracting the corresponding medical logical features includes: The semantically labeled discourse sequence fragments corresponding to complete clinical elements in the structured clinical information representation are parsed and the corresponding time expressions are extracted and converted to obtain standard timestamps. If no time expression exists, the relative temporal relationship is inferred based on the position index corresponding to the semantically labeled discourse sequence fragments. The complete clinical elements are used as nodes in the temporal constraint graph, and the standard timestamps or the relative temporal relationships are used as time attributes. Directed edges are established for the causal dependencies between different slots in the complete clinical elements. The time attributes are labeled to the nodes to obtain the temporal annotation graph. The time difference between each pair of nodes in the temporal annotation graph is calculated. When the time difference violates the preset temporal constraint rules in the medical knowledge graph, the current pair of nodes is marked as a candidate conflicting element pair. The semantic path of the concept node corresponding to the semantically enhanced medical entity in the complete clinical element corresponding to the candidate conflicting element pair is retrieved in the medical knowledge graph. The connectivity strength of the semantic path is calculated. When the connectivity strength is lower than a preset connectivity threshold, it is confirmed as a conflicting element pair. The node centrality feature corresponding to the conflicting element pair is calculated. The medical logical feature is obtained by combining the query vector of the complete clinical element corresponding to the conflicting element pair with the time difference.

6. The method according to claim 1, characterized in that, A consistency score is obtained by verifying and scoring based on the medical logical features and the medical knowledge graph. Based on the consistency score, the retained representations are selected and updated to obtain the resolved clinical information representation, including: Extract the node centrality feature and time difference from the medical logical features. Retrieve medical rules based on the complete clinical elements corresponding to the conflicting element pairs. Extract the causal and temporal constraints from the medical rules. Match the node centrality feature with the causal constraints to obtain the causal matching degree. Match the time difference with the temporal constraints to obtain the temporal matching degree. Perform a weighted fusion of the causal matching degree and the temporal matching degree to obtain the rule matching score. Calculate the semantic similarity between the query vector corresponding to the complete clinical element and the embedding vector of the concept node. Combine the rule matching score to obtain the consistency score of the conflicting element pairs. Determine whether the consistency score is greater than a preset consistency threshold. If it is, then the complete clinical element corresponding to the preceding node in the conflicting element pair is taken as the retained clinical element. Otherwise, the complete clinical element corresponding to the following node in the conflicting element pair is taken as the retained clinical element. Obtain the semantically annotated discourse sequence fragment corresponding to the retained clinical element as the retained expression. Concatenate the query vectors of the semantically enhanced medical entities filled in each slot of the retained clinical element according to the slot order in the clinical element template and update the vector representation corresponding to the retained clinical element. Repeat the process until all conflicting element pairs are processed to obtain the resolved clinical information representation.

7. The method according to claim 1, characterized in that, Based on the attribute dependency relationship identification of concept nodes in the medical knowledge graph, missing attributes in the clinical information representation are resolved to obtain a list of missing elements. Candidate positions are inferred from the semantically annotated discourse sequence based on the list of missing elements and consistency verification is performed. Electronic medical record documents are generated by mapping the verification results to a preset medical record document template, including: Extract the semantically enhanced medical entities contained in the complete clinical elements in the dissolved clinical information representation, obtain the concept nodes corresponding to the semantically enhanced medical entities in the medical knowledge graph, and determine the set of necessary attributes by analyzing attribute dependencies. Compare the attributes contained in the complete clinical elements with the set of necessary attributes to identify missing attributes. Combine the identifiers of the complete clinical elements to form missing elements. Repeatedly identify and summarize to obtain a list of missing elements. The position range of the complete clinical element corresponding to the missing element in the semantically labeled discourse sequence is obtained. The position range is expanded forward and backward by a preset window length to obtain an expanded range. Unlabeled discourse fragments within the expanded range are extracted and the semantic matching degree with the medical entity type corresponding to the missing element is calculated. The position corresponding to the maximum semantic matching degree is taken as a candidate position. The discourse fragments at the candidate positions are identified as medical entities and mapped to the medical knowledge graph to obtain supplementary semantically enhanced medical entities. The consistency between the supplementary semantically enhanced medical entities and the medical entity type corresponding to the missing element is verified. The verified supplementary semantically enhanced medical entities are filled into the missing attribute positions in the dissolved clinical information representation to obtain the complete clinical information representation. The complete clinical information is mapped to the field slots of the preset medical record document template to obtain an electronic medical record document.

8. A semantic understanding-based intelligent medical record automatic generation system for doctor-patient dialogue, used to implement the method of any one of claims 1-7, characterized in that, include: The semantic mapping module is used to acquire doctor-patient dialogue data, perform semantic parsing to obtain medical entities, and map them to the corresponding concept nodes in the pre-built medical knowledge graph to obtain semantically annotated discourse sequences. The network construction module is used to calculate the semantic dependency strength between each position and the preceding position in the semantically annotated discourse sequence, encode the contextual semantic features of each position, and construct a multi-layer semantic association network by combining the hierarchical relationship between concept nodes and the semantic dependency strength. Based on the multi-layer semantic association network, homologous semantic fragments are identified, and complete clinical elements are constructed based on the homologous semantic fragments and structural clinical information representations are extracted. The temporal resolution module is used to construct a temporal constraint graph based on the structured clinical information representation and mark the time position of each clinical element to obtain a temporal annotation graph. It analyzes the temporal annotation graph to identify conflicting element pairs and extracts the corresponding medical logical features. It performs verification scoring based on the medical logical features and the medical knowledge graph to obtain a consistency score. Based on the consistency score, it selects the retained expressions and updates them to obtain the resolved clinical information representation. The completion generation module is used to identify and resolve missing attributes in clinical information representation based on the attribute dependency relationship of concept nodes in the medical knowledge graph to obtain a list of missing elements. Based on the list of missing elements, it backtracks to the semantically labeled discourse sequence to infer candidate positions and performs consistency verification. Based on the verification results, it maps and generates electronic medical record documents with preset medical record document templates.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.