Drug identification method and related equipment based on machine learning

Through machine learning-based methods, coding models and recognition models are used to identify drug entities in medical texts, solving the problem of low efficiency in drug naming entities in the prior art, and achieving efficient and accurate drug extraction and recognition.

CN111523316BActive Publication Date: 2024-11-01PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010144271.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-04
Publication Date
2024-11-01
Estimated Expiration
2040-03-04

AI Technical Summary

Technical Problem

In the prior art, drug naming entity recognition is low efficiency and low accuracy. It relies on manual sorting, making it difficult to quickly and efficiently extract drug names from medical texts.

Method used

Using a machine learning-based approach, we can obtain drug statement sample sets, train coding models, extract vector sequences, and use chemical substances and therapeutic substance recognition models to identify drug entities, combine optical character recognition and web crawlers to obtain medical text data, and build drug knowledge Map.

Benefits of technology

It improves the efficiency and accuracy of drug recognition, realizes automated drug extraction and recognition, reduces manual intervention, and improves the efficiency of medical text analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111523316B_ABST
    Figure CN111523316B_ABST
Patent Text Reader

Abstract

The present invention provides a drug identification method based on machine learning and related equipment. The method uses a coding model to extract a vector sequence of a second drug statement sample, takes the vector sequence of the second drug sample as input, and trains a chemical substance identification model according to the chemical substance label of the second drug sample; uses a coding model to extract a vector sequence of a third drug statement sample, takes the vector sequence of the third drug sample as input, and trains a therapeutic substance identification model according to the therapeutic substance label of the third drug sample; the coding model extracts a vector sequence of a drug statement to be identified, the chemical substance identification model obtains a chemical substance entity set by identifying the vector sequence of the drug statement to be identified, and the therapeutic substance identification model obtains a therapeutic substance entity set by identifying the vector sequence of the drug statement to be identified; and the material entity existing in both the chemical substance entity set and the therapeutic substance entity set is determined as a drug. The present invention improves the efficiency and accuracy of drug identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of entity recognition technology, and in particular to a drug recognition method, device, computer equipment and computer-readable storage medium based on machine learning. Background Art

[0002] For many medical texts, extracting the drug names is of great help in understanding the text content. In order to help relevant practitioners and researchers quickly and efficiently obtain the drug names in medical texts, it is urgent to identify drug named entities and effectively obtain drug named entities from a large amount of medical texts.

[0003] In practical applications, named entity recognition technology is still a blank in the field of drug named entity recognition. At present, the work of organizing drugs is still done manually, which is inefficient and has low accuracy. Summary of the invention

[0004] In view of the above, it is necessary to propose a drug identification method, apparatus, computer device and computer-readable storage medium based on machine learning, which can identify drugs in drug sentences to be identified.

[0005] The first aspect of the present application provides a drug identification method based on machine learning, the method comprising:

[0006] Acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0007] Training the encoding model using the first drug sentence sample set;

[0008] Acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0009] extracting a vector sequence of the second drug sentence sample using the encoding model, and taking the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0010] extracting a vector sequence of the third drug sentence sample using the encoding model, and taking the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0011] Obtain a sentence of a drug to be identified;

[0012] Extracting the vector sequence of the to-be-identified drug sentence using the encoding model, obtaining the chemical substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the chemical substance identification model, and obtaining the therapeutic substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the therapeutic substance identification model;

[0013] A substance entity present in both the chemical substance entity set and the therapeutic substance entity set is identified as a drug.

[0014] In another possible implementation, obtaining the first drug statement sample set includes:

[0015] Scan and identify paper medical books through optical character recognition;

[0016] Use web crawlers to retrieve electronic medical documents from the Internet;

[0017] Extract multiple drug sentences from scanned paper medical books and crawled electronic medical documents;

[0018] Performing cleaning preprocessing on the multiple drug sentences;

[0019] Missing words and missing word labels are determined for each of the plurality of medication sentences.

[0020] In another possible implementation, the encoding model is a BERT model, and training the encoding model with the first drug sentence sample set includes:

[0021] Generate an input vector sequence for each first drug sentence sample;

[0022] Taking the input vector sequence of the first drug sentence sample as input, using the BERT model to calculate the output vector sequence of the first drug sentence sample;

[0023] Taking the output vector sequence of the first drug sentence sample as input, using a preset fully connected layer to calculate the missing word vector of the first drug sentence sample;

[0024] The BERT model and the preset fully connected layer are optimized according to the missing word vectors and labels of the first drug sentence sample.

