Medical text understanding method and device, electronic equipment and storage medium

By introducing a lightweight knowledge projection adapter and medical knowledge graph alignment during the fine-tuning stage of the large language model, the problem of insufficient understanding ability of the large language model in the medical field is solved, and efficient medical text understanding is achieved.

CN121328564APending Publication Date: 2026-01-13DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511473433.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing large language models lack domain-specific knowledge in medical applications, resulting in poor performance in understanding medical texts, especially in tasks such as key entity recognition, logical reasoning, and clinical decision support, where their generalization ability is limited.

Method used

In the fine-tuning stage of the large language model, a lightweight knowledge projection adapter is introduced. The hidden state matrix is ​​mapped to the medical knowledge space and back-mapped through a feedforward network to realize the injection of medical knowledge. At the same time, the medical knowledge graph is used to optimize entity alignment and relation comparison loss.

Benefits of technology

It significantly reduces computational overhead and improves the accuracy and ability of large language models in understanding medical texts, enhancing the performance of key entity recognition and logical reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328564A_ABST
    Figure CN121328564A_ABST
Patent Text Reader

Abstract

The invention relates to a medical text understanding method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a to-be-understood medical text; the to-be-understood medical text is input into the large language model, a text understanding result of the to-be-understood medical text is obtained, and the text understanding result comprises understanding results of symptoms, diagnostic logic or treatment schemes; wherein a knowledge projection adapter is connected between every two adjacent Transform layers in the large language model. By means of the method, the knowledge projection adapter is introduced in the fine tuning stage, medical knowledge injection can be achieved without re-pre-training, the calculation cost is remarkably reduced, meanwhile, after the medical knowledge is injected, the understanding ability of the large language model is improved, and the medical text to be understood can be more accurately understood based on the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large language model technology, and more specifically, to a medical text understanding method, apparatus, electronic device, and storage medium. Background Technology

[0002] In recent years, Large Language Models (LLMs) have demonstrated outstanding performance in general natural language processing tasks. However, when directly applied to highly specialized fields such as medicine, these models often perform poorly due to a lack of domain-specific knowledge. Medical texts are characterized by dense terminology, rigorous sentence structure, and a high semantic dependence on medical ontologies (such as ICD, SNOMED CT, UMLS, etc.), making it difficult for general pre-trained models to accurately understand the complex relationships between symptom descriptions, diagnostic logic, or treatment plans. Existing techniques typically employ continued pre-training on medical corpora or instruction tuning strategies, but these methods fail to explicitly model the medical knowledge structure, resulting in limited generalization ability of the models in tasks such as key entity recognition, logical reasoning, and clinical decision support.

[0003] Existing mainstream methods include: (1) domain-adaptive pre-training, which involves continuing to train the language model on large-scale medical texts; (2) introducing external knowledge bases based on prompting or retrieval-enhanced generation (RAG); and (3) adding entity recognition or multi-task objectives during the fine-tuning stage. However, these methods have obvious limitations: domain-adaptive pre-training has high computational costs and cannot guarantee knowledge structure alignment; RAG relies on external retrieval modules, has high inference latency, and is difficult to optimize end-to-end; while multi-task fine-tuning improves the performance of specific sub-tasks, it does not integrate the topological relationships of the medical knowledge graph into the model's internal representation. Therefore, there is an urgent need for a new architecture that can deeply inject structured medical knowledge into the model's internal representation during the fine-tuning stage while maintaining the fluency of language generation. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a medical text understanding method, device, electronic device and storage medium, which aims to solve at least one of the above-mentioned technical problems.

[0005] In a first aspect, the technical solution of the present invention to solve the above-mentioned technical problems is as follows: a medical text understanding method, the method comprising: Obtaining medical text to be understood; The medical text to be understood is input into a large language model to obtain the text understanding results of the medical text to be understood, which include the understanding results of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back. The knowledge-enhanced hidden state matrix with the same dimension as the hidden state matrix is ​​output to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

[0006] The beneficial effects of this invention are: for large language models, the introduction of a knowledge projection adapter during the fine-tuning stage enables the injection of medical knowledge without the need for re-pre-training, significantly reducing computational overhead. At the same time, the injection of medical knowledge improves the understanding ability of the large language model, enabling it to more accurately understand the medical text to be understood.

[0007] Based on the above technical solution, the present invention can be further improved as follows.

