CN116680619A - Method and device for predicting decoction time classification, electronic equipment and storage medium - Google Patents
Method and device for predicting decoction time classification, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116680619A CN116680619A CN202310934473.8A CN202310934473A CN116680619A CN 116680619 A CN116680619 A CN 116680619A CN 202310934473 A CN202310934473 A CN 202310934473A CN 116680619 A CN116680619 A CN 116680619A
- Authority
- CN
- China
- Prior art keywords
- prescription
- chinese medicine
- traditional chinese
- medicine
- classification prediction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 239000003814 drug Substances 0.000 claims abstract description 167
- 239000013598 vector Substances 0.000 claims abstract description 88
- 238000012549 training Methods 0.000 claims abstract description 34
- 238000012163 sequencing technique Methods 0.000 claims abstract description 4
- 238000013527 convolutional neural network Methods 0.000 claims description 20
- 230000015654 memory Effects 0.000 claims description 14
- 238000007781 pre-processing Methods 0.000 claims description 9
- 239000000203 mixture Substances 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 claims description 7
- 230000004927 fusion Effects 0.000 claims description 7
- 229940126680 traditional chinese medicines Drugs 0.000 claims description 7
- 238000004140 cleaning Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 3
- 238000007499 fusion processing Methods 0.000 claims description 2
- 230000007787 long-term memory Effects 0.000 claims 3
- 230000000694 effects Effects 0.000 abstract description 8
- 238000010438 heat treatment Methods 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 4
- 241000196324 Embryophyta Species 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 229940079593 drug Drugs 0.000 description 3
- 241001465754 Metazoa Species 0.000 description 2
- 201000010099 disease Diseases 0.000 description 2
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 2
- 235000013399 edible fruits Nutrition 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 229910052500 inorganic mineral Inorganic materials 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 230000005906 menstruation Effects 0.000 description 2
- 239000011707 mineral Substances 0.000 description 2
- 230000001568 sexual effect Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 244000061520 Angelica archangelica Species 0.000 description 1
- 241000213006 Angelica dahurica Species 0.000 description 1
- 241000132012 Atractylodes Species 0.000 description 1
- 241000255791 Bombyx Species 0.000 description 1
- 241000202726 Bupleurum Species 0.000 description 1
- VTYYLEPIZMXCLO-UHFFFAOYSA-L Calcium carbonate Chemical compound [Ca+2].[O-]C([O-])=O VTYYLEPIZMXCLO-UHFFFAOYSA-L 0.000 description 1
- 241000218671 Ephedra Species 0.000 description 1
- 241000208688 Eucommia Species 0.000 description 1
- 244000111489 Gardenia augusta Species 0.000 description 1
- 241000931143 Gleditsia sinensis Species 0.000 description 1
- 244000303040 Glycyrrhiza glabra Species 0.000 description 1
- 235000006200 Glycyrrhiza glabra Nutrition 0.000 description 1
- 235000001287 Guettarda speciosa Nutrition 0.000 description 1
- 240000000249 Morus alba Species 0.000 description 1
- 235000008708 Morus alba Nutrition 0.000 description 1
- 240000002853 Nelumbo nucifera Species 0.000 description 1
- 235000006508 Nelumbo nucifera Nutrition 0.000 description 1
- 235000006510 Nelumbo pentapetala Nutrition 0.000 description 1
- 244000236658 Paeonia lactiflora Species 0.000 description 1
- 235000008598 Paeonia lactiflora Nutrition 0.000 description 1
- 240000005001 Paeonia suffruticosa Species 0.000 description 1
- 235000003889 Paeonia suffruticosa Nutrition 0.000 description 1
- 241001619461 Poria <basidiomycete fungus> Species 0.000 description 1
- 240000006079 Schisandra chinensis Species 0.000 description 1
- 235000008422 Schisandra chinensis Nutrition 0.000 description 1
- 244000223014 Syzygium aromaticum Species 0.000 description 1
- 235000016639 Syzygium aromaticum Nutrition 0.000 description 1
- 241000244155 Taenia Species 0.000 description 1
- 239000004480 active ingredient Substances 0.000 description 1
- 238000004378 air conditioning Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000008280 blood Substances 0.000 description 1
- 210000004369 blood Anatomy 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 229940126678 chinese medicines Drugs 0.000 description 1
- 239000000571 coke Substances 0.000 description 1
- 235000009508 confectionery Nutrition 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000857 drug effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 239000000796 flavoring agent Substances 0.000 description 1
- 235000019634 flavors Nutrition 0.000 description 1
- 210000000232 gallbladder Anatomy 0.000 description 1
- LPLVUJXQOOQHMX-QWBHMCJMSA-N glycyrrhizinic acid Chemical compound O([C@@H]1[C@@H](O)[C@H](O)[C@H](O[C@@H]1O[C@@H]1C([C@H]2[C@]([C@@H]3[C@@]([C@@]4(CC[C@@]5(C)CC[C@@](C)(C[C@H]5C4=CC3=O)C(O)=O)C)(C)CC2)(C)CC1)(C)C)C(O)=O)[C@@H]1O[C@H](C(O)=O)[C@@H](O)[C@H](O)[C@H]1O LPLVUJXQOOQHMX-QWBHMCJMSA-N 0.000 description 1
- 210000002216 heart Anatomy 0.000 description 1
- 235000008216 herbs Nutrition 0.000 description 1
- 210000003734 kidney Anatomy 0.000 description 1
- 210000002429 large intestine Anatomy 0.000 description 1
- 239000010985 leather Substances 0.000 description 1
- 235000011477 liquorice Nutrition 0.000 description 1
- 210000004185 liver Anatomy 0.000 description 1
- 210000004072 lung Anatomy 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 210000003516 pericardium Anatomy 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011002 quantification Methods 0.000 description 1
- 210000000582 semen Anatomy 0.000 description 1
- 210000000813 small intestine Anatomy 0.000 description 1
- 210000000952 spleen Anatomy 0.000 description 1
- 210000002784 stomach Anatomy 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000001988 toxicity Effects 0.000 description 1
- 231100000419 toxicity Toxicity 0.000 description 1
- 239000002023 wood Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
- G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/90—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to alternative medicines, e.g. homeopathy or oriental medicines
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Abstract
The application discloses a method, a device, electronic equipment and a storage medium for predicting decoction time classification, wherein the method for predicting decoction time classification comprises the following steps: s1, acquiring prescription data, converting actual use doses of each traditional Chinese medicine in the prescription into relative doses, converting traditional Chinese medicine names into medicine name vectors, and converting medicinal parts into medicinal part vectors; s2, obtaining a traditional Chinese medicine characteristic vector by traditional Chinese medicine quantitative representation; s3, quantitatively representing the prescription to obtain an original sample; s4, data enhancement: randomly sequencing and splicing the traditional Chinese medicine feature vectors of the original samples to obtain new samples; s5, taking the original sample and the new sample as training samples to be input into a classification prediction training model for training, so as to obtain a trained classification prediction model; s6, inputting the sample to be predicted into a trained classification prediction model to obtain a classification prediction result. The application solves the problems that the traditional Chinese medicine heating is difficult to accurately control and the curative effect is affected by setting the decoction time only by the traditional experience in the prior art.
Description
Technical Field
The application relates to the technical field of traditional Chinese medicines, in particular to a method and a device for predicting decoction time classification, electronic equipment and a storage medium.
Background
Prescription is a prescription developed by doctors for curing diseases, is a general name of names, dosages and usage of a plurality of medicines combined for curing a certain disease, and is more common in the field of traditional Chinese medicines. In the prescription, the medicine effect stability, the safety and the clinical application have important significance, and the reasonable decoction time can maximize the extraction of active ingredients in the traditional Chinese medicine, maintain the medicine effect stability, ensure the safety of the traditional Chinese medicine and improve the individuation treatment of the clinical application, so the decoction time is a key link for ensuring the curative effect of the traditional Chinese medicine.
At present, the prediction of the decoction time in clinic usually depends on the clinical experience and feel of individuals of traditional Chinese medical doctors, the objectivity and consistency are lacking, different doctors can adopt different decoction time according to own experience and judgment, the result has a certain variability and is influenced by individual experience and preference, the consistency and comparability are lacking, for new inexperienced doctors, the mistakes are increased by relying on traditional experience to give the decoction time, the decoction time is predicted according to the individual feel or trial and error due to lack of scientific basis and accurate guidance, and the insufficient decoction or excessive decoction is caused, so that the drug effect and treatment effect of the prescription are influenced; in addition, after the appearance of the medicine decocting equipment (medicine decocting machine), the medicine decocting machine generally sets the medicine decocting time by a user, and almost always the fixed medicine decocting time is needed for different prescriptions, so that the heating of the traditional Chinese medicine is difficult to accurately control, and the medicine effect is easy to influence.
Disclosure of Invention
The application aims to overcome the defects of the prior art and provide a method, a device, a storage medium and electronic equipment for predicting the classification of the decocting time so as to improve the consistency and the accuracy of the decocting time.
The technical scheme of the application is as follows:
the embodiment of the application provides a method for predicting decoction time classification, which comprises the following steps:
s1, acquiring prescription data, and preprocessing the prescription data, wherein the preprocessing comprises the following steps: taking the traditional Chinese medicine name of each medicine as a minimum semantic unit, carrying out composition division and cleaning treatment on the prescription, wherein the composition division and cleaning treatment on the prescription comprises the step of replacing the traditional Chinese medicines with standard names aiming at homonyms and homonymous foreign matters existing in the prescription; the actual dosage of each traditional Chinese medicine in the prescription is converted into relative dosage, the traditional Chinese medicine name replaced by the standard name is converted into medicine name vector, and the medicinal part is converted into medicinal part vector;
s2, traditional Chinese medicine quantitative representation: fusing the relative dose, medicine name vector and medicinal position vector corresponding to each Chinese medicine in the prescription to obtain Chinese medicine characteristic vector;
s3, quantitative representation of prescription: splicing the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription to obtain an original sample;
s4, data enhancement: randomly sequencing the Chinese medicine characteristic vectors of each Chinese medicine in the prescription, and then vector splicing to obtain a new sample;
s5, taking the original sample and the new sample as training samples to input a classification prediction training model for training, and adjusting the classification prediction training model until convergence based on a training result to obtain a trained classification prediction model;
s6, inputting the sample to be predicted into a trained classification prediction model to obtain a classification prediction result.
Further, in step S1, the formula for converting the actual dose of each traditional Chinese medicine in the prescription into the relative dose is as follows:
,
wherein ,represents the relative dose of traditional Chinese medicine i in prescription j, < >>Represents the actual dosage of Chinese medicine i in prescription j,/->Representing the minimum of the dose of Chinese medicine i in prescription j, < >>Represents the maximum value of the dosage of traditional Chinese medicine i in prescription j.
Further, in step S2, the fusion processing of the relative dose, the medicine name vector and the medicinal position vector corresponding to each traditional Chinese medicine in the prescription includes:
the product calculation is carried out on the medicinal position vector of each traditional Chinese medicine in the prescription and the relative dosage of the corresponding traditional Chinese medicine, so as to obtain the medicinal position vector containing dosage information;
vector splicing is carried out on the medicine name vector of each traditional Chinese medicine in the prescription and the medicine position vector containing the dosage information.
Further, the classification prediction training model is a two-way long-short time memory-attention-text convolutional neural network model, the two-way long-short time memory-attention-text convolutional neural network model comprises an input layer, a two-way long-short time memory network layer based on an attention mechanism, a text convolutional neural network layer and a soft maximum classifier output layer, the input layer is connected with the input end of the two-way long-short time memory network layer based on the attention mechanism, the output end of the two-way long-short time memory network layer based on the attention mechanism is connected with the input end of the text convolutional neural network layer, and the output end of the text convolutional neural network layer is connected with the input end of the soft maximum classifier output layer.
Further, step S1 further includes adding a label corresponding to the decoction time period to the prescription, where the label is divided into several categories according to the actual decoction time period of the prescription.
Further, the labels are divided into four types according to the real decoction time period of the prescription, wherein the label type I is more than or equal to 3 minutes and less than 15 minutes; label class II is less than or equal to 15min and less than 30min; label class III is less than or equal to 30min and less than 60min; the label IV is less than or equal to 60min and less than 120min.
The embodiment of the application also provides a decoction time classification prediction device based on the decoction time classification prediction method, which comprises the following steps:
the data preprocessing module is used for acquiring a prescription, converting the actual dosage of each traditional Chinese medicine in the prescription into a relative dosage, converting the name of the traditional Chinese medicine into a medicine name vector, and converting the medicinal part into a medicinal part vector;
the multi-feature fusion module is used for carrying out fusion treatment on the relative dose, the medicine name vector and the medicinal position vector corresponding to each traditional Chinese medicine in the prescription to obtain traditional Chinese medicine feature vectors, and splicing the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription to obtain a sample to be predicted;
and the prediction module is used for inputting the sample to be predicted into the classification prediction model, and receiving and outputting the classification prediction result of the classification prediction model.
The embodiment of the application also provides a decocting system based on the device for predicting the classifying and decocting time, which comprises:
the prescription database server is used for acquiring prescriptions prescribed by doctors and inputting the prescriptions into the medicine decocting time classification prediction device;
the medicine decocting time classification prediction device is used for receiving the prescription prescribed by a doctor, calculating a classification prediction result and transmitting the classification prediction result to a medicine decocting machine;
and the decoction machine is used for carrying out decoction of the prescription according to the classification prediction result.
The embodiment of the application also provides electronic equipment, which comprises: a processor and a memory storing machine-readable instructions executable by the processor, which when executed by the processor, perform the method as described above.
Embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs a method as described above.
The application has the beneficial effects that:
1. according to the application, a large amount of prescription data and related characteristics are analyzed by a deep learning technology, so that the problems that the traditional Chinese medicine heating is difficult to accurately control and the curative effect is affected in the prior art by setting the decoction time only through traditional experience are solved, and the consistency and accuracy of classification of the decoction time are improved.
2. In the aspect of feature engineering, the traditional Chinese medicine dosage, the traditional Chinese medicine name and the medicine position are selected, the vector representation (traditional Chinese medicine feature vector) of each traditional Chinese medicine is obtained by carrying out fusion treatment on the relative dosage of the traditional Chinese medicine, the medicine name vector and the medicine position vector, and the vector representation (original sample) of the prescription is spliced based on the traditional Chinese medicine feature vector; and then, the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription are randomly ordered and then vector splicing is carried out to obtain a new sample, so that the enhancement of data is realized, and the evaluation performance of the model in terms of different decoction time periods is effectively improved.
3. The classification prediction training model adopts a two-way long-short time memory-attention-text convolutional neural network model, can firstly and effectively learn the context information in a text sequence through a two-way long-short time memory network, and pay attention to important vocabularies in a specific context by using an attention mechanism on the basis; meanwhile, local features can be extracted through the text convolutional neural network layer, and learning of local contexts of the text is enhanced, so that accuracy and efficiency of text classification are improved; in addition, the model can achieve better adaptability and generalization capability by adjusting super parameters of different tasks, so that the model has good application value in different fields and scenes; in the whole, the model is integrated with a plurality of learning methods, so that text analysis tasks can be comprehensively optimized, results are more accurate and reliable, and the method has a great promotion effect on improving text processing efficiency and quality.
Drawings
FIG. 1 is a schematic diagram of a classification prediction training model according to a first embodiment of the present application;
FIG. 2 is a schematic structural diagram of a device for classifying and predicting decoction time based on a classification prediction model according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a decocting system based on a device for predicting decoction time classification according to a third embodiment of the present application.
Detailed Description
The application may be further described by the following examples, however, the scope of the application is not limited to the following examples: it is to be understood that the embodiments described herein are disclosed by way of illustration only and that the application is not intended to be limited in scope to the details of construction and the arrangement of components set forth in the following description or illustrated in the drawings. Furthermore, in describing the preferred embodiments, specific terminology will be resorted to for the sake of clarity. It is to be understood that each specific term includes all technical equivalents that operate in a similar manner to accomplish a similar purpose.
The classification prediction method of the decocting duration is only suitable for the common prescription with the decocting duration, and for the prescriptions with the uncommon decocting duration, especially the prescriptions with the decocting duration exceeding 2 hours, the prescriptions with the uncommon decocting duration are not considered in the application, and the classification prediction solution of the decocting duration can be provided with higher efficiency by eliminating the prescriptions with the uncommon decocting duration.
Example 1: the method for predicting the decoction time classification comprises the following steps:
s1, acquiring prescription data, and preprocessing the prescription data, wherein the preprocessing comprises the following steps: taking the traditional Chinese medicine name of each medicine as a minimum semantic unit, carrying out composition division and cleaning treatment on the prescription, wherein the composition division and cleaning treatment on the prescription comprises the steps of replacing the traditional Chinese medicines with standard names aiming at homonyms and homonymous foreign matters in the prescription, wherein the standard names are based on pharmacopoeia, so that the accurate extraction and standardized representation of the traditional Chinese medicine names are ensured; establishing a traditional Chinese medicine database and a prescription database; the actual dosage of each traditional Chinese medicine in the prescription is converted into relative dosage, the traditional Chinese medicine name replaced by the standard name is converted into medicine name vector, and the medicinal part is converted into medicinal part vector; the constructed traditional Chinese medicine database comprises traditional Chinese medicines, medicinal parts, sexual taste, menstruation, toxicity and dosage information, wherein the medicinal parts comprise, but are not limited to, rhizomes, stems, barks, leaves, flowers, whole plants, fruit seeds, minerals and animals, the sexual taste comprises cold, heat, warmth, benign, flat, sour, bitter, sweet, pungent and salty, and the menstruation comprises lung, pericardium, heart, large intestine, triple coke, small intestine, stomach, gall bladder, spleen, liver and kidney; the prescription database comprises prescription numbers, prescription compositions, actual dosage and decoction duration information; the decocting duration information includes the actual decocting duration of the prescription, and is divided into a plurality of types of labels according to the actual decocting duration, preferably, the labels are divided into four types according to the actual decocting duration of the prescription, of course, in order to divide the decocting duration more accurately, the labels can also be divided into more types, and the four types of labels are taken as examples: label class I is less than or equal to 3min and less than 15min; label class II is less than or equal to 15min and less than 30min; label class III is less than or equal to 30min and less than 60min; the label IV is less than or equal to 60 minutes and less than 120 minutes, and the four label types basically cover common prescriptions, so the method can be used for classification prediction.
Examples of prescription databases are shown in table 1:
table 1 exemplary table of prescription database
Prescription number | Prescription composition | True decoctionDuration (min) | Label class |
129634 | Bombyx Batryticatus 3g, caulis Bambusae in Taenia 4g, parched fructus Aurantii 4g, bulbus Fritillariae Thunbergii 6g, rhizoma Pinelliae Preparata 4g, poria 4g, and white blood cell4g before, 3g of schisandra chinensis and 2g of gleditsia sinensis | 20 | II |
129608 | 9g of bupleurum, 9g of Min angelica, 12g of white peony root, 10g of stir-fried white atractylodes rhizome, 10g of dried orange peel, 6g of liquorice and thin8g of lotus, 7g of tree peony bark, 5g of fried gardenia, 20g of fried eucommia bark, 10g of dangshen and 15g of semen cuscutae | 40 | III |
Examples of the traditional Chinese medicine database are shown in table 2:
。
step S1, the formula for converting the actual usage dose of the traditional Chinese medicine into the relative dose is as follows:
,
wherein ,represents the relative dose of traditional Chinese medicine i in prescription j, < >>Represents the actual dosage of Chinese medicine i in prescription j,/->Representing the minimum of the dose of Chinese medicine i in prescription j, < >>Represents the maximum value of the dosage of the traditional Chinese medicine i in the prescription j; taking ephedra decoction as an example, the relative dose conversion of each traditional Chinese medicine is shown in table 3:
。
word2vec pre-training word vector model in natural language processing is adopted for Chinese medicine names, word vector pre-training is carried out on the Chinese medicine names to obtain medicine name vectors, and the Chinese medicine name vectors are used for the Chinese medicine namesRepresentation of->Is the ith Chinese medicine, f is the mapping function, < ->Is->Is a medicine name vector of (a).
For medicinal parts of the traditional Chinese medicine, performing binary quantification by using one-hot independent heat vectors; as shown in table 4, the presence of this medicinal site is indicated by 1, and the absence of this medicinal site is indicated by 0, for example: the medicinal part of the clove is flower and can be quantitatively expressed as:。
table 4 examples of quantitative representations of medicinal parts of herbs
Medicine name | Rhizome stem | Stem wood | Leather sheet | Leaves of the plant | Flower pattern | Herb of whole plant | Fruit seed | Mineral material | Animals | Others |
Chinese angelica | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mulberry Leaves | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Oyster shell | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
。
For vectors of medicinal parts, useRepresentation of->Is the ith Chinese medicine, g is the mapping function, < ->Is->Is a one-hot vectorized representation of (i.e., a medicinal site vector).
S2, traditional Chinese medicine quantitative representation: fusing the relative dose, medicine name vector and medicinal position vector corresponding to each Chinese medicine in the prescription to obtain Chinese medicine characteristic vector;
specifically, the product calculation is carried out on the medicinal position vector of each Chinese medicine in the prescription and the relative dosage of the corresponding Chinese medicine to obtain the medicinal position vector containing dosage information, and then vector splicing is carried out on the medicinal position vector and the medicine name vector after word2vec vector to obtain the Chinese medicine feature vector, wherein the specific calculation formula is as follows:
wherein ,is Chinese medicine->Relative dose of>Is Chinese medicine->Is a medicinal part vector of->Is Chinese medicine->Site vector comprising dose information +.>Is Chinese medicine->Medicine name vector of (2),>is Chinese medicine->And obtaining the traditional Chinese medicine feature vector after fusion treatment.
S3, quantitative representation of prescription: the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription are spliced to obtain an original sample, and the original sample is as follows:
, wherein ,/>As an original sample, m represents the number of Chinese medicine flavors contained in the prescription.
S4, data enhancement: randomly sequencing the Chinese medicine characteristic vectors of each Chinese medicine in the prescription, and then vector splicing to obtain a new sample;
s5, taking the original sample and the new sample as training samples to input a classification prediction training model for training, and adjusting the classification prediction training model until convergence based on a training result to obtain a trained classification prediction model;
s6, inputting the sample to be predicted into a trained classification prediction model to obtain a classification prediction result.
As shown in fig. 1, the classification prediction training model in this embodiment adopts a two-way long-short time memory-attention-text convolutional neural network model, where the two-way long-short time memory-attention-text convolutional neural network model includes an input layer, a two-way long-short time memory network layer based on an attention mechanism, a text convolutional neural network layer, and a soft maximum classifier output layer, the input layer is connected with an input end of the two-way long-short time memory network layer based on the attention mechanism, an output end of the two-way long-short time memory network layer based on the attention mechanism is connected with an input end of the text convolutional neural network layer, and an output end of the text convolutional neural network layer is connected with an input end of the soft maximum classifier output layer; the method comprises the steps that a two-way long-short-term memory network layer based on an attention mechanism obtains semantic information in a context through two long-short-term memory networks in different directions, low-level features generated by the two-way long-short-term memory network are used as input operations of a text convolutional neural network layer, the attention mechanism in the two-way long-short-term memory network layer based on the attention mechanism gives a word weight according to the contribution degree of words to sentences so as to improve attention to key words, a final feature vector generated after convolution and pooling is used for calculating a predicted decoction time length of a training sample and a loss value of a real decoction time length, the parameters are updated based on the loss value and the calculation of a counter-propagation participation parameter gradient, so that a classification prediction training model is adjusted, the to-be-predicted sample is subjected to the two-way long-short-time memory-attention-text convolutional neural network to obtain depth feature representation, the depth feature representation is input into an output layer of the soft maximum classifier for classification, probability distribution of the to be predicted sample is obtained, and the probability is selected to be the maximum as a classification prediction result.
The classification prediction training model adopts a multi-classification cross entropy loss function as a loss function, wherein a loss value calculation formula is as follows:
wherein L is a loss value, n is the number of training samples,true label representing training sample, +.>Predictive labels representing training samples.
In order to verify the influence of the selected Chinese medicine characteristics on the classification prediction model, the application performs experiments on 14478 Chinese medicine clinical prescriptions, and comprises 565 Chinese medicines in total according to 8:1:1 randomly dividing training samples into a training set, a testing set and a verification set, using a two-way long-short time memory-attention-text convolutional neural network model, setting the learning rate to 0.6, using an Adam optimizer to train the model for 100 rounds, adopting an early stop system to prevent the model from being overfitted, and terminating the training if the verification loss of more than 10 rounds is not reduced.
In the present application, accuracy is usedPRecall rate ofRA kind of electronic device with high-pressure air-conditioning systemF1The value measures the model performance, and the calculation formula is as follows:
wherein ,TP(true positive) refers to the case where the forward category is predicted to be the forward category;FP (false positive) refers to the case where the negative category is predicted to be a positive category;FN(false positive) refers to the case where the positive class is predicted to be the negative class.
Through experiments, the accuracy of the sample constructed based on the traditional Chinese medicine dosage, the traditional Chinese medicine name and the medicine position in the classification prediction modelP89.45%, and,F1The value is 84.35%, and the accuracy of the sample constructed by using only the single traditional Chinese medicine name in the classification prediction model is appliedPOnly 75.55 percent,F1The value was only 74.56%. Therefore, the traditional Chinese medicine characteristics constructed based on the traditional Chinese medicine dosage, the traditional Chinese medicine name and the medicine application part can effectively improve the characteristic expression mode, and is favorable for classification prediction of the medicine decocting time.
Example 2: as shown in fig. 2, the embodiment of the present application further provides a device for predicting a decoction time class based on the method for predicting a decoction time class, including:
the data preprocessing module 10 is used for obtaining a prescription, converting actual usage dose of each traditional Chinese medicine in the prescription into relative dose, converting traditional Chinese medicine names into medicine name vectors, and converting medicinal parts into medicinal part vectors;
the multi-feature fusion module 20 is configured to fuse the relative dose, the medicine name vector and the medicine position vector corresponding to each traditional Chinese medicine in the prescription to obtain a traditional Chinese medicine feature vector, and splice the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription to obtain a sample to be predicted;
the prediction module 30 is configured to input the sample to be predicted into the classification prediction model, and receive and output a classification prediction result of the classification prediction model.
Example 3: as shown in fig. 3, the embodiment of the present application further provides a decocting system based on the above-mentioned decocting time period classification prediction device, where the decocting system includes:
the prescription database server 1 is used for acquiring prescriptions prescribed by doctors and inputting the prescriptions into the drug-decocting time classification prediction device 2;
the medicine decocting time classification prediction device 2 is used for receiving the medicine prescription prescribed by a doctor, calculating a classification prediction result and transmitting the classification prediction result to the medicine decocting machine 3;
and the decoction machine 3 is used for carrying out decoction of the prescription according to the classification prediction result.
Optionally, a specific decocting duration may be set for the classification prediction result, and preferably, a weighted average of a maximum value and a minimum value of the decocting duration corresponding to the label class is taken as a final decocting duration of the prescription.
Example 4: the embodiment of the application also provides electronic equipment, which comprises: a processor and a memory storing machine-readable instructions executable by the processor, which when executed by the processor perform the method as described above.
Example 5: embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs a method as described above.
While the fundamental and principal features of the application and advantages of the application have been shown and described, it will be apparent to those skilled in the art that the application is not limited to the details of the foregoing exemplary embodiments, but may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is provided for clarity only, and that the disclosure is not limited to the embodiments described in detail below, and that the embodiments described in the examples may be combined as appropriate to form other embodiments that will be apparent to those skilled in the art.
Claims (10)
1. The method for predicting the decoction time classification is characterized by comprising the following steps:
s1, acquiring prescription data, and preprocessing the prescription data, wherein the preprocessing comprises the following steps: taking the traditional Chinese medicine name of each medicine as a minimum semantic unit, carrying out composition division and cleaning treatment on the prescription, wherein the composition division and cleaning treatment on the prescription comprises the step of replacing the traditional Chinese medicines with standard names aiming at homonyms and homonymous foreign matters existing in the prescription; the actual dosage of each traditional Chinese medicine in the prescription is converted into relative dosage, the traditional Chinese medicine name replaced by the standard name is converted into medicine name vector, and the medicinal part is converted into medicinal part vector;
s2, traditional Chinese medicine quantitative representation: fusing the relative dose, medicine name vector and medicinal position vector corresponding to each Chinese medicine in the prescription to obtain Chinese medicine characteristic vector;
s3, quantitative representation of prescription: splicing the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription to obtain an original sample;
s4, data enhancement: randomly sequencing the Chinese medicine characteristic vectors of each Chinese medicine in the prescription, and then vector splicing to obtain a new sample;
s5, the original sample and the new sample are used as training samples to be input into a classification prediction training model for training, and the classification prediction training model is adjusted until convergence based on a training result to obtain a trained classification prediction model;
s6, inputting the sample to be predicted into a trained classification prediction model to obtain a classification prediction result.
2. The method for classifying and predicting decoction time according to claim 1, wherein the formula for converting the actual dose of each Chinese medicine in the prescription into the relative dose in step S1 is as follows:
,
wherein ,represents the relative dose of traditional Chinese medicine i in prescription j, < >>The actual dosage of the traditional Chinese medicine i in the prescription j is shown,representing the minimum of the dose of Chinese medicine i in prescription j, < >>Represents the maximum value of the dosage of traditional Chinese medicine i in prescription j.
3. The method for predicting decoction time classification according to claim 1, wherein the step S2 of performing fusion processing on the relative dose, the medicine name vector and the medicine location vector corresponding to each of the traditional Chinese medicines in the prescription comprises:
the product calculation is carried out on the medicinal position vector of each traditional Chinese medicine in the prescription and the relative dosage of the corresponding traditional Chinese medicine, so as to obtain the medicinal position vector containing dosage information;
vector splicing is carried out on the medicine name vector of each traditional Chinese medicine in the prescription and the medicine position vector containing the dosage information.
4. The method for classifying and predicting the decoction time according to claim 1, wherein the classification and prediction training model is a two-way long-short-term memory-attention-text convolutional neural network model, the two-way long-short-term memory-attention-text convolutional neural network model comprises an input layer, a two-way long-term memory network layer based on an attention mechanism, a text convolutional neural network layer and a soft maximum classifier output layer, the input layer is connected with the input end of the two-way long-term memory network layer based on the attention mechanism, the output end of the two-way long-term memory network layer based on the attention mechanism is connected with the input end of the text convolutional neural network layer, and the output end of the text convolutional neural network layer is connected with the input end of the soft maximum classifier output layer.
5. The method according to claim 1, wherein step S1 further comprises adding a label corresponding to the decoction time period to the prescription, the label being divided into several categories according to the actual decoction time period of the prescription.
6. The method for classifying and predicting decoction time according to claim 5, wherein the labels are divided into four types according to the actual decoction time of the prescription according to time periods, wherein 3min is less than or equal to label type I is less than 15min; label class II is less than or equal to 15min and less than 30min; label class III is less than or equal to 30min and less than 60min; the label IV is less than or equal to 60min and less than 120min.
7. The apparatus for predicting decoction time class based on the method for predicting decoction time class according to claim 1, wherein the apparatus for predicting decoction time class comprises:
the data preprocessing module is used for acquiring a prescription, converting the actual dosage of each traditional Chinese medicine in the prescription into a relative dosage, converting the name of the traditional Chinese medicine into a medicine name vector, and converting the medicinal part into a medicinal part vector;
the multi-feature fusion module is used for carrying out fusion treatment on the relative dose, the medicine name vector and the medicinal position vector corresponding to each traditional Chinese medicine in the prescription to obtain traditional Chinese medicine feature vectors, and splicing the traditional Chinese medicine feature vectors of each traditional Chinese medicine in the prescription to obtain a sample to be predicted;
and the prediction module is used for inputting the sample to be predicted into the classification prediction model, and receiving and outputting the classification prediction result of the classification prediction model.
8. The drug-decocting system based on the drug-decocting time-length classification prediction device of claim 7, characterized in that the drug-decocting system comprises:
the prescription database server is used for acquiring prescriptions prescribed by doctors and inputting the prescriptions into the medicine decocting time classification prediction device;
the medicine decocting time classification prediction device is used for receiving the prescription prescribed by a doctor, calculating a classification prediction result and transmitting the classification prediction result to a medicine decocting machine;
and the decoction machine is used for carrying out decoction of the prescription according to the classification prediction result.
9. An electronic device, comprising: a processor and a memory storing machine-readable instructions executable by the processor to perform the method of any one of claims 1 to 6 when executed by the processor.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the method according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310934473.8A CN116680619A (en) | 2023-07-28 | 2023-07-28 | Method and device for predicting decoction time classification, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310934473.8A CN116680619A (en) | 2023-07-28 | 2023-07-28 | Method and device for predicting decoction time classification, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116680619A true CN116680619A (en) | 2023-09-01 |
Family
ID=87784005
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310934473.8A Pending CN116680619A (en) | 2023-07-28 | 2023-07-28 | Method and device for predicting decoction time classification, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116680619A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105740909A (en) * | 2016-02-02 | 2016-07-06 | 华中科技大学 | Text recognition method under natural scene on the basis of spatial transformation |
CN109346180A (en) * | 2018-08-03 | 2019-02-15 | 电子科技大学 | The training recognition methods of tcm prescription monarch and system |
CN109558477A (en) * | 2018-10-23 | 2019-04-02 | 深圳先进技术研究院 | A kind of community's question answering system, method and electronic equipment based on multi-task learning |
CN110263869A (en) * | 2019-06-25 | 2019-09-20 | 咪咕文化科技有限公司 | A kind of duration prediction method and device of Spark task |
CN110516805A (en) * | 2019-08-23 | 2019-11-29 | 广东浪潮大数据研究有限公司 | The training duration prediction method and device of training pattern |
CN113268335A (en) * | 2021-06-24 | 2021-08-17 | 中国平安人寿保险股份有限公司 | Model training and execution duration estimation method, device, equipment and storage medium |
CN114822874A (en) * | 2022-05-25 | 2022-07-29 | 湖南中医药大学 | Prescription efficacy classification method based on characteristic deviation alignment |
CN115363432A (en) * | 2022-01-07 | 2022-11-22 | 宁波方太厨具有限公司 | Model training method, cooking control method, system, device and medium |
CN115718889A (en) * | 2022-12-15 | 2023-02-28 | 平安银行股份有限公司 | Industry classification method and device for company profile |
-
2023
- 2023-07-28 CN CN202310934473.8A patent/CN116680619A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105740909A (en) * | 2016-02-02 | 2016-07-06 | 华中科技大学 | Text recognition method under natural scene on the basis of spatial transformation |
CN109346180A (en) * | 2018-08-03 | 2019-02-15 | 电子科技大学 | The training recognition methods of tcm prescription monarch and system |
CN109558477A (en) * | 2018-10-23 | 2019-04-02 | 深圳先进技术研究院 | A kind of community's question answering system, method and electronic equipment based on multi-task learning |
CN110263869A (en) * | 2019-06-25 | 2019-09-20 | 咪咕文化科技有限公司 | A kind of duration prediction method and device of Spark task |
CN110516805A (en) * | 2019-08-23 | 2019-11-29 | 广东浪潮大数据研究有限公司 | The training duration prediction method and device of training pattern |
CN113268335A (en) * | 2021-06-24 | 2021-08-17 | 中国平安人寿保险股份有限公司 | Model training and execution duration estimation method, device, equipment and storage medium |
CN115363432A (en) * | 2022-01-07 | 2022-11-22 | 宁波方太厨具有限公司 | Model training method, cooking control method, system, device and medium |
CN114822874A (en) * | 2022-05-25 | 2022-07-29 | 湖南中医药大学 | Prescription efficacy classification method based on characteristic deviation alignment |
CN115718889A (en) * | 2022-12-15 | 2023-02-28 | 平安银行股份有限公司 | Industry classification method and device for company profile |
Non-Patent Citations (1)
Title |
---|
李园白 等: "方剂剂量与君臣佐使关系初探", 《中草药》, pages 2011 - 2014 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Singh | Brain enhancing ingredients from āyurvedic medicine: quintessential example of Bacopa monniera, a narrative review | |
ABDULRAHMAN et al. | Traditional medicinal knowledge of Malays in Terengganu, Peninsular Malaysia. | |
CN109190113A (en) | A kind of knowledge mapping construction method of theory of traditional Chinese medical science ancient books and records | |
CN112289441B (en) | Medical biological feature information matching system based on multiple modes | |
CN108509419A (en) | Ancient TCM books document participle and part of speech indexing method and system | |
CN110223784A (en) | Clinical test patient's matching process | |
Khatun et al. | Ethnomedicinal uses of plants by Santal Tribal peoples at Nawabganj upazila of Dinajpur district, Bangladesh | |
CN113990520A (en) | Traditional Chinese medicine prescription generation method based on controllable generation countermeasure network | |
Ray | Customary use of mangrove tree as a folk medicine among the sundarban resource collectors | |
Liu et al. | Herbal plants traded at the Kaili medicinal market, Guizhou, China | |
Anam et al. | A novel herbal leaf identification and authentication Using deep learning neural network | |
Venugopalan Nair et al. | Indian medicinal plants database (IMPLAD) and threatened medicinal plants of India | |
CN116680619A (en) | Method and device for predicting decoction time classification, electronic equipment and storage medium | |
Zhang et al. | Analysis of prescription database extracted from standard textbooks of traditional Dai medicine | |
Ndhlovu et al. | Commercialization potential of six selected medicinal plants commonly used for childhood diseases in South Africa: a review | |
CN114446488A (en) | Traditional Chinese medicine prescription identification method and system | |
Law et al. | Establishment of a Sustainable Management Model for Chinese Herbal Garden in an Urban City—Hong Kong | |
CN111180045B (en) | Method for mining relation between drug pairs and efficacy from prescription information | |
Morgan | The postcranial skeleton of caviomorphs: morphological diversity, adaptations and patterns | |
Dhankani et al. | A systematic review: ayurvedic herbal medicine for women with polycystic ovary syndrome | |
Ma | Science as a global governance and circulation tool?: The Baekshuoh disaster in South Korea | |
Mohankumar et al. | Ethnomedicines used by Kaani Tribes in the forest and towns of Kanyakumari district in Tamilnadu | |
Huang et al. | Correlation between the incidence of ischemic stroke and the changes of 24 solar terms in Fuzhou | |
CN113140310B (en) | Intelligent diagnosis and treatment system for traditional Chinese medicine and creation method | |
Husain | Botanical identification of Ayush-Ayurveda and Unani drugs and its relevance in quality control |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |