Methods and apparatus for training entity linking models in medical entity linking

By optimizing the training of the entity linking model through a shared-parameter encoder and a reordering module, the problems of inaccurate vector representation and poor adaptability to ontology updates in existing technologies are solved, resulting in more efficient entity linking results.

CN120196746BActive Publication Date: 2025-12-16BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510235607.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-12-16
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

Existing entity linking algorithms cannot accurately learn vector representations, leading to a decline in model generalization performance and an inability to adapt to the dynamic updates of medical ontology databases, thus affecting the accuracy and reliability of entity linking results.

Method used

The target text mentions and medical ontology entities are encoded using a first encoder and a second encoder with shared parameters. Similarity is calculated and the target loss function is determined. The model training is optimized to adapt to ontology updates by combining a re-ranking module and an elastic weight merging strategy.

Benefits of technology

It improves the performance of the entity linking model, enhances the accuracy and stability of entity linking results, and makes the vector distance between entities with similar ontology semantic structures closer, enabling it to quickly adapt to the dynamic changes of the ontology library.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196746B_ABST
    Figure CN120196746B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for training an entity linking model in medical entity linking. The method comprises the following steps: obtaining a target text mention to be subjected to entity linking and total entities in a medical ontology library; performing encoding operation on the target text mention and the total entities respectively by using a first encoder and a second encoder, so as to obtain a mention vector and an entity vector; calculating a first similarity of the mention vector and the entity vector; matching a candidate entity of the target text mention from the total entities; calculating a second similarity of the target text mention and the candidate entity; and determining a target loss function based on the first similarity and the second similarity, so as to train the entity linking model in medical entity linking. By using the scheme of the application, the performance of the entity linking model can be improved, and the entity linking result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application generally relates to the field of entity linking technology. More specifically, this application relates to a method for training an entity linking model in medical entity linking, a method for medical entity linking, an electronic device, and a computer-readable storage medium. Background Technology

[0002] In recent years, with the rapid development of computer technology and the rapid growth of biomedical data, massive amounts of medical data, scientific research literature, and clinical medical records have become important foundational resources for precision medicine research. Biomedical Entity Linking (BEL) is a core task in the field of medical natural language processing, aiming to match and associate medical terminology references (such as diseases, symptoms, genes, etc.) in text with entity concepts in medical ontology libraries (such as UMLS, MeSH, ISPO, etc.). For example, associating (or linking) references such as "delayed speech," "speech retardation," "speech dullness," "speech slowness," and "deafness" in text with "speech dullness" in a medical ontology library means they all represent the same concept.

[0003] The terminology used in medical texts is complex and constantly evolving. Relying solely on manual standardization of massive datasets and ontology updates is extremely time-consuming, labor-intensive, and impractical. Currently, various methods exist for linking medical entities, including those based on semantic information and structure in ontology, graph-based linking, frameworks for unsupervised Chinese medical text entity recognition and linking, and the BLINK architecture based on general domains. However, existing entity linking algorithms simply separate positive and negative samples without accurately learning vector representations. This forced separation of all negative samples from anchor points can disrupt the distance relationships between other anchor points and their corresponding positive samples. In other words, significant displacement of negative samples in the vector space causes interference, affecting the original geometric structure with other anchor points and positive samples, and compromising the overall vector space's consistency and representation stability. This can lead to decreased model generalization performance and inaccurate entity linking results, especially when maintaining reasonable distances between multiple groups of positive samples simultaneously.

[0004] In view of this, there is an urgent need to provide a scheme for training entity linking models in medical entity linking, so that the vector distance between entities with similar ontology semantic structures is closer, thereby improving the performance of entity linking models and improving entity linking results. Summary of the Invention

[0005] In order to at least address one or more of the technical problems mentioned above, this application proposes a scheme for training entity linking models in medical entity linking in several aspects.

