Sequence-to-sequence prescription generation system based on multi-feature interaction

Through multi-feature interaction technology, local and global semantic features and keyword features are extracted in the generation of traditional Chinese medicine prescriptions, and an information-rich feature vector is generated, which solves the problem of information loss caused by treating traditional Chinese medicine prescription generation as text machine translation in the existing technology, and achieves More accurate prescription generation alleviates the supply shortage of traditional Chinese medicine medical services and improves the efficiency of medical resource utilization.

CN118538360APending Publication Date: 2024-08-23ZHONGBEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410759142.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing TCM prescription generation methods mainly regard TCM prescription generation as a text machine translation process, resulting in the loss of key information and inability to effectively generate prescriptions from symptom text. Moreover, the generated input features cannot meet actual needs, limiting the effectiveness of TCM prescription generation.

Method used

Using multi-feature interaction technology, through the symptom encoder, keyword encoder, global attribute feature encoder and multi-feature interactive bilinear pooling fusion module, local semantic features, global semantic features and keyword features are extracted to generate information-rich new Feature vectors are used in sequence-to-sequence prescription generation systems to achieve end-to-end automatic generation of symptoms to prescriptions.

Benefits of technology

Significantly improves the effect of TCM prescription generation, can generate symptomatic TCM prescriptions more accurately, alleviates the shortage of high-quality TCM medical services, and improves the efficient use of medical resources. The generated result Recall is 84.2%, and the response time is less than or equal to 1.5 Second.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118538360A
    Figure CN118538360A
Patent Text Reader

Abstract

The invention discloses a sequence-to-sequence prescription generation system based on multi-feature interaction. The system comprises a symptom encoder module, a keyword encoder module, a global attribute feature encoder module, a multi-feature interaction bilinear pool fusion module and a prescription decoder module. The global attribute feature encoder module can capture global semantic information of an input symptom text and generate a global semantic feature vector; the multi-feature interaction bilinear pool fusion module can effectively fuse feature data of different dimensions and information densities so as to generate feature vectors with high information degrees; and the prescription decoder module integrates the information from each module, decodes and generates a proper prescription. According to the invention, doctors of traditional Chinese medicine can have a set of standard reference system, errors caused by subjective judgment of the doctors are effectively reduced, the accuracy and practicability of prescriptions are guaranteed, the development of intelligent traditional Chinese medicine prescription technology is promoted, and the progress of intelligent traditional Chinese medicine technology is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic generation of traditional Chinese medicine prescriptions in natural language processing, and in particular to a sequence-to-sequence prescription generation system based on multi-feature interaction. Background Art

[0002] In the current development context of TCM and Chinese medicine, thanks to the strong support of national policies and the public's enhanced awareness of health management, TCM treatment has gradually become an important choice for people pursuing a natural and healthy lifestyle. As a bridge connecting ancient medical theories and modern medical practices, TCM prescriptions not only show their uniqueness in disease treatment, but also play an important role in conditioning the body and preventing diseases. In order to alleviate the shortage of high-quality TCM medical services and to provide standard prescriptions as a reference for young TCM physicians with less experience, we have developed a TCM prescription generation model that can effectively utilize TCM compatibility knowledge, effectively and comprehensively interpret symptom texts, and effectively integrate multi-source information through the deep integration of traditional TCM knowledge, prescription principles, and modern computing technology, so as to realize the automatic generation of TCM prescriptions.

[0003] Traditional methods for generating TCM prescriptions mainly rely on machine learning and deep learning techniques, but these methods face limitations when analyzing the dependencies of text data, and can usually only identify the superficial connection between symptoms and herbs. With the advancement of encoding and decoding technology, Seq2seq models have begun to be effectively applied in this field, becoming a mainstream method and achieving remarkable results in TCM prescription generation models. Despite this, existing methods still mainly regard TCM prescription generation as a text machine translation process, which may lead to the loss of key information, thereby limiting the effect of generating TCM prescriptions from symptom texts and making the generated input features unable to meet actual needs.

[0004] To overcome these limitations, we introduced multi-feature interaction technology, which effectively fuses feature vectors from different information sources. Specifically, the local semantic feature vector and the global semantic feature vector contain the local and global information of the symptom text, respectively, while the keyword feature vector contains the prescription compatibility information. A global attribute feature encoder extracts the global semantic feature vector, a symptom encoder extracts the local semantic vector, and a keyword encoder extracts the keyword feature vector. Using the multi-feature interaction bilinear pooling fusion module, these vectors are effectively fused to generate a new feature vector that is rich in information, thereby significantly improving the effect of prescription generation. Summary of the invention

