Traditional Chinese medicine syndrome typing method and system

By combining autocoding and autoregressive language models, using BERT and QWen models to predict the probability of symptom type and keyword quantity characteristics, the problem of insufficient flexibility in TCM syndrome classification is solved, and higher classification accuracy and reliability are achieved.

CN120299635APending Publication Date: 2025-07-11SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510210342.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The autocoded language model relies on fixed feature vectors in the classification of traditional Chinese medicine syndromes, which leads to the inability to dynamically adjust the focus of context, and the allocation of key symptoms weights is unreasonable, resulting in insufficient classification accuracy of solid and weak symptoms.

Method used

Combining the autocoding language model and the autoregressive language model, by obtaining the patient's clinical information, using the BERT and QWen models to predict the probability of symptom type, combined with the keyword quantity feature vector, comprehensive feature extraction and classification are performed through the LSTM layer and the fully connected layer.

Benefits of technology

It improves the accuracy and reliability of typing traditional Chinese medicine syndrome, can focus on key symptoms more accurately, comprehensively capture the characteristics of the disease, and improves the flexibility and accuracy of classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299635A_ABST
    Figure CN120299635A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of classification, in particular to a traditional Chinese medicine syndrome typing method and system. Clinical information of a patient is input into an auto-encoding language model and an auto-regression language model respectively, each model predicts the probability that the disease of the patient belongs to an actual symptom type and the probability that the disease of the patient belongs to a deficiency symptom type, and an auto-encoding prediction result and an auto-regression prediction result are obtained; obtaining an actual symptom keyword set and a deficiency symptom keyword set, counting the number of actual symptom keywords and the number of deficiency symptom keywords in the clinical information of the patient, and combining the two statistical results to obtain a keyword number feature vector; splicing the self-encoding prediction result, the self-regression prediction result and the keyword quantity feature vector to obtain a comprehensive feature vector; and enabling the comprehensive feature vector to sequentially pass through an LSTM layer and a full connection layer to obtain a syndrome typing result of the patient. The accuracy and reliability of traditional Chinese medicine syndrome classification are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of classification, and particularly to a method and system for classifying traditional Chinese medicine (TCM) syndromes. Background Art

[0002] Syndrome differentiation in traditional Chinese medicine (TCM) refers to the process of comprehensively analyzing a patient's clinical information, such as symptoms, signs, medical history, and other relevant factors, to determine the specific pathological conditions affecting an individual. This process is the basis of TCM practice as it guides the selection of appropriate treatment methods in TCM. The syndrome differentiation task based on natural language processing (NLP) refers to using NLP techniques to analyze and interpret a patient's clinical information to determine the specific pathological conditions affecting an individual. The input of the syndrome classification method based on natural language processing (NLP) is the patient's symptoms, and the output is the type of syndrome classification. By using NLP techniques for syndrome classification, TCM practitioners can improve the accuracy and efficiency of the diagnosis process, ultimately enhancing patient care and treatment outcomes.

[0003] In the field of TCM syndrome differentiation, the method based on natural language processing (NLP) has become an important research direction. Since TCM clinical information is mostly presented in text form, containing a large amount of complex semantic information and professional knowledge, it is somewhat difficult to accurately classify and understand it. The autoencoder language model, with its powerful semantic learning ability, can perform deep feature extraction and representation learning on large-scale text data, effectively capturing the semantic associations and potential patterns in TCM clinical information, providing strong support for syndrome differentiation. Therefore, current existing technologies mainly rely on autoencoder pre-trained models for classification. Existing technologies mainly rely on autoencoder pre-trained models for classification. Song et al. (2019) proposed a new TCM case classification model by using multi-layer semantic expansion and character-level BERT for text representation. Chen et al. (2024) utilized publicly available TCM guidelines and textbooks to propose the TCM-BERT-CNN model based on deep learning for classifying and predicting various TCM syndromes. Ren et al. (in 2024) introduced TCM-SD, which is a large-scale TCM syndrome classification benchmark, and also introduced a domain-specific pre-trained language model, namely ZY-BERT.

[0004] However, in the binary classification of excess syndrome and deficiency syndrome in traditional Chinese medicine, although the auto-encoding language model can learn the context information within the text during the pre-training stage, when it comes to actual classification, it relies on the fixed feature vectors generated by the encoder to make judgments. This approach lacks flexibility and is difficult to dynamically adjust the focus of attention on the context according to the specific requirements of the excess syndrome and deficiency syndrome classification tasks. For example, for the "excess syndrome of yangming fu-organ", "high fever, abdominal pain with refusal to be pressed, constipation" and other are key symptom information, while for the "deficiency syndrome of spleen and stomach qi", "loss of appetite, abdominal distension, loose stools, fatigue" and other are important manifestations. It is very difficult for the auto-encoding language model to reasonably assign appropriate weights to these key symptoms, and it is very likely that the weights of key symptoms of excess syndrome such as "high fever, abdominal pain with refusal to be pressed" are underestimated, while the weights of some secondary or general symptoms are overestimated, which may lead to misjudgment of excess syndrome and deficiency syndrome, resulting in the inability of the auto-encoding language model to accurately classify excess syndrome and deficiency syndrome. Summary of the Invention

[0005] To this end, the technical problem to be solved by the present invention is to overcome the defect that when using the auto-encoding language model for syndrome typing, relying on fixed feature vectors leads to the inability to dynamically adjust the focus of attention on the context, unreasonable allocation of weights for key symptoms, and thus the inability to accurately classify symptoms.

[0006] To solve the above technical problem, the present invention provides a method for typing traditional Chinese medicine syndrome, including the following steps:

[0007] Obtain the clinical information of the patient, and input the clinical information of the patient into the auto-encoding language model and the auto-regressive language model respectively. Each model predicts the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and obtains the auto-encoding prediction result and the auto-regressive prediction result;

[0008] Obtain the set of excess syndrome keywords and the set of deficiency syndrome keywords, count the number of excess syndrome keywords and deficiency syndrome keywords in the patient's clinical information, and obtain the keyword quantity feature vector;

[0009] Concatenate the auto-encoding prediction result, the auto-regressive prediction result, and the keyword quantity feature vector to obtain the comprehensive feature vector;

[0010] Pass the comprehensive feature vector through the LSTM layer to extract the features of the comprehensive feature vector;

[0011] Pass the features of the comprehensive feature vector through the fully connected layer to obtain the syndrome typing result of the patient.

[0012] Preferably, the patient's clinical information includes: the patient's symptoms and signs.

[0013] Preferably, the auto-encoding language model is any one of the BERT model and the ZY-BERT model.

[0014] Preferably, the clinical information of the patient is input into the BERT model to predict the probability that the patient's condition belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and an auto-encoding prediction result is obtained, including:

[0015] Insert the text start marker [CLS] and the text end marker [SEP] at both ends of the patient's clinical information respectively to obtain the marked clinical information text;

[0016] Input the marked clinical information text into the first word embedding layer, encode each element in the text and convert it into a vector to obtain the first word embedding feature vector;

[0017] Pass the word embedding feature vector through multiple Transformer layers to obtain the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS];

[0018] Pass the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS] through the linear classification layer to obtain the probability that the patient's clinical information belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type predicted by the BERT model, as the auto-encoding prediction result.

[0019] Preferably, the formula for inserting the text start marker [CLS] and the text end marker [SEP] at both ends of the patient's clinical information respectively to obtain the marked clinical information text is:

[0020] X BERT =[[CLS], x, [SEP]],

[0021] The formula for inputting the marked clinical information text into the first word embedding layer, encoding each element in the text and converting it into a vector to obtain the word embedding feature vector is:

[0022] e BERT =Embedding BERT (X BERT ),

[0023] The formula for passing the word embedding feature vector through multiple Transformer layers to obtain the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS] is:

[0024] H l =Transformer BERT (H l-1 ), l = 1, 2…L,

[0025] t CLS =H L [0],

[0026] The hidden layer semantic feature vector corresponding to the text start token [CLS] is passed through a linear classification layer to obtain the probability that the patient's clinical information belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type predicted by the BERT model. The formula is:

[0027] [P BERT (C1|x),P BERT (C2|x)]=Linear BERT (t CLS ),

[0028] where X BERT is the tokenized clinical information text, [CLS] is the text start token, [SEP] is the text end token, x is the patient's clinical information, e BERT is the first word embedding feature vector, Embedding BERT (.) is the first word embedding layer, H l is the hidden layer semantic feature sequence output by the l-th Transformer layer, H l-1 is the hidden layer semantic feature sequence output by the l-th Transformer layer, t CLS is the hidden layer semantic feature vector corresponding to the text start token [CLS] output by the hidden layer, H L [0] is the first hidden layer semantic feature vector in the hidden layer semantic feature sequence output by the L-th Transformer layer, L is the number of Transformer layers, Linear BERT (.) is the linear classification layer, P BERT (C1|x) is the probability that the patient's clinical information belongs to the excess syndrome type predicted by the BERT model, P BERT (C2|x) is the probability that the patient's clinical information belongs to the deficiency syndrome type predicted by the BERT model, C1 is the excess syndrome type, and C2 is the deficiency syndrome type.

[0029] Preferably, the autoregressive language model is any one of the QWen model and the ChatGLM model.

[0030] Preferably, the patient's clinical information is input into the QWen model to predict the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and an autoregressive prediction result is obtained, including:

[0031] After connecting the patient's clinical information and the set prompt words, the input text is obtained;

[0032] The input text is encoded through the second word embedding layer, and each element in the input text is converted into a vector to obtain the second word embedding feature vector;

[0033] Input the second word embedding feature vector into the QWen model to obtain the probability distribution of the next generated word;

[0034] Extract the generation probabilities of the words corresponding to the real symptom types and the generation probabilities of the words corresponding to the deficiency syndrome types respectively from the probability distribution of the next generated word as the autoregressive prediction result.

[0035] Preferably, after connecting the clinical information of the patient and the set prompt word, the input text is obtained, and the formula is:

[0036] X QWen =[x, Prompt],

[0037] Encode the input text through the second word embedding layer, convert each element in the input text into a vector to obtain the second word embedding feature vector, and the formula is:

[0038] e QWen =Embedding QWen (X QWen ),

[0039] Input the second word embedding feature vector into the QWen model to obtain the probability distribution of the next generated word, and the formula is:

[0040] P(next_token = t next |X QWen ) = Qwen(e QWen ),

[0041] Extract the generation probabilities of the words corresponding to the real symptom types and the generation probabilities of the words corresponding to the deficiency syndrome types respectively from the probability distribution of the next generated word, and the formula is:

[0042] P QWen (C1|x) = P(next_token = M(C1)|X QWen ),

[0043] P QWen (C2|x) = P(next_token = M(C2)|X QWen ),

[0044] where X QWen is the input text, Prompt is the set prompt word, x is the clinical information of the patient, e QWen is the second word embedding feature vector, Embedding QWen (.) is the second word embedding layer, t next represents the next generated word, that is, given the input text, the next lexical unit predicted and generated by the QWen model, P(next_token = tnext |X QWen ) is the probability that the next generated word is t under the input text X QWen , Qwen(.) is the QWen model, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, P next (C1|x) is the probability that the clinical information of the patient predicted by the QWen model belongs to the type of excess syndrome, P QWen (C2|x) is the probability that the clinical information of the patient predicted by the QWen model belongs to the type of deficiency syndrome, M(C1) represents mapping the excess syndrome type C1 to the corresponding vocabulary in the QWen model vocabulary, and M(C2) represents mapping the deficiency syndrome type C2 to the corresponding vocabulary in the QWen model vocabulary. QWen (C2|x) is the probability that the clinical information of the patient predicted by the QWen model belongs to the type of deficiency syndrome, M(C1) represents mapping the excess syndrome type C1 to the corresponding vocabulary in the QWen model vocabulary, and M(C2) represents mapping the deficiency syndrome type C2 to the corresponding vocabulary in the QWen model vocabulary.

[0045] Preferably, the auto - encoding prediction result, the auto - regression prediction result, and the keyword quantity feature vector are concatenated to obtain a comprehensive feature vector, and the formula is:

[0046] P concat = concat(P A , P B , N)

[0047] The comprehensive feature vector is passed through the LSTM layer to extract the features of the comprehensive feature vector, and the formula is:

[0048] F concat = LSTM(P concat )