[0006] In a first aspect, this application provides a method for training an entity linking model in medical entity linking, wherein the entity linking model includes at least a first encoder and a second encoder sharing parameters, and the method includes: obtaining target text mentions to be linked and total entities in a medical ontology library; encoding the target text mentions and the total entities using the first encoder and the second encoder respectively to obtain mention vectors and entity vectors; calculating a first similarity between the mention vectors and the entity vectors; matching candidate entities of the target text mentions from the total entities; calculating a second similarity between the target text mentions and the candidate entities; and determining a target loss function based on the first similarity and the second similarity to train the entity linking model in medical entity linking.

[0007] In some embodiments, the first similarity includes cosine similarity, and the second similarity includes tree structure similarity.

[0008] In other embodiments, candidate entities mentioned in the target text are matched from the total entities by: determining a matching score between the corresponding target text mention and each entity in the total entities based on the first similarity; selecting the entity with the highest matching score among the target entities as the candidate entity to match the candidate entities mentioned in the target text from the total entities.

[0009] In some other embodiments, determining the target loss function based on the first similarity and the second similarity includes: calculating the mean squared error loss based on the first similarity and the second similarity to determine the target loss function.

[0010] In some other embodiments, the entity linking model further includes a reordering module, and the method further includes: using the reordering module to calculate new scores for each candidate entity, wherein the reordering module is trained based on cross-entropy loss; and selecting the entity with the highest new score as the candidate entity.

[0011] In some other embodiments, it further includes: in response to updating the medical ontology library, calculating a new target loss function based on the total entities in the updated medical ontology library and the historical total entities, to train the entity linking model in the medical entity linking.

[0012] In some other embodiments, calculating a new target loss function based on the total entities in the updated medical ontology library and the historical total entities includes: determining an intermediate target loss function and a first weight parameter based on the total entities in the updated medical ontology library; determining a second weight parameter corresponding to the historical total entities; and performing an elastic weight merging operation based on the intermediate target loss function, the first weight parameter, and the second weight parameter to obtain a new target loss function.

[0013] In a second aspect, this application provides a method for medical entity linking, comprising: obtaining target text mentions to be linked; inputting the target text mentions into an entity linking model trained according to a plurality of embodiments in the first aspect above to perform entity linking, thereby obtaining entity linking results.

[0014] In a third aspect, this application provides an electronic device comprising: a processor; and a memory having computer instructions stored thereon for training an entity linking model in medical entity linking, wherein when the computer instructions are executed by the processor, the embodiments of the first aspect described above are implemented; or having computer instructions for medical entity linking, wherein when the computer instructions are executed by the processor, the embodiments of the second aspect described above are implemented.

[0015] In a fourth aspect, this application provides a computer-readable storage medium storing computer program instructions for training an entity linking model in a medical entity linking system, which, when executed by one or more processors, causes the implementation of the various embodiments in the first aspect; or storing computer program instructions for training an entity linking model in a medical entity linking system, which, when executed by one or more processors, causes the implementation of the embodiments in the second aspect.

[0016] Using the above-described scheme for training the entity linking model in medical entity linking, this embodiment of the application encodes the target text mentions and the total entities using a first encoder and a second encoder with shared parameters, respectively, to obtain mention vectors and entity vectors. It then calculates a first similarity between the mention vectors and entity vectors, and a second similarity between the target text mentions and candidate entities. Finally, it combines the first and second similarities to determine the target loss function for training the entity linking model. Based on this, it can integrate the hierarchical relationship information of concepts in the medical ontology library, learn a better dense vector representation, and make the vector distance between entities with similar ontology semantic structures closer, thereby improving the performance of the entity linking model and enhancing the entity linking results. Attached Figure Description

[0017] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts, wherein:

[0018] Figure 1 This is an exemplary flowchart illustrating a method for training an entity link model in medical entity linking according to an embodiment of this application;

[0019] Figure 2 This is an exemplary flowchart illustrating the overall training of an entity linking model in medical entity linking according to an embodiment of this application;

[0020] Figure 3 This is an exemplary flowchart illustrating a method for linking medical entities according to an embodiment of this application;