[0005] Based on the above ideas, the present invention proposes a sequence-to-sequence prescription generation system based on multi-feature interaction. This system realizes the end-to-end automatic generation of symptoms to prescriptions, effectively alleviating the shortage of high-quality traditional Chinese medicine services, thereby improving the efficient use of medical resources.

[0006] In order to achieve the above purpose, the following technical solutions are adopted:

[0007] A sequence-to-sequence prescription generation system based on multi-feature interaction, characterized by comprising a symptom encoder module, a keyword encoder module, a global attribute feature encoder module, a multi-feature interaction bilinear pooling fusion module and a prescription decoder module;

[0008] Symptom encoder module: used to process symptom text information, including a recurrent neural network and a gated recurrent unit. The recurrent unit in the recurrent neural network is replaced with a gated recurrent unit. The obtained symptom text is input into the recurrent neural network for feature extraction to obtain a local semantic feature vector of the symptom text information.

[0009] Keyword encoder module: used to process the keyword text information of the main medicine, including a recurrent neural network composed of gated recurrent units, inputting the keyword information of the main medicine in the standard prescription corresponding to the symptoms into the recurrent neural network for feature extraction, and obtaining the feature vector of the keyword text information;

[0010] Global attribute feature encoder module: used to extract global semantic information from symptom text information. It uses multiple convolution kernels to adapt to the feature extraction of texts of different lengths, extracts information from multiple angles to construct feature maps, uses the maximum pooling strategy to filter out the most critical information in the feature map, and further uses the fully connected layer to obtain the global semantic feature vector.

[0011] Multi-feature interactive bilinear pooling fusion module: used to fuse local semantic features of symptoms, keyword features and global semantic features of symptoms, using Hadamard product to enhance the interaction between different features, merging different features to generate high-dimensional features, and introducing group accumulation pooling mechanism to group and accumulate elements in feature vectors to generate more compact feature representations, optimize training efficiency, and adjust hyperparameters to achieve cross-fusion of different information to obtain fusion vectors;

[0012] Prescription decoder module: A single-layer gated recurrent neural network is used as a decoder, and the fusion vector output by the multi-feature interactive bilinear pooling fusion module is passed through the decoder to obtain an appropriate prescription.

[0013] The sequence-to-sequence prescription generation system based on multi-feature interaction, the symptom encoder module, assuming s is a symptom text sequence to be input This is fed into the symptom encoder, and the forward GRU encodes the sequence from left to right into hidden states The backward encoder encodes the symptom character sequence from right to left into hidden states r i (i=1,2,...,T) is taken as the hidden state of each time step, that is, the forward hidden state and the backward hidden state of the current time step are connected, which is expressed as the following formula:

[0014]

[0015] This gives the hidden state sequence r1, r2, ..., r of the symptom encoder. T , which is the output sequence of the symptom encoder, where each r i The hidden layer size is 256.

[0016] The sequence-to-sequence prescription generation system based on multi-feature interaction, the keyword encoder module: assuming k is a keyword sequence k1, k2, ..., k n , input it into the keyword encoder, and the forward GRU processes these word sequences from left to right to generate a series of hidden states The reverse GRU encodes the word sequence from right to left, generating another set of hidden states The hidden state of the forward GRU at the end of the sequence is The hidden state of the reverse GRU at the beginning of the sequence The combined strategy is to obtain r n , expressed as the following formula:

[0017]

[0018] In this way, the hidden state feature vector r of the keyword encoder is obtained n , whose hidden layer size is 256.

[0019] The sequence-to-sequence prescription generation system based on multi-feature interaction, the global attribute feature encoder module: design three convolution kernels of different sizes and To adapt to the extraction of text features of different lengths, k = 128, representing the dimension of the symptom character vector. Such diverse convolution kernel sizes enable the model to extract global semantic information from symptom text from multiple perspectives. For each convolution kernel o i , by overlaying the character vector window s i:i+h-1 To generate feature a i This process can comprehensively consider the semantics of continuous character windows in the text, thereby extracting rich text features. The formula is as follows:

