Large language model-based syndrome data generation, classification and symptom extraction method

Through the generation, classification and symptom extraction methods based on the large language model, combined with the fine-tuning of the BERT model, the problems of insufficient and low accuracy of syndrome determination data in the prior art are solved, and the classification and symptom entity with high accuracy are achieved Identify.

CN119495432APending Publication Date: 2025-02-21DEEP BLUE PERCEPTION (HANGZHOU) IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411421675.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the prior art, the determination of syndrome depends on the clinical diagnosis of doctors and the automatic capture and monitoring of electronic medical records, resulting in insufficient data and difficulty in automatic model determination, and low accuracy.

Method used

Using the method of syndrome data generation, classification and symptom extraction based on large language models, the symptom diagnosis and treatment instructions building module, expert review and training data batch generation module, syndrome classification and symptom extraction model building module and other modules, combined with prompt word instructions and expert review Through the consultation data, diagnosis and treatment sample data are generated, and the pre-trained BERT model is fine-tuned to construct a syndrome classification and symptom entity recognition model.

Benefits of technology

The difficulty of automatic model determination caused by insufficient symptom determination data is avoided, and the task of quickly completing the syndrome classification and symptom entity identification with a higher accuracy rate is achieved, and the efficiency of automatic monitoring and early warning is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119495432A_ABST
    Figure CN119495432A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, in particular to a syndrome data generation, classification and symptom extraction method based on a large language model, which comprises the following steps of: 1, providing a device based on the large language model; 2, splicing the diagnosis and treatment data; 3, data review and correction; according to the method, a large language model is used, a mode of combining cue word instructions and inquiry data approved by experts is adopted, five big syndrome medical inquiry training data are generated, and the problem that automatic judgment of the model is difficult due to insufficient syndrome judgment data is solved through the mode; a BERT pre-training model is finely adjusted by adopting a data set generated by a large language model, and five syndrome classification and symptom entity recognition models are constructed, so that calculation resource limitation generated by using a large model to judge syndromes can be avoided, and the calculation efficiency can be improved. And the two tasks of syndrome classification and symptom entity identification can be rapidly and simultaneously completed with relatively high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a method for generating, classifying and extracting syndrome data based on a large language model. Background Art

[0002] Syndrome refers to a group of similar symptoms and signs that exist simultaneously in a specific disease or other medical condition. Syndrome is a comprehensive manifestation that covers multiple aspects of medical information, especially syndromes such as fever and respiratory tract, which are often a collection of infectious diseases. Early detection of these syndromes can detect the development trend of the disease early and provide early warning and control. Nowadays, the determination of syndromes mostly relies on the clinical diagnosis of doctors, through manual filling and reporting of syndrome cases, and then early warning of related content, which has a strong lag.

[0003] With the development of natural language processing, large models and other technologies, if there is a large amount of electronic medical record sample data, the determination of diseases and syndromes can be automatically captured and monitored, which improves efficiency, and can be automatically monitored and reported. At present, the determination of syndromes mostly relies on the clinical diagnosis of doctors and the automatic capture and monitoring of electronic medical records. The automatic capture and monitoring of electronic medical records often requires a large amount of sample data for model training, which has high requirements for the quality and quantity of data. Since it is difficult to obtain a large amount of positive and negative sample data for the diagnosis of various syndromes, it is also difficult to build an automatic syndrome capture model based on data features, and the accuracy is low. Therefore, it is very necessary to propose a syndrome data generation, classification and symptom extraction method based on a large language model. Summary of the invention

[0004] The purpose of the present invention is to provide a syndrome data generation, classification and symptom extraction method based on a large language model, which avoids the problem of insufficient syndrome determination data leading to difficulties in automatic model determination, and can also ensure that syndrome classification and symptom entity recognition are completed quickly and simultaneously with a high accuracy to solve existing technical defects and unattainable technical requirements.

[0005] To achieve the above object, the present invention provides the following technical solution: a method for generating, classifying and extracting syndrome data based on a large language model, comprising the following steps:

[0006] 1) Provide a device based on a large language model, comprising:

[0007] 1.1. A syndrome diagnosis and treatment instruction construction module, which processes the existing syndrome diagnosis and treatment text data to obtain prompt word text, then submits the prompt word text to the large language model to obtain the first diagnosis and treatment data, and sends the first diagnosis and treatment data to the expert review and training data batch generation module;

