Diabetes automatic inquiry system based on large language model

By introducing search enhancement technology and large language model optimization in the diabetes consultation system, the problem of large language model being unreliable in the diabetes consultation scenario is solved, and higher professionalism and accuracy are achieved, and reliable diabetes consultation is provided. Clinic services.

CN119446493AInactive Publication Date: 2025-02-14TONGJI UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411544316.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The large language model has an ‘aliagnosis’ phenomenon in the diabetes consultation scenario, which leads to the unreliable medical advice generated, lacks an in-depth understanding of medical knowledge, and is prone to generating false or inaccurate content.

Method used

A set of diabetes automatic consultation system based on large language models was designed, and the search enhancement technology was used to construct a knowledge base in the form of a vector database to accurately search user questions, and optimize and customize the large language models to generate enhanced answers. Avoid 'illusion' problems.

Benefits of technology

It improves the professionalism and accuracy of the system, ensures timely access to the latest medical knowledge, provides more reliable, professional and cutting-edge diabetes consultation services, and significantly improves system performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119446493A_ABST
    Figure CN119446493A_ABST
Patent Text Reader

Abstract

The invention provides an automatic diabetes inquiry system based on a large language model, the system comprises two parts, namely a retrieval part and a generation part, the retrieval part comprises a knowledge base and a retriever, and the retriever receives questions of a user, accesses the knowledge base and retrieves document fragments most related to the questions of the user; and the generation part is realized based on an optimized and customized large language model, generates a final answer by synthesizing and expressing the information according to a document fragment which is retrieved by a retriever and is most related to the question of the user, and presents the final answer in a natural language form. According to the invention, diagnosis suggestions can be automatically generated, and intelligent and personalized medical consultation services are provided for diabetics, so that the efficiency and quality of medical services are improved. In addition, the system can obtain latest medical knowledge in real time, and the accuracy and practicability of diagnosis and treatment suggestions are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of large language models and diabetes consultation services. Background Art

[0002] In the current global public health field, diabetes has become a major health problem that urgently needs to be addressed due to its increasing incidence and chronic metabolic characteristics. In the traditional diabetes management model, patients often need to see a doctor frequently, which not only consumes a lot of time and medical resources, but also brings economic and psychological burdens to patients.

[0003] With the development of information technology, especially artificial intelligence technology, large language models have brought new possibilities to the medical field. Advances in deep learning and natural language processing technology have enabled large language models to have powerful language understanding and generation capabilities, which are suitable for more intelligent and personalized health consultation and guidance, thereby improving the efficiency and quality of medical services.

[0004] At present, the application of large language models in medical consultation scenarios has obvious limitations, mainly reflected in the "hallucination" phenomenon and the unreliability it brings. Specifically, large language models rely on massive amounts of training data to generate answers, but lack a deep understanding of medical knowledge. They are prone to generating content out of thin air in the absence of clear information, leading to false or inaccurate medical advice, and wrong diagnoses or advice may directly endanger the health of patients. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes an automatic diabetes consultation system based on a large language model. Aiming at the specific scenario of the diabetes consultation system, the present invention introduces retrieval enhancement technology to design a complete system taking into account its special needs for answer accuracy. Specifically, the present invention accurately retrieves users' questions through a knowledge base in the form of a constructed vector database, optimizes and customizes the existing large language model, and performs enhanced answers based on the search results. Thereby avoiding the common "hallucination" problem of large language models, improving the professionalism and accuracy of the system, while ensuring that the latest medical knowledge can be obtained in a timely manner and flexibly adapt to different models and technological advances. The present invention realizes the provision of more reliable, professional and cutting-edge diabetes consultation services, significantly improving system performance and user experience.

[0006] In order to achieve the above object, the technical solution of the present invention is as follows: The automatic diabetes diagnosis system based on the large language model consists of two parts: the retrieval part and the generation part. The retrieval part includes a knowledge base and a retriever. The retriever accepts user questions, accesses the knowledge base, and retrieves the document fragments most relevant to the user questions. The generation part is implemented based on an optimized and customized large language model. According to the document fragments most relevant to the user's question retrieved by the retriever, the final answer is generated by synthesizing and expressing this information and presented in the form of natural language.