[0020] a i =f(w·s i:i+h-1 +b)

[0021] The activation function f(·) uses ReLU, w and b represent learnable parameters. The convolution kernel oi is applied to each character window {x 1:h ,x 1:h ,…,x n-h+1:n}Perform a convolution operation to generate a feature map o, the formula is as follows:

[0022] a=[a1,a2,...,a n-h+1 ]

[0023] Then, the maximum pooling strategy is implemented on the feature map obtained after convolution, and the most significant eigenvalue a=max(a) is selected as the new feature. After performing maximum pooling on six different feature maps, a eigenvalue is obtained for each. Subsequently, these eigenvalues ​​are connected in series to form a six-dimensional feature vector p. This vector comprehensively reflects the key information of the original symptom text after being processed by different convolution kernels, and provides a fused feature vector for further symptom text analysis and processing, as shown below:

[0024] p=[a1,a2,a3,a4,a5,a6]

[0025] Finally, the fully connected layer is used to transform p into the final global semantic vector:

[0026] e global =f(w·p+b)

[0027] The activation function f(·) uses ReLU, and w and b are learnable parameters.

[0028] The multi-feature interaction based sequence-to-sequence prescription generation system, the multi-feature interaction bilinear pooling fusion module: uses two MFI units to local semantic features Global semantic features global and keyword features r n In the fusion process, the input feature vectors are first merged through the Hadamard product operation to generate a new high-dimensional feature vector and In order to further optimize the training efficiency of the model, these high-dimensional vectors are reduced in dimension using the grouped cumulative pooling technique. By grouping and accumulating the elements in the feature vector, a more compact feature representation is generated, that is, converted into two D / g dimensional vectors. Then, the g units in each group are sequentially mapped to one unit to obtain two vectors. Subsequently, these vectors are further processed through the fully connected layer to generate and p GFinally, by adjusting the hyperparameter ω, the effective cross-fusion of different feature vectors is achieved, generating a highly information-based fusion vector p that integrates all aspects of information. i (i=1,2,...,n):

[0029]

[0030] The sequence-to-sequence prescription generation system based on multi-feature interaction, the prescription decoder module: the herbal prescription generation process uses a single-layer gated recurrent neural network as a prescription decoder. In this process, firstly start with a special start symbol <sos>Start the decoding process, and then gradually take each generated herb as the input of the next time step, and this continuous process continues until the end symbol is encountered <eos>, marking the generation of a complete herbal sequence. In this sequence generation process, each herbal y t The generation depends on the current decoder hidden state s t and a specific attention vector c t , which can be expressed as follows:

[0031]

[0032] The attention mechanism plays a key role here. It generates a weight distribution a by considering the relationship between the current state of the decoder and each fused output vector. t,i . Then a t,i The fusion vector sequence p1,p2,...,p generated by MFI n Then used to generate the weighted sum vector c t :

[0033]

[0034] The attention weight a t,i The calculation depends on the current hidden state s of the decoder t and the new fused vector sequence p1,p2,...,p n , which can be achieved through softmax(·):

[0035]

[0036] The calculation method of score(·) is as follows:

[0037] score(s t ,r i )=v T tanh(W s s t +W p p i +b)

[0038] Among them, v, W s , W p and b are learnable parameter vectors.

[0039] Then, the attention vector c t and the decoder’s hidden state s t are merged to form a new vector s t :

[0040]

[0041] Among them, W c is a learnable parameter vector

[0042] This vector is then transformed into a vector of the size of the herbal vocabulary, i.e. [d, 1], through a feed-forward neural network. The vector is processed using the softmax function to obtain the probability distribution of the generated herbs. Finally, the herbal word with the highest probability is selected as the output through argmax, thus gradually constructing the entire herbal prescription.

[0043] y=argmax(Softmax(W a s t ))

[0044] Among them, W a is a learnable parameter vector.

[0045] During the training process of the algorithm, the minimum value of the loss function is calculated by the gradient descent method, and the parameters are updated according to the calculated gradient direction: after a complete training process, a more ideal prescription generation effect will be obtained.

[0046] The beneficial effects of the present invention are:

[0047] The method of the present invention combines the latest research in related fields to construct and train a model that can accurately generate effective symptomatic Chinese medicine prescriptions. The trained model can be used for end-to-end automatic generation of symptoms to prescriptions, and can be integrated and adapted with different devices, which comprehensively alleviates the impact of the shortage of high-quality Chinese medicine medical services. The results of the present invention will be applied to multiple fields and the implementation cost is very low. General medical service providers can complete the entire process using purchased computer equipment; this project can also cultivate a group of important technical backbones for the theoretical system of automatic generation of Chinese medicine prescriptions. These researchers will become core members supporting the sustainable development of the project team, and apply their scientific research results such as papers and monographs to the research and application of the theoretical system of automatic generation of Chinese medicine prescriptions.

[0048] The recall of the sequence-to-sequence prescription generation model based on multi-feature interaction is 84.2%, and the response time for completing a generation task is usually less than or equal to 1.5 seconds. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the overall flow of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention.

[0050] Figure 2 Schematic diagram of the operation of the global attribute feature encoder module of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention.

[0051] Figure 3 This is a schematic diagram of the operation of the multi-feature interaction bilinear pooling fusion module of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention.

[0052] Figure 4 Belu-1 box plot of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and the other two methods.

[0053] Figure 5 Manual evaluation diagram of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and two other methods; (a) Method 1; (b) Method 2; (c) This method.

[0054] Figure 6 This is a comparison chart of the generation results of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and the other two methods. DETAILED DESCRIPTION

[0055] The present invention is described in detail below in conjunction with specific embodiments.

[0056] A sequence-to-sequence prescription generation system based on multi-feature interaction. The overall process is as follows Figure 1 As shown:

[0057] A1 For the symptom text information provided by the medical unit, the dimension of the feature vector after unified processing is adjusted to d×128, where d represents the length of the symptom text. Since the length of different symptoms varies, variables are used instead:

[0058] A2 will unify the symptom text sequence Input to the symptom encoder, the forward GRU encodes the sequence from left to right into hidden states The backward encoder encodes the symptom character sequence from right to left into hidden states r i (i=1,2,...,T) is taken as the hidden state of each time step, that is, the forward hidden state and the backward hidden state of the current time step are connected, which is expressed as the following formula:

[0059]

[0060] This gives the hidden state sequence r1, r2, ..., r of the symptom encoder. T , which is the output sequence of the symptom encoder, where each r i The hidden layer size is 256.

[0061] A3 takes the keyword sequence k1, k2, ..., k in the label prescription corresponding to the symptom n Select and input it into the keyword encoder. The forward GRU processes these word sequences from left to right to generate a series of hidden states The reverse GRU encodes the word sequence from right to left, generating another set of hidden states The hidden state of the forward GRU at the end of the sequence is The hidden state of the reverse GRU at the beginning of the sequence The combined strategy is to obtain r n , expressed as the following formula:

[0062]

[0063] A4 global attribute feature encoder module Figure 2 As shown in the figure, this module uses convolutional neural network technology to encode symptom text, aiming to capture and generate feature vectors that represent the global semantics of the text. The encoder structure includes convolutional layers, pooling layers, and fully connected layers. In natural language processing tasks, unlike the square convolution kernels used when processing image data, the convolution kernels for text data are usually designed to be consistent with the width of the word vector. This is done to ensure that each convolution operation can cover the complete word vector and ensure that the word is used as the processing unit rather than a smaller segmentation.

[0064] The specific steps of step A4 are as follows:

[0065] A41 converts the symptom text feature vector Input to the global attribute feature encoder module.

[0066] A42 designs three convolution kernels of different sizes and To adapt to the extraction of text features of different lengths, k = 128, representing the dimension of the symptom character vector. Such diverse convolution kernel sizes enable the model to extract global semantic information from symptom text from multiple perspectives. For each convolution kernel o i , by overlaying the character vector window s i:i+h-1 To generate feature a i This process can comprehensively consider the semantics of continuous character windows in the text, thereby extracting rich text features. The formula is as follows:

[0067] a i =f(w·s i:i+h-1 +b)

[0068] The activation function f(·) uses ReLU, w and b represent learnable parameters. The convolution kernel oi is applied to each character window {x 1:h ,x 1:h ,…,x n-h+1:n }Perform a convolution operation to generate a feature map o, the formula is as follows:

[0069] a=[a1,a2,...,a n-h+1 ]