[0049] The features of the comprehensive feature vector are passed through the fully - connected layer to obtain the syndrome classification result of the patient, and the formula is:

[0050] [P ensemble (C1|x), P ensemble (C2|x)] = Linear ensemble (F concat )

[0051] Among them, P concat is the comprehensive feature vector, concat(.) is concatenation along the channel dimension, P A = (P A (C1|x), P A (C2|x)), P B = (P B (C1|x), P B (C2|x)), N = (N1, N2), P A is the auto - encoding prediction result, P B is the auto - regression prediction result, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, x is the clinical information of the patient, P A(C1|x) is the probability that the clinical information of the patient predicted by the autoencoder language model belongs to the excess syndrome type, P A (C2|x) is the probability that the clinical information of the patient predicted by the autoencoder language model belongs to the deficiency syndrome type, P B (C1|x) is the probability that the clinical information of the patient predicted by the autoregressive language model belongs to the excess syndrome type, P B (C2|x) is the probability that the clinical information of the patient predicted by the autoregressive language model belongs to the deficiency syndrome type, N is the keyword quantity feature vector, N1 is the number of excess syndrome keywords in the patient's clinical information, N2 is the number of deficiency syndrome keywords in the patient's clinical information, F concat is the comprehensive feature vector feature, LSTM(.) is the LSTM layer, Linear ensemble (.) is the fully connected layer, P ensemble (C1|x) is the probability that the patient's clinical information belongs to the excess syndrome type, P ensemble (C2|x) is the probability that the patient's clinical information belongs to the deficiency syndrome type, Linear ensemble (.) is the fully connected layer.

[0052] The present invention also provides a traditional Chinese medicine syndrome classification system, including:

[0053] A disease probability prediction module, which is used to obtain the clinical information of the patient, input the clinical information of the patient into the autoencoder language model and the autoregressive language model respectively, and each model predicts the probability that the disease of the patient belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and obtains the autoencoder prediction result and the autoregressive prediction result;

[0054] A keyword quantity feature vector construction module, which is used to obtain the excess syndrome keyword set and the deficiency syndrome keyword set, count the number of excess syndrome keywords and deficiency syndrome keywords in the patient's clinical information, and combine these two statistical results to obtain the keyword quantity feature vector;

[0055] A splicing module, which is used to splice the autoencoder prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain a comprehensive feature vector;

[0056] A feature extraction module, which is used to pass the comprehensive feature vector through the LSTM layer to extract the comprehensive feature vector feature;

[0057] A classification module, which is used to pass the comprehensive feature vector feature through the fully connected layer to obtain the syndrome classification result of the patient.

[0058] The above technical solution of the present invention has the following beneficial effects compared with the prior art:

[0059] A method and system for classifying traditional Chinese medicine syndrome types. In order to effectively make up for the serious lack of flexibility in the self - encoding language model when classifying traditional Chinese medicine syndrome types, which is prone to misestimating the weights of key symptoms and then leading to misclassification, the present invention introduces an autoregressive language model for classifying traditional Chinese medicine syndrome types. The autoregressive language model can dynamically predict the probability of the next symptom word appearing based on the previous information of the traditional Chinese medicine symptom description text, paying attention to the context order and coherence of the symptom descriptions in the text. By adjusting the attention to different symptom information in real - time, the autoregressive language model can more accurately focus on the symptoms that play a key role in the classification of traditional Chinese medicine syndromes, thus significantly improving the accuracy of classification. However, the autoregressive language model focuses on predicting the next word based on the previous text, which may ignore some global semantic information in the text, resulting in insufficient extraction of the overall characteristics of the disease.

[0060] Based on this, the present invention inputs the clinical information of the patient into the self - encoding language model and the autoregressive language model respectively to obtain the self - encoding prediction result and the autoregressive prediction result. After splicing the self - encoding prediction result, the autoregressive prediction result, and the keyword quantity feature vector, they are passed through the LSTM layer and the fully - connected layer to obtain the syndrome classification result of the patient. When using the self - encoding language model to classify traditional Chinese medicine syndrome types, it can comprehensively extract and understand the clinical information. The autoregressive language model can play an advantage in processing local information. By counting the number of real - syndrome keywords and deficiency - syndrome keywords in the patient's clinical information, a keyword quantity feature vector is formed. This vector supplements the quantitative information of the key symptoms, enabling the model to more intuitively understand the distribution of key symptoms in the text and further strengthening the ability to capture key information. The self - encoding prediction result reflects the understanding of the overall semantics and structure of the patient's clinical information, the autoregressive prediction result reflects the processing of the text sequence information of the patient's clinical information, and the keyword quantity feature vector supplements the quantitative information of the key symptoms. Compared with simple synthesis, this splicing method integrates information from different angles, making the feature representation more comprehensive and detailed, providing a more sufficient basis for subsequent classification. Passing the comprehensive feature vector through the LSTM layer, the LSTM layer learns the relationship between the self - encoding prediction result, the autoregressive prediction result, and the keyword quantity feature vector. The features generated by the LSTM can more comprehensively and accurately reflect the disease type described by the patient, further improving the accuracy and reliability of classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to make the content of the present invention easier to be clearly understood, the following further details the present invention according to the specific embodiments of the present invention and in combination with the drawings, wherein:

[0062] Figure 1 is the step - flow chart of a method for classifying traditional Chinese medicine syndrome types of the present invention.

[0063] Figure 2 It is the flow structure diagram of a traditional Chinese medicine syndrome classification method of the present invention. Specific embodiments

[0064] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited do not limit the present invention.

[0065] In order to effectively make up for the serious lack of flexibility of the auto-encoding language model in traditional Chinese medicine syndrome classification, it is prone to errors in estimating the weights of key symptoms, which in turn leads to classification misjudgments. The present invention introduces an autoregressive language model. The autoregressive language model can dynamically predict the probability of the next word according to the previous information, pay attention to the context order and coherence of the text, and adjust the attention to different information in real time, so as to more accurately focus on the key symptoms.

[0066] Refer to Figure 1 As shown, the first embodiment of the present invention provides a traditional Chinese medicine syndrome classification method, including the following steps:

[0067] As Figure 2 shown, Figure 2 It is the flow structure diagram of a traditional Chinese medicine syndrome classification method of the present invention.