[0021] Figure 4 This is an exemplary structural block diagram illustrating an electronic device according to an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] It should be understood that the terms "comprising" and "including" as used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0024] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0025] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0026] As described in the background technology description, medical entity linking aims to align specific terminology references (such as diseases, symptoms, genes, etc.) in medical texts with corresponding conceptual entities in a medical knowledge base. This standardizes terms that share the same concept but have diverse expressions, thereby facilitating information retrieval, knowledge fusion, and intelligent analysis. Specifically, entity linking mainly includes the following:

[0027] (1) Mention Detection: The task of mention detection is to identify and locate entity mentions in the text, ensuring accurate capture of complete phrases, such as "hypertension" rather than "high" or "blood pressure". This step typically utilizes Named Entity Recognition (NER) technology, which has evolved from early rule-based methods to deep learning-based models, such as BiLSTM, and now to the widely used pre-trained language model BERT, greatly improving the accuracy of mention detection. In the context of medical entity linking, mention detection extracts medical terms from the text, laying the foundation for subsequent entity linking.

[0028] (2) Candidate Entity Generation: This stage generates candidate entities that may match each entity mention in the knowledge base. The main methods include string matching, synonym expansion, inverted index, graph structure analysis, and embedding representation. The most likely candidate entities are selected by calculating the similarity between the mention and the entity or by using retrieval models such as TF-IDF and BM25, thus providing a candidate set for subsequent precise disambiguation.

[0029] (3) Candidate Entity Ranking: The candidate entity set is scored and ranked to determine the most suitable candidate entities. Ranking methods typically combine the surface formal features and contextual features of mentions and entities, using models that have learned classification or ranking to optimize matching accuracy. In addition, graph models are also used to capture the relationships between candidate entities. Current mainstream entity linking systems are mainly based on general domain knowledge bases, and when directly applied to the Chinese medical field, they still face challenges such as insufficient structure of the knowledge base and scarcity of labeled data.

[0030] While entity linking algorithms have been widely applied in general domains, entity linking in the medical field remains a relatively new problem. For English corpora, semantic textual similarity has been used to link entity mentions in clinical texts. Collective reasoning methods also exist, leveraging semantic information and structure from ontology to address entity linking in biomedical literature. Graph-based linking methods first construct a graph of entity mentions, a knowledge base, and candidates, then use information entropy and similarity algorithms to link biomedical entities. The performance of these methods depends heavily on the contextual information of the entities and the completeness of the knowledge base, while research on entity linking in Chinese corpora is still limited.

[0031] Existing methods have only studied the standardization of Chinese medical terminology, without effectively implementing entity linking. For example, using a spatial vector model to classify disease names in medical insurance data according to the classification system of the International Classification of Diseases (ICD-10) does not achieve a correspondence between disease names and ICD-10 standard disease terms. Alternatively, a retrieval method could be used to address the standardization problem of medical terminology by searching across three dimensions: pinyin, characters, and words.

[0032] The general domain BLINK architecture fully leverages the powerful capabilities of the BERT model, increasing entity linking data by integrating data from other domains, requiring large-scale pre-training to improve model results. However, due to the specialized and domain-specific nature of medical terminology, the model needs to learn more accurate vector representations; therefore, this method is not suitable for the medical entity linking described in this application.

[0033] Furthermore, existing entity linking algorithms simply separate positive and negative samples without accurately learning their vector representations. While this method of forcibly separating all negative samples from the anchor point achieves separation, it triggers a global push-away effect, potentially disrupting the distance relationships between other anchor points and their corresponding positive samples. In other words, the significant displacement of negative samples in the vector space causes interference, affecting the original geometry of other anchor points and positive samples, thus compromising the overall vector space's consistency and representation stability. Specifically, it may lead to large differences in the vector representations of similar entities, while unrelated entities may have similar representations, impacting the accuracy and reliability of entity linking. This approach can also degrade model generalization performance during optimization, especially when maintaining reasonable distances between multiple groups of positive samples simultaneously.

