Gastroenterology pre-diagnosis system and method based on vector database and large language model
By adopting a combination technology of vector database and large language model in the gastroenterology prediagnosis system, the existing system's lack of semantic understanding ability when dealing with the description of fuzzy or emotional symptoms is solved, and more accurate and personalized preliminary diagnostic suggestions are achieved, which improves the overall performance of the system.
Patent Information
- Application Number
- CN202411792963.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-08
- Publication Date
- 2025-04-08
AI Technical Summary
The existing gastroenterology prediagnosis system lacks semantic understanding when dealing with patient descriptions of vague or emotional symptoms, resulting in low diagnostic accuracy, insufficient personalization and slow response speed.
A gastroenterology prediagnosis system based on vector databases and large language models is adopted to understand the patient's complex symptom description through natural language processing technology and vectorized matching mechanism, and to use large language models for context reasoning, combine medical history and timeline information to generate accurate preliminary diagnostic suggestions.
It significantly improves the semantic understanding ability and diagnostic accuracy of the pre-diagnosis system of the gastroenterology department, can process complex symptom combinations and multi-dimensional disease information, reduces the rate of misdiagnosis and improves user experience.
Smart Images

Figure CN119786013A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the medical field, and in particular to a gastroenterology pre-diagnosis system and method based on a vector database and a large language model. Background Art
[0002] In the traditional medical consultation process, doctors usually obtain the patient's symptom description through face-to-face communication. This method is not only time-consuming, but also easily limited by the patient's ability to express, resulting in low consultation efficiency. With the development of artificial intelligence and natural language processing technology, intelligent pre-consultation system has become an important tool to improve consultation efficiency. However, existing pre-consultation systems usually rely on keyword matching, lack semantic understanding capabilities, and cannot effectively handle complex and ambiguous symptom descriptions, thus affecting the accuracy of the consultation results. This method cannot fully understand the patient's natural language description, especially when the patient uses ambiguous or non-standard medical terms. Gastroenterological diseases often have complex and diverse symptoms. The symptoms described by patients may be vague and emotional, and traditional systems find it difficult to accurately determine the cause of the disease.
[0003] Current pre-consultation systems are usually based on the following two types of technologies:
[0004] (1) Rule-based systems: Using predefined medical terminology or symptom classification, the system outputs relevant disease information by matching keywords entered by the user. This type of system has high requirements for word accuracy and cannot handle complex or ambiguous expressions.
[0005] (2) Machine learning and shallow natural language processing (NLP): Use machine learning algorithms and basic NLP techniques to classify symptoms. These technologies can improve the flexibility of the system to a certain extent, but their semantic understanding is still limited, unable to capture the deep semantic information in user input, and unable to make accurate personalized recommendations.
[0006] In summary, the main disadvantages of the prior art are as follows:
[0007] Weak semantic understanding ability: Existing pre-diagnosis systems are often only based on keyword matching and cannot accurately understand patients' vague or complex descriptions.
[0008] Low diagnostic accuracy: Because the semantics cannot be fully understood, it is difficult for the system to perform accurate symptom analysis and disease classification.
[0009] Insufficient personalization: Existing systems are unable to provide personalized pre-diagnosis recommendations based on the specific symptoms and context of different patients.
[0010] Slow response: When processing complex queries, the existing system may have slow response speed, affecting the user experience.
[0011] Given that the Large Language Model (LLM) is an artificial intelligence model that uses machine learning technology to understand and generate human language, and natural language processing (NLP) is a machine learning technology that enables computers to interpret, process and understand human language; therefore, the present invention uses natural language processing technology and vectorized matching mechanism to use a large language model for semantic parsing to better understand patients' complex symptom descriptions, especially vague, non-standardized and emotional expressions, thereby providing more accurate preliminary diagnostic suggestions. Summary of the invention
[0012] The technical problem to be solved by the present invention is that, in response to the above-mentioned defects of the prior art, a gastroenterology pre-consultation system based on a vector database and a large language model is provided, aiming to improve the gastroenterology pre-consultation system's ability to understand natural language input, especially when dealing with patients' vague or emotional symptom descriptions. It can handle complex symptom combinations and multi-dimensional disease information, use a large language model for contextual reasoning, and combine medical history, timeline and other information to generate accurate preliminary diagnosis suggestions.
[0013] The present invention is implemented in this way. The present invention provides a pre-consultation system for gastroenterology based on a vector database and a large language model, characterized in that the pre-consultation system for gastroenterology understands the patient's complex and ambiguous symptom description through natural language processing technology to provide accurate preliminary diagnosis suggestions; the pre-consultation system for gastroenterology mainly includes:
[0014] A user input interface module, which is used for patients to input natural language descriptions of symptoms and medical history through mobile devices, computers or other intelligent terminals;
[0015] A natural language processing module, which is a large language model used to parse the patient's natural language input to extract semantic information, which includes symptoms, medical history, timeline, trigger conditions, and emotional expression key information;
[0016] A vectorization module, the vectorization module is used to convert the semantic information into a semantic vector so that the semantic vector can be matched with a medical case vector in a vector database; the semantic vector is a multidimensional vector, including the semantic information of the patient's current condition and the time and situation context related to the semantic information;
[0017] A vector database, which stores a large number of annotated medical cases, including vectorized representations of symptoms, causes, diseases, and treatment methods; the vector database is used to retrieve multiple symptoms closest to the patient's description from the symptom vector database through a similarity algorithm and generate a candidate list to provide support for the reasoning engine;
[0018] A similarity judgment module, which is used to screen out preliminary candidate cases by calculating the similarity between the user input vector and the case vector in the vector database; the similarity judgment module is based on the reasoning ability of the large language model, combined with the matching results of the vector database, to generate possible preliminary diagnosis results;
[0019] A fine ranking module, which is used to use a large language model or a ranking model to perform fine ranking of candidate cases to return the most likely diagnosis label; the diagnosis label is the diagnosis suggestion, possible disease name and further examination or action suggestion output by the reasoning engine;
[0020] A user feedback interface module, the user feedback interface module is used to convert the diagnosis label into a language that is easy for the patient to understand and output it to the patient;
[0021] Furthermore, the reasoning engine not only relies on the matching results of the vector database, but also uses the large language model for contextual reasoning; the reasoning engine can combine the patient's individual situation and medical common sense to derive a more accurate preliminary diagnosis; the reasoning engine uses the reasoning ability of the large language model to infer a more personalized preliminary diagnosis suggestion based on the matching results of the vector database; the reasoning engine can perform complex logical deductions based on the patient's symptom combination, timeline, and onset condition information.
[0022] Furthermore, the large language model uses a pre-trained large neural network model; the large language model also performs fine-tuning data training in specialized fields to enhance the model's recognition capabilities for gastroenterological diseases; the sources of the fine-tuning data include gastroenterological medical literature, textbooks, doctors' medical records and historical case data, and patients' symptom descriptions and treatment records.
[0023] Furthermore, the vector database is initially constructed with the help of existing medical databases, including medical literature databases, hospital case data, and public medical data sets.
[0024] Furthermore, the semantic vector adopts a multimodal fusion mechanism to improve the ability to understand complex diseases. The representation method of the semantic vector is as follows:
[0025] Assume i is the patient's natural language input, j is the patient's medical history, τ is the time information, and e is the vector representation of this information. The final symptom vector V is shown in Formula 1:
[0026] Formula 1: V = f ( e i , e j , e τ) =W i e i +W j e j +W τ e τ
[0027] Among them, Wi, Wj and Wτ are fusion weights, which are used to indicate the importance of different information; f is the fusion function, which is a simple weighted sum plus a deep neural network for nonlinear combination.
[0028] Furthermore, the similarity judgment module adopts a dynamic similarity adjustment mechanism to perform vector similarity matching. The dynamic similarity adjustment mechanism dynamically adjusts the weight of the similarity calculation according to the complexity of the input, the differences in historical data and the individual characteristics of the patient by integrating the two similarity calculation methods, namely, cosine similarity and Euclidean distance.
[0029] Furthermore, the refined ranking module is a refined ranking model based on reinforcement learning, which adopts a refined ranking algorithm based on reinforcement learning and continuously adjusts the ranking strategy of the model through reinforcement learning to optimize the final diagnostic label;
[0030] The refined sorting algorithm uses the Q-learning algorithm to update the parameters of the refined sorting strategy, and through continuous trial and adjustment through reinforcement learning, finally learns the optimal sorting strategy; the structure of the refined sorting model mainly includes:
[0031] Status, which is a current list of candidate cases and their similarity scores;
[0032] An action, wherein the action is to reorder the candidate cases;
[0033] A reward function is provided for giving a reward according to the accuracy of the final diagnosis, where a positive reward is given if the final diagnosis is correct, and a negative reward is given otherwise.
[0034] The present invention also provides a pre-diagnosis method for gastroenterology based on a vector database and a large language model, wherein the pre-diagnosis method for gastroenterology is implemented by the pre-diagnosis system for gastroenterology based on a vector database and a large language model as described above, and the pre-diagnosis method for gastroenterology comprises the following steps:
[0035] S1: Input natural language description; the patient inputs his current symptoms or health problems through the user input interface module as described above;
[0036] S2: Natural language processing: Through the natural language processing module as described above, the natural language input by the patient is parsed, medical-related vocabulary is identified, and the patient's emotions and timeline information are understood in context;
[0037] S3: vectorization processing; the information extracted by the natural language processing module is transmitted to the vectorization module as described above, and the vectorization module converts the patient's description into a multi-dimensional vector representation;
[0038] S4: vector database matching: using the vector database as described above to perform similarity matching between the patient's symptom vector and the medical case vector stored in the vector database, and using a vector matching algorithm to find the case that is closest to the patient's current description;
[0039] S5: Diagnostic reasoning by the reasoning engine; based on the cases matched from the vector database, the reasoning engine as described above starts to analyze possible causes of the disease. The reasoning engine not only relies on the matching results of the vector database, but also uses the large language model as described above for contextual reasoning, and can combine the individual conditions of the patient and medical common sense to derive a more accurate preliminary diagnosis; the result of the reasoning engine will be passed to the user feedback interface module as described above, and the user feedback interface module will convert the preliminary diagnosis result obtained by the reasoning engine into a language that is easy for the patient to understand, and provide suggestions for the next step.
[0040] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention provides a pre-consultation system for gastroenterology based on a vector database and a large language model, comprising a user input interface module, a natural language processing module, a vectorization module, a vector database, a similarity judgment module, a refined ranking module, and a user feedback interface module; through natural language processing technology, the patient's complex and vague symptom descriptions can be better understood, and accurate preliminary diagnosis suggestions can be provided; a large language model is used for semantic analysis; by improving vectorization representation, similarity calculation and refined ranking models, the accuracy and efficiency of the pre-consultation system are improved, thereby optimizing the pre-consultation process for gastroenterological diseases; the present invention also provides a pre-consultation method for gastroenterology based on the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a system structure diagram of a gastroenterology pre-diagnosis system based on a vector database and a large language model provided in an embodiment of the present invention.
[0043] Figure 2 It is a system processing flow chart of a gastroenterology pre-diagnosis system based on a vector database and a large language model provided by an embodiment of the present invention.
[0044] Figure 3 It is a schematic diagram of a dialogue extraction vector pattern of a gastroenterology pre-consultation system based on a vector database and a large language model provided by an embodiment of the present invention.
[0045] Figure 4 It is a schematic diagram of a rough sorting process combining multimodal fusion and adaptive similarity calculation of a gastroenterology pre-diagnosis system based on a vector database and a large language model provided by an embodiment of the present invention.
[0046] Figure 5 It is a flow chart of a gastroenterology pre-diagnosis method based on a vector database and a large language model provided in an embodiment of the present invention.
[0047] The markings in the above-mentioned figures are: 1. Gastroenterology pre-consultation system; 11. User input interface module; 12. Natural language processing module; 13. Vectorization module; 14. Vector database; 15. Similarity judgment module; 16. Refinement module; 17. User feedback interface module. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0049] The same or similar numbers in the drawings of this embodiment correspond to the same or similar parts; in the description of the present invention, it should be noted that when an element is referred to as "fixed to" another element, it can be directly on the other element or there can also be a central element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there can be a central element at the same time. It should be understood that if there are terms such as "upper", "lower", "left", "right", etc. indicating an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, it is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the positional relationship in the drawings are only used for exemplary descriptions and cannot be understood as limitations on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0050] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0051] Reference Figure 1 The gastroenterology pre-diagnosis system 1 based on a vector database and a large language model provided by the present invention understands the patient's complex and ambiguous symptom description through natural language processing technology to provide accurate preliminary diagnosis suggestions; the gastroenterology pre-diagnosis system 1 mainly includes:
[0052] The user input interface module 11 is used for the patient to input a natural language description of symptoms and medical history through a mobile device, computer or other intelligent terminal; the patient inputs a description of his or her symptoms through the system interface, such as "I have been feeling very depressed recently and have stomach pain";
[0053] Natural language processing module 12, which is a large language model used to parse the patient's natural language input to extract semantic information, which is key information such as symptoms, medical history, timeline, trigger conditions, and emotional expressions;
[0054] The vectorization module 13 is used to convert the semantic information into a semantic vector so that the semantic vector can be matched with the medical case vector in the vector database; the semantic vector is a multi-dimensional vector, including the semantic information of the patient's current condition and the time and situation context related to the semantic information; for example, the text input by the patient will be mapped to a vector such as [0.12, 0.33, ...];
[0055] Vector database 14, which stores a large number of annotated medical cases, including vectorized representations of symptoms, causes, diseases, and treatment methods; vector database 14 is used to retrieve multiple symptoms closest to the patient's description from symptom vector database 14 through a similarity algorithm and generate a candidate list, such as "anxiety (0.90 similarity)", "gastritis (0.85 similarity)", etc., which can quickly retrieve the most similar medical cases and provide support for the reasoning engine;
[0056] Similarity judgment module 15, the similarity judgment module 15 is used to screen out preliminary candidate cases by calculating the similarity between the user input vector and the case vector in the vector database 14; the similarity judgment module 15 is based on the reasoning ability of the large language model, combined with the matching results of the vector database 14, to generate possible preliminary diagnosis results; the similarity judgment module 15 can not only process common symptoms, but also combine medical common sense and context information to infer more potential causes;
[0057] The fine sorting module 16 is used to use a large language model or a sorting model to finely sort the candidate cases to return the most likely diagnosis label; the diagnosis label is the diagnosis suggestion, possible disease name and further examination or action suggestion output by the reasoning engine; such as whether to recommend medical treatment, recommended examination items, etc.;
[0058] The user feedback interface module 17 is used to convert the diagnosis label into a language that is easy for the patient to understand and output it to the patient, including the diagnosis result, possible disease name, further examination suggestion and other information.
[0059] Preferably, the reasoning engine not only relies on the matching results of the vector database 14, but also uses the large language model for contextual reasoning; the reasoning engine can combine the patient's individual situation and medical common sense to derive a more accurate preliminary diagnosis; the reasoning engine uses the reasoning ability of the large language model, and on the basis of the matching results of the vector database 14, it can infer a more personalized preliminary diagnosis suggestion; the reasoning engine can perform complex logical deductions based on the patient's symptom combination, timeline, and onset condition information.
[0060] Preferably, the large language model uses a pre-trained large neural network model; the large language model also performs fine-tuning data training in specialized fields to enhance the model's recognition capabilities for gastroenterological diseases; the sources of fine-tuning data include gastroenterological medical literature, textbooks, doctors' medical records and historical case data, and patients' symptom descriptions and medical records.
[0061] Preferably, the vector database 14 is initially constructed with the help of existing medical databases, including medical literature databases, hospital case data, and public medical data sets.
[0062] Preferably, the semantic vector adopts a multimodal fusion mechanism to improve the ability to understand complex diseases. The representation method of the semantic vector is as follows:
[0063] Assume i is the patient's natural language input, j is the patient's medical history, τ is the time information, and e is the vector representation of this information. The final symptom vector V is shown in Formula 1:
[0064] Formula 1: V = f(e i , e j , e τ )=W i e i +W j e j +W τ e τ
[0065] Among them, Wi, Wj and Wτ are fusion weights, which are used to indicate the importance of different information; f is the fusion function, which is a simple weighted sum plus a deep neural network for nonlinear combination.
[0066] Preferably, the similarity judgment module 15 adopts a dynamic similarity adjustment mechanism to perform vector similarity matching. The dynamic similarity adjustment mechanism dynamically adjusts the weight of similarity calculation according to the complexity of the input, the difference of historical data and the individual characteristics of the patient by integrating the two similarity calculation methods of cosine similarity and Euclidean distance; cosine similarity is used to measure the angle between two vectors, and the closer it is to 1, the higher the similarity of the vectors; Euclidean distance is used to measure the geometric distance between two vectors, and the smaller the distance, the higher the similarity;
[0067] Preferably, the fine ranking module 16 is a fine ranking model based on reinforcement learning, adopts a fine ranking algorithm based on reinforcement learning, and continuously adjusts the ranking strategy of the model through reinforcement learning to optimize the final diagnostic label;
[0068] The fine sorting algorithm uses the Q-learning algorithm to update the parameters of the fine sorting strategy. Through reinforcement learning, it continuously tries and adjusts to finally learn the optimal sorting strategy. The structure of the fine sorting model mainly includes:
[0069] State: The state is the current list of candidate cases and their similarity scores;
[0070] Action: the action is to reorder the candidate cases;
[0071] Reward Function: The reward function gives rewards based on the accuracy of the final diagnosis. If the final diagnosis is correct, a positive reward is given, otherwise a negative reward is given.
[0072] Specifically, the system processing flow of the digestive department pre-consultation system 1 is as follows: Figure 2 As shown:
[0073] (1) Symptoms (e.g., depression, anxiety, etc.) are represented by multidimensional vectors in the vector database 14;
[0074] For example, the text description (text) corresponding to id number 0 is always feeling nervous and uneasy, the multidimensional vector (vector) is represented as [0.11, 0.321, ...], and the label (label) is anxiety;
[0075] The text description corresponding to id number 1 is that it is always difficult to concentrate, and the multidimensional vector
[0076] It is expressed as [0.12, 0.332, …], and the label is anxiety;
[0077] The text description (text) corresponding to id number 2 is that I am in a very low mood recently, and the multidimensional vector (vector)
[0078] It is expressed as [-0.54, 0.569, …], and the label is depression;
[0079] (2) Vectorize the patient’s natural language description;
[0080] For example, the vectorization of the patient's expression that he has been a little irritable recently corresponds to the multi-dimensional vector representation of the vector database 14 in (1);
[0081] (3) Perform similarity matching with cases in the vector database 14 and give similarity judgment, i.e., rough sorting;
[0082] (4) The rough similarity judgment is refined through LLM or sorting model, and the diagnostic label is generated and output.
[0083] Specifically, the dialogue extraction vector pattern of the gastroenterology pre-consultation system 1 is as follows: Figure 3 As shown:
[0084] First, the patient's symptoms, eating habits, past medical history, etc. are confirmed through question-and-answer sessions. Then, based on the location of the symptoms, dietary preferences, and past medical conditions, the patient's pain location, dietary triggers, possible diseases, etc. are determined.
[0085] For example,
[0086] Dialogue question 1: The question is "Do you feel abdominal pain? If so, where is the pain?" The answer is "I often feel pain above the stomach, especially after eating." The extracted vectorized pattern is: symptom pain - location - above the stomach;
[0087] Dialogue question 2: The question is "What are your usual eating habits? Do you have the habit of eating spicy, greasy, or irritating food?" The answer is "I like spicy food and eat it almost every meal." The extracted vectorized pattern is: eating habits - preferences - spicy;
[0088] Dialogue question and answer 3: The question is "Do you have a history of stomach problems or other digestive tract diseases? Such as gastric ulcers, gastritis, etc.?" The answer is "I was diagnosed with gastritis a few years ago, but it did not recur after treatment." The extracted vectorized pattern is: past medical history - disease - gastritis.
[0089] Specifically, the rough sorting process of the digestive department pre-consultation system 1 combining multimodal fusion and adaptive similarity calculation is as follows: Figure 4 As shown:
[0090] Through the contextual abstract information, features such as symptoms, timeline, medical history information, emotions, etc. are extracted, and then each of these features is used to generate a corresponding diagnostic label through the multi-dimensional characteristics of the disease. These diagnostic labels are then scored to generate a comprehensive diagnostic label.
[0091] Compared with the existing intelligent pre-diagnosis system based on keyword matching or traditional machine learning, the vector database 14 and the large language model (LLM) of the above technical solution have significant advantages in handling complex pre-diagnosis of digestive diseases; the main advantages of the present invention compared with the prior art are as follows:
[0092] 1. Significantly improved semantic understanding capabilities
[0093] Most existing intelligent pre-diagnosis systems rely on keyword matching or symptom recognition based on simple classification algorithms. This approach cannot accurately capture the complex semantics of the natural language used by patients when describing their symptoms, especially when patients use non-standard medical terms, colloquial expressions, or emotional descriptions. Existing systems often have difficulty handling these diverse inputs;
[0094] Improved advantages:
[0095] The present invention greatly improves the ability to understand natural language by using a pre-trained large language model. The large language model can handle complex and ambiguous symptom descriptions, capture nuances in the context, and even understand the patient's vague or potential symptom expressions. For example, when a patient says, "I always feel stomach discomfort and a little blocked when eating recently," the traditional system may not be able to identify the specific symptoms of "stomach discomfort," but the present invention, based on the parsing ability of the large language model, can infer potential symptoms such as "stomach bloating" and "indigestion";
[0096] 2. Ability to handle complex symptom combinations
[0097] The symptoms of gastroenterological diseases are usually complex and varied, and patients may experience multiple related or unrelated symptoms at the same time. The combination and association of these symptoms are often the key to diagnosis. Traditional pre-diagnosis systems can usually only handle single symptoms, cannot flexibly deal with complex symptom combinations, and cannot accurately determine the potential connections between multiple symptoms;
[0098] Improved advantages:
[0099] The present invention realizes efficient processing of complex symptom combinations through the vector database 14. Each symptom, medical history, timeline and other information are vectorized and stored in the vector database 14. The system matches the patient's symptoms with the medical cases in the database in a vectorized manner. It can not only process common symptoms, but also identify and infer potential diseases under complex symptom combinations. This method significantly improves the accuracy of diagnosis because it can efficiently process multi-dimensional symptom information, rather than simple keyword matching or classification of single features.
[0100] 3. Stronger contextual reasoning capabilities
[0101] Traditional pre-diagnosis systems lack deep reasoning capabilities and can usually only make simple judgments based on surface symptoms, failing to fully consider contextual information such as the patient's medical history, symptom timeline, and symptom triggering conditions. Since these systems lack contextual understanding and reasoning capabilities, they are prone to misdiagnosis or omission of causes;
[0102] Improved advantages:
[0103] The reasoning engine of the present invention is based on the reasoning ability of a large language model, which can not only process surface symptoms, but also infer potential diseases in combination with the context. For example, the system can understand how the patient's symptoms change over time, and combine the patient's medical history, living habits and other information to derive a more accurate diagnosis. For example, "abdominal pain after meals" may indicate peptic ulcer, while "abdominal pain at night" may be more likely to point to gastroesophageal reflux disease (GERD). Through the integration and reasoning of these contextual information, the present invention can provide more accurate diagnostic suggestions.
[0104] 4. Significantly reduce the misdiagnosis rate
[0105] Existing pre-diagnosis systems rely on rules and keyword matching, which often lead to misdiagnosis due to non-standard language expression or unclear description of the patient. For example, the "stomach pain" described by the patient may include multiple causes such as "stomach spasm", "gastritis", "gastric ulcer", etc., and the traditional system may not be able to distinguish these different conditions, resulting in misdiagnosis;
[0106] Improved advantages:
[0107] The present invention can effectively reduce the misdiagnosis rate through the deep understanding of natural language by the large language model, combined with the similarity matching of the vector database 14. The system can not only identify the core symptoms of the patient, but also find the medical cases that are most similar to the patient's symptoms through vector matching, and provide accurate diagnostic suggestions in combination with the ability of the reasoning engine. In this way, the system can distinguish subtle symptom differences to avoid misdiagnosis, and can point out related symptoms or complications that the patient may ignore.
[0108] In summary, the present invention significantly improves the semantic understanding ability, complex symptom processing ability and contextual reasoning ability of the pre-consultation system 1 of the gastroenterology department by integrating a large language model and a vector database 14, reduces the misdiagnosis rate, and improves the user experience of patients. Compared with the existing pre-consultation technology, the present invention not only has a breakthrough advantage in technical implementation, but also shows a wider applicability and extensibility in practical applications.
[0109] The present invention also proposes a pre-consultation method for the gastroenterology department based on the vector database 14 and the large language model. The pre-consultation method for the gastroenterology department is implemented by the pre-consultation system 1 for the gastroenterology department as described above. The pre-consultation method for the gastroenterology department includes the following steps:
[0110] S1: Input natural language description; the patient inputs his current symptoms or health problems through the user input interface module 11;
[0111] S2: Natural language processing: The natural language input by the patient is parsed through the natural language processing module 12, medical-related vocabulary is identified, and the patient's emotions and timeline information are understood in context;
[0112] S3: vectorization processing; the information extracted by the natural language processing module 12 is transmitted to the vectorization module 13, and the vectorization module 13 converts the patient's description into a multi-dimensional vector representation;
[0113] S4: matching with the vector database 14; performing similarity matching between the patient's symptom vector and the medical case vector stored in the vector database 14 through the vector database 14, and using a vector matching algorithm to find the case that is closest to the patient's current description;
[0114] S5: Diagnostic reasoning of the inference engine; based on the cases matched from the vector database 14, the inference engine begins to analyze the possible causes of the disease. The inference engine not only relies on the matching results of the vector database 14, but also uses a large language model for contextual reasoning. It can combine the patient's individual conditions and medical common sense to derive a more accurate preliminary diagnosis; the results of the inference engine will be passed to the user feedback interface module 17, and the user feedback interface module 17 will convert the preliminary diagnosis results obtained by the inference engine into a language that is easy for the patient to understand, and provide suggestions for the next step.
[0115] Preferably, all computer programs involved in the present invention are implemented by using existing, public, open-source program codes; software programmers in the art can easily implement the technical solutions described in the embodiments of the present invention.
[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A pre-diagnosis system for gastroenterology based on vector database and large language model, characterized in that: The gastroenterology pre-diagnosis system uses natural language processing technology to understand patients' complex and ambiguous symptom descriptions to provide accurate preliminary diagnosis suggestions; The gastroenterology pre-diagnosis system mainly includes: A user input interface module, which is used for patients to input natural language descriptions of symptoms and medical history through mobile devices, computers or other intelligent terminals; A natural language processing module, which is a large language model used to parse the patient's natural language input to extract semantic information, which includes symptoms, medical history, timeline, trigger conditions, and emotional expression key information; A vectorization module, the vectorization module is used to convert the semantic information into a semantic vector so that the semantic vector can be matched with a medical case vector in a vector database; the semantic vector is a multidimensional vector, including the semantic information of the patient's current condition and the time and situation context related to the semantic information; A vector database, which stores a large number of annotated medical cases, including vectorized representations of symptoms, causes, diseases, and treatment methods; the vector database is used to retrieve multiple symptoms closest to the patient's description from the symptom vector database through a similarity algorithm and generate a candidate list to provide support for the reasoning engine; A similarity judgment module, which is used to screen out preliminary candidate cases by calculating the similarity between the user input vector and the case vector in the vector database; the similarity judgment module is based on the reasoning ability of the large language model, combined with the matching results of the vector database, to generate possible preliminary diagnosis results; A fine ranking module, which is used to use a large language model or a ranking model to perform fine ranking of candidate cases to return the most likely diagnosis label; the diagnosis label is the diagnosis suggestion, possible disease name and further examination or action suggestion output by the reasoning engine; A user feedback interface module is used to convert the diagnosis label into a language that is easy for the patient to understand and output it to the patient.
2. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 1, characterized in that: The reasoning engine not only relies on the matching results of the vector database, but also uses the large language model for contextual reasoning; the reasoning engine can combine the patient's individual situation and medical common sense to derive a more accurate preliminary diagnosis; the reasoning engine uses the reasoning ability of the large language model and, based on the matching results of the vector database, infers a more personalized preliminary diagnosis suggestion; the reasoning engine can perform complex logical deductions based on the patient's symptom combination, timeline, and onset condition information.
3. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 2 is characterized in that: The large language model uses a pre-trained large neural network model; the large language model also performs fine-tuning data training in specialized fields to enhance the model's ability to recognize gastroenterological diseases; the sources of the fine-tuning data include gastroenterological medical literature, textbooks, doctors' medical records and historical case data, and patients' symptom descriptions and treatment records.
4. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 1, characterized in that: The vector database is initially constructed with the help of existing medical databases, including medical literature databases, hospital case data, and public medical data sets.
5. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 1, characterized in that: The semantic vector adopts a multimodal fusion mechanism to improve the ability to understand complex diseases. The representation method of the semantic vector is as follows: Assume i is the patient's natural language input, j is the patient's medical history, τ is the time information, and e is the vector representation of this information. The final symptom vector V is shown in Formula 1: Formula 1: V = f(e i , e j , e τ ) = W i e i + W j e j + W τ e τ Among them, Wi, Wj and Wτ are fusion weights, which are used to indicate the importance of different information; f is the fusion function, which is a simple weighted sum plus a deep neural network for nonlinear combination.
6. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 1, characterized in that: The similarity judgment module adopts a dynamic similarity adjustment mechanism to perform vector similarity matching. The dynamic similarity adjustment mechanism dynamically adjusts the weight of similarity calculation according to the complexity of the input, the difference of historical data and the individual characteristics of the patient by integrating the two similarity calculation methods of cosine similarity and Euclidean distance.
7. The pre-diagnosis system for gastroenterology based on vector database and large language model according to claim 1, characterized in that: The refined ranking module is a refined ranking model based on reinforcement learning, which adopts a refined ranking algorithm based on reinforcement learning and continuously adjusts the ranking strategy of the model through reinforcement learning to optimize the final diagnostic label; The refined sorting algorithm uses the Q-learning algorithm to update the parameters of the refined sorting strategy, and through continuous trial and error and adjustment through reinforcement learning, it finally learns the optimal sorting strategy; The structure of the refined arrangement model mainly includes: Status, which is a current list of candidate cases and their similarity scores; An action, wherein the action is to reorder the candidate cases; A reward function is provided for giving a reward according to the accuracy of the final diagnosis, where a positive reward is given if the final diagnosis is correct, and a negative reward is given otherwise.
8. A pre-diagnosis method for gastroenterology based on a vector database and a large language model, characterized in that: The pre-consultation method for the gastroenterology department is implemented by the pre-consultation system for the gastroenterology department based on the vector database and the large language model as claimed in claim 1, and the pre-consultation method for the gastroenterology department comprises the following steps: S1: Input natural language description; the patient inputs his current symptoms or health problems through the user input interface module as described in claim 1; S2: Natural language processing: parsing the natural language input by the patient through the natural language processing module as described in claim 1, identifying medical-related vocabulary, and understanding the patient's emotions and timeline information in combination with the context; S3: vectorization processing; the information extracted by the natural language processing module is transmitted to the vectorization module as claimed in claim 1, and the vectorization module converts the patient's description into a multi-dimensional vector representation; S4: vector database matching; using the vector database as claimed in claim 1, the symptom vector of the patient is matched with the medical case vector stored in the vector database for similarity, and a vector matching algorithm is used to find the case that is closest to the current description of the patient; S5: Diagnostic reasoning of the reasoning engine; based on the cases matched from the vector database, the reasoning engine as claimed in claim 1 starts to analyze possible causes of the disease. The reasoning engine not only relies on the matching results of the vector database, but also uses the large language model as claimed in claim 1 for contextual reasoning, and can combine the patient's individual conditions and medical common sense to derive a more accurate preliminary diagnosis; the result of the reasoning engine will be passed to the user feedback interface module as claimed in claim 1, and the user feedback interface module converts the preliminary diagnosis result obtained by the reasoning engine into a language that is easy for the patient to understand, and provides suggestions for the next step.
Citation Information
Cited By
Traditional Chinese medicine intelligent inquiry method and system based on AI big language model
CN120067279A
Traditional Chinese Medicine Intelligent Inquiry Method and System Based on AI Large Language Model
CN120067279B
Peripheral artery disease patient rehabilitation management system based on whole process
CN120236771A
A comprehensive rehabilitation management system for patients with peripheral artery disease
CN120236771B