[0068] Step S1: Obtain the clinical information of the patient, and input the clinical information of the patient into the auto-encoding language model and the autoregressive language model respectively. Each model predicts the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and obtains the auto-encoding prediction result and the autoregressive prediction result;

[0069] In this embodiment, specifically, the clinical information of the patient includes: the symptoms and signs of the patient. The symptoms of the patient refer to the discomfort or abnormality subjectively felt by the patient, such as: headache, loss of appetite, insomnia, palpitation, tinnitus, etc. The signs of the patient refer to the abnormal manifestations objectively examined by the doctor through methods such as observation, auscultation, inquiry, and pulse-taking, such as: pale complexion, obese body shape, yellow and greasy tongue coating, etc.

[0070] In this embodiment, specifically, the auto-encoding language model is any one of the BERT model and the ZY-BERT model.

[0071] In this embodiment, preferably, the clinical information of the patient is input into the BERT model (Devlin et al., 2019), and the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type are predicted to obtain the auto-encoding prediction result, including:

[0072] Insert the text start marker [CLS] and the text end marker [SEP] at both ends of the clinical information of the patient to obtain the marked clinical information text;

[0073] Input the labeled clinical information text into the first word embedding layer, encode each element in the text and convert it into a vector to obtain the first word embedding feature vector;

[0074] Pass the word embedding feature vector through multiple Transformer layers to obtain the hidden semantic feature vector corresponding to the hidden layer output of the text start token [CLS];

[0075] Pass the hidden semantic feature vector corresponding to the hidden layer output of the text start token [CLS] through the linear classification layer to obtain the probabilities that the patient's clinical information belongs to the excess syndrome type and the deficiency syndrome type predicted by the BERT model, which are used as the autoencoding prediction results.

[0076] In this embodiment, specifically, insert the text start token [CLS] and the text end token [SEP] at both ends of the patient's clinical information respectively to obtain the labeled clinical information text. The formula is:

[0077] X BERT =[[CLS], x, [SEP]],

[0078] Input the labeled clinical information text into the first word embedding layer, encode each element in the text and convert it into a vector to obtain the word embedding feature vector. The formula is:

[0079] e BERT =Embedding BERT (X BERT ),

[0080] Pass the word embedding feature vector through multiple Transformer layers to obtain the hidden semantic feature vector corresponding to the hidden layer output of the text start token [CLS]. The formula is:

[0081] H l =Transformer BERT (H l-1 ), l = 1, 2…L,

[0082] t CLS =H L [0],

[0083] Pass the hidden semantic feature vector corresponding to the hidden layer output of the text start token [CLS] through the linear classification layer to obtain the probabilities that the patient's clinical information belongs to the excess syndrome type and the deficiency syndrome type predicted by the BERT model. The formula is:

[0084] [P BERT (C1|x), P BERT (C2|x)] = Linear BERT (tCLS )

[0085] Among them, X BERT is the marked clinical information text, [CLS] is the text start marker, [SEP] is the text end marker, x is the patient's clinical information, e BERT is the first word embedding feature vector, Embedding BERT (.) is the first word embedding layer, H l is the hidden layer semantic feature sequence output by the l-th Transformer layer, H l-1 is the hidden layer semantic feature sequence output by the l-th Transformer layer, t CLS is the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS], H L [0] is the first hidden layer semantic feature vector in the hidden layer semantic feature sequence output by the L-th Transformer layer, L is the number of Transformer layers, Linear BERT (.) is the linear classification layer, P BERT P(C1|x) is the probability that the patient's clinical information belongs to the excess syndrome type predicted by the BERT model, P BERT P(C2|x) is the probability that the patient's clinical information belongs to the deficiency syndrome type predicted by the BERT model, C1 is the excess syndrome type, and C2 is the deficiency syndrome type.

[0086] In the training stage, due to the small number of parameters of the BERT model, the present invention fine-tunes all parameters in the BERT model using the cross-entropy loss function.

[0087]

[0088] Among them, loss1 is the first loss function, n represents the number of categories, n = 2, C1 is the excess syndrome type, C2 is the deficiency syndrome type, m represents the number of samples in the current batch, j is the sample index, i is the type index, y ji is the label value of the j-th sample in the current batch on the i-th category, P BERT P(C i |x j ) is the probability that the j-th sample in the current batch belongs to C i type predicted by the BERT model.

[0089] In this embodiment, specifically, the autoregressive language model is any one of the QWen model and the ChatGLM model.

[0090] In this embodiment, preferably, the clinical information of the patient is input into the QWen model (Bai et al., 2023), and the probabilities that the patient's disease belongs to the excess syndrome type and the deficiency syndrome type are predicted to obtain an autoregressive prediction result, including:

[0091] After connecting the clinical information of the patient and the set prompt words, an input text is obtained;

[0092] The input text is encoded through a second word embedding layer, and each element in the input text is converted into a vector to obtain a second word embedding feature vector;

[0093] The second word embedding feature vector is input into the QWen model to obtain the probability distribution of the next generated word;

[0094] In the probability distribution of the next generated word, the generation probabilities of the words corresponding to the excess syndrome type and the generation probabilities of the words corresponding to the deficiency syndrome type are respectively extracted as the autoregressive prediction result.

[0095] In this embodiment, specifically, after connecting the clinical information of the patient and the set prompt words, the formula for obtaining the input text is:

[0096] X QWen =[x, Prompt],

[0097] The formula for encoding the input text through a second word embedding layer and converting each element in the input text into a vector to obtain a second word embedding feature vector is:

[0098] e QWen =Embedding QWen (X QWen ),

[0099] The formula for inputting the second word embedding feature vector into the QWen model to obtain the probability distribution of the next generated word is:

[0100] P(next_token = t next |X QWen ) = Qwen(e QWen ),

[0101] In this embodiment, a mapping function M is defined to map the task category to the corresponding token in the QWen model vocabulary.

[0102] M: c → v

[0103] For example, in the binary classification task of "Deficiency syndrome" and "Excess syndrome", the "Deficiency syndrome" category is mapped to the word "deficiency", and the "Excess syndrome" category is mapped to the word "excess".

[0104] Among them, M is the mapping function, c represents the task category, and v represents the corresponding token in the vocabulary of the QWen model.

