A medication conflict analysis method based on semantic analysis
By constructing a word set and a two-layer semantic analysis model, the problem of low accuracy in medication conflict analysis is solved, the accuracy and simplicity of the analysis are improved, and accurate medication conflict information is provided.
Patent Information
- Application Number
- CN202410941288.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-15
AI Technical Summary
The accuracy of medication conflict analysis in the existing technology is not high, the source of drug conflict text information lacks authority, and the semantic analysis algorithm is difficult to accurately screen out the correct information, resulting in low accuracy of medication conflict analysis.
By extracting the text content of the medication instructions, construct a word set, calculate word vector approximation, assign weights, and use a two-layer semantic analysis model for semantic extraction to enhance attention to key words and analyze medication conflicts.
It improves the accuracy of medication conflict analysis, provides accurate information screening, streamlines text information, and enhances the accuracy of conflict analysis.
Smart Images

Figure CN118467710B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of semantic processing, and in particular to a medication conflict analysis method based on semantic analysis. Background Art
[0002] With the rapid development of information technology, more patients choose to consult online in Internet hospitals and obtain prescriptions. At the same time, Internet hospitals review the rationality of prescriptions through pharmacists. If the review fails, the prescription needs to be changed. During the review, the prescription needs to be reviewed by a pharmacist, who needs to be online at all times and have authoritative qualifications. However, the working time and experience of each pharmacist are different, which leads to many subjective factors in the prescription review of pharmacists, and they cannot be online at all times, resulting in inconsistent accuracy and low timeliness of prescription review. Semantic analysis algorithms are currently used to analyze medication safety. By retrieving drug conflict text information from web pages, the medication situation can be evaluated. On the one hand, the source of drug conflict text information lacks authority. On the other hand, with a large amount of text information, it is difficult for semantic analysis algorithms to accurately screen out the correct information. Both aspects will lead to the problem of low accuracy in medication conflict analysis. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a medication conflict analysis method based on semantic analysis to solve the problem of low accuracy of medication conflict analysis in the prior art.
[0004] In order to achieve the above-mentioned purpose of the invention, the technical solution adopted by the present invention is: a medication conflict analysis method based on semantic analysis, comprising the following steps:
[0005] S1. Extract the text content of the instructions for two drugs to be used;
[0006] S2. construct a word set according to each text content, wherein the word set includes: multiple word subsets;
[0007] S3. Find two word subsets to be analyzed based on the approximation of the word vectors in the two word sets, and assign weights to the word vectors in the two word subsets to be analyzed;
[0008] S4. A two-layer semantic analysis model is used to perform semantic extraction on the two word subsets to be analyzed, and semantic enhancement is performed through weights to obtain the medication conflict values of the two drugs to be used.
[0009] The beneficial effects of the present invention are as follows: the present invention extracts the text content of two kinds of instructions for use of medicines from a database, and constructs a word set according to each text content, and finds two word subsets to be analyzed from the two word sets according to the approximation of word vectors, thereby determining texts with relevant content, and assigning weights to the word vectors in the two word subsets to be analyzed, and using a two-layer semantic analysis model to perform semantic extraction on the two word subsets to be analyzed, and semantic enhancement is performed through weights to improve the attention of key words, thereby analyzing the conflict of content-related texts on medication. The present invention starts from the instructions for use of medicines, provides accurate information for medication conflict analysis, and then screens out relevant content, simplifies text information, and improves the accuracy of medication conflict analysis.
[0010] Furthermore, the S2 comprises the following sub-steps:
[0011] S21, splitting each text content into segments according to the paragraphs in each text content;
[0012] S22. In a text content, split the text of each segment into word vectors to obtain word subsets;
[0013] S23. Construct word subsets belonging to the same text content into a word set.
[0014] The beneficial effect of the above further solution is: the present invention splits the paragraphs of the text content so that a word subset corresponds to a paragraph content, and a word set corresponds to a text content in the instructions for use of a medicine.
[0015] Furthermore, S3 includes the following sub-steps:
[0016] S31, extract word vectors from two word sets, calculate the approximation, and find approximate phrases;
[0017] S32, extracting the word subsets where the similar phrases are located, and obtaining two word subsets to be analyzed;
[0018] S33. Assign weights to the word vectors in the two word subsets to be analyzed according to the approximation.
[0019] Furthermore, the S31 includes the following sub-steps:
[0020] S311, calculate the similarity between the word vectors in one word set and the word vectors in another word set:
[0021] ,
[0022] Among them, μ is the approximation, x 1,i is the i-th word element of a word vector in a word set, x 2,iis the i-th word element of the word vector in another word set, N is the number of word elements in the word vector in the word set, when the two word vectors are of different lengths, the shorter word vector is padded with 0, and i is a positive integer;
[0023] S312: When the approximation is greater than the approximation threshold, the corresponding two word vectors are regarded as approximate word groups.
[0024] Furthermore, the S33 is specifically as follows: in a subset of words to be analyzed, the weight assigned to the word vectors in the approximate word group is (1+μ), and the weight assigned to other word vectors is 1.
[0025] The beneficial effect of the above further scheme is: the present invention extracts word vectors from two word sets, calculates the approximation, and uses it to compare the word vectors to find similar phrases, thereby finding two content-related word subsets to be analyzed, and assigns weights to the word vectors in the two word subsets to be analyzed based on the approximation, so that key words can get more attention.
[0026] Furthermore, the two-layer semantic analysis model in S4 includes: a first-layer semantic feature extraction unit, a second-layer semantic feature extraction unit, a semantic feature fusion unit, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a first Concat layer and a fully connected layer;
[0027] The input end of the first-layer semantic feature extraction unit is used to input a subset of words to be analyzed, and its output end is connected to the first input end of the semantic feature fusion unit; the input end of the second-layer semantic feature extraction unit is used to input another subset of words to be analyzed, and its output end is connected to the second input end of the semantic feature fusion unit; the output end of the semantic feature fusion unit is respectively connected to the input end of the first maximum pooling layer, the input end of the second maximum pooling layer, and the input end of the third maximum pooling layer; the input end of the first Concat layer is respectively connected to the output end of the first maximum pooling layer, the output end of the second maximum pooling layer, and the output end of the third maximum pooling layer, and its output end is connected to the input end of the fully connected layer; the output end of the fully connected layer serves as the output end of the two-layer semantic analysis model.
[0028] The beneficial effect of the above further scheme is as follows: the present invention uses each layer of semantic feature extraction unit to process a subset of words to be analyzed, extracts semantic features, performs semantic feature fusion at the semantic feature fusion unit, and then uses three maximum pooling layers with different window sizes to extract features of different scales, which can achieve a reduction in the feature quantity on the one hand and effective significant feature extraction on the other hand, splicing significant features of different scales through the first Concat layer, and predicting conflict values through the fully connected layer.
[0029] Furthermore, the first layer semantic feature extraction unit and the second layer semantic feature extraction unit have the same structure, both comprising: a word processing layer, a word feature extraction module, a multiplier, an LSTM neural network and a second Concat layer;
[0030] The input end of the word processing layer is used to input the word vectors in the word subset to be analyzed, and its output end is connected to the input end of the word feature extraction module; the first input end of the multiplier is connected to the output end of the word feature extraction module, the second input end is used to input the weight of the word vector, and its output end is connected to the input end of the cell unit in the LSTM neural network; the input end of the second Concat layer is respectively connected to the output end of each cell unit in the LSTM neural network, and its output end serves as the output end of the first layer semantic feature extraction unit or the second layer semantic feature extraction unit.
[0031] The beneficial effects of the above further scheme are as follows: the present invention uses a word processing layer to process each word vector, which is convenient for inputting into a word feature extraction module to extract word features; at the multiplier, weights are applied to the word features extracted by the word feature extraction module, the attention of each word feature is adjusted, and the accuracy of semantic analysis is improved; each cell unit in the LSTM neural network is then used to process each word feature; the LSTM neural network is used to capture the characteristics of long-term dependencies, so that the semantic feature extraction unit can consider the overall semantic features of the word subset to be analyzed.
[0032] Furthermore, the expression of the word processing layer is:
[0033] ,
[0034] ,
[0035] ,
[0036] Among them, H is the output of the word processing layer, R is the scaling vector, r1 is the first element in the scaling vector, and r j is the jth element in the scaling vector, r M is the Mth element in the scaling vector, y j is the j-th word element of the word vector of the input word processing layer, M is the number of word elements in the word vector of the input word processing layer, j is a positive integer, e is a natural constant, and T is the vector transpose.
[0037] The beneficial effect of the above further solution is: the present invention first uniformly scales the word elements of the word vector of the input word processing layer to a fixed scale, and then Expanding the data volume not only makes it easier for the word feature extraction module to process, but also expands the features of the word vector.
[0038] Further, the word feature extraction module includes: a convolution layer, a first channel attention layer, a second channel attention layer, an adder and a sampling layer;
[0039] The input end of the convolutional layer is used as the input end of the word feature extraction module, and its output end is respectively connected to the input end of the first channel attention layer and the input end of the second channel attention layer; the input end of the adder is respectively connected to the output end of the first channel attention layer and the output end of the second channel attention layer, and its output end is connected to the input end of the sampling layer; the output end of the sampling layer is used as the output end of the word feature extraction module;
[0040] The expression of the first channel attention layer is:
[0041] ,
[0042] Among them, Y1 is the output of the first channel attention layer, Sigmoid is the S-type function, is a convolution operation with a convolution kernel size of 1*1, X is the input of the convolution layer, For Hamadaji;
[0043] The expression of the second channel attention layer is:
[0044] ,
[0045] Among them, Y2 is the output of the second channel attention layer, and Tanh is the hyperbolic tangent activation function.
[0046] The beneficial effect of the above further scheme is: the word feature extraction module of the present invention includes two channel attention layers, and the dual-channel attention model pays higher attention to key features, reduces the attention to unimportant features, and automatically filters out unimportant features.
[0047] Furthermore, the output of the semantic feature fusion unit is S: , where A is the output of the first-layer semantic feature extraction unit, B is the output of the second-layer semantic feature extraction unit, T is the vector transpose, and Concat is the concatenation operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a flowchart of a medication conflict analysis method based on semantic analysis;
[0049] Figure 2 It is a structural diagram of the two-layer semantic analysis model;
[0050] Figure 3 It is a schematic diagram of the structure of the first-layer semantic feature extraction unit and the second-layer semantic feature extraction unit;
[0051] Figure 4 This is a structural diagram of the word feature extraction module. DETAILED DESCRIPTION
[0052] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0053] like Figure 1 As shown, a medication conflict analysis method based on semantic analysis includes the following steps:
[0054] S1. Extract the text content of the instructions for two drugs to be used;
[0055] S2. construct a word set according to each text content, wherein the word set includes: multiple word subsets;
[0056] S3. Find two word subsets to be analyzed based on the approximation of the word vectors in the two word sets, and assign weights to the word vectors in the two word subsets to be analyzed;
[0057] S4. A two-layer semantic analysis model is used to perform semantic extraction on the two word subsets to be analyzed, and semantic enhancement is performed through weights to obtain the medication conflict values of the two drugs to be used.
[0058] The S2 comprises the following sub-steps:
[0059] S21, splitting each text content into segments according to the paragraphs in each text content;
[0060] S22. In a text content, split the text of each segment into word vectors to obtain word subsets;
[0061] S23. Construct word subsets belonging to the same text content into a word set.
[0062] The present invention divides the paragraphs of the text content so that one word subset corresponds to one paragraph content, and one word set corresponds to one text content in the instruction manual of a medicine to be used.
[0063] The S3 comprises the following sub-steps:
[0064] S31, extract word vectors from two word sets, calculate the approximation, and find approximate phrases;
[0065] S32, extracting the word subsets where the similar phrases are located, and obtaining two word subsets to be analyzed;
[0066] S33. Assign weights to the word vectors in the two word subsets to be analyzed according to the approximation.
[0067] The S31 includes the following sub-steps:
[0068] S311, calculate the similarity between the word vectors in one word set and the word vectors in another word set:
[0069] ,
[0070] Among them, μ is the approximation, x 1,i is the i-th word element of a word vector in a word set, x 2,i is the i-th word element of the word vector in another word set, N is the number of word elements in the word vector in the word set, when the two word vectors are of different lengths, the shorter word vector is padded with 0, and i is a positive integer;
[0071] S312: When the approximation is greater than the approximation threshold, the corresponding two word vectors are regarded as approximate word groups.
[0072] In this embodiment, the approximation threshold is set to 0.5.
[0073] The S33 is specifically as follows: in a subset of words to be analyzed, the weight assigned to the word vectors in the approximate word group is (1+μ), and the weight assigned to other word vectors is 1.
[0074] The present invention extracts word vectors from two word sets, calculates the approximation, and uses it to compare the word vectors to find similar phrases, thereby finding two content-related word subsets to be analyzed, and assigns weights to the word vectors in the two word subsets to be analyzed based on the approximation, so that key words can gain more attention.
[0075] like Figure 2 As shown, the two-layer semantic analysis model in S4 includes: a first-layer semantic feature extraction unit, a second-layer semantic feature extraction unit, a semantic feature fusion unit, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a first Concat layer and a fully connected layer;
[0076] The input end of the first-layer semantic feature extraction unit is used to input a subset of words to be analyzed, and its output end is connected to the first input end of the semantic feature fusion unit; the input end of the second-layer semantic feature extraction unit is used to input another subset of words to be analyzed, and its output end is connected to the second input end of the semantic feature fusion unit; the output end of the semantic feature fusion unit is respectively connected to the input end of the first maximum pooling layer, the input end of the second maximum pooling layer, and the input end of the third maximum pooling layer; the input end of the first Concat layer is respectively connected to the output end of the first maximum pooling layer, the output end of the second maximum pooling layer, and the output end of the third maximum pooling layer, and its output end is connected to the input end of the fully connected layer; the output end of the fully connected layer serves as the output end of the two-layer semantic analysis model.
[0077] In this embodiment, the pooling window size of the first maximum pooling layer is set to , the pooling window size of the second maximum pooling layer is set to , and the pooling window size of the third maximum pooling layer is set to .
[0078] The present invention uses each layer of semantic feature extraction unit to process a subset of words to be analyzed, extracts semantic features, performs semantic feature fusion at the semantic feature fusion unit, and then uses three maximum pooling layers with different window sizes to extract features of different scales, on the one hand, achieving a reduction in the feature quantity, and on the other hand, achieving effective significant feature extraction, splicing significant features of different scales through the first Concat layer, and predicting conflict values through the fully connected layer.
[0079] like Figure 3 As shown, the structures of the first-layer semantic feature extraction unit and the second-layer semantic feature extraction unit are the same, both of which include: a word processing layer, a word feature extraction module, a multiplier, an LSTM neural network and a second Concat layer;
[0080] The input end of the word processing layer is used to input the word vectors in the word subset to be analyzed, and its output end is connected to the input end of the word feature extraction module; the first input end of the multiplier is connected to the output end of the word feature extraction module, the second input end is used to input the weight of the word vector, and its output end is connected to the input end of the cell unit in the LSTM neural network; the input end of the second Concat layer is respectively connected to the output end of each cell unit in the LSTM neural network, and its output end serves as the output end of the first layer semantic feature extraction unit or the second layer semantic feature extraction unit.
[0081] The present invention uses a word processing layer to process each word vector, which is convenient for inputting into a word feature extraction module to extract word features. At the multiplier, weights are applied to the word features extracted by the word feature extraction module, the attention of each word feature is adjusted, and the accuracy of semantic analysis is improved. Each cell unit in the LSTM neural network is then used to process each word feature. The LSTM neural network can capture the characteristics of long-term dependencies, so that the semantic feature extraction unit can consider the overall semantic features of the word subset to be analyzed.
[0082] The expression of the word processing layer is:
[0083] ,
[0084] ,
[0085] ,
[0086] Among them, H is the output of the word processing layer, R is the scaling vector, r1 is the first element in the scaling vector, and r j is the jth element in the scaling vector, r M is the Mth element in the scaling vector, y j is the j-th word element of the word vector of the input word processing layer, M is the number of word elements in the word vector of the input word processing layer, j is a positive integer, e is a natural constant, and T is the vector transpose.
[0087] The present invention first uniformly scales the word elements of the word vector of the input word processing layer to a fixed scale, and then Expanding the data volume not only makes it easier for the word feature extraction module to process, but also expands the features of the word vector.
[0088] like Figure 4 As shown, the word feature extraction module includes: a convolution layer, a first channel attention layer, a second channel attention layer, an adder and a sampling layer;
[0089] The input end of the convolutional layer is used as the input end of the word feature extraction module, and its output end is respectively connected to the input end of the first channel attention layer and the input end of the second channel attention layer; the input end of the adder is respectively connected to the output end of the first channel attention layer and the output end of the second channel attention layer, and its output end is connected to the input end of the sampling layer; the output end of the sampling layer is used as the output end of the word feature extraction module;
[0090] The expression of the first channel attention layer is:
[0091] ,
[0092] Among them, Y1 is the output of the first channel attention layer, Sigmoid is the S-type function, is a convolution operation with a convolution kernel size of 1*1, X is the input of the convolution layer, For Hamadaji;
[0093] The expression of the second channel attention layer is:
[0094] ,
[0095] Among them, Y2 is the output of the second channel attention layer, and Tanh is the hyperbolic tangent activation function.
[0096] The word feature extraction module of the present invention includes two channel attention layers. Through the dual-channel attention, the model pays higher attention to key features, reduces the attention to unimportant features, and automatically filters out unimportant features.
[0097] The output of the semantic feature fusion unit is S: , where A is the output of the first-layer semantic feature extraction unit, B is the output of the second-layer semantic feature extraction unit, T is the vector transpose, and Concat is the concatenation operation.
[0098] The output of the first layer semantic feature extraction unit and the output of the second layer semantic feature extraction unit are concatenated and constructed into a matrix for processing by the maximum pooling layer.
[0099] The present invention extracts the text content of two kinds of instructions for use of medicines to be used from a database, and constructs a word set according to each text content, finds two word subsets to be analyzed from the two word sets according to the approximation of word vectors, thereby determining texts with relevant content, and assigns weights to the word vectors in the two word subsets to be analyzed, uses a two-layer semantic analysis model to perform semantic extraction on the two word subsets to be analyzed, and performs semantic enhancement through weights to improve the attention of key words, thereby analyzing the conflict of content-related texts on medication. The present invention starts from the instructions for use of medicines to provide accurate information for medication conflict analysis, then filters out relevant content, simplifies text information, and improves the accuracy of medication conflict analysis.
[0100] In the instructions for use of drugs, the contents recorded include: drug name, ingredients, action category, indications, adverse reactions, contraindications, drug interactions and pharmacological effects, etc., and the contents that conflict with them are recorded in detail in the instructions for use of drugs, for example: this product can increase gastrointestinal adverse reactions and even cause ulcers when used together with other antipyretic, analgesic, and anti-inflammatory drugs (such as certain compound anti-cold drugs), and it is forbidden to use it together. When this product is used together with anticoagulants such as heparin and dicoumarol, it can lead to prolonged prothrombin time and increased bleeding tendency. When used together, the patient's bleeding signs should be closely monitored. When this product is used together with digoxin, methotrexate, and oral hypoglycemic drugs, the blood drug concentration of these drugs can be increased, and it is not suitable to use them together. Therefore, the present invention extracts the text content of the instructions for use, which can ensure the accuracy of the information source, and on the other hand, extracts and finds relevant content, simplifies a large amount of redundant other content, and can be conducive to semantic analysis model analysis.
[0101] In this embodiment, the two-layer semantic analysis model may be trained using a gradient descent method.
[0102] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A medication conflict analysis method based on semantic analysis, characterized in that: The following steps are involved: S1. Extract the text content of the instructions for two drugs to be used; S2. construct a word set according to each text content, wherein the word set includes: multiple word subsets; S3. Find two word subsets to be analyzed based on the approximation of the word vectors in the two word sets, and assign weights to the word vectors in the two word subsets to be analyzed; S4. A two-layer semantic analysis model is used to perform semantic extraction on two word subsets to be analyzed, and semantic enhancement is performed through weights to obtain the medication conflict values of the two drugs to be used; The two-layer semantic analysis model in S4 includes: a first-layer semantic feature extraction unit, a second-layer semantic feature extraction unit, a semantic feature fusion unit, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a first Concat layer and a fully connected layer, each layer of the semantic feature extraction unit processes a subset of words to be analyzed, extracts semantic features, performs semantic feature fusion at the semantic feature fusion unit, uses three maximum pooling layers with different window sizes to extract features of different scales, splices features of different scales through the first Concat layer, and predicts conflict values through the fully connected layer; The structures of the first-layer semantic feature extraction unit and the second-layer semantic feature extraction unit are the same, and both include: a word processing layer, a word feature extraction module, a multiplier, an LSTM neural network and a second Concat layer. The word processing layer is used to process each word vector, and the word feature extraction module extracts word features. At the multiplier, weights are applied to the word features extracted by the word feature extraction module, and each cell unit in the LSTM neural network is used to process each word feature. The second Concat layer is connected to each cell unit in the LSTM neural network.
2. The medication conflict analysis method based on semantic analysis according to claim 1, characterized in that: The S2 comprises the following sub-steps: S21, splitting each text content into segments according to the paragraphs in each text content; S22. In a text content, split the text of each segment into word vectors to obtain word subsets; S23. Construct word subsets belonging to the same text content into a word set.
3. The medication conflict analysis method based on semantic analysis according to claim 2, characterized in that: The S3 comprises the following sub-steps: S31, extract word vectors from two word sets, calculate the approximation, and find approximate phrases; S32, extracting the word subsets where the similar phrases are located, and obtaining two word subsets to be analyzed; S33. Assign weights to the word vectors in the two word subsets to be analyzed according to the approximation.
4. The medication conflict analysis method based on semantic analysis according to claim 3, characterized in that: The S31 includes the following sub-steps: S311, calculate the similarity between the word vectors in one word set and the word vectors in another word set: , Among them, μ is the approximation, x 1,i is the i-th word element of a word vector in a word set, x 2,i is the i-th word element of the word vector in another word set, N is the number of word elements in the word vector in the word set, when the two word vectors are of different lengths, the shorter word vector is padded with 0, and i is a positive integer; S312: When the approximation is greater than the approximation threshold, the corresponding two word vectors are regarded as approximate word groups.
5. The medication conflict analysis method based on semantic analysis according to claim 4, characterized in that: The S33 is specifically as follows: in a subset of words to be analyzed, the weight assigned to the word vectors in the approximate word group is (1+μ), and the weight assigned to other word vectors is 1.
6. The medication conflict analysis method based on semantic analysis according to claim 1, characterized in that: The two-layer semantic analysis model in S4 includes: a first-layer semantic feature extraction unit, a second-layer semantic feature extraction unit, a semantic feature fusion unit, a first maximum pooling layer, a second maximum pooling layer, a third maximum pooling layer, a first Concat layer and a fully connected layer; The input end of the first-layer semantic feature extraction unit is used to input a subset of words to be analyzed, and its output end is connected to the first input end of the semantic feature fusion unit; the input end of the second-layer semantic feature extraction unit is used to input another subset of words to be analyzed, and its output end is connected to the second input end of the semantic feature fusion unit; the output end of the semantic feature fusion unit is respectively connected to the input end of the first maximum pooling layer, the input end of the second maximum pooling layer, and the input end of the third maximum pooling layer; the input end of the first Concat layer is respectively connected to the output end of the first maximum pooling layer, the output end of the second maximum pooling layer, and the output end of the third maximum pooling layer, and its output end is connected to the input end of the fully connected layer; the output end of the fully connected layer serves as the output end of the two-layer semantic analysis model.
7. The method for analyzing medication conflicts based on semantic analysis according to claim 6, characterized in that: The first layer semantic feature extraction unit and the second layer semantic feature extraction unit have the same structure, both comprising: a word processing layer, a word feature extraction module, a multiplier, an LSTM neural network and a second Concat layer; The input end of the word processing layer is used to input the word vectors in the word subset to be analyzed, and its output end is connected to the input end of the word feature extraction module; the first input end of the multiplier is connected to the output end of the word feature extraction module, the second input end is used to input the weight of the word vector, and its output end is connected to the input end of the cell unit in the LSTM neural network; the input end of the second Concat layer is respectively connected to the output end of each cell unit in the LSTM neural network, and its output end serves as the output end of the first layer semantic feature extraction unit or the second layer semantic feature extraction unit.
8. The method for analyzing medication conflicts based on semantic analysis according to claim 7, characterized in that: The expression of the word processing layer is: , , , Among them, H is the output of the word processing layer, R is the scaling vector, r1 is the first element in the scaling vector, and r j is the jth element in the scaling vector, r M is the Mth element in the scaling vector, y j is the j-th word element of the word vector of the input word processing layer, M is the number of word elements in the word vector of the input word processing layer, j is a positive integer, e is a natural constant, and T is the vector transpose.
9. The method for analyzing medication conflicts based on semantic analysis according to claim 7, characterized in that: The word feature extraction module includes: a convolution layer, a first channel attention layer, a second channel attention layer, an adder and a sampling layer; The input end of the convolutional layer is used as the input end of the word feature extraction module, and its output end is respectively connected to the input end of the first channel attention layer and the input end of the second channel attention layer; the input end of the adder is respectively connected to the output end of the first channel attention layer and the output end of the second channel attention layer, and its output end is connected to the input end of the sampling layer; the output end of the sampling layer is used as the output end of the word feature extraction module; The expression of the first channel attention layer is: , Among them, Y1 is the output of the first channel attention layer, Sigmoid is the S-type function, which is a convolution operation with a convolution kernel size of 1*1, and X is the input of the convolution layer. For Hamadaji; The expression of the second channel attention layer is: , Among them, Y2 is the output of the second channel attention layer, and Tanh is the hyperbolic tangent activation function.
10. The method for analyzing medication conflicts based on semantic analysis according to claim 6, characterized in that: The output of the semantic feature fusion unit is S: , where A is the output of the first-layer semantic feature extraction unit, B is the output of the second-layer semantic feature extraction unit, T is the vector transpose, and Concat is the concatenation operation.