[0007] Beneficial effects of the present invention: Based on vector embedding technology, vector database technology, and large language model optimization technology, the present invention proposes an automatic diabetes consultation system based on a large language model. The system provides patients with intelligent and personalized medical consultation and guidance, thereby improving the efficiency and quality of medical services, reducing the pressure on medical resources, and promoting the popularization and fairness of medical services.

[0008] Vector embedding technology can convert complex, high-dimensional data (such as text, images or audio) into continuous vector representations. The system of the present invention uses vector embedding technology to better analyze medical texts and patient data, thereby providing more accurate personalized medical advice.

[0009] Vector databases are specially designed for efficient indexing, querying and retrieving of high-dimensional vector data. Compared with traditional databases, vector databases have significant advantages in processing complex data types and query operations. The system of the present invention adopts vector database technology, which can support real-time acquisition of the latest medical knowledge and patient information, and improve the response speed and accuracy of the system.

[0010] Optimize the large language model to improve the accuracy and completeness of the answers generated by the large language model and overcome the "hallucination" problem; and through fine-tuning for specific tasks, make the large language model more effectively applied to the diabetes consultation system, ensuring that the medical advice and guidance it generates are both accurate and practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A schematic diagram of the basic framework of the automatic diabetes diagnosis system based on a large language model of the present invention.

[0012] Figure 2 Schematic diagram of the knowledge base construction process.

[0013] Figure 3 Schematic diagram of the user input text consultation interface. DETAILED DESCRIPTION

[0014] The technical solution provided by the present application will be further described below in conjunction with specific embodiments and accompanying drawings. The advantages and features of the present application will become more apparent with the following description.

[0015] like Figure 1 As shown in the figure, the diabetes automatic diagnosis system based on the large language model consists of two parts, namely the retrieval part and the generation part, where: The retrieval part includes a knowledge base and a retriever. The retriever accepts user questions, accesses the knowledge base, and retrieves the document fragments most relevant to the user questions. The generation part is implemented based on an optimized and customized large language model. According to the document fragments most relevant to the user's question retrieved by the retriever, the final answer is generated by synthesizing and expressing this information and presented in the form of natural language.

[0016] Each part is described in detail below.

[0017] The search part: The knowledge base is built based on medical documents, such as Figure 2 As shown, the construction process includes: First, relevant documents about diabetes are collected and text content is extracted from the documents.

[0018] Then, the text content is split to a certain extent to obtain document fragments. As an embodiment, a recursive character text splitting algorithm is adopted to keep related text fragments adjacent as much as possible. In addition, a separator list is constructed to assist the splitting work. Specifically, the operation of constructing the separator list includes adding additional punctuation marks as splitting separators, considering special zero-width spaces and distinguishing different comma symbols, etc.

[0019] Next, a vector embedding model is used to map the document fragments obtained by the above splitting into a high-dimensional vector space, so that semantically similar words are closer in the space, and a document after vector embedding is obtained. As an embodiment, text-embedding-3-small is used as a vector embedding model.

[0020] Finally, the documents after vector embedding form a vector database, namely the knowledge base.

[0021] When new research results are produced in the field of diabetes, the present invention can incorporate the latest results into the knowledge base of the search part by applying the above steps to ensure that the system can obtain the latest medical knowledge in a timely manner.

[0022] The retriever is used to find documents or information fragments related to a given query from a large document in a knowledge base.

[0023] When the retriever receives a question from a user, it scans the knowledge base and extracts the most relevant vectors and their corresponding knowledge or document content to help answer the question.

[0024] When the retriever processes a user's query, the system needs to find the most relevant text or paragraph to answer. The present invention abstracts it into a nearest neighbor search problem and uses vector similarity to retrieve similar document paragraphs. The retrieval process includes five core steps: query processing, index construction, relevance measurement, sorting and filtering, and result return: First, query processing: standardize the query through steps such as word segmentation and stop word removal to extract keywords.

[0025] Then, index construction: Use the vector embedding model to build an index to speed up the retrieval process.