[0008] Furthermore, for the knowledge-enhanced hidden state matrix output by each knowledge projection adapter, the above method also includes: Based on the knowledge-enhanced hidden state matrix, medical named entities in the medical text to be understood are identified; For each medical named entity, the medical named entity is aligned with the medical knowledge graph to learn the standard conceptual semantics of the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity, and to determine the text understanding result based on the target feature vector.

[0009] Furthermore, the total loss function value of the aforementioned large language model during the training phase includes a first loss function value, which represents the difference between the target feature vector corresponding to each medical named entity and the corresponding real feature vector in the medical knowledge graph.

[0010] Furthermore, the total loss function value mentioned above also includes a second loss function value, which characterizes the difference between the predicted triples and the true triples for each medical named entity. The predicted triples are output by the large language model during the training phase, while the true triples are determined through the medical knowledge graph. For any triple between the true and predicted triples, the triples describe the contextual relationship of the corresponding medical named entity in the medical world.

[0011] Furthermore, the second loss function value mentioned above is determined based on the contrastive loss function, which is a loss value determined based on positive sample pairs and negative sample pairs.

[0012] Furthermore, the above-mentioned input of the medical text to be understood into the large language model yields the text understanding results of the medical text to be understood, including: The medical text to be understood is input into a large language model to obtain medical named entities in the medical text. Based on each medical named entity in the medical text to be understood, determine the triple corresponding to each medical named entity; The text understanding result is determined based on the triples corresponding to each medical named entity.

[0013] Secondly, in order to solve the above-mentioned technical problems, the present invention also provides a medical text understanding device, the device comprising: The acquisition module is used to acquire the medical text to be understood. The understanding module is used to input the medical text to be understood into the large language model and obtain the text understanding results of the medical text to be understood. The text understanding results include the understanding results of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back. The knowledge-enhanced hidden state matrix with the same dimension as the hidden state matrix is ​​output to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

[0014] Thirdly, in order to solve the above-mentioned technical problems, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the medical text understanding method of the present application.

[0015] Fourthly, in order to solve the above-mentioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the medical text understanding method of the present application.

[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of this application. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below.

[0018] Figure 1 A flowchart illustrating a medical text understanding method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a medical text understanding device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0019] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0020] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with 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. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0021] The solutions provided in these embodiments of the invention are applicable to any application scenario requiring the understanding of medical text. The solutions provided in these embodiments of the invention can be executed by any electronic device, such as a user's terminal device, including at least one of the following: smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, smart TV, and smart in-vehicle device.

[0022] This invention provides a possible implementation, such as... Figure 1 The diagram shows a flowchart of a medical text understanding method. This method can be executed by any electronic device, such as a terminal device, or jointly executed by a terminal device and a server. For ease of description, the method provided in this embodiment will be described below using a terminal device as the execution subject as an example. Figure 1 The flowchart shown indicates that the method may include the following steps: S10, Obtain the medical text to be understood; S20, Input the medical text to be understood into the large language model to obtain the text understanding result of the medical text to be understood. The text understanding result includes the understanding result of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back. The knowledge-enhanced hidden state matrix with the same dimension as the hidden state matrix is ​​output to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

[0023] The method of this invention introduces a knowledge projection adapter during the fine-tuning stage for large language models, enabling the injection of medical knowledge without re-pre-training, significantly reducing computational overhead. At the same time, the injection of medical knowledge improves the understanding ability of the large language model, enabling it to more accurately understand the medical text to be understood.

[0024] The following specific embodiments further illustrate the solution of the present invention. In this embodiment, a medical text understanding method may include the following steps: S10, Obtain the medical text to be understood; S20, Input the medical text to be understood into the large language model to obtain the text understanding result of the medical text to be understood. The text understanding result includes the understanding result of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter (KPA) is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter receives the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, maps the hidden state matrix to the medical knowledge space through a feedforward network and then maps it back, outputting a knowledge-enhanced hidden state matrix of the same dimension as the hidden state matrix to the next Transformer layer. The hidden state features are the semantic feature representations of the medical text to be understood.

[0025] The knowledge projection adapter can be a lightweight adaptation module, and the hidden state matrix output by the previous Transformer layer can be represented as follows: (Where L is the sequence length of the medical text to be understood, and d is the dimension of the hidden state matrix). Alternatively, the hidden state matrix can be understood as a general semantic feature representation of the medical text at each token position, containing both medical named entity tokens and semantic information of non-medical named entity tokens.