[0034] Furthermore, existing medical entity linking methods do not consider the dynamic updates of ontology databases, and their entity linking algorithms cannot adapt to changes in the ontology database. In practice, as the ontology database is updated, the feature vector space of the terms in the ontology database changes. Entity linking algorithms trained on older versions of the ontology database often face performance degradation when applied to newer versions. For example, when new disease concepts are added to the medical ontology database or information on certain drugs is updated, existing algorithms may not be able to incorporate this new information into the entity linking process in a timely manner, still matching and linking according to the old ontology database, thus leading to a decrease in the accuracy of the linking results. To adapt to updates to the ontology database, the entire algorithm often needs to be retrained and adjusted, which not only consumes a lot of computational resources and time, but also brings high maintenance costs.

[0035] Based on this, this application provides a method for training an entity linking model in medical entity linking. It uses a dual encoder to fuse the hierarchical relationship information of concepts in a medical ontology library and utilizes the similarity of ontology semantic structures to calculate a loss function to guide model training optimization. This allows the entity linking model to learn a better dense vector representation, making the vector distance between entities with similar ontology semantic structures closer, thus improving the performance of the entity linking model and enhancing the entity linking results. Furthermore, embodiments of this application also optimize the loss function by jointly updating the total entities in the medical ontology library and the historical total entities, i.e., incorporating continuous learning, to better adapt to the dynamic updates of the ontology library.

[0036] Several embodiments of the present application will now be described in detail with reference to the accompanying drawings.

[0037] Figure 1 This is an exemplary flowchart illustrating a method 100 for training an entity linking model in medical entity linking according to an embodiment of this application. The entity linking model may include at least a first encoder and a second encoder sharing parameters. In some embodiments, the first encoder and the second encoder may be, for example, a BERT model. Figure 1 As shown, the method 100 includes: step S101: obtaining the target text mentions to be linked and the total entities in the medical ontology library; step S102: using a first encoder and a second encoder to encode the target text mentions and the total entities respectively, to obtain mention vectors and entity vectors accordingly; step S103: calculating the first similarity between the mention vectors and the entity vectors; step S104: matching candidate entities of the target text mentions from the total entities; step S105: calculating the second similarity between the target text mentions and the candidate entities; step S106: determining the target loss function based on the first similarity and the second similarity to train the entity linking model in the medical entity linking.

[0038] First, in step S101, the target text reference to be linked and the total entity in the medical ontology are obtained. As mentioned earlier, the target text submission can be, for example, medical terms such as disease, symptom, or gene, such as "delayed speech," "speech impairment," or "hypertension." The total entity in the medical ontology can be, for example, a concept or entry that contains the aforementioned text submission or a related concept or entry corresponding to the text reference. For example, the related entry for "delayed speech" or "speech impairment" is "speech impairment."

[0039] Next, in step S102, the first encoder and the second encoder are used to encode the target text mentions and the total entity, respectively, to obtain the mention vector and the entity vector. In some implementation scenarios, the first and second encoders with shared parameters can be used to encode the target text mentions and the total entity into dense vector representations, thereby mapping them to the same vector space.

[0040] Dense vector representation is a method of converting mentions in biomedical texts (such as specific medical terms) and entities in medical ontology into numerical vectors. These vectors, characterized by their density, effectively represent the semantic information of entities and play a crucial role in medical entity linking. Through encoding with first and second encoders (such as the BERT model), dense vectors can capture the deep semantic information of biomedical terms and entities. For example, for medical terms with similar meanings, their corresponding dense vectors will be relatively close in the vector space, reflecting the semantic relationships between these terms.

