Methods, apparatus, devices, and media for information extraction from medical texts
By using modular column topic adapters and topic adaptive mechanisms, the simultaneous optimization of entity recognition and relation extraction in medical texts is achieved, solving the problems of semantic inconsistency and low degree of structure in information extraction in existing technologies, and improving the accuracy and consistency of information extraction in clinical research on oncology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YIYONG TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies for automatically extracting highly structured information from medical texts suffer from semantic inconsistencies, weak topic generalization capabilities, and low levels of structuring, making it particularly difficult to accurately extract information from specific topics in oncology clinical research and data governance.
It adopts a modular column theme adapter and theme adaptation mechanism, performs entity recognition and relationship extraction in parallel through a neural network model, and performs joint training by combining a multi-task loss function to dynamically adjust the focus of feature extraction and generate structured information that conforms to the specific column theme.
It significantly improves the accuracy and semantic consistency of information extraction, directly generating high-quality structured topic data suitable for clinical decision-making and scientific research analysis.
Smart Images

Figure CN121528577B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a method, apparatus and device for extracting information from medical text, as well as a non-transitory computer-readable storage medium. Background Technology
[0002] In the current fields of medical artificial intelligence and natural language processing, data processing and structuring of medical texts, particularly electronic medical records (EMRs) from oncology departments, has always been a major challenge in the development of medical informatics. In clinical research and data governance, such as in oncology, automatically extracting highly structured information from medical texts like free-text medical records is a fundamental and crucial task.
[0003] Therefore, accurately and automatically extracting highly structured information from medical texts is an urgent problem to be solved. Summary of the Invention
[0004] According to one aspect of this application, a method for information extraction from medical text is provided, comprising: encoding the medical text using an encoding network to obtain a sequence of context vectors of the medical text; determining, based on a target category topic of the medical text, an adapter to be activated from a neural network model including multiple adapters, wherein each of the multiple adapters corresponds to a category topic; injecting information of the target category topic of the medical text into the sequence of context vectors using the activated adapter to obtain an optimized feature vector; performing entity recognition on the optimized feature vector and predicting the relationship type between each pair of entities in the identified entities; and outputting an information set with a predetermined structured format based on the identified entities and the predicted relationship type, wherein each category topic has a corresponding topic representative vector, and wherein the information extraction method further comprises: obtaining a numerical vector of the medical text; and determining the topic representative vector closest to the numerical vector based on the textual semantic similarity between the numerical vector and the topic representative vector corresponding to each category topic, and determining the target category topic of the medical text based on the closest topic representative vector.
[0005] According to an embodiment of this application, the topic representative vector corresponding to each column theme is obtained by: grouping multiple reference medical texts into multiple groups, each group including reference medical texts with the same column theme; and extracting the average vector from each group as the topic representative vector corresponding to the column theme of the group.
[0006] According to an embodiment of this application, entity recognition is performed on the optimized feature vector, and the relationship between entities is predicted, including: performing entity recognition using an entity recognition model and extracting the relationship between entities using a relationship extraction model in parallel for the optimized feature vector.
[0007] According to an embodiment of this application, the method further includes: for the optimized feature vector, using the entity recognition model and employing a pointer network or conditional random field (CRF) decoder to decode the entity, and for each entity identified, using a relation extraction model to predict the relationship between the entity and other identified entities.
[0008] According to an embodiment of this application, for each identified entity, predicting the relationship between the entity and other identified entities using a relation extraction model includes: constructing an n×n matrix, where n is the sequence length corresponding to the optimized feature vector; and using each entity identified for the optimized feature vector as the main diagonal element and boundary of the matrix, and using the relationship type predicted for the currently identified entity with each previously identified entity as the off-diagonal element of the matrix.
[0009] According to embodiments of this application, the information extraction method further includes: acquiring a training sample set, wherein each training sample in the training sample set includes an entity label and a relationship label between entities; dividing the training sample set to obtain multiple sample subsets, wherein each sample subset includes training samples with the same topic label (column topic); performing comparative learning and determining a comparative loss based on the positive and negative sample sets of each training sample, as a first loss associated with the neural network model; determining a second loss associated with the entity recognition model using a span-based NER method based on the training optimized feature vector corresponding to each training sample and the entity labels included in the training sample; determining a third loss associated with the relationship extraction model based on the predicted relationship of the entity pair and the corresponding relationship label for each entity pair in the entities identified by each training sample or the entity pair in the entities corresponding to the included entity labels; and constructing a multi-task loss function based on the first loss, the second loss, and the third loss to jointly train the neural network model, the entity recognition model, and the relationship extraction model.
[0010] According to an embodiment of this application, the training sample set is divided into multiple sample subsets, including: using a clustering algorithm to cluster the various medical texts included in the training sample set to obtain multiple training sample clusters, wherein, for each training sample, training samples under the topic tag (column topic) to which the training sample belongs belong to the positive sample set of the training sample, and training samples under other topic tags (column topics) belong to the negative sample set of the training sample.
[0011] According to embodiments of this application, constructing a multi-task loss function to jointly train the neural network model, the entity recognition model, and the relation extraction model includes: for different training samples in the training sample set, alternately performing the following steps: fixing the parameters of the neural network model to minimize the total loss value of the multi-task loss function, and adjusting the parameters of the entity recognition model and the relation extraction model; and fixing the parameters of the entity recognition model and the relation extraction model to minimize the total loss value of the multi-task loss function, and adjusting the parameters of the neural network model.
[0012] According to an embodiment of this application, the neural network model includes multiple sub-neural networks, each sub-neural network corresponding to an adapter. The information extraction method further includes: after training the neural network model, training additional sub-neural networks corresponding to additional adapters, the additional adapters corresponding to new column topics.
[0013] According to an embodiment of this application, the predetermined structured format is JSON format.
[0014] According to an embodiment of this application, the medical text includes the medical record text of a cancer patient, and the plurality of adapters includes a treatment adapter, an examination adapter, and a TNM staging adapter, respectively corresponding to the column topics of treatment, examination, and TNM staging.
[0015] According to another aspect of this application, an information extraction apparatus for medical text is also provided, comprising: an encoding module configured to encode the medical text using an encoding network to obtain a context vector sequence of the medical text; an optimization module configured to: determine, based on a target category theme of the medical text, an adapter to be activated from a neural network model including multiple adapters, wherein each of the multiple adapters corresponds to a category theme; and inject information of the target category theme of the medical text into the context vector sequence using the activated adapter to obtain an optimized feature vector; an identification and prediction module configured to perform entity recognition on the optimized feature vector and predict the relationship between each pair of entities in the identified entities; and an output module configured to output an information set having a predetermined structured format based on the identified entities and the predicted relationship type, wherein each category theme has a corresponding topic representative vector, and wherein the optimization module is further configured to: obtain a numerical vector of the medical text; and determine the topic representative vector closest to the numerical vector based on the textual semantic similarity between the numerical vector and the topic representative vector corresponding to each category theme, and determine the target category theme of the medical text based on the closest topic representative vector.
[0016] According to an embodiment of this application, the information extraction device further includes a training module configured to: acquire a training sample set, wherein each training sample in the training sample set includes an entity label and a relationship label between entities; divide the training sample set to obtain multiple sample subsets, wherein each sample subset includes training samples with the same topic label (column topic); perform contrastive learning and determine a contrastive loss based on the positive and negative sample sets of each training sample, as a first loss associated with the neural network model; determine a second loss associated with the entity recognition model using a span-based NER method based on the training optimized feature vector corresponding to each training sample and the entity labels included in the training sample; determine a third loss associated with the relationship extraction model based on the predicted relationship of the entity pair and the corresponding relationship label for each entity pair in the entities identified by each training sample or the entity pair in the entities corresponding to the included entity labels; and construct a multi-task loss function based on the first loss, the second loss, and the third loss to jointly train the neural network model, the entity recognition model, and the relationship extraction model.
[0017] According to another aspect of this application, a computing device is also provided, comprising: one or more processors; and one or more memories storing a computer program thereon, which, when executed by the one or more processors, causes the one or more processors to perform the information extraction method as described above.
[0018] According to another aspect of this application, a non-transitory computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by one or more processors, causes the one or more processors to perform the information extraction method as described above.
[0019] According to the information extraction scheme for medical text in this application, a modular column topic adapter is designed, introducing a topic adaptation mechanism. Simultaneously, entity recognition and relation extraction are optimized, enabling the model to dynamically adjust its feature extraction focus based on the target column topic. This significantly improves the accuracy and semantic consistency of information extraction under different column topics. Furthermore, by jointly training the three models as described above, corresponding column topic adapters can be dynamically selected or weighted for training samples during training, generating adapters specifically for column topics. Moreover, by using a multi-task loss function for joint optimization, these models are forced to learn consistent representations beneficial to both entity recognition and relation extraction tasks, in addition to generating adapters. Attached Figure Description
[0020] Figure 1An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.
[0021] Figure 2 A flowchart illustrating an information extraction method for medical text according to an embodiment of this application is shown.
[0022] Figure 3A A schematic flowchart illustrating a table-filling-based method for determining relation types is shown.
[0023] Figure 3B A schematic diagram of an architecture for an example of an information extraction method for medical text (specifically for tumor medical record text) according to an embodiment of this application is shown.
[0024] Figure 4 A flowchart illustrating the joint training method according to an embodiment of this application is shown.
[0025] Figure 5 An exemplary block diagram of an information extraction apparatus according to an embodiment of this application is shown.
[0026] Figure 6 A structural block diagram of a computing device according to an embodiment of this application is shown. Detailed Implementation
[0027] The technical solutions of the embodiments of this disclosure 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 disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0028] As mentioned earlier, in clinical research and data governance, such as in oncology, automatically extracting highly structured information from medical texts like free-text medical records is a fundamental and crucial task. Furthermore, this information typically revolves around specific clinical themes, such as "examinations and tests," "tumor staging," "surgical treatment," "drug therapy," and "pathological examination." Therefore, accurately and automatically extracting highly structured information from medical texts is a problem that urgently needs to be solved.
[0029] Currently, mainstream solutions suffer from significant technical bottlenecks:
[0030] 1) Semantic inconsistencies caused by task separation: Existing technologies typically employ a pipelined architecture. First, a model (such as a sequence labeling model) is used for entity recognition (NER) to identify entities such as "tumor size," "lymph node location," and "drug name." Then, another model (such as a relation classification model) is used for relation extraction (RE) to determine the relationships between entities (such as the "drug-adverse reaction" relationship). This separate design is prone to error accumulation and semantic conflicts. Furthermore, entity recognition models may fail to identify certain entities, and the network relationships between multiple entity nodes are very complex. For example, an entity recognition model might correctly identify the entities "paclitaxel" and "neutropenia," but a relation extraction model might fail to extract the "cause" relationship between them, or worse, extract the incorrect "treatment" relationship. Therefore, the correct semantics should be "paclitaxel causes neutropenia," but this correct relationship is not extracted, or the final generated semantics is "paclitaxel is used to treat neutropenia." In other words, the final generated "drug treatment" section content and the "adverse reactions" section content do not correspond semantically, resulting in low data quality.
[0031] 2) Weak Topic Generalization Ability: Existing information extraction models are typically general-purpose, lacking the ability to perceive and adapt to specific clinical topic categories. A model trained to extract entities and relationships of all types corresponding to clinical topic categories may fail to adequately focus on key entities such as stage (T), lymph nodes (N), and distant metastasis (M) and their complex combination rules when faced with a specific topic like "tumor staging," leading to a significant performance degradation in complex scenarios (such as new cancer types or non-standard expressions). The model cannot dynamically adjust its focus based on the topic of the clinical topic.
[0032] 3) Low degree of structuring: The discrete method only generates discrete entity and relation triples (i.e., entity 1, entity 2, relation type), which are difficult to directly form high-quality, structured column topics that can be directly used for clinical decision-making or scientific research analysis. In addition, a large number of post-processing rules are required to assemble them into a usable format, which is cumbersome and has high maintenance costs.
[0033] Therefore, embodiments of this disclosure provide a new method that can deeply integrate column topic semantics and achieve end-to-end integrated modeling to improve the accuracy, consistency and usability of structured information extraction from medical texts.
[0034] It should be noted that the patient user information and data involved in this application (including but not limited to data used for analysis, stored data, and displayed data from various data sources) are all information and data authorized by the patient user or fully authorized by all parties. Furthermore, the collection, use, and processing of the relevant data must comply with relevant laws, regulations, and standards, and corresponding operation entry points are provided for the patient user to choose to authorize or refuse.
[0035] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.
[0036] like Figure 1 As shown, the system architecture 100 may include terminal device 110, network 120, and server 130. Terminal device 110 may include various electronic devices such as smartphones, tablets, laptops, and desktop computers. Server 130 may be a standalone physical server, a server cluster or distributed device composed of multiple physical servers, or a cloud server providing cloud computing services. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.
[0037] Depending on the implementation requirements, the system architecture in this application embodiment can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group composed of multiple server devices. In addition, the technical solutions provided in this application embodiment can be applied to terminal device 110, or to server 130, or can be implemented jointly by terminal device 110 and server 130. This application does not impose any special limitations on this.
[0038] For example, server 130 can execute the information extraction method for medical text provided in this application. For instance, it can receive medical record text of a cancer patient input by a doctor through terminal device 110 via network 120, or retrieve stored medical record text from a storage device, accurately identify each entity in the medical record text, extract the relationship types between entity pairs, and return the identified entities and the relationship types between entity pairs to terminal device 110. Furthermore, since the information extraction method also involves various neural network models, server 130 can also train and update each neural network model to use the trained models for information extraction from the current medical text. In other embodiments, the information extraction method can be executed at terminal device 110, for example, if terminal device 110 has sufficient computing and processing capabilities, and terminal device 110 can retrieve trained models from the server via network, and locally extract information from the medical record text input by the doctor.
[0039] The following combination Figures 2 to 5 The specific details of the scheme for predicting the survival of cancer patients according to embodiments of this application are further described.
[0040] Figure 2 A flowchart illustrating an information extraction method for medical text according to an embodiment of this application is shown. Figure 2 The method 200 shown can be derived from Figure 1 The endpoint device or server shown is used to execute this.
[0041] like Figure 2 As shown, in step S210, the medical text is encoded using an encoding network to obtain a context vector sequence of the medical text.
[0042] For example, the encoding network can be a pre-trained language model, such as BERT, BioBERT, or ClinicalBERT. It serves as a shared foundation for all medical texts, responsible for deep semantic encoding of the input medical text (e.g., the original medical records of cancer patients), obtaining a context-aware vector representation of each token, thus yielding a sequence of context vectors derived from the tokens of the corresponding medical text. For each medical text, the sequence length of its context vector sequence is equal to the number of tokens. The concept of lexicalization is simple: it divides continuous natural language text into finer-grained processing units, i.e., tokens. The encoding network can further encode each token separately, transforming natural language text into a numerical representation, thereby facilitating the processing and training of neural network models such as deep learning models.
[0043] In step S220, based on the target column topic of the medical text, the adapter to be activated is determined from a neural network model including multiple adapters, and the activated adapter is used to inject the column topic information of the medical text into the context vector sequence to obtain an optimized feature vector, wherein each of the multiple adapters corresponds to a column topic.
[0044] Optionally, the neural network model may include a set of lightweight, pluggable sub-neural networks (e.g., multilayer perceptrons, specific attention layers, or vectors (e.g., MOE hybrid expert models)), with each adapter / sub-neural network corresponding to a specific topic. As an example, medical text may include the medical records of cancer patients, in which case the multiple adapters include a treatment adapter, an examination adapter, and a TNM staging adapter, respectively corresponding to the topic of treatment, examination, and TNM staging.
[0045] As mentioned earlier, each adapter corresponds to a sub-neural network (e.g., a multilayer perceptron, a specific attention layer, or a vector (e.g., the MOE hybrid expert model)). After the neural network model is trained and used in the inference process, if it is needed for a new column topic (e.g., "gene detection"), only a new lightweight adapter needs to be trained for that column topic, without retraining the entire neural network model. This greatly reduces the expansion cost and deployment difficulty.
[0046] According to the embodiment, each category topic has a corresponding topic representative vector. Therefore, based on the medical text under the target category topic (such as "drug treatment") for which information extraction is needed, for example, by referring to external control signals indicating relevant information of each category topic or the indication information of the target category topic, the corresponding adapter is activated to transform the context vector sequence obtained by the encoding network for the medical text, and output a feature vector rich in category topic information, i.e., an optimized feature vector. In other words, the feature vector processed by the adapter contains information of the corresponding target category topic. For example, by injecting prior knowledge and topic preferences of specific category topics into the context vector sequence output by the encoding network, it helps to optimize the subsequent information extraction process (e.g., entity recognition, relation extraction, and structured text output process). For example, after learning, the "TNM staging adapter" will pay more attention to words and their contextual patterns related to tumor size, number of lymph nodes, and metastatic sites.
[0047] Optionally, the indication information for the target topic can be user-input selection information. For example, the model parameters of each different adapter can be stored after training and correspond to different identifiers. The user inputs the identifier of the selected adapter through an input device. This selection information is converted into data that can be recognized by the neural network model, enabling the model to determine the current target topic and activate the corresponding adapter. For example, a doctor can input indication information for the corresponding topic, i.e., the adapter, through the input interface of terminal device 110.
[0048] In other examples, the external control signals indicating relevant information about each section's theme can be control vectors, such as theme representative vectors for each section's theme obtained through clustering, and the adapter to be activated can be automatically determined, for example, based on the control vectors. For instance, each of the multiple adapters corresponds to a theme representative vector; therefore, a numerical vector of the medical text can be obtained, and then, based on the textual semantic similarity between the numerical vector and each theme representative vector, the theme representative vector closest to the numerical vector can be determined, and the section's theme can be determined based on the closest theme representative vector, thereby determining the selected adapter. As an example, multiple groups can be obtained by grouping multiple reference medical texts, each group including reference medical texts with the same section theme; and an average vector can be extracted from each group as the theme representative vector of that group, corresponding to an adapter. For example, multiple clusters can be obtained by performing cluster analysis on historical reference medical texts to form a cluster set. For example, unsupervised clustering algorithms (such as K-Means, DBSCAN, or semantic clustering based on pre-trained models such as BERT) can be used to cluster all reference medical texts, extracting representative vectors from each cluster to represent the topic content, thus obtaining the topic representative vector for each cluster. Each cluster in the cluster set includes texts with the same or similar topics or styles, and the average vector extracted from each cluster is used as the topic representative vector for that cluster.
[0049] For example, given the current medical text, it can be converted into a numerical vector, for example, using a TF-IDF or Sentence-BERT model. Then, it is grouped into appropriate groups based on text semantic similarity (e.g., cosine similarity), and the adapter to be activated is determined based on the appropriate group.
[0050] Optionally, in other embodiments, for a given medical text, there may be more than one adapter that can be activated, for example, when certain sections have similar themes, and different adapters may be assigned different weights. In this case, the final optimized feature vector can be obtained by processing the context vector sequence of the medical text separately based on the two or more activated adapters (e.g., through averaging or weighting).
[0051] In step S230, entity recognition is performed on the optimized feature vector, and the relationship type between each entity pair in the recognized entities is predicted.
[0052] For example, in some implementations, it is simple to identify all entities and then re-identify the relationships between entity pairs. Since the optimized feature vector has been infused with information related to specific column topics, the accuracy of identification and prediction can be improved to some extent. However, this approach is generally inefficient and still carries the possibility of identification errors. Therefore, in other implementations of this application, entity identification using an entity recognition model and the extraction of relationship types between entities using a relation extraction model are performed in parallel for the optimized feature vector.
[0053] The entity recognition model and relation extraction model can employ widely used models. Since the operations of the entity recognition model and relation extraction model are parallel in the embodiments of this application, they are considered to jointly constitute an integrated joint decoding network, which includes an entity recognition head and a relation extraction head. The entity recognition head can synchronously decode all entities related to the column topic using a feature vector (i.e., an optimized feature vector) injected with the topic information of the column topic, employing a decoder such as a pointer network or a conditional random field (CRF). Simultaneously, the relation extraction head can predict the relationship between each entity and other identified entities as soon as the entity recognition head identifies it. This cascaded decoding method improves decoding efficiency and the accuracy of the relationship types between the decoded entities.
[0054] Optionally, joint decoding can be performed using a table-filling method. For example, an n×n matrix is constructed, where n is the sequence length corresponding to the optimized feature vector. The sequence length corresponding to the optimized feature vector can actually be regarded as the sequence length of the context vector sequence or the number of tokens. Then, each entity identified for the optimized feature vector is used as the main diagonal element and boundary of the matrix, and the relationship type predicted for the currently identified entity with each previously identified entity is used as the off-diagonal element of the matrix.
[0055] For example, Figure 3AA schematic flowchart is shown for determining the type of relationship based on a table-filling method, which includes processes 1 to 6 in sequence, corresponding to reference numerals 301-306 respectively.
[0056] like Figure 3A As shown, after obtaining the optimized feature vector in process 1, an n×n relation matrix is constructed in process 2. Then, joint prediction is initiated based on the relation table in process 3. In process 4, the entity type and boundary are predicted for the main diagonal cell element (i, j), for example, the entity type is B-Tumor. Alternatively, if no entity is identified for the current word (the part of the optimized feature vector corresponding to the word), the corresponding diagonal element is filled with a specific symbol (e.g., O) as the boundary. In process 5, the relation type between the current word i and the previously identified word j is predicted for the off-diagonal cell element (i, j), and the relation type between the currently identified entity (if the current word i corresponds to an entity) and the previously identified entity is predicted accordingly. For example, the relation type can be SizeOf, or if there is no relation, it can be represented as None. Then, in process 6, the relation types between all identified entities and the predicted entity pairs are combined to output the final result.
[0057] In step S240, based on the identified entities and the predicted relationship types, an information set with a predetermined structured format is output.
[0058] For example, the output is no longer isolated entities and relations, but directly forms a structured result set for the selected adapter's corresponding category topic. This results in highly structured, semantically consistent category topic data that can be directly imported into a database or applied to downstream tasks. For instance, for the category topic "Drug Treatment," a structured object like {Drug: Paclitaxel, Dosage: 175mg / m2, Frequency: Every three weeks, AND: [Carboplatin, AUC=5]} can be directly output.
[0059] Optionally, the predefined structured format can be JSON or other formats.
[0060] For example, as a concrete example, let's take the generation of an information set for the "TNM staging" section from a medical record text.
[0061] In this example, the doctor can, for example, through Figure 1 The terminal device 110 shown can input text or select the following medical record text from the stored historical text: "...microscopic examination revealed a tumor with a maximum diameter of 3.5 cm, infiltrating into the parietal pleura; 5 / 15 lymph nodes were detected with cancer metastasis; preoperative CT showed no signs of distant metastasis...".
[0062] After processing the medical record text and obtaining its topic representative vector (i.e., external control signal), the activation of the "TNM staging adapter" can be determined based on the topic representative vector.
[0063] The “TNM staging adapter” can obtain optimized feature vectors from the encoded context vector sequence of the medical record text, such as topic and preference information related to TNM staging.
[0064] Next, the entity recognition and relation extraction models jointly decode the optimized feature vector. For example, the entity recognition model simultaneously identifies the entities: tumor size: 3.5cm (T), lymph nodes: 5 / 15 (N), distant metastasis: none (M).
[0065] The relation extraction model, based on the table filling method, simultaneously predicts the following relations: (3.5cm, ->SizeOf->, Tumor), (5 / 15, ->PositiveFor->, Lymph Node), (None, ->NegativeFor->, Metastasis).
[0066] Structured output: Ultimately, structured JSON output is directly generated.
[0067] json
[0068] {
[0069] "T_stage": "T3",
[0070] "N_stage": "N2",
[0071] "M_stage": "M0",
[0072] "evidence": {
[0073] "T": "Tumor maximum diameter 3.5cm, infiltrating into the parietal pleura",
[0074] "N": "5 out of 15 lymph nodes were detected with cancer metastasis".
[0075] "M": Preoperative CT scan showed no signs of distant metastasis.
[0076] }
[0077] }
[0078] In contrast to the traditional pipeline approach, where entity recognition and relation extraction tasks are completely separated, the entity recognition model NER may correctly identify all entities, but the relation extraction model RE may mistakenly associate "nothing" that should be related to the entity "remote transfer" with the entity "lymph node".
[0079] The embodiments of this application, through joint learning and focusing on the "TNM staging" topic (selecting the appropriate adapter network through the topic representative vector), can effectively avoid such errors and ensure accurate matching of "T", "N", and "M" evidence.
[0080] Figure 3B A schematic diagram of a specific architecture for an information extraction method for medical text according to an embodiment of this application is shown (for tumor medical record text).
[0081] For example, such as Figure 3B As shown, the original tumor medical record text is first input into an encoding network 31 (e.g., BERT or BioBERT). The encoding network 31 encodes the original tumor medical record text, involving lexicalization, ultimately obtaining a context vector sequence of the original tumor medical record text (the sequence length is the number of lexical units). This context vector sequence, along with external control signals, can be provided to a neural network model 32. The neural network model 32 can include a component-based category topic adapter library, such as a treatment adapter 32-1, an examination adapter 32-2, and a TNM staging adapter 32-3, etc. Each adapter corresponds to a lightweight sub-neural network, and other adapters can be additionally trained as needed to adapt to more category topics. Furthermore, the external control signals can cluster the topic representative vectors of multiple clusters obtained from historical reference medical texts, and determine the category topic to which the current medical record text belongs based on the similarity between the numerical vector of the current medical record text and the topic representative vectors of each cluster. For example, in... Figure 3BIn the example shown, the selected topic is "TNM Installment Adapter" based on an external control signal. Alternatively, in other examples, the user can specify the adapter during inference. The selected adapter can then be activated, allowing the context vector sequence to be injected with topic-specific information (e.g., prior knowledge and topic preferences) through the neural network model 32, resulting in an information-enhanced optimized feature vector. For this optimized feature vector, the integrated joint decoding network 33 (obtained through joint learning of NER and RE) can employ a pointer network or a Conditional Random Field (CRF) decoder to simultaneously decode all entities related to the topic. Simultaneously, it predicts the relationship between the currently identified entity and other identified entities, for example, through table filling. In other words, entity recognition and relation extraction share underlying features and perform joint inference. Then, the output module 34, based on the identified entities and relation types, ultimately generates highly structured, semantically consistent topic data, which can be directly stored in a database or applied to downstream tasks.
[0082] In summary, the information extraction method for medical text according to the embodiments of this application, by designing a modular column topic adapter and introducing a topic adaptation mechanism, simultaneously optimizes entity recognition and relation extraction, enabling the model to dynamically adjust its feature extraction focus according to the topic of the target column, thereby significantly improving the accuracy and semantic consistency of information extraction under different column topics.
[0083] Furthermore, according to the embodiments of this application, by adopting the above-described scheme, a predetermined structured information set is directly output based on the input medical text, and a new method for end-to-end integrated modeling is realized.
[0084] As mentioned above, the neural network model including multiple adapters, as well as the entity recognition model and the relation extraction model, are the core of the information extraction scheme according to the embodiments of this application. Therefore, according to another aspect of this application, a training method for the neural network model, the entity recognition model, and the relation extraction model is also provided.
[0085] In this application, the neural network model, the entity recognition model, and the relation extraction model are jointly trained.
[0086] For example, Figure 4 A flowchart illustrating the joint training method according to an embodiment of this application is shown.
[0087] like Figure 4 As shown, in step S410, a training sample set is obtained, wherein each training sample in the training sample set includes an entity label and a relationship label between entities.
[0088] For example, each training sample may include historical medical text, which is similarly encoded by an encoding network (e.g., BERT) to obtain a sequence of context vectors, and may include entity labels indicating all the real entities it includes, as well as relation labels indicating the real relationships between these entities.
[0089] In step S420, the training sample set is divided into multiple sample subsets, wherein each sample subset includes training samples with the same topic label (column topic).
[0090] For example, a clustering algorithm can be used to cluster the various medical texts included in the training sample set, resulting in multiple training sample clusters. Each training sample cluster has the same topic label, corresponding to different section topics in different adapters. Additionally, each training sample cluster also has a corresponding topic representative vector.
[0091] The training sample set here may be the same as the multiple reference medical texts mentioned above, or may include medical text sets from other sources. For each training sample, training samples under the same topic tag (category topic) belong to the positive sample set of the training sample, and training samples under other topic tags (category topics) belong to the negative sample set of the training sample.
[0092] For example, clustering the training sample set (such as K-Means, DBSCAN, or semantic clustering based on pre-trained models such as BERT) can yield multiple clusters, and as mentioned earlier, each cluster can have a corresponding topic representative vector. All training samples in each cluster can be pooled using corresponding adapters (sub-neural networks), and after joint training as described later, adapters specific to each section's topic can be obtained.
[0093] In step S430, based on the positive and negative sample sets of each training sample, contrastive learning is performed and a contrastive loss is determined as the first loss associated with the neural network model.
[0094] For example, the positive sample set of each training sample can include other training samples under the same topic tag (category topic) as the training sample, and the negative sample set can include training samples under other topic tags (category topics). For example, InfoNCE contrastive learning can be used to make training samples under the same category topic more clustered in the vector space, and training samples under different category topics more separated in the vector space, thereby further enhancing the model's topic discrimination and generalization capabilities.
[0095] For example, the first loss function, which yields the first loss, can be expressed in the following format:
[0096] (1)
[0097] Where B is the training sample set, =Pool( ), that is, for the sample Pooling vectors after using the adapter This is the pooling vector of positive samples under the same topic tag (category topic) as sample i. This is the pooling vector for negative samples under different topic tags (section topics) from sample i. Let be the negative sample set of sample i; sim(·, ·) is the similarity calculation function, such as vector cosine similarity; This is a temperature coefficient used to adjust the sharpness of the distribution.
[0098] In step S440, based on the training optimized feature vector corresponding to each training sample and the fact that the training sample includes entity labels, a second loss associated with the entity recognition model is determined using the Span-based NER method.
[0099] The Span-based NER method treats NER as a fragment classification task. Its core idea is to enumerate all possible text fragments (spans) and then directly determine whether each fragment belongs to a predefined entity type.
[0100] For example, a set of candidate segments is generated by optimizing the feature vectors during training. Then, for each candidate segment, a feature representation is constructed. The segment representation is then input into a classifier to predict its category. Categories include, for example, [O (non-entity), PER, LOC, ORG, MISC, ...].
[0101] The classification loss can be expressed as follows:
[0102] (2)
[0103] S is the set of candidate fragments. Let `span(s,e)` represent a candidate segment, where `s` is the start position and `e` is the end position. The segment length does not exceed [a certain value]. To avoid excessively long and meaningless segments, S can be any span that meets the criteria, or you can use "gold standard (select only real entities) + sampling (select some negative samples)" to reduce the amount of computation.
[0104] The model outputs logits (unnormalized score vectors) for the candidate segment span(s,e), with a length equal to... , Represents the real category; None indicates that the span (s,e) is not an entity.
[0105] The combined NER loss (i.e., the second loss function that yields the second loss) is expressed as follows:
[0106] (3)
[0107] in, Entity boundary loss is typically a loss that models the start / end position of an entity separately, such as predicting whether each position is the start / end point of an entity. The value is between 0 and 1, and the purpose is to combine information from "boundary localization" and "Span classification" so that the model can learn the boundaries and types of entities at the same time.
[0108] In step S450, for each entity pair in the entities identified by each training sample or for each entity pair in the entities corresponding to the entity labels included, a third loss associated with the relation extraction model is determined based on the predicted relation of the entity pair and the corresponding relation label.
[0109] For example, the set of identified entities is Relationship prediction for each pair of directed entities The output relation category probability is represented as The relation loss is the sum of the cross-entropy of all entity pairs:
[0110] (4)
[0111] in For model pairs of entities The output is logits (unnormalized score vector). For the set of entity pairs used for training, there are two common choices: Gold entity pairs, which use labeled real entities to form pairs (ensuring the entities are correct and focusing on relation learning); and Predictive entity pairs, which use entities identified by the model itself to form pairs (simulating the reasoning process and end-to-end training).
[0112] In step S460, a multi-task loss function is constructed based on the first loss, the second loss, and the third loss to jointly train the neural network model, the entity recognition model, and the relation extraction model.
[0113] For example, the total loss can be expressed as a weighted sum of the three losses, therefore the multi-task loss function can be expressed as:
[0114] (5)
[0115] in, This is the weight parameter, and its value is between 0 and 1.
[0116] During joint training, the neural network model, entity recognition model, and relation extraction model can be trained alternately. Specifically, for different samples in the training sample set, the following steps are performed alternately: fixing the parameters of the neural network model to minimize the total loss value of the loss function, and adjusting the parameters of the entity recognition model and the relation extraction model; and fixing the parameters of the entity recognition model and the relation extraction model to minimize the total loss value of the loss function, and adjusting the parameters of the neural network model.
[0117] By jointly training the three models as described above, corresponding category-theme adapters can be dynamically selected or weighted for training samples during training, generating adapters specifically for category themes. Furthermore, by using a multi-task loss function for joint optimization, these models are forced to learn consistent representations beneficial to both entity recognition and relation extraction tasks, in addition to generating adapters. Moreover, through integrated joint learning, entity recognition and relation extraction share underlying features and mutually promote each other, fundamentally avoiding the error propagation problem of pipelined architectures and ensuring the internal logical consistency of the final generated category themes.
[0118] According to another aspect of the embodiments of this application, an information extraction device for medical text is also provided.
[0119] Figure 5 An exemplary block diagram of an information extraction apparatus according to an embodiment of this application is shown. Figure 5 The information extraction device shown may be or includes, for example, Figure 1 The terminal device or server shown.
[0120] like Figure 5 As shown, the information extraction device 500 may include an encoding module 510, an optimization module 520, an identification and prediction module 530, and an output module 540.
[0121] The encoding module 510 can be as follows: Figure 3B The encoding network is configured to encode the medical text using the encoding network to obtain a sequence of context vectors for the medical text.
[0122] For example, medical texts can include the medical records of cancer patients.
[0123] Optimization module 520 can be Figure 3BThe neural network module 32 is configured to determine the adapter to be activated from a neural network model including multiple adapters based on the target column topic of the medical text, and to inject the information of the target column topic of the medical text into the context vector sequence using the activated adapter to obtain an optimized feature vector, wherein each of the multiple adapters corresponds to a column topic.
[0124] For example, in the case of a medical record of a cancer patient, multiple adapters could include treatment adapters, examination adapters, and TNM staging adapters, respectively corresponding to the column topics of treatment, examination, and TNM staging. Of course, depending on the specific type of medical text, many more types of adapters could exist to accommodate various column topics.
[0125] The identification and prediction module 530 can be Figure 3B The integrated joint decoding network 33 is configured to perform entity recognition on the optimized feature vector and predict the relationship type between individual entity pairs in the recognized entities.
[0126] For example, the identification and prediction module 530 can perform entity identification using an entity recognition model and relationship extraction using a relation extraction model in parallel on the optimized feature vector obtained from the optimization module 520. For example, for the obtained optimized feature vector, entities are decoded using an entity recognition model and a pointer network or conditional random field (CRF) decoder, and for each identified entity, the relationship between that entity and other identified entities is predicted using a relation extraction model. For example, the parallel operation of entity identification and relation extraction can be performed based on a table-filling method.
[0127] The output module 540 can be configured to output a set of information with a predetermined structured format based on the identified entities and the relationship type. For example, the predetermined structured format is JSON.
[0128] Optionally, each category theme has a corresponding theme representative vector. For example, the numerical vector of the medical text can be a sequence of context vectors obtained through an encoding network, or a vector representation obtained through other feature extraction methods. Correspondingly, the optimization module 520 can also be configured to: obtain the numerical vector of the medical text; and determine the theme representative vector closest to the numerical vector based on the textual semantic similarity between the numerical vector and the theme representative vector corresponding to each category theme, and determine the target category theme of the medical text based on the closest theme representative vector. The theme representative vector corresponding to each category theme is obtained by: grouping multiple reference medical texts into multiple groups, each group including reference medical texts with the same category theme; and extracting the average vector from each group as the theme representative vector corresponding to the category theme of the group.
[0129] Optionally, in other embodiments, the information extraction device 500 may further include a training module 550 for jointly training the neural network model, the entity recognition model, and the relation extraction model.
[0130] For example, the training module 550 can be configured to: acquire a training sample set, wherein each training sample in the training sample set includes an entity label and a relationship label between entities; divide the training sample set to obtain multiple sample subsets, wherein each sample subset includes training samples with the same topic label (column topic); perform contrastive learning based on the positive and negative sample sets of each training sample and determine a contrastive loss as the first loss associated with the neural network model; determine the second loss associated with the entity recognition model using a span-based NER method based on the training optimized feature vector corresponding to each training sample and the entity labels included in the training sample; for each entity pair in the entities identified by each training sample or each entity pair in the entities corresponding to the entity labels included, determine the third loss associated with the relationship extraction model based on the predicted relationship of the entity pair and the corresponding relationship label; and construct a multi-task loss function based on the first loss, the second loss, and the third loss to jointly train the neural network model, the entity recognition model, and the relationship extraction model.
[0131] Furthermore, each adapter corresponds to a sub-neural network, and after the neural network model is trained and used in the inference process, if it is subsequently needed for a new column topic (such as "gene detection"), the training module 550 can be configured to train a new lightweight adapter for that column topic without retraining the entire neural network model. This greatly reduces the expansion cost and deployment difficulty.
[0132] For more details on joint training of training module 550, please refer to the previous text. Figures 2 to 4 The content described will not be repeated here.
[0133] The information extraction device for medical text according to embodiments of this application designs a modular column topic adapter and introduces a topic adaptation mechanism, simultaneously optimizing entity recognition and relation extraction. This allows the model to dynamically adjust its feature extraction focus according to the topic of the target column, thereby significantly improving the accuracy and semantic consistency of information extraction under different column topics. Furthermore, by jointly training the three models as described above, corresponding column topic adapters can be dynamically selected or weighted for training samples during training, generating adapters specifically for column topics. Moreover, by using a multi-task loss function for joint optimization, these models are forced to learn consistent representations beneficial to both entity recognition and relation extraction tasks, in addition to generating adapters.
[0134] Figure 5 For more details on the various modules, please refer to the previous section about Figures 2-4 Therefore, a detailed description of it is not required here.
[0135] In addition, although Figure 5 The modules described above are illustrated by way of example; however, it should be understood that the device 500 may be divided into more or fewer modules depending on different functions, or each module may be divided into further more or fewer sub-modules. In some example embodiments, a module or its sub-module may be implemented using electronic hardware (e.g., a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc.), computer software (e.g., which may be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable ROM (EPROM), etc.), or a combination of both.
[0136] According to another aspect of this application, a computing device for extracting information from medical text is also provided.
[0137] Figure 6 A structural block diagram of a computing device according to an embodiment of this application is shown. Figure 6 The computing device shown may be or includes, for example, Figure 1 The terminal device or server shown.
[0138] See Figure 6The computing device 600 may include one or more processors 610 and one or more memories 620 connected to the processors 610. Both the processors 610 and the memories 620 may be connected via a bus 630. The computing device 600 can be any type of portable device (such as a smart camera, smartphone, tablet, etc.) or any type of stationary device (such as a desktop computer, server, etc.). For example, the computing device may be... Figure 1 The server shown. Computing devices may also include other modules, such as... Figure 6 The network interface 670, display screen 640, input device 650, and camera 660 shown are among the components.
[0139] Processor 610 can perform various actions and processes according to the computer program 60 and computer instruction set stored in memory 620. Specifically, processor 610 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, and can be based on x86 architecture or ARM architecture.
[0140] Memory 620 stores computer-executable instructions that, when executed by processor 610, implement the aforementioned method for information extraction from medical text. Memory 620 may be volatile memory (e.g., internal memory 622) or non-volatile memory 621, or may include both volatile and non-volatile memory. Non-volatile memory 621 may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory of the methods described herein is intended to include, but is not limited to, these and any other suitable categories of memory.
[0141] Furthermore, the information extraction method for medical text according to the present invention can be recorded in a non-transitory computer-readable recording medium. Specifically, according to the present invention, a non-transitory computer-readable recording medium storing computer-executable instructions or computer programs can be provided, which, when executed by a processor, causes the processor to perform the information extraction method for medical text as described above.
[0142] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, 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, program segment, or portion of code containing at least one executable instruction for implementing a 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, can 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.
[0143] In general, various exemplary embodiments of the present invention can be implemented in hardware or dedicated circuitry, software, firmware, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device. When aspects of embodiments of the present invention are illustrated or described as block diagrams, flowcharts, or represented using certain other images, it will be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as non-limiting examples in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or certain combinations thereof.
[0144] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in a common dictionary shall be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or highly formalized meaning, unless expressly defined herein.
[0145] The foregoing description is intended to illustrate the invention and should not be construed as limiting it. Although several exemplary embodiments of the invention have been described, those skilled in the art will readily understand that many modifications can be made to the exemplary embodiments without departing from the novel teachings and advantages of the invention. Therefore, all such modifications are intended to be included within the scope of the invention as defined in the claims. It should be understood that the foregoing description is intended to illustrate the invention and should not be construed as limiting it to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The invention is defined by the claims and their equivalents.
Claims
1. A method for information extraction from medical text, characterized in that, include: The medical text is encoded using an encoding network to obtain a sequence of context vectors for the medical text. Based on the target column theme of the medical text, the adapter to be activated is determined from a neural network model including multiple adapters, and the activated adapter is used to inject the information of the target column theme of the medical text into the context vector sequence to obtain an optimized feature vector, wherein each of the multiple adapters corresponds to a column theme. Entity recognition is performed on the optimized feature vector, and the relationship type between each entity pair in the recognized entities is predicted; Based on the identified entities and the predicted relationship types, an information set with a predetermined structured format is output. Each section topic has a corresponding topic representative vector, and the information extraction method further includes: Obtain the numerical vector of the medical text; Based on the textual semantic similarity between the numerical vector and the topic representative vector corresponding to each column topic, the topic representative vector that is closest to the numerical vector is determined, and the target column topic of the medical text is determined based on the closest topic representative vector. The theme representation vector for each section's theme is obtained in the following way: Multiple groups were obtained by grouping multiple reference medical texts, and each group included reference medical texts with the same column theme; The average vector of each group is extracted as the theme representative vector corresponding to the column theme of that group. The medical text includes the medical records of cancer patients, and the multiple adapters include a treatment adapter, an examination adapter, and a TNM staging adapter, respectively corresponding to the column topics of treatment, examination, and TNM staging.
2. The information extraction method according to claim 1, characterized in that, Entity recognition is performed on the optimized feature vector, and relationships between entities are predicted, including: For the optimized feature vector, entity recognition using the entity recognition model and the extraction of relationships between entities using the relationship extraction model are performed in parallel.
3. The information extraction method according to claim 2, characterized in that, Also includes: For the optimized feature vector, the entity recognition model is used, and a pointer network or a conditional random field (CRF) decoder is employed to decode the entity. For each entity identified, a relation extraction model is used to predict the relationship between that entity and other identified entities.
4. The information extraction method according to claim 3, characterized in that, For each identified entity, the relationship between that entity and other identified entities is predicted using the relation extraction model, including: Construct an n×n matrix, where n is the sequence length corresponding to the optimized feature vector; Each entity identified for the optimized feature vector is used as the main diagonal element and boundary of the matrix, and the relationship type predicted for the currently identified entity with each previously identified entity is used as the off-diagonal element of the matrix.
5. The information extraction method according to claim 1, characterized in that, Also includes: Obtain a training sample set, wherein each training sample in the training sample set includes an entity label and a label relating the entities; The training sample set is divided into multiple sample subsets, each of which includes training samples with the same topic label. Based on the positive and negative sample sets for each training sample, contrastive learning is performed and a contrastive loss is determined as the first loss associated with the neural network model. Based on the training optimized feature vector corresponding to each training sample and the entity labels included in the training sample, the second loss associated with the entity recognition model for entity recognition is determined using the span-based NER method. For each entity pair in the entities identified by each training sample, or for each entity pair in the entities corresponding to the entity labels included, a third loss associated with the relation extraction model for relation type prediction is determined based on the predicted relation of the entity pair and the corresponding relation label. Based on the first loss, the second loss, and the third loss, a multi-task loss function is constructed to jointly train the neural network model, the entity recognition model, and the relation extraction model.
6. The information extraction method according to claim 5, characterized in that, The training sample set is divided into multiple sample subsets, including: A clustering algorithm is used to cluster the medical texts included in the training sample set to obtain multiple training sample clusters, each training sample cluster corresponding to a topic label; Specifically, for each training sample, training samples under the topic label to which the training sample belongs belong to the positive sample set of the training sample, and training samples under other topic labels belong to the negative sample set of the training sample.
7. The information extraction method according to claim 6, characterized in that, Constructing a multi-task loss function to jointly train the neural network model, the entity recognition model, and the relation extraction model includes: alternately performing the following steps for different training samples in the training sample set: With the parameters of the neural network model fixed, the parameters of the entity recognition model and the relation extraction model are adjusted to minimize the total loss value of the multi-task loss function. The parameters of the entity recognition model and the relation extraction model are fixed, and the parameters of the neural network model are adjusted with the goal of minimizing the total loss value of the multi-task loss function.
8. The information extraction method according to claim 1, characterized in that, The neural network model includes multiple sub-neural networks, each corresponding to an adapter. The information extraction method further includes: after training the neural network model, training an additional sub-neural network corresponding to the additional adapter, wherein the additional adapter corresponds to the new column topic.
9. The information extraction method according to claim 1, characterized in that, The predetermined structured format is JSON.
10. An information extraction device for medical text, characterized in that, include: The encoding module is configured to encode the medical text using an encoding network to obtain a sequence of context vectors of the medical text; The optimization module is configured to: determine the adapter to be activated from a neural network model including multiple adapters based on the target column topic of the medical text, wherein each of the multiple adapters corresponds to a column topic; And by using the activated adapter, information about the target section topic of the medical text is injected into the context vector sequence to obtain an optimized feature vector; The identification and prediction module is configured to perform entity identification on the optimized feature vector and predict the relationships between individual entity pairs among the identified entities. The output module is configured to output an information set with a predetermined structured format based on the identified entities and the predicted relationship types. Each section topic has a corresponding topic representative vector, and the optimization module is further configured as follows: Obtain the numerical vector of the medical text; Based on the textual semantic similarity between the numerical vector and the topic representative vector corresponding to each column topic, the topic representative vector that is closest to the numerical vector is determined, and the target column topic of the medical text is determined based on the closest topic representative vector. The theme representation vector for each section's theme is obtained in the following way: Multiple groups were obtained by grouping multiple reference medical texts, and each group included reference medical texts with the same column theme; The average vector of each group is extracted as the theme representative vector corresponding to the column theme of that group. The medical text includes the medical records of cancer patients, and the multiple adapters include a treatment adapter, an examination adapter, and a TNM staging adapter, respectively corresponding to the column topics of treatment, examination, and TNM staging.
11. The information extraction device according to claim 10, characterized in that, It also includes a training module, configured as follows: Obtain a training sample set, wherein each training sample in the training sample set includes an entity label and a label relating the entities; The training sample set is divided into multiple sample subsets, each of which includes training samples with the same topic label. Based on the positive and negative sample sets for each training sample, contrastive learning is performed and a contrastive loss is determined as the first loss associated with the neural network model. Based on the training optimized feature vector corresponding to each training sample and the fact that the training sample includes entity labels, a second loss associated with the entity recognition model for entity recognition is determined using a span-based NER method. For each entity pair in the entities identified by each training sample, or for each entity pair in the entities corresponding to the entity labels included, a third loss associated with the relation extraction model for relation type prediction is determined based on the predicted relation of the entity pair and the corresponding relation label. Based on the first loss, the second loss, and the third loss, a multi-task loss function is constructed to jointly train the neural network model, the entity recognition model, and the relation extraction model.
12. A computing device, characterized in that, include: One or more processors; One or more memories having a computer program stored thereon, which, when executed by the one or more processors, causes the one or more processors to perform the information extraction method as described in any one of claims 1-9.
13. A non-transitory computer-readable storage medium, characterized in that, It stores a computer program that, when executed by one or more processors, causes the one or more processors to perform the information extraction method as described in any one of claims 1-9.
Citation Information
Patent Citations
Electronic medical record free text analysis method, system and equipment
CN120821854A