[0105] In the probability distribution of the next generated word, the generation probability of the words corresponding to the actual syndrome type and the generation probability of the words corresponding to the deficiency syndrome type are extracted respectively. The formula is:

[0106] P QWen (C1|x)=P(next_token=M(C1)|X QWen ),

[0107] P QWen (C2|x)=P(next_token=M(C2)|X QWen ),

[0108] Among them, X QWen is the input text, Prompt is the set prompt word, x is the patient's clinical information, e QWen Embedding is the second word embedding feature vector, QWen (.) is the second word embedding layer, t next represents the next generated word, that is, given the input text, the QWen model predicts the next vocabulary unit to be generated, P(next_token=t next |X QWen ) is the input text X QWen Next, the next generated word is t next The probability of Qwen(.) is the QWen model, C1 is the excess syndrome type, C2 is the deficiency syndrome type, P QWen (C1|x) is the probability that the patient’s clinical information belongs to the real disease type predicted by the QWen model, P QWen (C2|x) is the probability that the patient's clinical information predicted based on the QWen model belongs to the deficiency syndrome type. M(C1) means mapping the excess syndrome type C1 to the corresponding vocabulary in the QWen model vocabulary. M(C2) means mapping the deficiency syndrome type C2 to the corresponding vocabulary in the QWen model vocabulary.

[0109] For example, if the input x is "The patient experiences palpitations a few minutes after exercise...", and the set prompt is "Does this symptom belong to the deficiency syndrome or the excess syndrome in traditional Chinese medicine? The answer must be deficiency syndrome or excess syndrome. Please answer:", then the input text X QWen for QWen model is: "The patient experiences palpitations a few minutes after physical activity... Does this symptom belong to the deficiency syndrome or the excess syndrome in traditional Chinese medicine? The answer must be deficiency syndrome or excess syndrome. The answer is", and then, X QWen is encoded through the second word embedding layer to obtain the second word embedding feature vector e QWen .

[0110] In this embodiment, BERT, as an autoencoding model, has accumulated rich language knowledge through large-scale general text pre-training, can capture the global semantic information of traditional Chinese medicine texts bidirectionally, deeply understand the overall symptom combinations of patients, the comprehensive correlations between symptoms, etc., and grasp the macroscopic characteristics of diseases. And QWen, as an autoregressive model, based on large-scale data pre-training, can dynamically predict the next word according to the previous information, pay attention to the local coherence and sequentiality of symptom descriptions in traditional Chinese medicine texts, and capture the development logic of the disease and the dynamic changes of symptoms.

[0111] Step S2: Obtain the set of excess syndrome keywords and the set of deficiency syndrome keywords, count the number of excess syndrome keywords and deficiency syndrome keywords in the patient's clinical information, and obtain the keyword quantity feature vector;

[0112] The schematic tables of the set of excess syndrome keywords and the set of deficiency syndrome keywords are shown in Table 1.

[0113] Table 1

[0114]

[0115]

[0116] Step S3: Concatenate the autoencoding prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain the comprehensive feature vector. The formula is:

[0117] P concat = concat(P A , P B , N),

[0118] where P concat is the comprehensive feature vector, concat(.) is concatenation along the channel dimension, P A is the autoencoding prediction result, P A = (P A (C1|x), P A (C2|x)), P AFor the auto-encoding prediction result, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, x is the clinical information of the patient, P A P(C1|x) is the probability that the clinical information of the patient predicted by the auto-encoding language model belongs to the type of excess syndrome, P A P(C2|x) is the probability that the clinical information of the patient predicted by the auto-encoding language model belongs to the type of deficiency syndrome, P B For the autoregressive prediction result, P B P = (P B (C1|x), P B (C2|x)), P B P(C1|x) is the probability that the clinical information of the patient predicted by the autoregressive language model belongs to the type of excess syndrome, P B P(C2|x) is the probability that the clinical information of the patient predicted by the autoregressive language model belongs to the type of deficiency syndrome, N is the keyword quantity feature vector, N = (N1, N2), N1 is the number of excess syndrome keywords in the clinical information of the patient, and N2 is the number of deficiency syndrome keywords in the clinical information of the patient.

[0119] In the training stage, due to the fewer parameters of the QWen model, the present invention uses the cross-entropy loss function and the LoRA technology to finely tune all the parameters in the QWen model.

[0120]

[0121] Among them, loss2 is the second loss function, n represents the number of categories, n = 2, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, m represents the number of samples in the current batch, j is the sample index, i is the type index, y ji is the label value of the j-th sample in the current batch on the i-th category, P QWen P(C i |x j ) is the probability that the j-th sample in the current batch belongs to C i type predicted by the QWen model.

[0122] Step S4: Pass the comprehensive feature vector through the LSTM layer to extract the features of the comprehensive feature vector. The formula is:

[0123] F concat = LSTM(P concat ),

[0124] Among them, F concat is the feature of the comprehensive feature vector, and LSTM(.) is the LSTM layer.

[0125] Step S5: Pass the feature of the comprehensive feature vector through the fully connected layer to obtain the syndrome classification result of the patient. The formula is:

[0126] [P ensemble (C1|x),P ensemble (C2|x)] = Linear ensemble (F concat ),

[0127] Among them, P ensemble (C1|x) is the probability that the clinical information of the patient belongs to the excess syndrome type, and P ensemble (C2|x) is the probability that the clinical information of the patient belongs to the deficiency syndrome type, and Linear ensemble (.) is a fully connected layer.

[0128] Through the cross-entropy loss function, the fusion model of the autoencoder language model and the autoregressive language model proposed by the present invention is trained. The formula is:

[0129]

[0130] Among them, loss3 is the third loss function, n represents the number of categories, n = 2, C1 is the excess syndrome type, C2 is the deficiency syndrome type, m represents the number of samples in the current batch, j is the sample index, i is the type index, and y ji is the label value of the j-th sample in the current batch on the i-th category, and P ensemble (C i |x j ) is the probability that the j-th sample in the current batch belongs to C i type.

[0131] The present invention learns tasks by training a single task and a fusion task simultaneously. Therefore, the overall loss function that dominates this joint learning process is as follows:

[0132] loss ensemble = loss1 + loss2 + loss3,

[0133] Among them, loss ensemble is the overall loss function.