[0026] Next, measure the relevance of the indexed query and the documents in the knowledge base: use algorithms such as Boolean retrieval model, vector space model, BM25, TF-IDF, etc. to measure the relevance of the indexed query and the documents in the knowledge base. That is, for the indexed query, calculate the distance between it and each document after vector embedding in the knowledge base. The present invention quantifies the distance between vectors by the sum of squared difference distance, the sum of absolute difference distance and the normalized mutual correlation distance, and finally calculates the relevance score of the indexed query and the documents in the knowledge base.

[0027] Next, sort and filter: select the most relevant documents based on the relevance score, and perform deduplication and filtering.

[0028] Finally, the result is returned: a sorted list of documents, i.e., relevant document fragments, is returned.

[0029] Thus, the retriever provides the most relevant contextual information to the large language model of the generation part, thereby improving the accuracy and relevance of the system's answers.

[0030] The generation part generates the final answer by synthesizing and expressing the knowledge base material fragments (text fragments) most relevant to the user's question retrieved by the retriever of the retrieval part, and presents it in the form of natural language.

[0031] Since the diabetes consultation system directly serves the patient group, the present invention also needs to synthesize and re-express the information retrieved by the retriever and provide it to the user. The generation part takes the user's question and the relevant documents or paragraphs that the retriever retrieves and identifies as potentially containing the answer as input, and generates human-like text through a large language model, thereby forming a response to the user's question.

[0032] The present invention adopts three large language models: GPT-3.5-Turbo, Gemma 7B and Llama3 8B. Among them, although Llama3 8B performs well in inference efficiency and generalization ability, it is not well adapted to Chinese question answering. The present invention adopts the supervised fine-tuning method ORPO, and fine-tunes Llama3 8B on the DPO-En-Zh-20k English-Chinese dataset using the LLaMA-Factory training framework. The parameter settings are shown in Table 1 below, and the fine-tuned Llama3 8B model is recorded as Fine-TunedLlama3 8B.

[0033] Table 1. LLaMA-Factory training framework parameter settings Gemma 7B is good at generating concise answers, Fine-Tuned Llama3 8B can provide more detailed and comprehensive suggestions, and GPT-3.5-Turbo's style is in between the two.

[0034] There are three types of language styles for users to choose to generate text, namely concise, standard, and detailed. Depending on the language style type selected by the user, the generation part uses different large language models to generate answers. If "Concise" is selected, Gemma 7B will be used to generate concise answers; if "Standard" is selected, GPT-3.5-Turbo will be used to generate answers; if "Detailed" is selected, Fine-Tuned Llama3 8B will be used to generate answers, providing more detailed and comprehensive suggestions.

[0035] Furthermore, a consultation interface is designed for interaction between the user and the system. In the consultation interface, the user is allowed to select the language style of the generated text, including concise, standard, and detailed. The consultation interface also displays the chat history between the user and the system, and uses different icons and colors to distinguish between user questions and system answers, such as Figure 3 shown.

[0036] The comprehensive application of the above three large language models enables the generation part to accurately and coherently answer user queries, significantly improving the effectiveness of the consultation system and user experience.

[0037] Furthermore, the retrieval and generation parts of the system adopt independent structures. If a new generation of large language models is released, the present invention can fully utilize the latest language model technology to improve system performance and effects by re-fine-tuning or replacing the model.

[0038] The above description is only a description of the preferred embodiments of the present application, and is not intended to limit the scope of the present application. Any changes or modifications made by any person skilled in the art based on the above disclosed technical contents shall be deemed as equivalent effective embodiments and shall fall within the scope of protection of the technical solution of the present application.

Claims

1. The automatic diabetes diagnosis system based on large language model is characterized by: It consists of two parts, namely the retrieval part and the generation part, among which: The retrieval part includes a knowledge base and a retriever. The retriever accepts user questions, accesses the knowledge base, and retrieves the document fragments most relevant to the user questions. The generation part is implemented based on an optimized and customized large language model. According to the document fragments most relevant to the user's question retrieved by the retriever, the final answer is generated by synthesizing and expressing this information and presented in the form of natural language.