[0025] In another possible implementation, generating an input vector sequence for each first drug sentence sample includes:

[0026] Segmenting each first drug sentence sample to obtain the words contained in each first drug sentence sample;

[0027] Obtaining a coding vector for each word of each first drug sentence sample according to a preset word coding table;

[0028] Generate a position vector of each word according to the position number of each word of each first drug sentence sample;

[0029] Concatenate the encoding vector and the position vector of each word of each first drug sentence sample to obtain the encoding input vector of each word of the first drug sentence sample;

[0030] The encoded input vectors of each word of each first drug sentence sample are combined in word order to obtain an input vector sequence of the first drug sentence sample.

[0031] In another possible implementation, the chemical substance identification model includes:

[0032] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0033] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0034] Model based on BiGRU and Conditional Random Fields.

[0035] In another possible implementation, the method further includes:

[0036] Outputting substance entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set;

[0037] Send identification reminder.

[0038] In another possible implementation, the method further includes:

[0039] Construct a drug knowledge graph using the identified drugs.

[0040] A second aspect of the present application provides a drug identification device based on machine learning, the device comprising:

[0041] A first acquisition module is used to acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0042] A first training module, used for training a coding model using the first drug sentence sample set;

[0043] A second acquisition module is used to acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0044] a second training module, configured to extract a vector sequence of the second drug sentence sample using the encoding model, and take the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0045] a third training module, configured to extract a vector sequence of the third drug sentence sample using the encoding model, and take the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0046] The third acquisition module is used to acquire the drug sentence to be identified;

[0047] A first recognition module, configured to extract the vector sequence of the to-be-recognized drug sentence using the encoding model, obtain a chemical substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the chemical substance recognition model, and obtain a therapeutic substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the therapeutic substance recognition model;

[0048] The second identification module is used to identify the material entities existing in both the chemical substance entity set and the therapeutic substance entity set as drugs.

[0049] In another possible implementation, obtaining the first drug statement sample set includes:

[0050] Scan and identify paper medical books through optical character recognition;

[0051] Use web crawlers to retrieve electronic medical documents from the Internet;

[0052] Extract multiple drug sentences from scanned paper medical books and crawled electronic medical documents;

[0053] Performing cleaning preprocessing on the multiple drug sentences;

[0054] Missing words and missing word labels are determined for each of the plurality of medication sentences.

[0055] In another possible implementation, the encoding model is a BERT model, and training the encoding model with the first drug sentence sample set includes:

[0056] Generate an input vector sequence for each first drug sentence sample;

[0057] Taking the input vector sequence of the first drug sentence sample as input, using the BERT model to calculate the output vector sequence of the first drug sentence sample;

[0058] Taking the output vector sequence of the first drug sentence sample as input, using a preset fully connected layer to calculate the missing word vector of the first drug sentence sample;

[0059] The BERT model and the preset fully connected layer are optimized according to the missing word vectors and labels of the first drug sentence sample.

[0060] In another possible implementation, generating an input vector sequence for each first drug sentence sample includes:

[0061] Segmenting each first drug sentence sample to obtain the words contained in each first drug sentence sample;

[0062] Obtaining a coding vector for each word of each first drug sentence sample according to a preset word coding table;

[0063] Generate a position vector of each word according to the position number of each word of each first drug sentence sample;

[0064] Concatenate the encoding vector and the position vector of each word of each first drug sentence sample to obtain the encoding input vector of each word of the first drug sentence sample;

[0065] The encoded input vectors of each word of each first drug sentence sample are combined in word order to obtain an input vector sequence of the first drug sentence sample.

[0066] In another possible implementation, the chemical substance identification model includes:

[0067] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0068] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0069] Model based on BiGRU and Conditional Random Fields.

[0070] In another possible implementation, the machine learning-based drug identification device further includes a sending module for outputting material entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set; and sending an identification reminder.

[0071] In another possible implementation, the machine learning-based drug identification device further includes a construction module for constructing a drug knowledge graph using the identified drugs.

[0072] A third aspect of the present application provides a computer device, comprising a processor, wherein the processor is configured to implement the machine learning-based drug identification method when executing a computer program stored in a memory.

[0073] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the machine learning-based drug identification method when executed by a processor.

[0074] The present invention realizes the identification of the drugs in the drug sentence to be identified, thereby improving the efficiency and accuracy of drug identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 It is a flow chart of a drug identification method based on machine learning provided in an embodiment of the present invention.

[0076] Figure 2 It is a structural diagram of a drug identification device based on machine learning provided in an embodiment of the present invention.