[0134] Since there is a serious problem of insufficient flexibility in the autoencoder language model when performing traditional Chinese medicine syndrome typing, it is easy to misestimate the weights of key symptoms, which may lead to misclassification. To effectively make up for this defect, the present invention introduces an autoregressive language model. The autoregressive language model can dynamically predict the probability of the next word based on the previous information, highly focus on the context order and coherence of the text, and adjust the attention to different information in real time, so as to more accurately focus on key symptoms. However, the autoregressive language model is not perfect. It focuses on predicting the next word based on the previous text and may ignore some global semantic information in the text, resulting in an incomplete extraction of the overall characteristics of the disease.

[0135] Specifically, the performance comparison between the auto - encoding language model BERT and the auto - regressive language model QWen in different diseases is different. In terms of the diseases of palpitation and dizziness, QWen, as a representative of the auto - regressive language model, shows better performance than BERT, the auto - encoding language model, with higher classification accuracy. This is due to QWen's ability to more flexibly capture the key information about the symptoms of palpitation and dizziness in the text and adjust the focus of attention in real - time according to the context. However, when facing the classification task of rheumatism, the situation is different, and the classification result of BERT is slightly better than that of QWen. This is because the BERT model can better utilize its ability to grasp the global semantic information of the text.

[0136] Therefore, in the present invention, the clinical information of patients is respectively input into the auto - encoding language model and the auto - regressive language model to obtain the auto - encoding prediction result and the auto - regressive prediction result. By counting the number of real - syndrome keywords and deficiency - syndrome keywords in the clinical information of patients, a keyword quantity feature vector is formed. This vector supplements the quantitative information of the key symptoms, enabling the model to more intuitively understand the distribution of key symptoms in the text and further strengthening the ability to capture key information. After concatenating the auto - encoding prediction result, the auto - regressive prediction result, and the keyword quantity feature vector, they are passed through the LSTM layer and the fully - connected layer to obtain the syndrome classification result of the patient. The LSTM layer fully learns the relationship among the auto - encoding prediction result, the auto - regressive prediction result, and the keyword quantity feature vector, and can more comprehensively and accurately reflect the disease type described by the patient.

[0137] Based on Example 1, in this Example 2, the data of Ren et al. (2022) is used to conduct a real - syndrome investigation. This data is a publicly available large - scale benchmark for traditional Chinese medicine syndrome classification. Through observation, it is found that there are intersections and even overlaps between the diagnostic categories in the data. For example, the "syndrome of disharmony between the liver and stomach" and the "syndrome of liver qi invading the stomach" in its paper classification system actually describe the same pathological mechanism and clinical manifestations from the perspectives of traditional Chinese medicine theory and clinical practice, and essentially belong to the same diagnostic type. This situation of category overlap will undoubtedly bring many interferences and challenges to the accuracy and scientific nature of traditional Chinese medicine syndrome classification, and may lead to deviations in subsequent diagnosis, treatment, and research work.

[0138] Therefore, in order to reduce the problems caused by overlapping categories, the present invention adopts the deficiency-excess distinction standard in Wang (2012) to reclassify the existing diagnostic types. This reorganization divides all diagnostic types into two categories: deficiency and excess. The reason why we choose deficiency-excess classification is that deficiency-excess classification is of great significance in traditional Chinese medicine and is widely used, including acupuncture therapy and drug therapy. In acupuncture therapy, the selection of acupoints, the technique of acupuncture, and the intensity of stimulation are determined based on deficiency-excess syndrome differentiation, which plays a key role in improving the effect of acupuncture therapy. For example, for patients with deficiency syndrome, the tonic method is often used to stimulate the body's positive energy; for patients with excess syndrome, the purgative method is used to eliminate pathogenic factors. In terms of drug therapy, deficiency-excess syndrome differentiation is an important basis for guiding prescription compatibility and drug selection. Deficiency syndrome requires tonic drugs, while excess syndrome requires drugs to eliminate pathogenic factors. Through this deficiency-excess classification method, the syndrome classification of traditional Chinese medicine can be made more concise, clear, scientific and reasonable, providing a more reliable foundation and support for subsequent clinical practice and research work of traditional Chinese medicine.

[0139] As shown in Table 2, a subset of diagnostic categories mapped from the classification system in (Ren et al., 2012) to false or real categories is shown.

[0140] Table 2

[0141] Empty Solid Liver and kidney yin deficiency √ Wind-dampness and stagnant heat √ Damp-heat pouring downward √ Wind-phlegm harassing upward √ Disharmony between the spleen and stomach √ Disharmony between the liver and stomach √ Qi deficiency failing to control √ Hyperactivity of liver yang √ Qi and yin deficiency √ Yang deficiency with blood stasis √

[0142] Table 2 lists the subset of diagnostic categories in Wang’s (2012) classification system and maps them to the corresponding “Deficiency” or “Excess” categories.

[0143] According to this perfect framework, this Example 2 selected vertigo disease for experiment, as shown in Table 3, which is a distribution table of vertigo samples in the virtual and real categories.

[0144] Table 3

[0145]

[0146]

[0147] In the experimental configuration, we use 70% of the data of the vertigo sample as the training set, 10% as the development set, and the remaining 20% ​​as the test set.

[0148] In order to comprehensively evaluate the performance of a TCM syndrome classification method proposed in the present invention, this embodiment 2 adopts standard evaluation indicators widely used in classification tasks as main indicators, including: Accuracy, Precision, Recall and F1 score.

[0149] In the second embodiment, the following benchmark methods are used for comparative research with a traditional Chinese medicine syndrome classification method proposed by the present invention:

[0150] (1) GPT-3.5 (Brown et al., 2020): In the second embodiment, GPT-3.5 is used for text classification, and the prompt for classification is: "Does this symptom belong to the deficiency syndrome or excess syndrome in traditional Chinese medicine? The answer must be deficiency syndrome or excess syndrome."

[0151] (2) BERT (Devlin et al., 2019): In this embodiment, a 6-layer BERT base model is adopted.

[0152] (3) QWen (Bai et al., 2023): In the second embodiment, the size of the learning model adopted is 1.5B, and the Chinese prompt for the classification task is "Does this symptom belong to the deficiency syndrome or excess syndrome in traditional Chinese medicine?"

[0153] (4) ZY-BERT (Ren et al., 2022): Obtained by retraining a BERT model in a large-scale traditional Chinese medicine text corpus.