[0008] 1.2. Expert review and training data batch generation module, which is used to receive the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module, and perform expert screening on the first diagnosis and treatment data to obtain reasonable samples after screening, and then further optimize the prompt word instructions in the first diagnosis and treatment data according to the reasonable samples, and at the same time generate second diagnosis and treatment data based on other disease knowledge base information, and perform the same optimization and screening on the second diagnosis and treatment data as the first diagnosis and treatment data, and finally input the processed samples of the first diagnosis and treatment data and the optimized prompt word instructions into the large language model to obtain diagnosis and treatment sample data, and send it to the syndrome classification and symptom extraction model construction module;

[0009] 1.3. Syndrome classification and symptom extraction model construction module, which is used to receive the diagnosis and treatment sample data sent by the expert review and training data batch generation module, and to construct a syndrome classification and symptom entity classification model. The pre-trained BERT model is used to process the symptoms, drugs, signs, etc. in the diagnosis and treatment samples, and the processed content is input into the BERT model as a training set for BERT model fine-tuning. Finally, the fine-tuned BERT model is used in the syndrome classification and entity labeling module;

[0010] After the BERT model is fine-tuned, the syndrome classification and symptom extraction model construction module receives the diagnosis and treatment sample data sent by the expert review and training data batch generation module, inputs the diagnosis and treatment sample data into the fine-tuned BERT model, extracts features and classifies syndromes on the diagnosis and treatment sample data, obtains syndrome classification results, and sends the syndrome classification results to the syndrome classification and entity labeling module;

[0011] 1.4. Syndrome classification and entity labeling module. The syndrome classification and entity labeling module uses the fine-tuned BERT model constructed by the syndrome classification and symptom extraction model construction module to perform syndrome classification and symptom and other entity extraction on the new diagnosis and treatment data, and uses manual verification to correct the syndrome results, and uses the corrected data to be put back into the module to fine-tune and improve the model;

[0012] 2) Integration of diagnosis and treatment data

[0013] 2.1) The syndrome diagnosis and treatment instruction construction module uses named entity recognition to extract the symptoms and signs information in the existing syndrome diagnosis and treatment text data, and extracts the abnormal test items and medication information based on the test and examination information and drug information in the diagnosis and treatment text data;

[0014] 2.2) Based on the extracted symptoms, signs, abnormal test items and medication information, a prompt word text is constructed by combining knowledge entries and formatting instructions;

[0015] 2.3) Randomly submit the prompt words to the large language model to generate the first diagnosis and treatment data, and then send the first diagnosis and treatment data to the expert review and training data batch generation module; here, the first diagnosis and treatment data of different styles and expressions are generated, and for each type of syndrome, several first diagnosis and treatment data are generated for the next step of expert review and correction.

[0016] The prompt words include but are not limited to the following forms. For example: "Disease: ×× syndrome; Symptoms: ××; Abnormal test items: ××; Used drugs: ××. Based on the above information, if you are a ×× doctor, construct a doctor-patient dialogue, the content of which is required to prescribe tests based on the patient's chief complaint and personal history, and determine that the patient has a certain disease through abnormal test items. Among them, the expression of symptoms can use synonyms or similar semantic expressions to expand the richness of the consultation process." etc.

[0017] 3) Data review and correction

[0018] 3.1) The expert review and training data batch generation module receives the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module;

[0019] 3.2) The expert review and training data batch generation module optimizes the prompt word instructions in the first diagnosis and treatment data according to the suggestions of medical experts;

[0020] 3.3) At the same time, the first diagnosis and treatment data is screened according to the advice of the medical expert, and the screened diagnosis and treatment data is used as a sample;

[0021] 3.4) Using the One-Shot method, the samples generated by the first diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate positive sample diagnosis and treatment data;

[0022] 3.5) The expert review and training data batch generation module constructs the second diagnosis and treatment data of other diseases based on the information of other disease knowledge bases, and optimizes and screens the second diagnosis and treatment data in the same way as the first diagnosis and treatment data;

[0023] 3.6) Using the One-Shot method, the samples generated by the second diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate negative sample diagnosis and treatment data;