2. The automatic diabetes diagnosis system based on a large language model as claimed in claim 1, characterized in that: The search part: The knowledge base is constructed based on medical documents, and the construction process includes: First, collect relevant documents about diabetes and extract text content from the documents; Then, the text content is split to a certain extent to obtain document fragments; Next, the vector embedding model is used to map the document fragments obtained by the above splitting into a high-dimensional vector space, so that the distance between semantically similar words in the space is closer, and the document after vector embedding is obtained; Finally, the documents after vector embedding form a vector database, namely the knowledge base.

3. The automatic diabetes diagnosis system based on a large language model as claimed in claim 2, characterized in that: A recursive character text splitting algorithm is used to keep related text segments adjacent.

4. The automatic diabetes diagnosis system based on a large language model as claimed in claim 2, characterized in that: Use text-embedding-3-small as the vector embedding model.

5. The automatic diabetes diagnosis system based on a large language model as claimed in claim 1, characterized in that: The retriever is used to find documents or information fragments related to a given query from a large document in the knowledge base; When the retriever receives a question from a user, it scans the knowledge base and extracts the most relevant vectors and their corresponding knowledge or document content to help answer the question; When processing user queries, the retriever abstracts them into nearest neighbor search problems and uses vector similarity to retrieve similar document paragraphs. The retrieval process includes five core steps: query processing, index construction, relevance measurement, sorting and filtering, and result return: First, query processing: standardize the query through word segmentation and stop word removal steps to extract keywords; Then, index construction: use the vector embedding model to build an index to speed up the retrieval process; Next, measure the relevance of the indexed query to the documents in the knowledge base; Next, sort and filter: select the most relevant documents based on the relevance score, and perform deduplication and filtering; Finally, the result is returned: a sorted list of documents, i.e., relevant document fragments, is returned.

6. The automatic diabetes diagnosis system based on a large language model as claimed in claim 5, characterized in that: Measure the relevance of indexed queries to documents in the knowledge base: For indexed queries, calculate the distance between them and each document after vector embedding in the knowledge base, and quantify the distance between vectors using the sum of squared differences, sum of absolute differences, and normalized cross-correlation distance. Finally, calculate the relevance score of the indexed queries to documents in the knowledge base.

7. The automatic diabetes diagnosis system based on a large language model as claimed in claim 1, characterized in that: The generation part takes the user's question and the relevant documents or paragraphs retrieved and identified by the retriever as potentially containing the answer as input, and generates human-like text through a large language model, thereby constituting a response to the user's question; Three large language models, GPT-3.5-Turbo, Gemma 7B and Llama3 8B, were used. The supervised fine-tuning method ORPO was used to fine-tune Llama3 8B on the DPO-En-Zh-20k English-Chinese dataset using the LLaMA-Factory training framework. The fine-tuned Llama3 8B model was recorded as Fine-Tuned Llama3 8B. There are three types of language styles that users can choose to generate texts: concise, standard, and detailed. Depending on the language style type selected by the user, the generation part uses different large language models to generate answers: If you select "Concise", Gemma 7B will generate a concise answer; If you select "Standard", use GPT-3.5-Turbo to generate answers; If you select "Detailed", answers are generated using Fine-Tuned Llama3 8B, which provides more detailed and comprehensive suggestions.

8. The automatic diabetes diagnosis system based on a large language model as claimed in claim 7, characterized in that: An interactive consultation interface is designed between the user and the system. In the consultation interface, the user is allowed to select the language style type of the generated text, including concise, standard, and detailed. The consultation interface also displays the chat history between the user and the system, and uses different icons and colors to distinguish between user questions and system answers.

Citation Information

Patent Citations

  • Method for filtrating search engine searching result

    CN101334773A

  • Intelligent question answering method and device based on large language model, equipment and storage medium

    CN117556020A

  • Network blasting attack detection method and system based on langchain large model

    CN118138343A

  • Medical question and answer method and system based on large language model and storage medium

    CN118152533A

  • Large model fine tuning method and device based on supervised fine tuning, equipment and medium

    CN118445397A