[0026] The knowledge-enhanced hidden state matrix can be represented as: in, , Here are the trainable parameters, and k is the knowledge embedding dimension (usually...). ), which is the dimension of the embedding vectors associated with the medical text to be understood in the external knowledge graph (i.e., the medical knowledge graph mentioned below), GeLU is the Gaussian error linear unit activation function, and LayerNorm is the layer normalization. Output The knowledge-enhanced representation, namely the knowledge-enhanced hidden state matrix Z, is used for subsequent layer calculations.

[0027] In this process, the external knowledge graph pre-represents each medical concept and relation as an embedding vector of a fixed dimension k (e.g., k=100), which is independent of the length of the input text and the hidden dimension d of the model. In the entity linking stage, the medical named entities in the medical text to be understood are pointed to the corresponding embedding vectors only by mapping the IDs of the medical named entities in the medical text to be understood.

[0028] Here, the "medical knowledge space" is the low-dimensional vector space (dimension k) corresponding to all embedded vectors in the external knowledge graph. The hidden state matrix is ​​temporarily projected onto this space to "align" with the pre-stored medical semantics in the medical knowledge graph; after alignment, it is projected back into the model space to continue calculation.

[0029] Optionally, for each knowledge-enhanced hidden state matrix output by the knowledge projection adapter, the method further includes: Based on the knowledge-enhanced hidden state matrix, medical named entities in the medical text to be understood are identified; For each medical named entity, the medical named entity is aligned with the medical knowledge graph to learn the standard conceptual semantics of the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity, and to determine the text understanding result based on the target feature vector.

[0030] The purpose of the above alignment process is to ensure that the knowledge-enhancing hidden state matrix used for computation within the model and the "standard answer" in the medical knowledge graph are aligned on the same level. This ensures that when the model mentions "diabetes," it thinks of the concept of "diabetes" in the medical knowledge graph, rather than other miscellaneous semantics, thereby reducing errors and making the model more professional in subsequent generation or reasoning.

[0031] As an example, medical named entities can be diseases, drugs, symptoms, etc.

[0032] In a medical knowledge graph, each node represents a standard medical concept, and each edge represents the clinical relationship between two corresponding nodes. For example, if two nodes are Disease 1 and Disease 2, the relationship between them could be that Disease 2 is a complication of Disease 1. For each medical named entity in the medical text to be understood, the corresponding standard medical concept (also known as standard concept semantics) and the clinical relationships between that medical named entity and other concepts (other nodes) can be found from the medical knowledge graph as entity linking results. ,in, This indicates that the i-th medical named entity in the medical text to be understood has a corresponding standard medical concept in the medical knowledge graph. This represents the set of all standard medical concepts in a medical knowledge graph. If it is a non-entity, then... .

[0033] During the training phase of the large language model, the training process for the sample medical text is as follows: The sample medical text is input into the large language model, and the hidden state matrix is ​​output through the Transformer layer in the large language model. Then, the hidden state matrix is ​​received through the knowledge projection adapter connected to the Transformer layer, and the hidden state matrix is ​​mapped to the medical knowledge space and then mapped back through the feedforward network. The knowledge-enhanced hidden state matrix with the same dimension as the hidden state matrix is ​​output to the next Transformer layer.

[0034] Based on this, the method also includes: For each knowledge projection adapter's output knowledge-enhanced hidden state matrix, medical named entities in the sample medical text are identified based on the knowledge-enhanced hidden state matrix. For each medical named entity, alignment is performed based on the medical named entity and the medical knowledge graph to learn the standard conceptual semantics corresponding to the medical named entity in the medical knowledge graph and the clinical relationships between the medical named entity and other concepts. Specifically, the corresponding standard conceptual semantics and the clinical relationships between the medical named entity and other concepts are embedded in the feature representation corresponding to the medical named entity. The embedded vector can be represented as: After embedding, the target feature vector corresponding to the medical named entity is obtained. That is, the target feature vector contains the embedded vector, so as to determine the text understanding result based on the target feature vector. Based on this, the total loss function value of the large language model during the training phase includes the first loss function value, which represents the difference between the target feature vector corresponding to each medical named entity and the corresponding true feature vector in the medical knowledge graph. Specifically, it can be expressed as: in, This represents the value of the first loss function. This represents a set of location indexes for medical named entities. This represents the i-th row of the knowledge-enhanced hidden state matrix Z. This represents the learnable projection matrix used to embed medical knowledge into the model's hidden space. This loss term (the first loss function value) forces the model to maintain semantic consistency between the representation of medical named entities within the model and their representation in the medical knowledge graph.