[0024] 3.7) The expert review and training data batch generation module sends the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data to the syndrome classification and symptom extraction model construction module;

[0025] IV) Model construction, syndrome classification and symptom extraction

[0026] 4.1) Syndrome classification and symptom extraction model construction module constructs syndrome classification and symptom entity classification models, using the pre-trained BERT model;

[0027] 4.2) The syndrome classification and symptom extraction model construction module receives the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data sent by the expert review and training data batch generation module;

[0028] 4.3) Sequence the symptoms, drugs, signs, etc. in the generated medical consultation data according to the BIO strategy;

[0029] 4.4) Label the results of the consultation according to the categories of positive sample diagnosis and treatment data or negative sample diagnosis and treatment data;

[0030] 4.5) Input the labeled data as a training set into the BERT model to fine-tune the model. The fine-tuned BERT model is used for syndrome classification and entity labeling modules;

[0031] The present invention uses the BERT model to complete the syndrome classification and symptom extraction tasks at the same time. BERT is a two-stage model composed of a stack of multiple layers of Transformer encoders, each layer of which contains a self-attention mechanism and a feedforward neural network. This deep structure enables BERT to capture different levels of semantic information from shallow grammatical features to deep semantic features. The so-called two-stage model includes two parts: pre-training and fine-tuning. When using the BERT model, it is usually not necessary to perform pre-training again. It is only necessary to use a pre-training model to construct a data set for the task for different tasks, and the model can be fine-tuned to meet the needs of specific tasks. Compared with the large model, the model has a small number of parameters, does not need to rely on a large amount of GPU computing power, is easy to deploy and use, and in addition, for different tasks, the same pre-training model can be used, and the task can be met only by fine-tuning. For example, the entity recognition and classification task of the present invention, the entity recognition, that is, the recognition and extraction of entities such as symptoms. Fine-tuning with a smaller data set can achieve a better accuracy rate. It is very suitable for situations where the amount of data is small, the computing power is insufficient, and the large model is difficult to deploy.

[0032] V) Improve the model

[0033] 5.1) The syndrome classification and entity labeling module receives the BERT model fine-tuned by the syndrome classification and symptom extraction model construction module;

[0034] 5.2) The syndrome classification and entity annotation module receives new diagnosis and treatment data, and uses the fine-tuned BERT model to classify syndromes and extract entities such as symptoms from the new diagnosis and treatment data;

[0035] 5.3) The syndrome classification and entity labeling module uses manual verification to calibrate the syndrome classification results;

[0036] 5.4) Syndrome Classification and Entity Labeling Module The corrected syndrome results in step 5.3 are sent to the syndrome classification and symptom extraction model construction module, and the BERT model is further fine-tuned through this syndrome classification result.

[0037] Preferably, the existing syndrome diagnosis and treatment text data in step 1.1) includes patient complaints, personal history, doctor's diagnosis, test information and medication information.

[0038] Preferably, the content of optimizing the prompt word instructions in the first diagnosis and treatment data in step 3.2) includes: adding information such as possible associated symptoms, similar semantic symptom expressions, and abnormal test items.

[0039] Preferably, in step 3.4) and step 3.6), One-Shot refers to a setting in which a task demonstration is given to the model as a condition during inference, but weight updating is not allowed.

[0040] Preferably, in step 3.4), the positive sample diagnosis and treatment data are: positive sample diagnosis and treatment data of five major syndromes, wherein the five major syndromes include fever with respiratory syndrome, fever with hemorrhagic syndrome, fever with rash syndrome, fever with diarrhea syndrome and encephalitis meningitis syndrome.

[0041] Preferably, in step 4.3), the specific method of sequence labeling the entities such as symptoms, drugs, and signs in the generated medical consultation data according to the BIO strategy is as follows: all non-entities are labeled as "O", entities are labeled according to specific entity types, the first character of the entity is labeled as B_entity name, and other characters are labeled as I_entity name, and at the same time, the results of the medical consultation are labeled according to the five major syndrome types or not syndromes (i.e., the negative sample data generated by module (2)). In the training input stage, each data is split by word, and [CLS] is added at the starting position, and [SEP] is added at the end to mark the start and end of a sentence. The output stage uses the BERT model output to obtain the vector representation of each position, and maps it to the final sequence labeling classification space of each word through a linear layer to obtain the sequence labeling type result of the position. In addition, the vector at the [CLS] position is used to represent the sentence vector of the input sentence. After the sentence vector is obtained, a Softmax classifier is connected to perform training on the syndrome type classification task. The loss function uses the cross entropy loss function. The sequence labeling loss is combined with the sentence vector classification loss, and the model is fine-tuned with the goal of minimizing the total loss.