[0070] A43 implements the maximum pooling strategy on the feature map obtained after convolution, and selects the most significant eigenvalue a=max(a) as the new feature. After performing maximum pooling on six different feature maps, each obtains a eigenvalue. Subsequently, these eigenvalues ​​are connected in series to form a six-dimensional feature vector p. This vector comprehensively reflects the key information of the original symptom text after being processed by different convolution kernels, and provides a fused feature vector for further symptom text analysis and processing, as shown below:

[0071] p=[a1,a2,a3,a4,a5,a6]

[0072] A44 uses a fully connected layer to transform p into the final global semantic vector:

[0073] e global =f(w·p+b)

[0074] The activation function f(·) uses ReLU, and w and b are learnable parameters.

[0075] A5 inputs the output symptom text local semantic vector, global semantic vector and keyword vector into the multi-feature interactive bilinear pooling fusion module.

[0076] Step A5 uses Multi-feature Interaction Bilinear Pooling (MFI-BiPool) for feature fusion. This strategy is used to integrate the local features of symptoms, global semantic features, and keyword features, such as Figure 3 Among them, MFI-BiPool technology not only enhances the interaction between features of different dimensions and improves the accuracy of the model in complex data processing, but also effectively avoids the computational burden caused by overfitting and too many parameters by introducing a group accumulation pooling mechanism, thereby accelerating the model training process.

[0077] The specific steps of step A5 are as follows:

[0078] A51 uses two MFI units to analyze local semantic features. Global semantic features global and keyword features r n In the fusion process, the input feature vectors are combined through the Hadamard product operation to generate a new high-dimensional feature vector. and

[0079] In order to further optimize the training efficiency of the model, A52 uses group accumulation pooling technology to reduce the dimensionality of these high-dimensional vectors. By grouping and accumulating the elements in the feature vector, a more compact feature representation is generated, that is, converted into two D / g-dimensional vectors, and the g units in each group are sequentially mapped to one unit to obtain two vectors.

[0080] A53 further processes these vectors through a fully connected layer to generate and p G Finally, by adjusting the hyperparameter ω, the effective cross-fusion of different feature vectors is achieved, generating a highly information-based fusion vector p that integrates all aspects of information. i (i=1,2,...,n):

[0081]

[0082] The generation process of A6 herbal prescriptions uses a single-layer gated recurrent neural network as a prescription decoder. In this process, we first start with a special start symbol <sos>Start the decoding process, and then gradually take each generated herb as the input of the next time step, and this continuous process continues until the end symbol is encountered <eos>, marking the generation of a complete herbal sequence. In this sequence generation process, each herbal y t The generation of depends on the current decoder hidden state s t and a specific attention vector c t , which can be expressed as follows:

[0083]

[0084] The attention mechanism plays a key role here. It generates a weight distribution a by considering the relationship between the current state of the decoder and each fused output vector. t,i . Then a t,i The fusion vector sequence p1,p2,...,p generated by MFI n Then used to generate the weighted sum vector c t :

[0085]

[0086] The attention weight a t,i The calculation depends on the current hidden state s of the decoder t and the new fused vector sequence p1,p2,...,p n , which can be achieved through softmax(·):

[0087]

[0088] The calculation method of score(·) is as follows:

[0089] score(s t ,r i )=v T tanh(W s s t +W p p i +b)

[0090] Among them, v, W s , W p and b are learnable parameter vectors.

[0091] Then, the attention vector c t and the decoder’s hidden state s t are merged to form a new vector s t :

[0092]

[0093] Among them, W c is a learnable parameter vector

[0094] This vector is then transformed into a vector of the size of the herbal vocabulary, i.e. [d, 1], through a feed-forward neural network. The vector is processed using the softmax function to obtain the probability distribution of the generated herbs. Finally, the herbal word with the highest probability is selected as the output through argmax, thus gradually constructing the entire herbal prescription.

[0095] y=argmax(Softmax(W a s t ))

[0096] Among them, W a is a learnable parameter vector.

[0097] During the training process of the algorithm, the minimum value of the loss function is calculated by the gradient descent method, and the parameters are updated according to the calculated gradient direction: after a complete training process, a more ideal prescription generation effect will be obtained.