[0035] After learning the standard conceptual semantics of medical named entities in the medical knowledge graph and the clinical relationships between medical named entities and other concepts, the text understanding results can be determined based on the target feature vector, that is, the predicted text understanding results of the large language model during the training process.

[0036] Therefore, based on the difference between the predicted text understanding result and the actual text understanding result, the value of the third loss function can be determined, expressed as: The third loss function value can be determined through the cross-entropy loss function, and the total loss function value can be determined based on the first and third loss function values.

[0037] Furthermore, based on the above training process, the total loss function value also includes a second loss function value. This second loss function value characterizes the difference between the predicted triples and the true triples for each medical named entity. The predicted triples are output by the large language model during the training phase, while the true triples are determined through the medical knowledge graph. For any triple between the true and predicted triples, the triple describes the contextual relationship of the corresponding medical named entity in the medical world. At this point, the total loss function value can be determined based on the first, second, and third loss function values.

[0038] Specifically, it can be expressed as: in, These are hyperparameters that control the weights of knowledge alignment and relationship comparison, respectively. This represents the total loss function value. This represents the value of the third loss function. This represents the value of the first loss function. This represents the value of the second loss function.

[0039] Optionally, the value of the second loss function can be determined based on the following method: Based on each medical named entity in the sample medical text, a large language model is used to determine the corresponding predicted triple for each medical named entity. Each predicted triple describes the contextual relationship of the corresponding medical named entity in the medical world, that is, the logical relationship between medical concepts, which may include etiology, complications, drugs, and contraindications. As an example, a predicted triple can be represented as: The predicted triples consist of a head entity, a relation, and a tail entity. The head entity represents each medical named entity in the sample medical text, the tail entity represents the entity associated with the corresponding medical named entity, and the relation represents the contextual relationship between the head entity and the tail entity, that is, the logical relationship between medical concepts, such as "diabetes → complications → retinopathy".

[0040] Based on each medical named entity in the sample medical text, the true triplet corresponding to each medical named entity is determined through a medical knowledge graph. Then, based on the difference between the predicted triplet and the true triplet for each medical named entity, the value of the second loss function is determined.

[0041] Optionally, the second loss function value is determined based on the contrastive loss function, which is a loss value determined based on positive sample pairs and negative sample pairs.

[0042] Among them, positive sample pairs refer to triples existing in the medical knowledge graph, namely "head entity + relation + correct tail entity", while negative sample pairs refer to artificially created fake relations by randomly replacing the tail entity (or head entity) of the same triple with irrelevant entities in the medical knowledge graph.

[0043] The purpose of training a large language model is to make the vector distance between positive samples closer and the vector distance between negative samples farther.

[0044] Specifically, the value of the second loss function can be determined based on the following method: The first similarity of positive sample pairs is calculated as follows: in, Indicates the first similarity. The vector representation of the head entity. represents the vector representation of the tail entity, and r represents the vector representation of the relation.

[0045] For the same head entity and relation, sample negative tail entities from the medical knowledge graph. We obtain negative sample pairs, calculate the second similarity of the negative sample pairs, and express it as: in, Indicates the second similarity. A vector representation of a negative-tailed entity.

[0046] The second loss function value (also known as the relation-aware contrastive loss value) can be expressed as: in, This represents the value of the second loss function, where N represents the number of positive sample pairs in a batch. This represents the first similarity of the nth positive sample pair. Let M represent the second similarity between the nth positive sample pair and the mth negative sample pair, where M represents the number of negative sample pairs corresponding to each positive sample pair. The temperature coefficient (usually set to 0.05~0.1) is used to adjust the sharpness of the distribution. This loss is trained end-to-end, enabling the model to implicitly learn the logical transmission paths between medical concepts.

[0047] In practical applications, after inputting the medical text to be understood into a large language model, the text understanding result of the medical text can be obtained based on the following processing: The medical text to be understood is input into a large language model to identify medical named entities in the medical text. Based on each medical named entity in the medical text to be understood, determine the triple corresponding to each medical named entity; The text understanding result is determined based on the triples corresponding to each medical named entity.