[0077] Figure 3 It is a schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0078] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0079] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than 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 are within the scope of protection of the present invention.

[0080] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0081] Preferably, the drug identification method based on machine learning of the present invention is applied in one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0082] The computer device may be a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with the user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0083] Embodiment 1

[0084] Figure 1 The flowchart of the drug identification method based on machine learning provided in the first embodiment of the present invention is shown in FIG. The drug identification method based on machine learning is applied to a computer device to identify drugs in a drug sentence to be identified.

[0085] like Figure 1 As shown, the drug identification method based on machine learning includes:

[0086] 101 , obtaining a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label.

[0087] In a specific embodiment, obtaining the first drug statement sample set includes:

[0088] (1) Scan and recognize paper medical books using optical character recognition (OCR).

[0089] For example, a book image of a paper medical book can be obtained through an optical scanner or a digital camera; the book image is binarized and converted into a black and white image by setting a preset binarization threshold; the black and white image is preprocessed by denoising and tilt correction; and the preprocessed black and white image is subjected to text recognition based on a neural network or distance.

[0090] (2) Use web crawlers to retrieve electronic medical documents from the Internet.

[0091] For example, a web crawler can be used to crawl electronic medical documents from Chinese journal literature databases (such as Wanfang, CNKI) or Baidu Encyclopedia using keywords such as "ingredients" and "traditional Chinese medicine" (or Chinese medicine name).

[0092] (3) Extract multiple drug statements from scanned paper medical books and crawled electronic medical documents.

[0093] For example, scanned paper medical books and captured electronic medical documents can be segmented and deduplicated to obtain multiple drug sentences.

[0094] (4) Perform cleaning preprocessing on the multiple drug statements.

[0095] For example, the extracted multiple drug sentences can be subjected to cleaning preprocessing such as typo correction and irrelevant sentence filtering.

[0096] (5) Determine the missing words and missing word labels of each drug sentence in the plurality of drug sentences.

[0097] For example, a drug sentence is "Metformin is a white powder", and a word (such as powder) in the drug sentence is randomly selected as the missing word, and the drug sentence with the missing word determined is obtained. <s>Metformin is a white <mask> <e>";in" <s>" indicates the head word of the drug sentence, " <e>" indicates the last word of the drug sentence. <mask>Indicates the missing word of the drug sentence, and "powder" is the missing word label of the drug sentence.

[0098] 102. Train an encoding model using the first drug sentence sample set.

[0099] In a specific embodiment, the encoding model may be a BERT model or a word embedding model.

[0100] If the encoding model is a BERT model, training the encoding model using the first drug sentence sample set includes:

[0101] Generate an input vector sequence for each first drug sentence sample;

[0102] Taking the input vector sequence of the first drug sentence sample as input, using the BERT model to calculate the output vector sequence of the first drug sentence sample;

[0103] Taking the output vector sequence of the first drug sentence sample as input, using a preset fully connected layer to calculate the missing word vector of the first drug sentence sample;

[0104] The BERT model and the preset fully connected layer are optimized according to the missing word vectors and labels of the first drug sentence sample.

[0105] In another embodiment, generating an input vector sequence for each first drug sentence sample may include:

[0106] (1) Segment each first drug sentence sample to obtain the words contained in each first drug sentence sample.

[0107] For example, a first drug sentence sample (Metformin is a white powder) is segmented to obtain the words "Metformin is a white powder" contained in the first drug sentence sample. The first drug sentence sample can be segmented using the Stanford word segmentation tool, or using a statistical or string matching-based method.

[0108] (2) Obtain the encoding vector of each word of each first drug sentence sample according to a preset word encoding table.

[0109] The preset word encoding table can adopt encoding methods such as one-hot, word2vec, etc., and the encoding vector of each word corresponds to the word one-to-one.

[0110] (3) Generate a position vector of each word according to the position number of each word in each first drug sentence sample.

[0111] For example, in the first drug sentence sample "Metformin is a white powder", the position number of "Metformin" is 1, and the position vector of the word is (0, 1).

[0112] (4) Concatenate the encoding vector and position vector of each word in each first drug sentence sample to obtain the encoding input vector of each word in the first drug sentence sample.

[0113] For example, the encoding vector of a word in a first drug sentence sample is a 10-dimensional vector, and the position vector is a 2-dimensional vector. Then the encoding input vector of the word is a 12-dimensional vector composed of the encoding vector of the word and the position vector of the word.

