New drug progress relationship extraction method and device
Through the BERT coding sequence and pre-trained prediction model, new drug research and development progress information is extracted and predicted, which solves the problem of low efficiency in obtaining drug research and development progress information from massive information in the biomedical industry, and achieves efficient and accurate acquisition of new drug development progress information. .
Patent Information
- Application Number
- CN202011402141.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-02
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-12-02
AI Technical Summary
In the biomedical industry, the efficiency of extracting new drug R&D progress information from massive news information data is low, and it is difficult to accurately obtain drug R&D progress with existing technology.
Using BERT coding sequences and pre-trained prediction models, by obtaining medical-related information text sequences, extracting drug name entities, and sequentially using the pre-trained model to predict triples of drug name entities, relationships and associated entities, thereby extracting from massive amounts of Accurately and efficiently obtain the progress of new drugs in the information.
It achieves accurate and efficient acquisition of new drug progress from massive information, improves the efficiency and accuracy of drug development progress information acquisition, accelerates convergence without changing the internal distribution, and solves the problem of category imbalance.
Smart Images

Figure CN112507009B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing, and in particular to a method and device for extracting new drug progress relations. Background Art
[0002] The biopharmaceutical industry includes the manufacturing, research and development, circulation and voluntary services of chemical drugs, biological drugs, traditional Chinese medicines and medical devices, and new drug research and development is an important part of it. The research and development of new drugs is a long-term process. The name of the drug is the product of continuous evolution in the process of drug research and development. It consists of research and development code, active ingredient and trade name. Among them, there is no industry standard for the research and development code, and the name is relatively arbitrary, generally starting with a letter and a few numbers; the active ingredient can be the name of the chemical molecular formula or a synonym; the trade name can be any noun.
[0003] At present, with the rapid development of the Internet industry, various new media information websites continue to emerge, such as Weibo, WeChat public accounts and other media platforms. News and information in the biopharmaceutical industry are no longer limited to government agency websites such as NMPA (National Medical Products Administration), FDA (Food and Drug Administration) and EMA (European Medicines Agency). More than 40% of drug research and development progress is reported by traditional news media. How to obtain drug research and development progress information from massive news information data is a problem that the industry urgently needs to solve. Summary of the invention
[0004] The present invention provides a new drug progress relationship extraction method and device, which can accurately and efficiently obtain the new drug progress status from massive information.
[0005] To this end, the present invention provides the following technical solutions:
[0006] A method for extracting new drug progress relations, the method comprising:
[0007] Obtaining medical-related information text sequences;
[0008] Obtain a BERT encoding sequence of the text sequence;
[0009] Extract all drug name entities in the text sequence;
[0010] Each drug name entity is taken as a condition in turn, and a pre-trained prediction model is used to predict a relationship triplet, wherein the relationship triplet includes: a drug name entity, a relationship, and an associated entity.
[0011] Optionally, obtaining a BERT encoding sequence of the text sequence includes:
[0012] The text sequence is segmented by words and input into a BERT encoder to obtain a BERT encoding sequence.
[0013] Optionally, extracting the drug name entity in the text sequence includes:
[0014] Segmenting the text sequence, searching a domain knowledge base according to each word unit obtained by segmentation to obtain a drug name entity in the text sequence; and / or
[0015] Performing layer normalization on the BERT encoding sequence;
[0016] The layer-normalized encoded sequence is input into the binary classifier to predict the position of the drug name entity;
[0017] The drug name entity in the text sequence is obtained according to the position of the drug name entity.
[0018] Optionally, the step of taking each drug name entity as a condition in turn and using a pre-trained prediction model to predict a relationship triplet includes:
[0019] (1) performing conditional layer normalization processing on the BERT encoding sequence using the encoding vector of each drug name entity as a condition in turn to obtain a first test sequence;
[0020] (2) Inputting the first test sequence into the prediction model, and obtaining a relation triple based on the drug name entity according to the output of the prediction model.
[0021] Optionally, the step of taking each drug name entity as a condition in turn and using a pre-trained relationship prediction model to predict entity relationship triples includes:
[0022] (1) performing conditional layer normalization processing on the BERT encoding sequence using the encoding vector of each drug name entity as a condition in turn to obtain a first test sequence;
[0023] (2) using the first test sequence and the associated entity model, predicting each associated entity;
[0024] (3) using the encoding vector of the drug name entity and the encoding vectors of each associated entity as conditions in turn to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence;
[0025] (4) using the second test sequence and the relationship model, predicting the relationship between the drug name entity and the associated entity;
[0026] (5) After traversing all drug name entities and associated entities, a relationship triple with complete drug name entities, relationships, and associated entities is obtained.
[0027] A new drug progress relationship extraction device, the device comprising:
[0028] A text acquisition module is used to acquire a sequence of medical-related information texts;
[0029] An encoding module, used to obtain a BERT encoding sequence of the text sequence;
[0030] An entity extraction module, used for extracting all drug name entities in the text sequence;
[0031] The relationship determination module is used to take each drug name entity as a condition in turn and use a pre-trained prediction model to predict a relationship triplet, wherein the relationship triplet includes: a drug name entity, a relationship, and an associated entity.
[0032] Optionally, the encoding module includes:
[0033] A segmentation unit, used for segmenting the text sequence by words;
[0034] The encoding unit is used to input the segmented word sequence into the BERT encoder to obtain a coding sequence.
[0035] Optionally, the entity extraction module includes: a first extraction module, and / or a second extraction module;
[0036] The first extraction module comprises:
[0037] A word segmentation unit, used to segment the text sequence to obtain word units;
[0038] A search unit, used for searching a domain knowledge base according to the word unit to obtain a drug name entity in the text sequence;
[0039] The second extraction module comprises:
[0040] A layer normalization processing unit, used to perform layer normalization processing on the BERT encoding sequence;
[0041] A position prediction unit is used to input the layer-normalized encoded sequence into a binary classifier to predict the position of the drug name entity;
[0042] The entity determination unit is used to obtain the drug name entity in the text sequence according to the position of the drug name entity.
[0043] Optionally, the relationship determination module includes:
[0044] A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence;
[0045] The triple prediction unit is used to input the first test sequence into the prediction model, and obtain the relationship triple based on the drug name entity according to the output of the prediction model.
[0046] Optionally, the relationship determination module includes:
[0047] A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence;
[0048] A related entity prediction unit, configured to predict each related entity using the first test sequence and the related entity model;
[0049] A second processing unit is used to sequentially use the encoding vector of the drug name entity and the encoding vectors of each associated entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence;
[0050] A relationship prediction unit, used to predict the relationship between the drug name entity and the associated entity by using the second test sequence and the relationship model;
[0051] The output unit is used to output the relation triples with complete drug name entities, relations, and associated entities.
[0052] The new drug progress relationship extraction method and device provided by the embodiment of the present invention obtain a medical-related information text sequence, encode it to obtain a BERT encoding sequence, first extract the main entity, that is, the drug name entity, and after obtaining the drug name entity, each drug name entity is used as a condition in turn, and a pre-trained prediction model is used to predict the relationship triple. The relationship triple includes: drug name entity, relationship, and associated entity, so that the progress of new drugs can be accurately and efficiently obtained from massive information.
[0053] Furthermore, when extracting drug name entities, not only can the domain knowledge base or model method be used for extraction, but the two methods can also be combined to ensure that all drug name entities in the information text are extracted.
[0054] Furthermore, considering that the number of target entity words is much smaller than that of non-target entity words and facing the problem of category imbalance, when using the model to extract drug name entities, the probability value is expressed in quadratic form, so that the distribution can be closer to the target without changing the distribution of the original inner product (the probability value p is usually obtained by adding sigmoid to the inner product). Not changing the inner product distribution is usually more friendly to optimization and can greatly speed up the convergence speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 is a flow chart of a method for extracting new drug progress relations according to an embodiment of the present invention;
[0056] Figure 2 is a flow chart for predicting relationship triples based on drug name entities in an embodiment of the present invention;
[0057] Figure 3 is another flow chart for predicting relationship triples based on drug name entities in an embodiment of the present invention;
[0058] Figure 4 is a schematic diagram of a method for extracting new drug progress relations according to an embodiment of the present invention;
[0059] Figure 5 It is a structural block diagram of a new drug progress relationship extraction device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The embodiment of the present invention provides a new drug progress relationship extraction method and device, which obtains a medical-related information text sequence, encodes it to obtain a BERT encoding sequence, first extracts the main entity, namely the drug name entity, and after obtaining the drug name entity, each drug name entity is used as a condition in turn, and a pre-trained prediction model is used to predict the relationship triple. The relationship triple includes: drug name entity, relationship, and associated entity, so that the progress of new drugs can be accurately and efficiently obtained from massive information.
[0061] like Figure 1 FIG. 1 is a flow chart of a method for extracting new drug progress relationships according to an embodiment of the present invention, comprising the following steps:
[0062] Step 101, obtaining a sequence of medical-related information texts.
[0063] Among them, the information text can be obtained through various channels and methods, such as media platforms such as Weibo and WeChat public accounts, government agency websites such as NMPA, FDA, EMA, medical newspapers, magazines and other media, which are not limited in the embodiments of the present invention. It should be noted that due to the different media forms, some specific processing is required when obtaining the corresponding information text. For example, for data sources in the form of images, text recognition is required; for data sources in the form of audio and video, voice recognition is required. These processes can be completed using existing technologies, which are not limited in the embodiments of the present invention.
[0064] Step 102: Obtain a BERT encoding sequence of the text sequence.
[0065] BERT (Bidirectional Encoder Representations from Transformers) is a new type of language model. The BERT encoding sequence refers to the ID of each word in the text sequence in the BERT dictionary.
[0066] Specifically, the text sequence is first segmented by word, and then input into the BERT encoder to obtain a BERT encoding sequence. For example, input "HPV vaccine", the output BERT encoding sequence is [11068,455,5729];
[0067] Step 103, extracting all drug name entities in the text sequence.
[0068] In practical applications, entity extraction can be performed based on domain knowledge base or model.
[0069] The domain knowledge base may specifically include a variety of entities, such as indications, drugs, targets, companies and other medical-related concepts, and may also include a variety of medical relationships.
[0070] For example, in an embodiment of the present invention, the domain knowledge base is mainly divided into two parts, a named entity vocabulary and a semantic relationship. Among them, the named entity vocabulary may include: a third-party standard vocabulary and an expert dictionary. The third-party standard vocabulary may include: a disease field professional vocabulary, an indication professional vocabulary, a clinical terminology professional vocabulary, a biomedical field organization library, etc.; the expert dictionary may be entity words sorted and annotated by experts in the medical field. The semantic relationship may include: a hierarchical relationship and an association relationship; among them, the association relationship may include: various relationships such as concept correlation, spatial correlation, and functional correlation.
[0071] The drug entity vocabulary in the domain knowledge base needs to be used as a basic dictionary. The word segmentation tool loads the basic dictionary to segment the text sequence, and each word unit obtained by the word segmentation is matched with the drug entity in the basic dictionary to obtain the drug name entity in the text sequence.
[0072] For example, the whole sentence is passed into the jieba word segmenter, combined with the drug name dictionary in the domain knowledge base, and the drug name entity string is output. According to the starting and ending positions of the string in the text sequence, the BERT encoding vector corresponding to the drug name entity can be obtained.
[0073] The process of extracting drug name entities using the model is as follows:
[0074] First, the BERT encoding sequence is layer-normalized, and then the layer-normalized encoding sequence is input into a binary classifier to predict the position of the drug name entity; and the drug name entity in the text sequence is obtained according to the position of the drug name entity.
[0075] The purpose of normalization is to ensure the consistency of data. The general formula for normalization is as follows:
[0076]
[0077] Among them, μ is the translation parameter (mean), σ is the scaling parameter (variance), b is the re-translation parameter, and g is the re-scaling parameter.
[0078] Layer normalization refers to normalizing all neurons in an intermediate layer. Its purpose is to make the distribution of input data more stable, reduce the variance of data in each dimension, and make subsequent deep network calculations more stable. Layer normalization also follows the above general formula (1), but the special thing is that the direction of solving μ and σ is horizontal (the same layer of the network).
[0079] It should be noted that, in the embodiment of the present invention, the position of the drug name entity predicted by the model includes the starting position and the ending position of the entity.
[0080] Furthermore, considering that some new words may not have been included in the domain knowledge base, in practical applications, the above two methods can be combined, with the drug names in the domain knowledge base as the main method and the recognition results of the model method as the auxiliary method, making full use of their respective advantages, namely the accuracy of domain knowledge base matching and the wide applicability of the model method, to extract all drug name entities in the text sequence.
[0081] It should be noted that in order to solve the problem of category imbalance caused by the fact that the target entity words are much less than the non-target entity words, some existing adjustment techniques can be used when extracting drug name entities using the model, such as focal loss, or manually adjusting class weights.
[0082] In addition, the embodiment of the present invention also provides a sample balance adjustment method. Specifically, the probability of representing category 1 (ie, the target entity word) is expressed as p 2 , so that p 2 It is closer to 0, and the loss still uses the normal binary cross entropy loss to accelerate the convergence speed.
[0083] The following is a brief explanation from the perspective of loss: 2 The difference from the probability value is denoted as p.
[0084] Assume the label is t∈{0,1},
[0085] When the probability value is expressed as p, the loss is: -tlogp-(1-t)log(1-p);
[0086] The probability value is denoted as p 2 In the case of , the loss is: -tlogp 2 -(1-t)log(1-p 2 );
[0087] Due to -tlogp 2 =-2tlogp, so when the label is 1, it is equivalent to amplifying the weight of the loss, and when the label is 0, 1-p 2 is closer to 1, so the corresponding loss is log(1-p 2 ) is smaller (the gradient is also smaller). Therefore, through this transformation, the loss weight (gradient weight) can be adaptively adjusted.
[0088] Compared with focal loss or manually adjusting class weights, the above-mentioned adaptive adjustment of loss weights does not change the distribution of the original inner product (p is usually the inner product plus sigmoid) to make the distribution closer to the target, and not changing the inner product distribution is usually more friendly to optimization.
[0089] Step 104, taking each drug name entity as a condition in turn, and using a pre-trained prediction model to predict a relationship triplet, the relationship triplet includes: a drug name entity, a relationship, and an associated entity.
[0090] After extracting the drug name entity, the pre-trained prediction model can be used to predict the relationship triple. For the convenience of description, the relationship triple is represented as: (s, p, o), where s represents the drug name entity, o represents the associated entity of the drug name, and p represents the relationship between the drug name entity and the associated entity.
[0091] When extracting the relationship triples, the following two methods can be used:
[0092] Method 1: First predict s, then predict the corresponding o based on s, and then predict the relationship p between s and o based on s and o.
[0093] Figure 2 A flow chart of predicting relationship triples based on drug name entities in an embodiment of the present invention is shown, including the following steps:
[0094] Step 201, conditional layer normalization is performed on the BERT encoding sequence using the encoding vector of the drug name entity as a condition to obtain a first test sequence. Conditional layer normalization is a special modification method of layer normalization, which adds constraints on the basis of existing layer normalization so that the neural network can make predictions in combination with the constraints.
[0095] Referring to the general formula for normalization mentioned above, for the pre-trained model, there are already ready-made g and b, which are both vectors of fixed length. To this end, in an embodiment of the present invention, the input condition s is transformed to the same dimension as g and b through two different transformation matrices. For example, the dimension of g is [50,768], the dimension of the word vector c of the restricted condition is [100,768], the dimension of the randomly generated change matrix t is [50,100], and matrix multiplication t*c is performed. The dimension of the matrix gc finally obtained is [50,768].
[0096] Then, add the two transformation results to g and b respectively, that is:
[0097]
[0098] Among them, g c and b c are the parameters obtained using conditional s transformation.
[0099] Step 202: using the first test sequence and the associated entity model, predict each associated entity.
[0100] The associated entity model may adopt a binary classifier, the first test sequence is input into the binary classifier, and the associated entity related to the drug name entity is obtained according to the output of the binary classifier.
[0101] Step 203: Get an associated entity.
[0102] Step 204, using the encoding vector of the drug name entity and the encoding vector of the associated entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence.
[0103] Step 205: using the second test sequence and the relationship model, predict the relationship between the drug name entity and the associated entity.
[0104] The relationship model may adopt a binary classifier, the second test sequence is input into the binary classifier, and the relationship between the drug name entity and the associated entity is obtained according to the output of the binary classifier.
[0105] Step 206 , determining whether there are any unpredicted related entities; if so, returning to step 203 ; otherwise, executing step 207 .
[0106] Step 207, obtaining a relationship triplet with complete drug name entity, relationship, and associated entity.
[0107] It should be noted that for each extracted drug name entity, Figure 2 The process shown is used to obtain the relationship triples based on the drug name entity.
[0108] Method 2: First predict s, and then predict o and p corresponding to s based on s, that is, P(s, p, o) = P(s)P(o|s)P(p|s, o).
[0109] Figure 3 Another flow chart of predicting relationship triples based on drug name entities in an embodiment of the present invention is shown, including the following steps:
[0110] Step 301, using the encoding vector of the drug name entity as a condition to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence.
[0111] Step 302: input the first test sequence into the prediction model, and obtain a relation triple based on the drug name entity according to the output of the prediction model.
[0112] Similarly, for each drug name entity extracted, Figure 2 The process shown is used to obtain the relationship triples based on the drug name entity.
[0113] It should be noted that in practical applications, Figure 4 The principle of the method of the present invention is to build a deep learning model for extracting the relationship triples, which can realize the above-mentioned drug name entity extraction, associated entity prediction, and relationship prediction functions. The deep learning model can be trained using artificially annotated data to obtain model parameters. Based on the trained deep learning model, the S, P, and O entity relationship extraction work can be performed.
[0114] The new drug progress relationship extraction method provided by the embodiment of the present invention obtains a medical-related information text sequence, encodes it to obtain a BERT encoding sequence, first extracts the main entity, that is, the drug name entity, and after obtaining the drug name entity, each drug name entity is used as a condition in turn, and a pre-trained prediction model is used to predict the relationship triple. The relationship triple includes: drug name entity, relationship, and associated entity, so that the progress of new drugs can be accurately and efficiently obtained from massive information.
[0115] Furthermore, when using the model to extract drug name entities, the probability value is expressed in quadratic form, so that the distribution can be closer to the target without changing the distribution of the original inner product (the probability value p is usually obtained by adding the inner product to the sigmoid). Not changing the inner product distribution is usually more friendly to optimization and can greatly speed up the convergence speed.
[0116] Accordingly, an embodiment of the present invention also provides a new drug progress relationship extraction device, such as Figure 5 Shown is a structural block diagram of the device.
[0117] In this embodiment, the device includes the following modules:
[0118] The text acquisition module 501 is used to acquire a sequence of medical-related information texts;
[0119] An encoding module 502, used to obtain a BERT encoding sequence of the text sequence;
[0120] Entity extraction module 503, used to extract all drug name entities in the text sequence;
[0121] The relationship determination module 504 is used to sequentially use each drug name entity as a condition and use a pre-trained prediction model to predict a relationship triplet, wherein the relationship triplet includes: a drug name entity, a relationship, and an associated entity.
[0122] The encoding module 501 may specifically include: a segmentation unit and an encoding unit. The segmentation unit is used to segment the text sequence by word; and the encoding unit is used to input the segmented word sequence into a BERT encoder to obtain an encoding sequence.
[0123] In practical applications, the entity extraction module 503 may perform entity extraction based on a domain knowledge base and / or a model. Accordingly, the entity extraction module 503 may include: a first extraction module and / or a second extraction module.
[0124] The first extraction module includes the following units:
[0125] A word segmentation unit, used to segment the text sequence to obtain word units;
[0126] A search unit is used to search the domain knowledge base according to the word unit to obtain the drug name entity in the text sequence.
[0127] The second extraction module includes the following units:
[0128] A layer normalization processing unit, used to perform layer normalization processing on the BERT encoding sequence;
[0129] A position prediction unit, used for inputting the layer-normalized coded sequence into a binary classifier to predict the position of the drug name entity, which includes the start position and the end position of the entity;
[0130] The entity determination unit is used to obtain the drug name entity in the text sequence according to the position of the drug name entity.
[0131] When the first extraction module and the second extraction module are used simultaneously to extract drug name entities, the drug names in the domain knowledge base can be taken as the main focus, and the recognition results of the model method can be used as an auxiliary, so as to make full use of their respective advantages, namely the accuracy of matching the domain knowledge base and the wide applicability of the model method, to extract all drug name entities in the text sequence.
[0132] The relationship determination module 504 can predict the relationship triples using a pre-trained prediction model. In practical applications, the prediction model can be a model that predicts the associated entity and the relationship between the drug name entity, or it can include two models, namely, a model that predicts the associated entity based on the drug name entity, and a model that predicts the relationship between the drug name entity and the associated entity.
[0133] For example, a specific structure of the relationship determination module may include the following units:
[0134] A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence;
[0135] The triple prediction unit is used to input the first test sequence into the prediction model, and obtain the relationship triple based on the drug name entity according to the output of the prediction model.
[0136] For another example, another specific structure of the relationship determination module may include the following units:
[0137] A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence;
[0138] A related entity prediction unit, configured to predict each related entity using the first test sequence and the related entity model;
[0139] A second processing unit is used to sequentially use the encoding vector of the drug name entity and the encoding vectors of each associated entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence;
[0140] A relationship prediction unit, used to predict the relationship between the drug name entity and the associated entity by using the second test sequence and the relationship model;
[0141] The output unit is used to output the relation triples with complete drug name entities, relations, and associated entities.
[0142] The new drug progress relationship extraction device provided by the embodiment of the present invention obtains a medical-related information text sequence, encodes it to obtain a BERT encoding sequence, first extracts the main entity, that is, the drug name entity, and after obtaining the drug name entity, each drug name entity is used as a condition in turn, and a pre-trained prediction model is used to predict the relationship triple. The relationship triple includes: drug name entity, relationship, and associated entity, so that the progress of new drugs can be accurately and efficiently obtained from massive information.
[0143] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. Moreover, the system embodiments described above are merely schematic, in which the modules and units described as separate components may or may not be physically separated, that is, they may be located on one network unit, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0144] A person skilled in the art can understand that all or part of the steps in the above method implementation can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc.
[0145] Accordingly, an embodiment of the present invention further provides a device for a method for extracting new drug progress relationships, which is an electronic device, such as a mobile terminal, a computer, a tablet device, a personal digital assistant, etc. The electronic device may include one or more processors and memories; wherein the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the methods described in the above embodiments.
[0146] The embodiments of the present invention are described in detail above. The present invention is described in detail using specific implementation methods herein. The description of the above embodiments is only used to help understand the method and device of the present invention. It is only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should belong to the scope of protection of the present invention, and the content of this specification should not be understood as limiting the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for extracting new drug progress relations, characterized in that: The method comprises: Obtaining medical-related information text sequences; Obtain a BERT encoding sequence of the text sequence; Extract all drug name entities in the text sequence; Taking each drug name entity as a condition in turn, using a pre-trained prediction model to predict a relationship triplet, the relationship triplet includes: drug name entity, relationship, and associated entity; The method of taking each drug name entity as a condition in turn and using a pre-trained relationship prediction model to predict entity relationship triples includes: (1) performing conditional layer normalization processing on the BERT encoding sequence using the encoding vector of each drug name entity as a condition in turn to obtain a first test sequence; (2) using the first test sequence and the associated entity model, predicting each associated entity; (3) using the encoding vector of the drug name entity and the encoding vectors of each associated entity as conditions in turn to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence; (4) using the second test sequence and the relationship model, predicting the relationship between the drug name entity and the associated entity; (5) After traversing all drug name entities and associated entities, a relationship triple with complete drug name entities, relationships, and associated entities is obtained; Among them, when the class imbalance problem is caused by the fact that the target entity words are much less than the non-target entity words, when using the model method to extract drug name entities, a sample balance adjustment method is provided, and the probability of representing the target entity word of category 1 is expressed as p 2 , so that p 2 It is closer to 0, and the loss still uses the normal binary cross entropy loss to accelerate the convergence speed.
2. The method according to claim 1, characterized in that The obtaining of the BERT encoding sequence of the text sequence comprises: The text sequence is segmented by words and input into a BERT encoder to obtain a BERT encoding sequence.
3. The method according to claim 1, characterized in that The extracting of drug name entities in the text sequence comprises: Segmenting the text sequence, searching a domain knowledge base according to each word unit obtained by segmentation to obtain a drug name entity in the text sequence; and / or Performing layer normalization on the BERT encoding sequence; The layer-normalized encoded sequence is input into the binary classifier to predict the position of the drug name entity; The drug name entity in the text sequence is obtained according to the position of the drug name entity.
4. A new drug progress relationship extraction device, characterized in that: The device comprises: A text acquisition module is used to acquire a sequence of medical-related information texts; An encoding module, used to obtain a BERT encoding sequence of the text sequence; An entity extraction module, used for extracting all drug name entities in the text sequence; A relationship determination module is used to sequentially use each drug name entity as a condition and predict a relationship triplet using a pre-trained prediction model, wherein the relationship triplet includes: a drug name entity, a relationship, and an associated entity; The relationship determination module comprises: A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence; A related entity prediction unit, configured to predict each related entity using the first test sequence and the related entity model; A second processing unit is used to sequentially use the encoding vector of the drug name entity and the encoding vectors of each associated entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a second test sequence; The relationship prediction unit is used to predict the relationship between the drug name entity and the associated entity using the second test sequence and the relationship model; wherein, when the class imbalance problem is caused by the fact that the target entity words are much less than the non-target entity words, when extracting the drug name entity using the model, a sample balance adjustment method is provided, and the probability of representing the target entity word of category 1 is expressed as p 2 , so that p 2 Closer to 0, the loss still uses the normal binary cross entropy loss to accelerate the convergence speed; The output unit is used to output the relation triples with complete drug name entities, relations, and associated entities.
5. The device according to claim 4, characterized in that The encoding module comprises: A segmentation unit, used for segmenting the text sequence by words; The encoding unit is used to input the segmented word sequence into the BERT encoder to obtain a coding sequence.
6. The device according to claim 4, characterized in that The entity extraction module includes: a first extraction module and / or a second extraction module; The first extraction module comprises: A word segmentation unit, used to segment the text sequence to obtain word units; A search unit, used for searching a domain knowledge base according to the word unit to obtain a drug name entity in the text sequence; The second extraction module comprises: A layer normalization processing unit, used to perform layer normalization processing on the BERT encoding sequence; A position prediction unit is used to input the layer-normalized encoded sequence into a binary classifier to predict the position of the drug name entity; The entity determination unit is used to obtain the drug name entity in the text sequence according to the position of the drug name entity.
7. The device according to claim 6, characterized in that The relationship determination module comprises: A first processing unit is used to sequentially use the encoding vectors of each drug name entity as conditions to perform conditional layer normalization processing on the BERT encoding sequence to obtain a first test sequence; The triple prediction unit is used to input the first test sequence into the prediction model, and obtain the relationship triple based on the drug name entity according to the output of the prediction model.
Citation Information
Patent Citations
Entity relationship joint extraction method based on transfer learning
CN111079431A
Entity relationship joint extraction method and device, equipment and medium
CN111666427A