[0042] Preferably, in step 4.5), the vector at the [CLS] position is used to represent the sentence vector of the input sentence, and after the sentence vector is obtained, a Softmax classifier is connected to perform training for the syndrome type classification task.

[0043] Preferably, in step 4.5), the sequence labeling loss and the sentence vector classification loss are combined, and the model is fine-tuned with the goal of minimizing the total loss.

[0044] Preferably, the sequence labeling loss and the sentence vector classification loss are calculated by a loss function, and the loss function adopts a cross entropy loss function.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1. Use a large language model and combine prompt word instructions with consultation data approved by experts to generate training data for the five major syndromes. This method avoids the problem of insufficient syndrome judgment data leading to difficulties in automatic model judgment.

[0047] 2. Using the dataset generated by the large language model, we fine-tune the BERT pre-trained model and build a model for the classification of five major syndromes and entity recognition such as symptoms. This approach can not only avoid the computing resource limitations caused by using a large model to determine syndromes, but also ensure that both syndrome classification and symptom entity recognition tasks can be completed quickly and simultaneously with a high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1It is a logical relationship diagram of the present invention;

[0049] Figure 2 It is the logical relationship diagram between modules;

[0050] In the figure: 1. Syndrome diagnosis and treatment instruction construction module; 2. Expert review and training data batch generation module; 3. Syndrome classification and symptom extraction model construction module; 4. Syndrome classification and entity labeling module. DETAILED DESCRIPTION

[0051] The following will be combined with the attached embodiment of the present invention Figure 1-Figure 2 , the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0053] See also Figure 1-Figure 2 , embodiments of the present invention:

[0054] Example:

[0055] like Figure 1-Figure 2 As shown: The syndrome data generation, classification and symptom extraction method based on the large language model includes the following steps:

[0056] 1) Provide a device based on a large language model, comprising:

[0057] 1.1. Syndrome diagnosis and treatment instruction construction module 1, the syndrome diagnosis and treatment instruction construction module 1 processes the existing syndrome diagnosis and treatment text data to obtain prompt word text, then submits the prompt word text to the large language model to obtain the first diagnosis and treatment data, and sends the first diagnosis and treatment data to the expert review and training data batch generation module 2;

[0058] Existing syndrome diagnosis and treatment text data include patient complaints, personal history, doctor's diagnosis, test information and medication information.

[0059] 1.2. Expert review and training data batch generation module 2, the expert review and training data batch generation module 2 is used to receive the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module 1, and perform expert screening on the first diagnosis and treatment data to obtain reasonable samples after screening, and then further optimize the prompt word instructions in the first diagnosis and treatment data according to the reasonable samples, and at the same time generate second diagnosis and treatment data based on other disease knowledge base information, and perform the same optimization and screening on the second diagnosis and treatment data as the first diagnosis and treatment data, and finally input the processed samples of the first diagnosis and treatment data and the optimized prompt word instructions into the large language model to obtain diagnosis and treatment sample data, and send it to the syndrome classification and symptom extraction model construction module 3;

[0060] 1.3. Syndrome classification and symptom extraction model construction module 3, the syndrome classification and symptom extraction model construction module 3 is used to receive the diagnosis and treatment sample data sent by the expert review and training data batch generation module 2, and construct a syndrome classification and symptom entity classification model, use the pre-trained BERT model to process the symptoms, drugs, signs, etc. in the diagnosis and treatment samples, and input the processed content into the BERT model as a training set for BERT model fine-tuning, and finally use the fine-tuned BERT model in the syndrome classification and entity labeling module 4;

[0061] 1.4. Syndrome classification and entity labeling module 4. The syndrome classification and entity labeling module 4 uses the fine-tuned BERT model constructed by the syndrome classification and symptom extraction model construction module 3 to perform syndrome classification and symptom and other entity extraction on the new diagnosis and treatment data, and uses manual verification to correct the syndrome results, and uses the corrected data to be put into module 3 again to fine-tune and improve the model;