[0114] (5) Combining the encoded input vectors of each word of each first drug sentence sample according to word order to obtain an input vector sequence of the first drug sentence sample.

[0115] 103 , obtaining a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label.

[0116] For example, a second drug sentence sample in the second drug sentence sample set is "Metformin is a white powder soluble in water", and the label of the second drug sentence sample is "BH IH IH IH OOOOOOOO BH OOO". A third drug sentence sample in the third drug sentence sample set is "Metformin is often used as the main drug in the treatment of diabetes", and the label of the third drug sentence sample is "OOOOOOOOOO BZ IZ IZ IZ OOOOOO". Among them, "O" is a non-named entity, "BH" is the starting label of the chemical substance label, "IH" is the middle label of the chemical substance label, "BZ" is the starting label of the therapeutic substance label, and "IZ" is the middle label of the therapeutic substance label.

[0117] 104. Extract the vector sequence of the second drug sentence sample using the encoding model, and use the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample.

[0118] In a specific embodiment, the chemical substance identification model includes:

[0119] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0120] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0121] Model based on BiGRU and Conditional Random Fields.

[0122] For example, the chemical substance identification model is composed of a long short-term memory network and a conditional random field connected to the long short-term memory network; the encoding model can be used to extract the vector sequence of the second drug sentence sample, and the long short-term memory network can be used to extract the contextual semantic features of the second drug sentence sample to obtain the intermediate vector sequence of the second drug sentence sample; the conditional random field is used to output the chemical substance prediction label of the second drug sentence sample with the intermediate vector sequence as input, and the parameters of the long short-term memory network and the conditional random field are optimized according to the chemical substance label and the chemical substance prediction label.

[0123] 105 , extracting a vector sequence of the third drug sentence sample using the encoding model, and taking the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample.

[0124] In a specific embodiment, the therapeutic substance identification model includes:

[0125] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0126] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0127] Model based on BiGRU and Conditional Random Fields.

[0128] For example, the therapeutic substance identification model is composed of a bidirectional long short-term memory network and a conditional random field connected to the bidirectional long short-term memory network; the encoding model can be used to extract the vector sequence of the third drug sentence sample, and the bidirectional long short-term memory network can be used to extract the contextual semantic features of the third drug sentence sample to obtain the intermediate vector sequence of the third drug sentence sample; the conditional random field is used to output the therapeutic substance prediction label of the third drug sentence sample with the intermediate vector sequence as input, and the parameters of the bidirectional long short-term memory network and the conditional random field are optimized according to the therapeutic substance label and the therapeutic substance prediction label.

[0129] 106, obtaining a sentence of a drug to be identified.

[0130] For example, the sentence of the drug to be identified may be "Metformin is a white powder soluble in water. It is often used as the main drug in the treatment of diabetes. During the medication period, the patient should strictly control the intake of glucose."

[0131] 107. Use the encoding model to extract the vector sequence of the drug sentence to be identified, use the chemical substance identification model to obtain the chemical substance entity set by identifying the vector sequence of the drug sentence to be identified, and use the therapeutic substance identification model to obtain the therapeutic substance entity set by identifying the vector sequence of the drug sentence to be identified.

[0132] For example, the encoding model is used to extract the vector sequence of the above-mentioned drug sentences to be identified, and the chemical entity set obtained by using the trained chemical substance identification model to identify the vector sequence of the above-mentioned drug sentences to be identified is {metformin, metformin, glucose}, and the therapeutic substance entity set obtained by using the therapeutic substance identification model to identify the vector sequence of the above-mentioned drug sentences to be identified is {metformin}.

[0133] 108 , identifying a material entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0134] For example, if the chemical substance entity set is {metformin, metformin, glucose} and the therapeutic substance entity set is {metformin}, the material entity "metformin" that exists in both the chemical substance entity set and the therapeutic substance entity set is identified as a drug.

[0135] Embodiment 1 identifies drugs in a drug sentence to be identified, thereby improving the efficiency and accuracy of drug identification.

[0136] In another embodiment, the method further comprises:

[0137] Outputting substance entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set;

[0138] Send identification reminder.

[0139] Outputting the material entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set can avoid misidentification, and sending an identification reminder to the user to receive the user's determination result.

[0140] In another embodiment, the method further comprises:

[0141] Construct a drug knowledge graph using the identified drugs.

[0142] Two drugs that appear in a drug sentence can be connected in the knowledge graph to reflect the relationship between the drugs.

[0143] Embodiment 2