[0041] As an example, suppose the target text mentions are denoted as m and the entities in the total entity are denoted as e. i Both the first and second encoders use the BERT model to obtain the mention vector y. m =Pool mean (BERT(m)) and entity vector y ei =Pool mean (BERT(e i Pool mean This indicates average pooling.

[0042] Based on the extracted mention vector and entity vector, in step S103, a first similarity between the mention vector and the entity vector is calculated. In some embodiments, this first similarity may be, for example, a cosine similarity. Specifically, in one implementation scenario, the mention vector y can be calculated using the following formula: m With all entity vectors in the knowledge base Cosine similarity:

[0043]

[0044] Further, in step S104, candidate entities mentioned in the target text are matched from the total entities. In some embodiments, the matching score between the corresponding target text mention and each entity in the total entities can be determined based on a first similarity, and the entity with the highest matching score among the target entities is selected as the candidate entity to match the candidate entities mentioned in the target text from the total entities. For example, the K entities with the highest matching scores are selected as candidate entities, where the higher the first similarity (e.g., cosine similarity), the higher the matching score. As an example, for each target text mention m, the K candidate entities with the highest matching scores are found in the total entity set E in the medical ontology library: {e1, e2, ... e... K}=argtopK e∈E Sim(m,e i ).

[0045] After obtaining candidate entities, in step S105, a second similarity between the target text mention and the candidate entity is calculated. In some embodiments, this second similarity can be, for example, a tree structure similarity, i.e., the second similarity is calculated based on the positions of the mention and the candidate entity in the tree structure. Specifically, in one implementation scenario, the similarity between the target text mention m and the candidate entity can be calculated using the following formula. Tree structure similarity:

[0046]

[0047] Where lcs represents the length of the longest common substring, which is the nearest common root node found according to the tree structure; freq(c) represents the number of child nodes of node c, where c is 1 when it is a leaf node. freq(root) represents the number of root nodes.

[0048] Finally, in step S106, a target loss function is determined based on the first similarity and the second similarity to train the entity link model in the medical entity link. In some embodiments, the mean squared error loss is calculated based on the first similarity and the second similarity to determine the target loss function. That is, the target loss function is the mean squared error loss, and the entity link model is trained forward and backward based on this mean squared error loss to obtain a trained entity link model. In one implementation scenario, based on the first similarity Sim(m,e)... i ) and second similarity The target loss function L can be calculated using the following formula: (MSE) :

[0049]

[0050] As described above, this embodiment of the application uses a first encoder and a second encoder with shared parameters to encode the target text mentions and total entities respectively, obtaining mention vectors and entity vectors. Candidate entities are extracted, and the first and second similarities are jointly used to calculate the target loss function to train the entity linking model. Based on this, by fusing the hierarchical relationship information of concepts in the medical ontology library with dual encoders and using the similarity of ontology semantic structures to guide model training optimization, the dual encoders can learn a better dense vector representation. The vector distance between entities with similar ontology semantic structures is closer, thereby improving the performance of the entity linking model and enhancing the entity linking results.

[0051] In some embodiments, the entity linking model described above may further include a re-ranking module, which calculates new scores for each candidate entity and selects the entity with the highest new score as the candidate entity. The re-ranking module is trained based on cross-entropy loss. Therefore, by further considering the semantic similarity between mentions and candidate entities through the re-ranking module, it can capture finer-grained interactions between mentions and candidate entities, achieving a more accurate ranking of candidate entities and further improving the accuracy of the entity linking model.

[0052] Specifically, in one implementation scenario, for each mention m and its corresponding K candidate entity set {e1, e2, ... e... K The reordering module is used to calculate a new score for each candidate entity. The entity with the highest score will be selected. In some implementation scenarios, the reordering module is trained based on cross-entropy loss, which optimizes the probability that each mentioned correct candidate entity is selected as the final linked entity - logP(e^(-log ... * |m), and cross-entropy loss L rerank This can be expressed by the following formula:

[0053]

[0054] In some embodiments, this application also relates to updating a medical ontology library, calculating a new target loss function based on the total entities in the updated medical ontology library and the historical total entities, in order to train the entity link model in the medical entity link. In some embodiments, an intermediate target loss function and a first weight parameter can be determined through the total entities in the updated medical ontology library, and a second weight parameter corresponding to the historical total entities can be determined. Then, an elastic weight merging operation is performed based on the intermediate target loss function, the first weight parameter, and the second weight parameter to obtain a new target loss function.

[0055] Continuous learning is understood to be a process of gradually acquiring new knowledge from non-stationary data streams while retaining previously learned information, primarily involving strategies and experience. Strategies refer to various methods used to balance learning new data and retaining previous knowledge, specifically categorized into regularization-based methods and data-based strategies. Preferably, a strategy of elastic weight merging regularization is employed, which avoids forgetting historical knowledge by imposing constraints on the parameters of the entity linking model. Data strategies involve storing a subset of historical data, forming a training set with new data to ensure that the entity linking model strengthens historical knowledge while learning new information.

[0056] Experience suggests that each stage of data exposure and learning allows the entity linking model to progressively process and adapt to new inputs, aiding in gradual learning without degrading performance on earlier tasks. In other words, continuous learning enables the entity linking model to quickly update itself while retaining previous knowledge when receiving new ontology concepts or relationships. This allows the model to adapt to changes in the medical ontology database without requiring retraining the entire model after each update.

[0057] In the implementation scenario, corresponding labels can be assigned to entities based on the order in which they are updated. For example, if a linked entity is not yet in the ontology, it is marked as NIL; if the linked entity has been added to the ontology, it is updated with the corresponding entity label. As an example, during the update process, data marked as NIL in historical data is selected as the replay dataset to prevent the entity link model from forgetting it. The labels of these NIL data change dynamically as the ontology is updated. If at time t, a link mentioning term m is NIL, then label(m) = NIL; if at time t+1, after the ontology is updated, m maps to entity e, then label(m) = e.

[0058] Furthermore, assume O t D represents the ontology version at time t. t This indicates the input dataset used at time t, and the entity linking model needs to adapt to O. t The ontology O is adjusted according to the update, so that at time t+1 t+1 In this model, the entity linking model is still able to accurately link entities in the input text. As mentioned earlier, this entity linking model may include a first encoder, a second encoder, and a reordering module.

[0059] In the implementation scenario, for the total entities in the updated medical ontology database at the current moment, the aforementioned training process can be used to obtain the intermediate target loss function L at the current moment. new And obtain the corresponding first weight parameter θ i The second weight parameter corresponding to the total historical entities In this scenario, a new target loss function L can be obtained by using the elastic weight merging operation. EWC Specifically, it can be expressed as follows:

[0060]

[0061] Where λ represents the regularization coefficient, used to control the importance of historical knowledge. F i The diagonal elements of the Fisher information matrix are used to measure the importance of each first weight and second weight parameter. Based on this, embodiments of this application implement entity links that can maintain high efficiency and stability as the ontology is dynamically updated.

[0062] Figure 2 This is an exemplary flowchart illustrating the overall training of an entity linking model in medical entity linking according to embodiments of this application. It should be understood that... Figure 2 The above Figure 1 A specific embodiment of method 100, therefore the above regarding Figure 1 The description also applies to Figure 2 .

[0063] like Figure 2 As shown, in step S201, the target text mentions to be linked and the total entities in the medical ontology library are obtained. Next, in steps S202 and S203, the target text mentions and the total entities are encoded using a first encoder and a second encoder, respectively, to obtain mention vectors and entity vectors in steps S204 and S205. In step S206, candidate entities matching the target text mentions from the total entities are used. For example, the K entities with the highest matching scores are obtained as candidate entities based on similarity. Alternatively, a re-ranking module can be used to recalculate new scores to re-rank and obtain the final candidate entities.

[0064] Further, in step S207, a first similarity between the mention vector and the entity vector is calculated, and in step S208, a second similarity between the target text mention and the candidate entity is calculated. The first similarity can be, for example, cosine similarity, and the second similarity can be, for example, tree structure similarity, specifically calculated based on the above formulas (1) and (2). In step S209, a target loss function is determined based on the first and second similarities. This target loss function is the mean squared error loss, specifically calculated based on the above formula (3). In some embodiments, in step S210, a new target loss function can also be calculated by combining historical total entities based on elastic weights. Finally, in step S211, the entity link model in the medical entity link is trained based on the new target loss function.

[0065] Figure 3 This is an exemplary flowchart illustrating a method 300 for linking medical entities according to an embodiment of this application. Figure 3 As shown, method 300 may include step S301: obtaining the target text mentions to be linked to entities, and step S302: inputting the target text mentions into the trained entity linking model to perform entity linking, and obtaining the entity linking result. For more details regarding the training of the entity linking model, please refer to the above. Figure 1 The description of the subject matter will not be repeated here.

[0066] Figure 4 This is an exemplary structural block diagram illustrating an electronic device 400 according to an embodiment of this application. It is understood that the electronic device 400 may include the apparatus of the embodiments of this application, and the device implementing the solution of this application may be a single device (e.g., a computing device) or a multifunctional device including various peripheral devices.

[0067] like Figure 4 As shown, the electronic device of this application may further include a central processing unit (“CPU”) 411, which may be a general-purpose CPU, a dedicated CPU, or other information processing and program execution unit. Further, the electronic device 400 may also include a mass storage 412 and a read-only memory (“ROM”) 413. The mass storage 412 may be configured to store various types of data, including various target text mentions and total entities in a medical ontology library, mention vectors and entity vectors, first similarity and second similarity, target loss function, algorithm data, intermediate results, and various programs required to run the electronic device 400. The ROM 413 may be configured to store data and instructions required for the power-on self-test of the electronic device 400, the initialization of various functional modules in the system, the drivers for the system's basic input / output, and the booting of the operating system.

[0068] Optionally, the electronic device 400 may also include other hardware platforms or components, such as the tensor processing unit (“TPU”) 414, graphics processing unit (“GPU”) 415, field-programmable gate array (“FPGA”) 416, and machine learning unit (“MLU”) 417 shown. It is understood that although various hardware platforms or components are shown in the electronic device 400, they are merely exemplary and not limiting, and those skilled in the art can add or remove appropriate hardware as needed. For example, the electronic device 400 may include only a CPU, associated storage devices, and interface devices to implement the method for training entity linking models in medical entity linking or the method for medical entity linking of this application.

[0069] In some embodiments, to facilitate data transmission and interaction with external networks, the electronic device 400 of this application further includes a communication interface 418, through which it can connect to a local area network / wireless local area network (“LAN / WLAN”) 405, and further through the LAN / WLAN to connect to a local server 406 or to the Internet (“Internet”) 407. Alternatively or additionally, the electronic device 400 of this application can also directly connect to the Internet or cellular network based on wireless communication technology, such as 3G (“3G”), 4G (“4G”), or 5G (“5G”) wireless communication technology, via the communication interface 418. In some application scenarios, the electronic device 400 of this application can also access the server 408 and database 409 of an external network as needed to obtain various known algorithms, data, and modules, and can remotely store various data, such as various data or instructions for presenting, for example, target text mentions and total entities in a medical ontology, mention vectors and entity vectors, first similarity and second similarity, target loss function, etc.

[0070] Peripherals of the electronic device 400 may include a display device 402, an input device 403, and a data transmission interface 404. In one embodiment, the display device 402 may include, for example, one or more speakers and / or one or more visual displays, configured to train the entity linking model in the medical entity linking of this application or to provide voice prompts and / or image / video display for medical entity linking. The input device 403 may include, for example, a keyboard, mouse, microphone, gesture capture camera, or other input buttons or controls, configured to receive audio data input and / or user commands. The data transmission interface 404 may include, for example, a serial interface, parallel interface, or Universal Serial Bus interface (“USB”), Small Computer System Interface (“SCSI”), Serial ATA, FireWire (“FireWire”), PCI Express, and High Definition Multimedia Interface (“HDMI”), configured for data transmission and interaction with other devices or systems. According to the scheme of this application, the data transmission interface 404 can receive target text references from a medical database and total entities from a medical ontology library, and transmit to the electronic device 400 data or results including target text references and total entities from a medical ontology library or various other types of data.

[0071] The CPU 411, mass storage 412, ROM 413, TPU 414, GPU 415, FPGA 416, MLU 417, and communication interface 418 of the electronic device 400 of this application can be interconnected via bus 419, and can interact with peripheral devices through this bus. In one embodiment, the CPU 411 can control other hardware components and peripheral devices in the electronic device 400 through bus 419.

[0072] The above combination Figure 4 An electronic device that can be used to execute this application is described. It should be understood that the device structure or architecture described herein is merely exemplary, and the implementation method and implementation entity of this application are not limited thereto, but can be changed without departing from the spirit of this application.

[0073] Based on the foregoing description in conjunction with the accompanying drawings, those skilled in the art will understand that the embodiments of this application can also be implemented by software programs. Therefore, this application also provides a computer-readable storage medium storing computer-readable instructions for training or using an entity linking model in medical entity linking. When executed by one or more processors, these computer-readable instructions can be used to implement the embodiments of this application in conjunction with the accompanying drawings. Figure 1 The described method for training or combining entity link models in medical entity linking. Figure 3 The method described is for linking medical entities.

[0074] It should be noted that although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0075] It should be understood that when the terms "first," "second," "third," and "fourth," etc., are used in the claims, specification, and drawings of this application, they are used only to distinguish different objects and not to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0076] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0077] Although the embodiments of this application are described above, the content is merely an example adopted for the purpose of facilitating understanding of this application and is not intended to limit the scope and application scenarios of this application. Any person skilled in the art described in this application may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be determined by the scope defined in the appended claims.