[0062] 2) Integration of diagnosis and treatment data

[0063] 2.1) The syndrome diagnosis and treatment instruction construction module 1 uses named entity recognition to extract the symptom and sign information in the diagnosis and treatment text data from the existing syndrome diagnosis and treatment text data, and extracts the abnormal test items and medication information based on the test and examination information and drug information in the diagnosis and treatment text data;

[0064] 2.2) Based on the extracted symptoms, signs, abnormal test items and medication information, a prompt word text is constructed by combining knowledge entries and formatting instructions;

[0065] 2.3) Randomly submit the prompt words to the large language model to generate the first diagnosis and treatment data, and then send the first diagnosis and treatment data to the expert review and training data batch generation module 2;

[0066] Here, the first diagnosis and treatment data of different styles and expressions are generated, and for each type of syndrome, several pieces of first diagnosis and treatment data are generated for the next step of expert review and correction.

[0067] The prompt words are in the following form: "Disease: ×× syndrome; Symptoms: ××; Abnormal test items: ××; Medication used: ××. Based on the above information, if you are a doctor of ××, construct a doctor-patient dialogue. The required content is to prescribe tests based on the patient's chief complaint and personal history, and determine whether the patient has a certain disease based on the abnormal test items. Among them, expressions such as symptoms can use synonyms or similar semantic expressions to expand the richness of the consultation process.".

[0068] 3) Data review and correction

[0069] 3.1) The expert review and training data batch generation module 2 receives the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module 1;

[0070] 3.2) The expert review and training data batch generation module 2 optimizes the prompt word instructions in the first diagnosis and treatment data according to the suggestions of the medical experts;

[0071] The optimization of the prompt word instructions in the first diagnosis and treatment data includes: adding information such as possible related symptoms, similar semantic symptom expressions, and abnormal test items.

[0072] 3.3) At the same time, the first diagnosis and treatment data is screened according to the advice of the medical expert, and the screened diagnosis and treatment data is used as a sample;

[0073] 3.4) Using the One-Shot method, the samples generated by the first diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate positive sample diagnosis and treatment data;

[0074] The positive sample diagnosis and treatment data are: the positive sample diagnosis and treatment data of the five major syndromes, wherein the five major syndromes include fever with respiratory syndrome, fever with hemorrhagic syndrome, fever with rash syndrome, fever with diarrhea syndrome and encephalitis meningitis syndrome.

[0075] 3.5) The expert review and training data batch generation module 2 constructs the second diagnosis and treatment data of other diseases based on the information of other disease knowledge bases, and optimizes and screens the second diagnosis and treatment data in the same way as the first diagnosis and treatment data;

[0076] 3.6) Using the One-Shot method, the samples generated by the second diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate negative sample diagnosis and treatment data;

[0077] 3.7) The expert review and training data batch generation module 2 sends the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data to the syndrome classification and symptom extraction model construction module 3;

[0078] One-Shot refers to a setting where a task demonstration is given to the model as a condition at inference time, but weight updates are not allowed.

[0079] 4) Syndrome classification and symptom extraction

[0080] 4.1) Syndrome classification and symptom extraction model construction module 3 constructs the syndrome classification and symptom entity classification model, using the pre-trained BERT model;

[0081] 4.2) The syndrome classification and symptom extraction model construction module 3 receives the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data sent by the expert review and training data batch generation module 2;

[0082] The specific method of sequence annotation of symptoms, drugs, signs, etc. in the medical consultation data to be generated according to the BIO strategy is as follows: all non-entities are marked as "O", entities are marked according to specific entity types, the first characters of the entity are marked as B_entity name, and other characters are marked as I_entity name.

[0083] 4.3) Sequence the symptoms, drugs, signs, etc. in the generated medical consultation data according to the BIO strategy;

[0084] The specific method of sequence labeling of entities such as symptoms, drugs, and signs in the generated medical consultation data according to the BIO strategy is as follows: all non-entities are labeled as "O", entities are labeled according to specific entity types, the first characters of the entity are labeled as B_entity name, and other characters are labeled as I_entity name.

[0085] 4.4) Label the results of the consultation according to the categories of positive sample diagnosis and treatment data or negative sample diagnosis and treatment data;