[0144] Figure 2 1 is a structural diagram of a drug identification device based on machine learning provided in Embodiment 2 of the present invention. The drug identification device based on machine learning 20 is applied to a computer device. The drug identification device based on machine learning 20 is used to identify drugs in a drug sentence to be identified.

[0145] like Figure 2 As shown, the machine learning-based drug identification device 20 may include a first acquisition module 201, a first training module 202, a second acquisition module 203, a second training module 204, a third training module 205, a third acquisition module 206, a first identification module 207, and a second identification module 208.

[0146] The first acquisition module 201 is used to acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label.

[0147] In a specific embodiment, obtaining the first drug statement sample set includes:

[0148] (1) Scan and recognize paper medical books using optical character recognition (OCR).

[0149] For example, a book image of a paper medical book can be obtained through an optical scanner or a digital camera; the book image is binarized and converted into a black and white image by setting a preset binarization threshold; the black and white image is preprocessed by denoising and tilt correction; and the preprocessed black and white image is subjected to text recognition based on a neural network or distance.

[0150] (2) Use web crawlers to retrieve electronic medical documents from the Internet.

[0151] For example, a web crawler can be used to crawl electronic medical documents from Chinese journal literature databases (such as Wanfang, CNKI) or Baidu Encyclopedia using keywords such as "ingredients" and "traditional Chinese medicine" (or Chinese medicine name).

[0152] (3) Extract multiple drug statements from scanned paper medical books and crawled electronic medical documents.

[0153] For example, scanned paper medical books and captured electronic medical documents can be segmented and deduplicated to obtain multiple drug sentences.

[0154] (4) Perform cleaning preprocessing on the multiple drug statements.

[0155] For example, the extracted multiple drug sentences can be subjected to cleaning preprocessing such as typo correction and irrelevant sentence filtering.

[0156] (5) Determine the missing words and missing word labels of each drug sentence in the plurality of drug sentences.

[0157] For example, a drug sentence is "Metformin is a white powder", and a word (such as powder) in the drug sentence is randomly selected as the missing word to obtain the drug sentence with the missing word determined. <s>Metformin is a white <mask> <e>";in" <s>" indicates the head word of the drug sentence, " <e>" indicates the last word of the drug sentence. <mask>Indicates the missing word of the drug sentence, and "powder" is the missing word label of the drug sentence.

[0158] The first training module 202 is used to train the encoding model using the first drug sentence sample set.

[0159] In a specific embodiment, the encoding model may be a BERT model or a word embedding model.

[0160] If the encoding model is a BERT model, training the encoding model using the first drug sentence sample set includes:

[0161] Generate an input vector sequence for each first drug sentence sample;

[0162] Taking the input vector sequence of the first drug sentence sample as input, using the BERT model to calculate the output vector sequence of the first drug sentence sample;

[0163] Taking the output vector sequence of the first drug sentence sample as input, using a preset fully connected layer to calculate the missing word vector of the first drug sentence sample;

[0164] The BERT model and the preset fully connected layer are optimized according to the missing word vectors and labels of the first drug sentence sample.

[0165] In another embodiment, generating an input vector sequence for each first drug sentence sample may include:

[0166] (1) Segment each first drug sentence sample to obtain the words contained in each first drug sentence sample.

[0167] For example, a first drug sentence sample (Metformin is a white powder) is segmented to obtain the words "Metformin is a white powder" contained in the first drug sentence sample. The first drug sentence sample can be segmented using the Stanford word segmentation tool, or using a statistical or string matching-based method.

[0168] (2) Obtain the encoding vector of each word of each first drug sentence sample according to a preset word encoding table.

[0169] The preset word encoding table can adopt encoding methods such as one-hot, word2vec, etc., and the encoding vector of each word corresponds to the word one-to-one.

[0170] (3) Generate a position vector of each word according to the position number of each word in each first drug sentence sample.

[0171] For example, in the first drug sentence sample "Metformin is a white powder", the position number of "Metformin" is 1, and the position vector of the word is (0, 1).

[0172] (4) Concatenate the encoding vector and position vector of each word in each first drug sentence sample to obtain the encoding input vector of each word in the first drug sentence sample.

[0173] For example, the encoding vector of a word in a first drug sentence sample is a 10-dimensional vector, and the position vector is a 2-dimensional vector. Then the encoding input vector of the word is a 12-dimensional vector composed of the encoding vector of the word and the position vector of the word.

[0174] (5) Combining the encoded input vectors of each word of each first drug sentence sample according to word order to obtain an input vector sequence of the first drug sentence sample.