[0098] Figure 4 It is a comparison chart of the Precision curves of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and the other two methods. Among them, method 1 uses the traditional Seq2Seq model for generation, and does not add the global attribute feature encoder module and the MFI module, and method 2 uses the attention Seq2Seq model for generation; it can be seen that after adding the global attribute feature encoder module and the MFI module, the Belu-1 of the sequence-to-sequence prescription generation system based on multi-feature interaction is the best. This is because after adding the global attribute feature encoder module and the MFI module, the key information in the prescription can be captured more effectively. The introduction of the MFI module enables the system to handle the interaction between different features more carefully, thereby generating a more accurate prescription. Although methods 1 and 2 can also obtain relatively high Belu-1 values ​​in some cases, their quartile ranges are wider, especially method 1, which shows greater performance fluctuations. It shows the importance of integrating the global attribute feature encoder and the multi-feature interaction module into the prescription generation system.

[0099] Figure 5 This is a comparison chart of the manual evaluation of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and the other two methods. Method 1 and Method 2 describe the same Figure 4 ,We found professional Chinese medicine physicians to score the generation effects of these three methods from 0 to 10. ,It can be seen that compared with other methods, the system proposed in ,the present invention is closest to the label prescription set and is superior to the other ,two models.

[0100] Figure 6 1 is a diagram comparing the generation results of the sequence-to-sequence prescription generation system based on multi-feature interaction of the present invention and the other two methods. Method 1 and Method 2 describe the same Figure 4 , where the main drugs are all underlined. It can be seen that among the herbal medicines generated by this method, the overlap with the label prescription is the highest.

[0101] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.< / eos> < / sos> < / eos> < / sos>

Claims

1. A sequence-to-sequence prescription generation system based on multi-feature interaction, characterized in that: It includes symptom encoder module, keyword encoder module, global attribute feature encoder module, multi-feature interactive bilinear pooling fusion module and prescription decoder module; Symptom encoder module: used to process the symptom text information provided by the medical unit, input the obtained symptom text into the recurrent neural network for feature extraction, and obtain the local semantic feature vector of the symptom text information; Keyword encoder module: used to process the keyword text information of the main medicine in the label prescription corresponding to the symptom, input the keyword information of the main medicine in the standard prescription corresponding to the symptom into the recurrent neural network for feature extraction, and obtain the keyword feature vector of the keyword text information; Global attribute feature encoder module: used to extract global semantic features of symptom text information. It uses multiple convolution kernels to adapt to the feature extraction of texts of different lengths, extracts information from multiple angles to construct feature maps, uses the maximum pooling strategy to filter out the most critical information in the feature map, and further uses the fully connected layer to obtain the global semantic feature vector. Multi-feature interactive bilinear pooling fusion module: used to fuse local semantic features of symptoms, keyword features and global semantic features of symptoms, using Hadamard product to enhance the interaction between different features, merging different features to generate high-dimensional features, and introducing group accumulation pooling mechanism to group and accumulate elements in feature vectors to generate more compact feature representations, optimize training efficiency, and adjust hyperparameters to achieve cross-fusion of different information to obtain fusion vectors; Prescription decoder module: A single-layer gated recurrent neural network is used as a decoder, and the fusion vector output by the multi-feature interactive bilinear pooling fusion module is passed through the decoder to obtain an appropriate prescription.

2. A sequence-to-sequence prescription generation system based on multi-feature interaction according to claim 1, characterized in that: The symptom encoder module: Assume s is a symptom text sequence to be input This is fed into the symptom encoder, and the forward GRU encodes the sequence from left to right into hidden states The backward encoder encodes the symptom character sequence from right to left into hidden states r i (i=1,2,...,T) is taken as the hidden state of each time step, that is, the forward hidden state and the backward hidden state of the current time step are connected, which is expressed as the following formula: This gives the hidden state sequence r1, r2, ..., r of the symptom encoder. T , which is the output sequence of the symptom encoder, where each r i The hidden layer size is 256.

3. A sequence-to-sequence prescription generation system based on multi-feature interaction according to claim 1, characterized in that: The keyword encoder module: Assume k is a keyword sequence k1, k2, ..., k n , input it into the keyword encoder, and the forward GRU processes these word sequences from left to right to generate a series of hidden states The reverse GRU encodes the word sequence from right to left, generating another set of hidden states The hidden state of the forward GRU at the end of the sequence is The hidden state of the reverse GRU at the beginning of the sequence The combined strategy is to obtain r n , expressed as the following formula: In this way, the hidden state feature vector r of the keyword encoder is obtained n , whose hidden layer size is 256.