[0086] 4.5) Input the labeled data as a training set into the BERT model to fine-tune the model. The fine-tuned BERT model is used for syndrome classification and entity labeling module 4;

[0087] The vector at the [CLS] position is used to represent the sentence vector of the input sentence. After the sentence vector is obtained, a Softmax classifier is connected to train the syndrome type classification task.

[0088] The sequence labeling loss and sentence vector classification loss are combined to fine-tune the model with the goal of minimizing the total loss.

[0089] The sequence labeling loss and sentence vector classification loss are calculated through the loss function, and the loss function adopts the cross entropy loss function.

[0090] V) Improve the model

[0091] 5.1), the syndrome classification and entity labeling module 4 receives the BERT model fine-tuned by the syndrome classification and symptom extraction model construction module 3;

[0092] 5.2) The syndrome classification and entity annotation module 4 receives new diagnosis and treatment data, and uses the fine-tuned BERT model to perform syndrome classification and extract entities such as symptoms from the new diagnosis and treatment data;

[0093] 5.3) The syndrome classification and entity labeling module 4 uses manual verification to calibrate the syndrome classification results;

[0094] 5.4) The syndrome classification and entity labeling module 4 sends the corrected syndrome results in step 5.3 to the syndrome classification and symptom extraction model construction module 3, and the BERT model is further fine-tuned through this syndrome classification result.

[0095] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.

[0096] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation modes that those skilled in the art can understand.

Claims

1. A method for generating, classifying and extracting syndrome data based on a large language model, characterized in that: The following steps are involved: 1) Provide a device based on a large language model, comprising: 1.

1. A syndrome diagnosis and treatment instruction construction module (1), wherein the syndrome diagnosis and treatment instruction construction module (1) processes the existing syndrome diagnosis and treatment text data to obtain a prompt word text, and then submits the prompt word text to a large language model to obtain first diagnosis and treatment data, and sends the first diagnosis and treatment data to an expert review and training data batch generation module (2); 1.

2. An expert review and training data batch generation module (2), wherein the expert review and training data batch generation module (2) is used to receive the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module (1), and perform expert screening on the first diagnosis and treatment data to obtain reasonable samples after screening, and then further optimize the prompt word instructions in the first diagnosis and treatment data based on the reasonable samples, and at the same time generate second diagnosis and treatment data based on other disease knowledge base information, and perform the same optimization and screening on the second diagnosis and treatment data as the first diagnosis and treatment data, and finally input the processed samples of the first diagnosis and treatment data and the optimized prompt word instructions into the large language model to obtain diagnosis and treatment sample data, and send it to the syndrome classification and symptom extraction model construction module (3); 1.

3. Syndrome classification and symptom extraction model construction module (3). The syndrome classification and symptom extraction model construction module (3) is used to receive the diagnosis and treatment sample data sent by the expert review and training data batch generation module (2), and to construct a syndrome classification and symptom entity classification model. The pre-trained BERT model is used to process the symptoms, drugs, signs, etc. in the diagnosis and treatment samples, and the processed content is input into the BERT model as a training set for BERT model fine-tuning. Finally, the fine-tuned BERT model is used in the syndrome classification and entity labeling module (4); 1.