[0078] Furthermore, the collection and acquisition of various data in this application comply with relevant laws and regulations and are authorized by the data providers. Any organization or individual that needs to obtain external data shall obtain authorization in accordance with the law and ensure data security, and shall not illegally collect, use, process, or transmit unauthorized or unprotected data, nor shall it illegally buy, sell, provide, or disclose unauthorized or unprotected data.

Claims

1. A method for training an entity linking model in medical entity linking, wherein the entity linking model includes at least a first encoder and a second encoder sharing parameters, and the method includes: Retrieve the target text references for the entities to be linked and the total entities in the medical ontology library; The first encoder and the second encoder are used to encode the target text mentions and the total entities respectively, to obtain mention vectors and entity vectors accordingly; Calculate the first similarity between the mention vector and the entity vector; Match candidate entities mentioned in the target text from the total entities; Calculate the second similarity between the target text mentions and the candidate entities; A target loss function is determined based on the first similarity and the second similarity to train the entity link model in medical entity linking; The following operations are used to match candidate entities mentioned in the target text from the total entity: The matching score between the corresponding target text mention and each entity in the total entities is determined based on the first similarity. The entity with the highest matching score among the target entities is selected as the candidate entity, so as to match the candidate entity mentioned in the target text from the total entities.

2. The method according to claim 1, wherein the first similarity includes cosine similarity, and the second similarity includes tree structure similarity.