[0048] or, For each medical named entity, alignment processing is performed based on the medical named entity and the medical knowledge graph to learn the standard conceptual semantics corresponding to the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, thereby obtaining the target feature vector corresponding to the medical named entity; based on the target feature vector corresponding to each medical named entity, the text understanding result is obtained.

[0049] or, For each medical named entity, the medical named entity is aligned with the medical knowledge graph to learn the standard concept semantics corresponding to the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity. Based on the target feature vector corresponding to each medical named entity, determine the triplet corresponding to each medical named entity; The text understanding result is determined based on the triples corresponding to each medical named entity.

[0050] Compared with the prior art, the innovation of this invention is as follows: (1) A lightweight knowledge projection adapter is introduced in the fine-tuning stage, which can realize knowledge injection without re-pre-training and significantly reduce the computational overhead; (2) The entity alignment loss and relation contrast loss are jointly optimized so that the model can not only remember isolated medical concepts, but also understand their logical connections; (3) Knowledge embedding and language model representation are dynamically aligned through learnable projection, avoiding the representation rigidity problem caused by fixed embedding.

[0051] Experiments show that, on benchmark tasks such as MIMIC-III clinical note comprehension and MedQA medical question answering, this architecture improves the F1 score by an average of 4.2 to 7.8 percentage points compared to the standard fine-tuning and RAG methods, while maintaining the fluency and clinical rationality of the generated text. This solution is suitable for medical AI applications such as electronic medical record analysis, intelligent consultation, and medical literature summarization.

[0052] Based on and Figure 1 Based on the same principle as the method shown, this embodiment of the invention also provides a medical text understanding device 20, such as... Figure 2 As shown, the medical text understanding device 20 may include an acquisition module 210 and an understanding module 220, wherein: Module 210 is used to acquire the medical text to be understood; The understanding module 220 is used to input the medical text to be understood into the large language model and obtain the text understanding result of the medical text to be understood. The text understanding result includes the understanding result of symptoms, diagnostic logic or treatment plan. In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back. The knowledge-enhanced hidden state matrix with the same dimension as the hidden state matrix is ​​output to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

[0053] Optionally, for each knowledge-enhanced hidden state matrix output by the knowledge projection adapter, the device further includes: The alignment module is used to identify medical named entities in the medical text to be understood by enhancing the hidden state matrix based on knowledge. For each medical named entity, the medical named entity is aligned with the medical knowledge graph to learn the standard concept semantics of the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity, and to determine the text understanding result based on the target feature vector.

[0054] Optionally, the total loss function value of the above-mentioned large language model during the training phase includes a first loss function value, which represents the difference between the target feature vector corresponding to each medical named entity and the corresponding real feature vector in the medical knowledge graph.

[0055] Optionally, the total loss function value mentioned above also includes a second loss function value, which characterizes the difference between the predicted triples and the true triples for each medical named entity. The predicted triples are output by the large language model during the training phase, while the true triples are determined through the medical knowledge graph. For any triple between the true triples and the predicted triples, the triples describe the contextual relationship of the corresponding medical named entity in the medical world.

[0056] Optionally, the second loss function value is determined based on the contrastive loss function, which is a loss value determined based on positive sample pairs and negative sample pairs.

[0057] Optionally, when the aforementioned understanding module 220 inputs the medical text to be understood into the large language model to obtain the text understanding result of the medical text to be understood, it is specifically used for: The medical text to be understood is input into a large language model to obtain medical named entities in the medical text. Based on each medical named entity in the medical text to be understood, determine the triple corresponding to each medical named entity; The text understanding result is determined based on the triples corresponding to each medical named entity.

[0058] The medical text understanding device of this invention can execute the medical text understanding method provided in this invention. The implementation principle is similar. The actions performed by each module and unit in the medical text understanding device in each embodiment of this invention correspond to the steps in the medical text understanding method in each embodiment of this invention. For detailed functional descriptions of each module of the medical text understanding device, please refer to the descriptions in the corresponding medical text understanding methods shown above. They will not be repeated here.

[0059] The aforementioned medical text understanding device may be a computer program (including program code) running on a computer device, such as an application software; the device may be used to execute the corresponding steps in the method provided in the embodiments of the present invention.