4. Syndrome classification and entity labeling module (4). The syndrome classification and entity labeling module (4) uses the fine-tuned BERT model constructed by the syndrome classification and symptom extraction model construction module (3) to perform syndrome classification and symptom and other entity extraction on the new diagnosis and treatment data, and uses manual verification to correct the syndrome results, and uses the corrected data to be put back into the module (3) to fine-tune and improve the model; 2) Integration of diagnosis and treatment data 2.1) The syndrome diagnosis and treatment instruction construction module (1) uses named entity recognition to extract symptom and sign information from the existing syndrome diagnosis and treatment text data, and extracts abnormal test items and medication information based on the test and examination information and drug information in the diagnosis and treatment text data; 2.2) Based on the extracted symptoms, signs, abnormal test items and medication information, a prompt word text is constructed by combining knowledge entries and formatting instructions; 2.3) Randomly submit the prompt words to the large language model to generate the first diagnosis and treatment data, and then send the first diagnosis and treatment data to the expert review and training data batch generation module (2); 3) Data review and correction 3.1), the expert review and training data batch generation module (2) receives the first diagnosis and treatment data sent by the syndrome diagnosis and treatment instruction construction module (1); 3.2) The expert review and training data batch generation module (2) optimizes the prompt word instructions in the first diagnosis and treatment data according to the suggestions of the medical experts; 3.3) At the same time, the first diagnosis and treatment data is screened according to the advice of the medical expert, and the screened diagnosis and treatment data is used as a sample; 3.4) Using the One-Shot method, the samples generated by the first diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate positive sample diagnosis and treatment data; 3.5) The expert review and training data batch generation module (2) constructs the second diagnosis and treatment data of other diseases based on the information of other disease knowledge bases, and optimizes and screens the second diagnosis and treatment data in the same way as the first diagnosis and treatment data; 3.6) Using the One-Shot method, the samples generated by the second diagnosis and treatment data and the optimized prompt words are input into the large language model together to generate negative sample diagnosis and treatment data; 3.7) The expert review and training data batch generation module (2) sends the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data to the syndrome classification and symptom extraction model construction module (3); IV) Model construction, syndrome classification and symptom extraction 4.1) Syndrome classification and symptom extraction model construction module (3) Construct syndrome classification and symptom entity classification model, using the pre-trained BERT model; 4.2) The syndrome classification and symptom extraction model construction module (3) receives the positive sample diagnosis and treatment data and the negative sample diagnosis and treatment data sent by the expert review and training data batch generation module (2); 4.3) Sequence the symptoms, drugs, signs, etc. in the generated medical consultation data according to the BIO strategy; 4.4) Label the results of the consultation according to the categories of positive sample diagnosis and treatment data or negative sample diagnosis and treatment data; 4.5) Input the labeled data as a training set into the BERT model and fine-tune the model. The fine-tuned BERT model is used for the syndrome classification and entity labeling modules (4); V) Improve the model 5.1), the syndrome classification and entity labeling module (4) receives the fine-tuned BERT model from the syndrome classification and symptom extraction model building module (3); 5.2) The syndrome classification and entity annotation module (4) receives new diagnosis and treatment data, and uses the fine-tuned BERT model to perform syndrome classification and extract entities such as symptoms from the new diagnosis and treatment data; 5.3) The syndrome classification and entity labeling module (4) uses manual verification to calibrate the syndrome classification results; 5.4) Syndrome classification and entity labeling module (4) The corrected syndrome results in step 5.3 are sent to the syndrome classification and symptom extraction model construction module (3), and the BERT model is further fine-tuned through this syndrome classification result.

2. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: The existing syndrome diagnosis and treatment text data in step 1.1) includes patient complaints, personal history, doctor's diagnosis, test information and medication information.

3. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: The content of optimizing the prompt word instructions in the first diagnosis and treatment data in the step 3.2) includes: adding information such as possible related symptoms, similar semantic symptom expressions, and abnormal test items.

4. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: In the steps 3.4) and 3.6), One-Shot refers to a setting in which a task demonstration is given to the model as a condition during inference, but weight updates are not allowed.

5. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: In the step 3.4), the positive sample diagnosis and treatment data are: the positive sample diagnosis and treatment data of the five major syndromes, wherein the five major syndromes include fever with respiratory syndrome, fever with hemorrhagic syndrome, fever with rash syndrome, fever with diarrhea syndrome and encephalitis meningitis syndrome.

6. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: In the step 4.3), the specific method of sequence labeling of entities such as symptoms, drugs, and signs in the generated medical consultation data according to the BIO strategy is as follows: all non-entities are labeled as "O", entities are labeled according to specific entity types, the first characters of the entity are labeled as B_entity name, and other characters are labeled as I_entity name.

7. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 1, characterized in that: In the step 4.5), the vector at the [CLS] position is used to represent the sentence vector of the input sentence, and after the sentence vector is obtained, a Softmax classifier is connected to perform training for the syndrome type classification task.

8. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 7, characterized in that: In step 4.5), the sequence labeling loss and the sentence vector classification loss are combined, and the model is fine-tuned with the goal of minimizing the total loss.

9. The method for generating, classifying and extracting syndrome data based on a large language model according to claim 8, characterized in that: The sequence labeling loss and sentence vector classification loss are calculated through the loss function, and the loss function adopts the cross entropy loss function.