[0175] The second acquisition module 203 is used to acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set contains a chemical substance label, and each third drug statement sample in the third drug statement sample set contains a therapeutic substance label.

[0176] For example, a second drug sentence sample in the second drug sentence sample set is "Metformin is a white powder soluble in water", and the label of the second drug sentence sample is "BH IH IH IH OOOOOOOO BH OOO". A third drug sentence sample in the third drug sentence sample set is "Metformin is often used as the main drug in the treatment of diabetes", and the label of the third drug sentence sample is "OOOOOOOOOO BZ IZ IZ IZ OOOOOO". Among them, "O" is a non-named entity, "BH" is the starting label of the chemical substance label, "IH" is the middle label of the chemical substance label, "BZ" is the starting label of the therapeutic substance label, and "IZ" is the middle label of the therapeutic substance label.

[0177] The second training module 204 is used to extract the vector sequence of the second drug sentence sample using the encoding model, and take the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample.

[0178] In a specific embodiment, the chemical substance identification model includes:

[0179] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0180] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0181] Model based on BiGRU and Conditional Random Fields.

[0182] For example, the chemical substance identification model is composed of a long short-term memory network and a conditional random field connected to the long short-term memory network; the encoding model can be used to extract the vector sequence of the second drug sentence sample, and the long short-term memory network can be used to extract the contextual semantic features of the second drug sentence sample to obtain the intermediate vector sequence of the second drug sentence sample; the conditional random field is used to output the chemical substance prediction label of the second drug sentence sample with the intermediate vector sequence as input, and the parameters of the long short-term memory network and the conditional random field are optimized according to the chemical substance label and the chemical substance prediction label.

[0183] The third training module 205 is used to extract the vector sequence of the third drug sentence sample using the encoding model, and take the vector sequence of the third drug sample as input to train the therapeutic substance recognition model according to the therapeutic substance label of the third drug sample.

[0184] In a specific embodiment, the therapeutic substance identification model includes:

[0185] Models based on Long Short-Term Memory Networks and Conditional Random Fields; or

[0186] Models based on bidirectional long short-term memory networks and conditional random fields; or

[0187] Model based on BiGRU and Conditional Random Fields.

[0188] For example, the therapeutic substance identification model is composed of a bidirectional long short-term memory network and a conditional random field connected to the bidirectional long short-term memory network; the encoding model can be used to extract the vector sequence of the third drug sentence sample, and the bidirectional long short-term memory network can be used to extract the contextual semantic features of the third drug sentence sample to obtain the intermediate vector sequence of the third drug sentence sample; the conditional random field is used to output the therapeutic substance prediction label of the third drug sentence sample with the intermediate vector sequence as input, and the parameters of the bidirectional long short-term memory network and the conditional random field are optimized according to the therapeutic substance label and the therapeutic substance prediction label.

[0189] The third acquisition module 206 is used to acquire a sentence of a drug to be identified.

[0190] For example, the sentence of the drug to be identified may be "Metformin is a white powder soluble in water. It is often used as the main drug in the treatment of diabetes. During the medication period, the patient should strictly control the intake of glucose."

[0191] The first recognition module 207 is used to extract the vector sequence of the drug sentence to be identified by using the encoding model, obtain the chemical substance entity set by identifying the vector sequence of the drug sentence to be identified by using the chemical substance recognition model, and obtain the therapeutic substance entity set by identifying the vector sequence of the drug sentence to be identified by using the therapeutic substance recognition model.

[0192] For example, the encoding model is used to extract the vector sequence of the above-mentioned drug sentences to be identified, and the chemical entity set obtained by using the trained chemical substance identification model to identify the vector sequence of the above-mentioned drug sentences to be identified is {metformin, metformin, glucose}, and the therapeutic substance entity set obtained by using the therapeutic substance identification model to identify the vector sequence of the above-mentioned drug sentences to be identified is {metformin}.

[0193] The second identification module 208 is configured to identify a substance entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0194] For example, if the chemical substance entity set is {metformin, metformin, glucose} and the therapeutic substance entity set is {metformin}, the material entity "metformin" that exists in both the chemical substance entity set and the therapeutic substance entity set is identified as a drug.

[0195] Embodiment 2 identifies drugs in a drug sentence to be identified, thereby improving the efficiency and accuracy of drug identification.

[0196] In another embodiment, the machine learning-based drug identification device 20 further includes: a sending module, configured to output material entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set; and to send an identification reminder.

[0197] In another embodiment, the machine learning-based drug identification device 20 may further include: a construction module for constructing a drug knowledge graph using the identified drugs.