[0154] (5) SETFIT (Tunstall et al., 2022): Designed for fine-tuning sentence transformers (ST) in few-shot learning tasks. This method first uses the contrastive learning method in the siamese network setting to fine-tune the pre-trained sentence transformer model on a small number of text pairs. Then, the fine-tuned model generates text embeddings for training the classification head.

[0155] (6) DLM-CSC (Xie et al., 2024): This method uses the auto-encoded pre-trained ELECTRA model to perform few-shot text classification based on semantic consistency and outperforms existing methods in multiple tasks.

[0156] (7) TRD-FSL (Li et al., 2022): This method uses the auto-encoded pre-trained ELECTRA and reformulates the task as a token permutation detection problem for few-shot learning.

[0157] (8) BERT+QWen: This method simply adds the probability outputs of the BERT and QWen models and then performs classification based on the combined probability.

[0158] (9) BERT+QWen+LSTM: It integrates the BERT and QWen methods but does not introduce an external knowledge base into the LSTM.

[0159] (10) The present invention: Integrates the BERT and QWen methods and introduces a comprehensive feature vector into the LSTM.

[0160] In this study, the BERT model was fine-tuned using the Transformers package from Hugging Face (https: / / huggingface.co / ), and the QWen model was fine-tuned using LoRA (Localized Rank Adaptation). During the fine-tuning process, the number of training epochs was set to 10, the learning rate was set to 5e-5, and the batch size was set to 2.

[0161] As shown in Table 4, Table 4 is a schematic table of the experimental results of different models on vertigo data.

[0162] Table 4

[0163]

[0164] As can be seen from Table 4, among the existing methods, a traditional Chinese medicine syndrome classification method proposed in the present invention always shows excellent performance. It not only outperforms the BERT model or the QWen model, but also is superior to other benchmark classification methods, including ZY-BERT, SETFIT, DLM-SCS, and TRD-FSL. In addition, our method achieves better results than a simple method that combines the probabilities of the two methods (i.e., BERT+QWen).

[0165] This Embodiment 3 also provides a traditional Chinese medicine syndrome classification system, including:

[0166] A disease probability prediction module, configured to obtain the clinical information of a patient, input the clinical information of the patient into an autoencoder language model and an autoregressive language model respectively, and each model predicts the probability that the disease of the patient belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, to obtain an autoencoder prediction result and an autoregressive prediction result;

[0167] A keyword quantity feature vector construction module, configured to obtain an excess syndrome keyword set and a deficiency syndrome keyword set, count the number of excess syndrome keywords and deficiency syndrome keywords in the clinical information of the patient, and combine these two statistical results to obtain a keyword quantity feature vector;

[0168] A splicing module, configured to splice the autoencoder prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain a comprehensive feature vector;

[0169] A feature extraction module, configured to pass the comprehensive feature vector through an LSTM layer to extract the features of the comprehensive feature vector;

[0170] A classification module, configured to pass the features of the comprehensive feature vector through a fully connected layer to obtain the syndrome classification result of the patient.

[0171] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0172] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0173] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0174] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0175] Obviously, the above embodiments are only examples given for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to exhaustively list all the implementation manners here. And the obvious changes or modifications derived therefrom are still within the protection scope of the present invention.

Claims

1. A method for classifying traditional Chinese medicine syndrome types, characterized in that, It includes the following steps: Obtain the clinical information of the patient, and input the clinical information of the patient into the autoencoder language model and the autoregressive language model respectively. Each model predicts the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type, and obtain the autoencoder prediction result and the autoregressive prediction result; Obtain the set of excess syndrome keywords and the set of deficiency syndrome keywords, and count the number of excess syndrome keywords and deficiency syndrome keywords in the patient's clinical information to obtain the keyword quantity feature vector; Concatenate the autoencoder prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain the comprehensive feature vector; Pass the comprehensive feature vector through the LSTM layer to extract the features of the comprehensive feature vector; Pass the features of the comprehensive feature vector through the fully connected layer to obtain the syndrome classification result of the patient.

2. The traditional Chinese medicine syndrome classification method according to claim 1, characterized in that, The clinical information of the patient includes: the patient's symptoms and signs.

3. A traditional Chinese medicine syndrome typing method according to claim 1, characterized in that The autoencoder language model is any one of the BERT model and the ZY-BERT model.

4. The traditional Chinese medicine syndrome typing method according to claim 3, characterized in that, Input the clinical information of the patient into the BERT model, and predict the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type to obtain the autoencoder prediction result, including: Insert the text start marker [CLS] and the text end marker [SEP] at both ends of the patient's clinical information respectively to obtain the marked clinical information text; Input the marked clinical information text into the first word embedding layer, encode each element in the text and convert it into a vector to obtain the first word embedding feature vector; Pass the word embedding feature vector through multiple Transformer layers to obtain the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS]; Pass the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS] through the linear classification layer to obtain the probability that the patient's clinical information belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type predicted by the BERT model as the autoencoder prediction result.

5. A method for classifying traditional Chinese medicine syndromes according to claim 4, characterized in that, The step of inserting the text start marker [CLS] and the text end marker [SEP] at both ends of the patient's clinical information respectively to obtain the marked clinical information text, the formula is: X BERT = [[CLS],x,[SEP]], The step of inputting the marked clinical information text into the first word embedding layer, encoding each element in the text and converting it into a vector to obtain the word embedding feature vector, the formula is: e BERT = Embedding BERT (X BERT ) The step of passing the word embedding feature vector through multiple Transformer layers to obtain the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS], the formula is: H l = Transformer BERT (H l-1 ), l = 1, 2…L, t CLS = H L [0], The step of passing the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS] through the linear classification layer to obtain the probability that the patient's clinical information belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type predicted by the BERT model, the formula is: [P BERT (C1|x),P BERT (C2|x)] = Linear BERT (t CLS ), Among them, X BERT is the labeled clinical information text, [CLS] is the text start marker, [SEP] is the text end marker, x is the patient's clinical information, e BERT is the first word embedding feature vector, Embedding BERT (.) is the first word embedding layer, H l is the hidden layer semantic feature sequence output by the l-th Transformer layer, H l-1 is the hidden layer semantic feature sequence output by the l-th Transformer layer, t CLS is the hidden layer semantic feature vector corresponding to the hidden layer output of the text start marker [CLS], H L [0] is the first hidden layer semantic feature vector in the hidden layer semantic feature sequence output by the L-th Transformer layer, L is the number of Transformer layers, Linear BERT (.) is the linear classification layer, P BERT P(C1|x) is the probability that the patient's clinical information belongs to the real syndrome type predicted by the BERT model, P BERT P(C2|x) is the probability that the patient's clinical information belongs to the deficiency syndrome type predicted by the BERT model, C1 is the real syndrome type, and C2 is the deficiency syndrome type.