[0060] In some embodiments, the medical text understanding device provided in this invention can be implemented using a combination of hardware and software. As an example, the medical text understanding device provided in this invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the medical text understanding method provided in this invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0061] In other embodiments, the medical text understanding device provided in this invention can be implemented in software. Figure 2 A medical text understanding device stored in a memory is shown. It may be software in the form of programs and plug-ins, and includes a series of modules, including an acquisition module 210 and an understanding module 220, for implementing the medical text understanding method provided in the embodiments of the present invention.

[0062] The modules described in the embodiments of the present invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.

[0063] Based on the same principles as the methods shown in the embodiments of the present invention, the embodiments of the present invention also provide an electronic device, which may include, but is not limited to: a processor and a memory; the memory for storing computer programs; and the processor for executing the methods shown in any embodiment of the present invention by invoking the computer programs.

[0064] In one alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0065] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0066] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0067] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0068] The memory 4003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.

[0069] Among these, electronic devices can also be terminal devices. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0070] This invention provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments.

[0071] According to another aspect of the present invention, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.

[0072] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0073] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

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

[0075] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.

[0076] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

Claims

1. A method for understanding medical text, characterized in that, include: Obtaining medical text to be understood; The medical text to be understood is input into a large language model to obtain the text understanding result of the medical text to be understood, which includes the understanding result of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back, outputting a knowledge-enhanced hidden state matrix of the same dimension as the hidden state matrix to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

2. The method according to claim 1, characterized in that, For each of the knowledge-enhanced hidden state matrices output by the knowledge projection adapter, the method further includes: Based on the knowledge-enhanced hidden state matrix, medical named entities in the medical text to be understood are identified; For each medical named entity, alignment processing is performed on the medical named entity and the medical knowledge graph to learn the standard concept semantics corresponding to the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity, and to determine the text understanding result based on the target feature vector.

3. The method according to claim 2, characterized in that, The total loss function value of the large language model during the training phase includes a first loss function value, which represents the difference between the target feature vector corresponding to each medical named entity and the corresponding real feature vector in the medical knowledge graph.

4. The method according to claim 3, characterized in that, The total loss function value also includes a second loss function value, which characterizes the difference between the predicted triples and the true triples for each of the medical named entities. The predicted triples are output by the large language model during the training phase, and the true triples are determined through a medical knowledge graph. For any triple between the true triples and the predicted triples, the triples describe the contextual relationship of the corresponding medical named entity in the medical world.

5. The method according to claim 4, characterized in that, The second loss function value is determined based on the contrastive loss function, which is a loss value determined based on positive sample pairs and negative sample pairs.

6. The method according to any one of claims 1 to 4, characterized in that, The process of inputting the medical text to be understood into a large language model to obtain the text understanding result of the medical text includes: The medical text to be understood is input into a large language model to obtain medical named entities in the medical text to be understood. Based on each medical named entity in the medical text to be understood, determine the triplet corresponding to each medical named entity; The text understanding result is determined based on the triples corresponding to each of the medical named entities.

7. A medical text understanding device, characterized in that, include: The acquisition module is used to acquire the medical text to be understood. The understanding module is used to input the medical text to be understood into a large language model to obtain the text understanding result of the medical text to be understood, which includes the understanding result of symptoms, diagnostic logic or treatment plan; In the large language model, a knowledge projection adapter is connected between every two adjacent Transformer layers. For each knowledge projection adapter, the knowledge projection adapter is used to receive the hidden state matrix output by the previous Transformer layer in the corresponding two Transformer layers, and then map the hidden state matrix to the medical knowledge space through a feedforward network and then map it back, outputting a knowledge-enhanced hidden state matrix of the same dimension as the hidden state matrix to the next Transformer layer. The hidden state features are the semantic feature representation of the medical text to be understood.

8. The apparatus according to claim 7, characterized in that, For each of the knowledge-enhanced hidden state matrices output by the knowledge projection adapter, the apparatus further includes: An alignment module is used to enhance the hidden state matrix based on the knowledge and identify medical named entities in the medical text to be understood. For each medical named entity, the medical named entity is aligned based on the medical named entity and the medical knowledge graph to learn the standard concept semantics corresponding to the medical named entity in the medical knowledge graph and the clinical relationship between the medical named entity and other concepts, so as to obtain the target feature vector corresponding to the medical named entity, and to determine the text understanding result based on the target feature vector.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method of any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1-6.