[0198] Embodiment 3

[0199] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned drug identification method embodiment based on machine learning are implemented, such as Figure 1 Steps 101-108 shown:

[0200] 101, obtaining a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0201] 102, training an encoding model using the first drug sentence sample set;

[0202] 103, obtaining a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0203] 104, extracting a vector sequence of the second drug sentence sample using the encoding model, and taking the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0204] 105, extracting a vector sequence of the third drug sentence sample using the encoding model, and taking the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0205] 106, obtaining a sentence of a drug to be identified;

[0206] 107, extracting the vector sequence of the to-be-identified drug sentence using the encoding model, obtaining a chemical substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the chemical substance identification model, and obtaining a therapeutic substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the therapeutic substance identification model;

[0207] 108 , identifying a material entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0208] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-208:

[0209] A first acquisition module 201 is used to acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0210] A first training module 202, used for training a coding model using the first drug sentence sample set;

[0211] A second acquisition module 203 is used to acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0212] A second training module 204 is used to extract the vector sequence of the second drug sentence sample using the encoding model, and take the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0213] A third training module 205 is used to extract the vector sequence of the third drug sentence sample using the encoding model, and take the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0214] The third acquisition module 206 is used to acquire a sentence of a drug to be identified;

[0215] A first recognition module 207, configured to extract the vector sequence of the to-be-recognized drug sentence using the encoding model, obtain a chemical substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the chemical substance recognition model, and obtain a therapeutic substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the therapeutic substance recognition model;

[0216] The second identification module 208 is configured to identify a substance entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0217] Embodiment 4

[0218] Figure 3 Schematic diagram of a computer device provided in Embodiment 3 of the present invention. The computer device 30 includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and executable on the processor 302, such as a drug identification program based on machine learning. When the processor 302 executes the computer program 303, the steps in the above-mentioned drug identification method embodiment based on machine learning are implemented, such as Figure 1 101-108 shown:

[0219] 101, obtaining a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0220] 102, training an encoding model using the first drug sentence sample set;

[0221] 103, obtaining a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0222] 104, extracting a vector sequence of the second drug sentence sample using the encoding model, and taking the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0223] 105, extracting a vector sequence of the third drug sentence sample using the encoding model, and taking the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0224] 106, obtaining a sentence of a drug to be identified;

[0225] 107, extracting the vector sequence of the to-be-identified drug sentence using the encoding model, obtaining a chemical substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the chemical substance identification model, and obtaining a therapeutic substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the therapeutic substance identification model;

[0226] 108 , identifying a material entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0227] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-208:

[0228] A first acquisition module 201 is used to acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label;

[0229] A first training module 202, used for training a coding model using the first drug sentence sample set;

[0230] A second acquisition module 203 is used to acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label;

[0231] A second training module 204 is used to extract the vector sequence of the second drug sentence sample using the encoding model, and take the vector sequence of the second drug sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sample;

[0232] A third training module 205 is used to extract the vector sequence of the third drug sentence sample using the encoding model, and take the vector sequence of the third drug sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sample;

[0233] The third acquisition module 206 is used to acquire a sentence of a drug to be identified;

[0234] A first recognition module 207, configured to extract the vector sequence of the to-be-recognized drug sentence using the encoding model, obtain a chemical substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the chemical substance recognition model, and obtain a therapeutic substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the therapeutic substance recognition model;

[0235] The second identification module 208 is configured to identify a substance entity existing in both the chemical substance entity set and the therapeutic substance entity set as a drug.

[0236] Exemplarily, the computer program 303 may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the computer device 30. For example, the computer program 303 may be divided into Figure 2 For the first acquisition module 201, the first training module 202, the second acquisition module 203, the second training module 204, the third training module 205, the third acquisition module 206, the first recognition module 207, and the second recognition module 208, please refer to the second embodiment for the specific functions of each module.

[0237] Those skilled in the art will understand that the Figure 3 It is only an example of the computer device 30 and does not constitute a limitation of the computer device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, etc.

[0238] The processor 302 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 302 may also be any conventional processor, etc. The processor 302 is the control center of the computer device 30, and uses various interfaces and lines to connect various parts of the entire computer device 30.

[0239] The memory 301 can be used to store the computer program 303. The processor 302 implements various functions of the computer device 30 by running or executing the computer program or module stored in the memory 301 and calling the data stored in the memory 301. The memory 301 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer device 30, etc. In addition, the memory 301 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0240] If the module integrated in the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).