6. A traditional Chinese medicine syndrome typing method according to claim 1, characterized in that, The autoregressive language model is any one of the QWen model and the ChatGLM model.

7. A traditional Chinese medicine syndrome typing method according to claim 6, characterized in that Input the clinical information of the patient into the QWen model, and predict the probability that the patient's disease belongs to the excess syndrome type and the probability that it belongs to the deficiency syndrome type to obtain the autoregressive prediction result, including: After connecting the clinical information of the patient and the set prompt words, obtain the input text; Encode the input text through the second word embedding layer, convert each element in the input text into a vector, and obtain the second word embedding feature vector; Input the second word embedding feature vector into the QWen model to obtain the probability distribution of the next generated word; Extract the generation probabilities of the words corresponding to the real syndrome type and the words corresponding to the deficiency syndrome type respectively from the probability distribution of the next generated word as the autoregressive prediction result.

8. A traditional Chinese medicine syndrome classification method according to claim 7, characterized in that After connecting the clinical information of the patient and the set prompt words, the input text is obtained. The formula is: X QWen = [x, Prompt], Encode the input text through the second word embedding layer, convert each element in the input text into a vector, and obtain the second word embedding feature vector. The formula is: e QWen = Embedding QWen (X QWen ) Input the second word embedding feature vector into the QWen model to obtain the probability distribution of the next generated word. The formula is: P(next_token=t next |X QWen )=Qwen(e QWen ), Extract the generation probabilities of the words corresponding to the real syndrome type and the words corresponding to the deficiency syndrome type respectively from the probability distribution of the next generated word. The formula is: P QWen (C1|x) = P(next_token = M(C1)|X QWen ) P QWen (C2|x) = P(next_token = M(C2)|X QWen ) Among them, X QWen is the input text, Prompt is the set prompt word, x is the patient's clinical information, and e QWen is the second word embedding feature vector, and Embedding QWen (.) is the second word embedding layer, and t next represents the next generated word, that is, given the input text, it is the next lexical unit predicted and generated by the QWen model. P(next_token = t next |X QWen ) is the probability that the next generated word is t QWen under the input text X next . Qwen(.) is the QWen model, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, and P QWen (C1|x) is the probability that the patient's clinical information belongs to the type of excess syndrome predicted by the QWen model, and P QWen (C2|x) is the probability that the patient's clinical information belongs to the type of deficiency syndrome predicted by the QWen model. M(C1) represents mapping the type of excess syndrome C1 to the corresponding word in the QWen model vocabulary, and M(C2) represents mapping the type of deficiency syndrome C2 to the corresponding word in the QWen model vocabulary.

9. A traditional Chinese medicine syndrome typing method according to claim 1, characterized in that, Concatenate the autoencoding prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain the comprehensive feature vector. The formula is: P concat = concat(P A , P B , N), Pass the comprehensive feature vector through the LSTM layer to extract the features of the comprehensive feature vector. The formula is: F concat = LSTM(P concat ) Pass the features of the comprehensive feature vector through the fully connected layer to obtain the syndrome classification result of the patient. The formula is: [P ensemble (C1|x),P ensemble (C2|x)] = Linear ensemble (F concat ), Among them, P concat is the comprehensive feature vector, concat(.) is concatenation along the channel dimension, P A =(P A (C1|x), P A (C2|x)), P B =(P B (C1|x), P B (C2|x)), N=(N1, N2), P A is the autoencoder prediction result, P B is the autoregressive prediction result, C1 is the type of excess syndrome, C2 is the type of deficiency syndrome, x is the clinical information of the patient, P A (C1|x) is the probability that the clinical information of the patient belongs to the type of excess syndrome predicted by the autoencoder language model, P A (C2|x) is the probability that the clinical information of the patient belongs to the type of deficiency syndrome predicted by the autoencoder language model, P B (C1|x) is the probability that the clinical information of the patient belongs to the type of excess syndrome predicted by the autoregressive language model, P B (C2|x) is the probability that the clinical information of the patient belongs to the type of deficiency syndrome predicted by the autoregressive language model, N is the keyword quantity feature vector, N1 is the number of excess syndrome keywords in the clinical information of the patient, N2 is the number of deficiency syndrome keywords in the clinical information of the patient, F concat is the comprehensive feature vector feature, LSTM(.) is the LSTM layer, Linear ensemble (.) is the fully connected layer, P ensemble (C1|x) is the probability that the clinical information of the patient belongs to the type of excess syndrome, P ensemble (C2|x) is the probability that the clinical information of the patient belongs to the type of deficiency syndrome, Linear ensemble (.) is the fully connected layer.

10. A traditional Chinese medicine syndrome classification system, characterized in that, Including: A disease probability prediction module, which is used to obtain the clinical information of the patient, input the clinical information of the patient into the autoencoding language model and the autoregressive language model respectively, and each model predicts the probability that the disease of the patient belongs to the real syndrome type and the probability that it belongs to the deficiency syndrome type, so as to obtain the autoencoding prediction result and the autoregressive prediction result; Keyword A keyword quantity feature vector construction module, which is used to obtain the real syndrome keyword set and the deficiency syndrome keyword set, count the number of real syndrome keywords and deficiency syndrome keywords in the clinical information of the patient, and combine these two statistical results to obtain the keyword quantity feature vector; A concatenation module, which is used to concatenate the autoencoding prediction result, the autoregressive prediction result, and the keyword quantity feature vector to obtain the comprehensive feature vector; A feature extraction module, which is used to pass the comprehensive feature vector through the LSTM layer to extract the features of the comprehensive feature vector; A classification module, which is used to pass the features of the comprehensive feature vector through the fully connected layer to obtain the syndrome classification result of the patient.