4. The sequence-to-sequence prescription generation system based on multi-feature interaction according to claim 1, characterized in that: The global attribute feature encoder module described above: design three convolution kernels of different sizes and To adapt to the text feature extraction of different lengths, k = 128, representing the dimension of the symptom character vector; such diverse convolution kernel sizes enable the model to extract global semantic information in the symptom text from multiple perspectives; for each convolution kernel o i , by overlaying the character vector window s i:i+h-1 To generate feature a i , this process can comprehensively consider the semantics of continuous character windows in the text, thereby extracting rich text features. The formula is as follows: a i =f(w·s i:i+h-1 +b) The activation function f(·) uses ReLU, w and b represent learnable parameters; the convolution kernel oi is used for each character window {x 1:h ,x 1:h ,…,x n-h+1:n }Perform a convolution operation to generate a feature map o, the formula is as follows: <h2 style=";text-align:left;direction:ltr">a=[a1,a2,...,a<h2 style=";text-align:left;direction:ltr"> n-h+1 <h2 style=";text-align:left;direction:ltr"> ] Then, the maximum pooling strategy is implemented on the feature map obtained after convolution, and the most significant eigenvalue a=max(a) is selected as the new feature; after performing maximum pooling on six different feature maps, a eigenvalue is obtained for each; then, these eigenvalues ​​are connected in series to form a six-dimensional feature vector p; this vector comprehensively reflects the key information of the original symptom text after being processed by different convolution kernels, and provides a fused feature vector for further symptom text analysis and processing, as shown below: p=[a1,a2,a3,a4,a5,a6] Finally, the fully connected layer is used to transform p into the final global semantic vector: e global =f(w·p+b) The activation function f(·) uses ReLU, and w and b are learnable parameters.

5. The sequence-to-sequence prescription generation system based on multi-feature interaction according to claim 1, characterized in that: The multi-feature interactive bilinear pooling fusion module uses two MFI units to fusion local semantic features. Global semantic features global and keyword features r n Perform effective fusion; in the fusion process, the input feature vectors are first merged through the Hadamard product operation to generate a new high-dimensional feature vector and In order to further optimize the training efficiency of the model, these high-dimensional vectors are reduced in dimension using the grouped cumulative pooling technique. By grouping and accumulating the elements in the feature vector, a more compact feature representation is generated, that is, converted into two D / g dimensional vectors. The g units in each group are sequentially mapped to one unit to obtain two vectors. Subsequently, these vectors are further processed through the fully connected layer to generate and p G Finally, by adjusting the hyperparameter ω, the effective cross-fusion of different feature vectors is achieved, generating a highly information-based fusion vector p that integrates all aspects of information. i (i=1,2,...,n):

6. A sequence-to-sequence prescription generation system based on multi-feature interaction according to claim 1, characterized in that: The prescription decoder module: The herbal prescription generation process uses a single-layer gated recurrent neural network as a prescription decoder; in this process, first a special start symbol <sos>Start the decoding process, and then gradually take each generated herb as the input of the next time step, and this continuous process continues until the end symbol is encountered <eos>, marking the generation of a complete herbal sequence; in this sequence generation process, each herbal y t The generation of depends on the current decoder hidden state s t and a specific attention vector c t , which can be expressed as follows:< / eos> < / sos> The attention mechanism plays a key role here. It generates a weight distribution a by considering the relationship between the current state of the decoder and each fusion output vector. t,i ; and then a t,i The fusion vector sequence p1,p2,...,p generated by MFI n Then used to generate the weighted sum vector c t : The attention weight a t,i The calculation depends on the current hidden state s of the decoder t and the new fused vector sequence p1,p2,...,p n , which can be achieved through softmax(·): The calculation method of score(·) is as follows: score(s t ,r i )=v T tanh(W s s t +W p p i +b) Among them, v, W s , W p and b are learnable parameter vectors; Then, the attention vector c t and the decoder’s hidden state s t are merged to form a new vector Among them, W c is a learnable parameter vector This vector is then transformed into a vector of the size of the herbal vocabulary, i.e. [d, 1], through a feed-forward neural network. The vector is processed using the softmax function to obtain the probability distribution of the generated herbs. Finally, the herbal word with the highest probability is selected as the output through argmax, thus gradually constructing the entire herbal prescription. y=argmax(Softmax(W a s t )) Among them, W a is a learnable parameter vector.