[0241] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0242] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0243] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0244] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention.

[0245] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or devices stated in the system claim can also be implemented by one module or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0246] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.< / mask> < / e> < / s> < / e> < / mask> < / s> < / mask> < / e> < / s> < / e> < / mask> < / s>

Claims

1. A drug identification method based on machine learning, characterized in that: The method comprises: Acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label; The encoding model is trained with the first drug sentence sample set, and the encoding model is a BERT model, including: performing word segmentation on each first drug sentence sample to obtain the words contained in each first drug sentence sample; obtaining the encoding vector of each word of each first drug sentence sample according to a preset word encoding table; generating the position vector of each word of each first drug sentence sample according to the position number of each word; splicing the encoding vector and position vector of each word of each first drug sentence sample to obtain the encoding input vector of each word of the first drug sentence sample; combining the encoding input vector of each word of each first drug sentence sample according to the word order to obtain the input vector sequence of the first drug sentence sample; using the input vector sequence of the first drug sentence sample as input, using the BERT model to calculate the output vector sequence of the first drug sentence sample; using the output vector sequence of the first drug sentence sample as input, using a preset fully connected layer to calculate the missing word vector of the first drug sentence sample; optimizing the BERT model and the preset fully connected layer according to the missing word vector and label of the first drug sentence sample; Acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label; extracting a vector sequence of the second drug sentence sample using the encoding model, and taking the vector sequence of the second drug sentence sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug sentence sample; extracting the vector sequence of the third drug sentence sample using the encoding model, and taking the vector sequence of the third drug sentence sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sentence sample; Obtain a sentence of a drug to be identified; Extracting the vector sequence of the to-be-identified drug sentence using the encoding model, obtaining the chemical substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the chemical substance identification model, and obtaining the therapeutic substance entity set by identifying the vector sequence of the to-be-identified drug sentence using the therapeutic substance identification model; A substance entity present in both the chemical substance entity set and the therapeutic substance entity set is identified as a drug.

2. The method according to claim 1, characterized in that The obtaining of the first drug statement sample set comprises: Scan and identify paper medical books through optical character recognition; Use web crawlers to retrieve electronic medical documents from the Internet; Extract multiple drug sentences from scanned paper medical books and crawled electronic medical documents; Performing cleaning preprocessing on the multiple drug sentences; Missing words and missing word labels are determined for each of the plurality of medication sentences.

3. The method according to claim 1, characterized in that The chemical substance identification model includes: Models based on Long Short-Term Memory Networks and Conditional Random Fields; or Models based on bidirectional long short-term memory networks and conditional random fields; or Model based on BiGRU and Conditional Random Fields.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Outputting substance entities that exist in the chemical substance entity set and do not exist in the therapeutic substance entity set; Send identification reminder.

5. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Construct a drug knowledge graph using the identified drugs.

6. A drug identification device based on machine learning, characterized in that: For implementing the drug identification method based on machine learning as claimed in any one of claims 1 to 5, the device comprises: A first acquisition module is used to acquire a first drug sentence sample set, wherein each first drug sentence sample in the first drug sentence sample set includes a missing word and a missing word label; A first training module, used for training a coding model using the first drug sentence sample set; A second acquisition module is used to acquire a second drug statement sample set and a third drug statement sample set, wherein each second drug statement sample in the second drug statement sample set includes a chemical substance label, and each third drug statement sample in the third drug statement sample set includes a therapeutic substance label; a second training module, configured to extract a vector sequence of the second drug statement sample using the encoding model, and take the vector sequence of the second drug statement sample as input to train a chemical substance recognition model according to the chemical substance label of the second drug statement sample; a third training module, configured to extract a vector sequence of the third drug sentence sample using the encoding model, and take the vector sequence of the third drug sentence sample as input to train a therapeutic substance recognition model according to the therapeutic substance label of the third drug sentence sample; The third acquisition module is used to acquire the drug sentence to be identified; A first recognition module, configured to extract the vector sequence of the to-be-recognized drug sentence using the encoding model, obtain a chemical substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the chemical substance recognition model, and obtain a therapeutic substance entity set by recognizing the vector sequence of the to-be-recognized drug sentence using the therapeutic substance recognition model; The second identification module is used to identify the material entities existing in both the chemical substance entity set and the therapeutic substance entity set as drugs.

7. A computer device, characterized in that: The computer device includes a processor, which is used to execute a computer program stored in a memory to implement the drug identification method based on machine learning as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the drug identification method based on machine learning as described in any one of claims 1 to 5 is implemented.