3. The method according to claim 1 or 2, wherein determining the target loss function based on the first similarity and the second similarity comprises: The mean squared error loss is calculated based on the first similarity and the second similarity to determine the target loss function.

4. The method according to claim 1, wherein the entity linking model further includes a reordering module, and the method further includes: The re-ranking module is used to calculate a new score for each candidate entity, wherein the re-ranking module is trained based on cross-entropy loss. The entity with the highest new score is selected as the candidate entity.

5. The method according to claim 1, further comprising: In response to updating the medical ontology library, a new target loss function is calculated based on the total entities in the updated medical ontology library and the historical total entities to train the entity linking model in the medical entity linking.

6. The method of claim 5, wherein calculating the new target loss function based on the total entities in the updated medical ontology library and the historical total entities comprises: The intermediate target loss function and the first weight parameter are determined based on the total entities in the updated medical ontology library; Determine the second weight parameter corresponding to the total historical entities; A new target loss function is obtained by performing an elastic weight merging operation based on the intermediate target loss function, the first weight parameter, and the second weight parameter.

7. A method for linking medical entities, comprising: Obtain the target text mentions for the entities to be linked; The target text reference is input into the entity linking model trained by the method according to any one of claims 1-6 to perform entity linking and obtain entity linking results.

8. An electronic device, comprising: processor; as well as A memory storing computer instructions for training an entity linking model in medical entity linking, which, when executed by a processor, cause the implementation of the method according to any one of claims 1-6; or storing computer instructions for medical entity linking, which, when executed by a processor, cause the implementation of the method according to claim 7.

9. A computer-readable storage medium storing computer program instructions for training an entity linking model in a medical entity linking system, wherein the computer program instructions, when executed by one or more processors, cause the implementation of the method according to any one of claims 1-6; or storing computer program instructions for training an entity linking model in a medical entity linking system, wherein the computer program instructions, when executed by one or more processors, cause the implementation of the method according to claim 7.