Intelligent question and answer method based on respiration knowledge big language model

By adopting a large language model intelligent question and answer method based on respiratory knowledge in the medical question and answer system, the existing system's insufficient understanding, inaccurate answers and lagging knowledge update problems in dealing with respiratory disease problems is solved, and higher accuracy, timeliness and response speed are achieved.

CN119862959APending Publication Date: 2025-04-22BEIJING AEONMED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411925189.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

When dealing with complex problems of respiratory diseases, existing medical Q&A systems have problems such as insufficient understanding, inaccurate answers, slow response speed and lagging knowledge updates.

Method used

The intelligent question-and-answer method of large language model based on breathing knowledge is adopted to generate answers by receiving user questions, preprocessing data, inputting pre-trained models, and updating the professional knowledge base and model for fine-tuning when necessary to improve the accuracy and timeliness of the answers.

Benefits of technology

It significantly improves the accuracy and response speed of the system when dealing with respiratory disease problems, ensures the timeliness and reliability of knowledge, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862959A_ABST
    Figure CN119862959A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence and natural language processing, and particularly relates to an intelligent question and answer method based on a breathing knowledge big language model. The method comprises the following steps: receiving a breathing knowledge related question text proposed by a user, and preprocessing to obtain a numerical vector; inputting the preprocessed numerical vector into a pre-trained breathing knowledge big language model, and generating an answer through reasoning; when doubtful answers exist, the professional respiration knowledge base is updated, and the respiration knowledge big language model is finely adjusted; and generating a new answer based on the fine-tuned breathing knowledge big language model. By adopting the method provided by the invention, the efficiency of the whole system is improved, the accuracy and timeliness of the answer are greatly improved, the answer quality can be continuously optimized, and the use experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of artificial intelligence and natural language processing, and in particular relates to an intelligent question-answering method based on a large language model of respiratory knowledge. Background Art

[0002] In the field of clinical medicine, the diagnosis and treatment of respiratory diseases is a complex and highly professional field. Existing general medical question-and-answer systems often have problems such as insufficient understanding of such questions, inaccurate answers, and slow response when dealing with complex issues involving respiratory diseases. In particular, existing systems are unable to meet the high requirements of doctors and patients in terms of the handling of professional terminology, complex disease descriptions, and the ability to integrate the latest medical research results. Some existing technical solutions attempt to improve the accuracy of the question-and-answer system by increasing the amount of training data and enhancing the complexity of the model. Other technical solutions continuously optimize the quality of the model's answers through reinforcement learning and expert feedback.

[0003] In summary, the above-mentioned prior art has the following deficiencies:

[0004] 1. High consumption of computing resources: Traditional methods of fine-tuning large language models require a lot of computing resources, resulting in low efficiency.

[0005] 2. Delayed knowledge updating: Most systems rely on static knowledge bases and cannot reflect the latest medical research results in a timely manner.

[0006] 3. Limited answer accuracy: Due to the model’s insufficient understanding of the professional field, the system often gives inaccurate or irrelevant answers when dealing with complex problems.

[0007] Therefore, there is an urgent need for a respiratory knowledge question-answering system based on large language model technology. By fine-tuning the model and dynamically updating the respiratory knowledge base, the existing large language model technology can solve the problems of insufficient understanding of respiratory professional knowledge, high consumption of computing resources, and delayed knowledge base updates, so as to improve the accuracy, timeliness and response speed of the system. Summary of the invention

[0008] The purpose of the present invention is to overcome the defects of the prior art and propose an intelligent question-answering method based on a large language model of respiratory knowledge.

[0009] In view of this, the present invention proposes an intelligent question-answering method based on a large language model of respiratory knowledge, comprising:

[0010] Receive the respiratory knowledge-related question text raised by the user and perform preprocessing to obtain a numerical vector;

[0011] The preprocessed numerical vector is input into the pre-trained large language model of respiratory knowledge, and the answer is generated through reasoning;

[0012] When there is doubt about the answer, the professional respiratory knowledge base is updated and the respiratory knowledge language model is fine-tuned; a new answer is generated based on the fine-tuned respiratory knowledge language model.

[0013] Preferably, the respiratory knowledge-related questions include: respiratory disease questions, respiratory health questions and respiratory professional knowledge questions;

[0014] The pre-processing comprises:

[0015] The input question text is cleaned, segmented and vectorized in turn; the vectorization of word segmentation satisfies the following formula:

[0016]

[0017] Among them, V text Represents the vector representation of text segmentation, n is the number of words in the text, w i is the i-th word, E(w i ) represents word w i The embedding vector of .

[0018] Preferably, the respiratory knowledge large language model uses the large language model Qwen-1.8B as a basic model, and adds a respiratory knowledge embedding module. The respiratory knowledge embedding module includes an encoding layer and a domain attention head, which is used to construct a domain word vector through a respiratory knowledge base, and understand and prioritize the special vocabulary and semantic context of the respiratory field through the domain attention head.

[0019] Preferably, the respiratory knowledge large language model further includes: a respiratory knowledge dynamic adaptation module, a core reasoning module and an answer generation feedback optimization module, wherein:

[0020] The respiratory knowledge dynamic adaptation module introduces a scene classifier to adjust the model parameter weights according to the input question type and dynamically activate the scene-related knowledge path; and adopts a multi-layer gating mechanism to control the interaction intensity between the basic model and the respiratory domain enhancement module;

[0021] The core reasoning module is based on an improved Transformer layer, adopts a multi-head attention mechanism, and includes a feedforward network and a layer normalization module;

[0022] The answer generation feedback optimization module is used to detect errors in the generated preliminary answers, refine the answers through the attention mechanism, and perform secondary optimization.

[0023] Preferably, the method further comprises a step of training a large language model of respiratory knowledge, comprising:

[0024] Establish a training set including dynamic data in the respiratory field and professional data of the respiratory system;

[0025] The training set data is preprocessed in sequence, including text cleaning, text segmentation processing and word segmentation vectorization, to obtain the text word segmentation vector;

[0026] The text segmentation vectors of the training set are input into the basic general large language model in sequence, and the hyperparameters including learning rate and batch size are set. The model is trained until the training convergence conditions are met to obtain a trained respiratory knowledge large language model.

[0027] Preferably, feature normalization is performed during the model training to satisfy the following formula:

[0028] x′=(x-μ) / σ

[0029] Among them, x is the original eigenvalue, μ is the feature mean, σ is the standard deviation of the feature, and x′ is the normalized eigenvalue;

[0030] The training convergence condition is:

[0031] |L t -L t-1 |<ε

[0032] Among them, L t represents the loss function value of the tth iteration, L t-1 represents the loss function value of the t-1th iteration, and ε is the convergence threshold.

[0033] Preferably, the dynamic data in the respiratory field include: the latest research results and medical trends in the respiratory field obtained through automatic monitoring; the professional data of the respiratory system include: medical literature, clinical cases and doctor's consultation records.

[0034] Preferably, the fine-tuning of the respiratory knowledge large language model includes adopting any one of LoRA technology, Adapters or quantization technology; when the LoRA technology is adopted, it includes: adopting a freezing strategy to adjust only the respiratory knowledge embedding module; the fine-tuned respiratory knowledge large language model satisfies the following formula:

[0035] y′=f(x;W+αΔW)

[0036] Among them, y′ is the output of the model, f represents the model function, x is the input data, W is the original model weight, α is the adjustment parameter, and ΔW represents the weight update after fine-tuning, satisfying the following formula:

[0037] ΔW=A×B T

[0038] Among them, A and B are matrices obtained by low-rank decomposition, respectively representing two low-rank approximate matrices of the weight matrix, and T represents transpose.

[0039] Preferably, the updating of the professional respiratory knowledge base includes:

[0040]

[0041] Among them, S sim (q, d) represents the cosine similarity between the user question text q and the document d of the professional respiratory knowledge base, q i and d i They represent the corresponding numerical vectors after preprocessing, i represents the entry, and n represents the total number.

[0042] Preferably, the method further comprises: real-time monitoring and acquisition of the latest research results in the respiratory field, and integration and updating of a professional respiratory knowledge base.

[0043] Compared with the prior art, the advantages of the present invention are:

[0044] 1. The respiratory knowledge language model of the present invention adds a respiratory professional terminology knowledge embedding module to the basic model of Qwen-1.8B to ensure that the model can understand and prioritize the special vocabulary and semantic context in the respiratory field; by introducing the respiratory knowledge dynamic adaptation module, the parameter weights of the model are dynamically adjusted for different scenarios (such as disease, health, and professional consultation), thereby improving the scenario adaptation capability; after generating the preliminary answer, the potential errors in the answer are automatically detected through the feedback module for secondary optimization.

[0045] 2. Improvement of computing efficiency: A fine-tuning solution combining LoRA technology and parameter freezing strategy is adopted to adjust only the layers related to the respiratory field, which significantly reduces the computing resource requirements during the model fine-tuning process and improves the efficiency of the overall system.

[0046] 3. Timeliness of knowledge updating: Through the dynamically updated knowledge base mechanism, the system can integrate the latest medical research results in real time to ensure the accuracy and timeliness of answers.

[0047] 4. Optimization of answer quality: Combining feedback from domain experts (doctors, expert users) and reinforcement learning mechanisms, the system can continuously optimize answer quality and enhance user experience.

[0048] 5. Improved response speed: The application of multi-threaded parallel computing strategy enables the system to generate high-quality answers in a short time. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a system architecture diagram of the present invention;

[0050] Figure 2 It is a professional data preprocessing flow chart;

[0051] Figure 3 It is a flowchart for fine-tuning the large language model of breathing knowledge;

[0052] Figure 4 It is the system feedback optimization flow chart.

[0053] Figure 5 It is a structural diagram of the large language model of respiratory knowledge. DETAILED DESCRIPTION

[0054] The present invention discloses an intelligent question-answering method based on a respiratory knowledge big language model. By combining the pathology of respiratory-related diseases, expert consensus, guidelines and a large amount of clinical data, the basic general language big language model is fine-tuned, focusing on improving the accuracy and efficiency of question-answering about respiratory diseases / treatment plans in the medical field.

[0055] By building a dataset that covers existing comprehensive respiratory knowledge and fine-tuning the large language model with LoRA (low-rank adaptation) technology, the computing resource requirements during fine-tuning are significantly reduced while maintaining the high accuracy of the model. In addition, through a dynamic knowledge base update mechanism, the present invention can acquire and integrate the latest respiratory medicine research results in real time to ensure the timeliness and reliability of the system's answers.

[0056] The core technology of the present invention includes the following aspects:

[0057] 1) Build a dedicated data set containing multi-dimensional knowledge such as respiratory physiology, pathology, diagnosis and treatment, the latest research results, medical trends, expert consensus, clinical guidelines, etc., and clean and label the data;

[0058] 2) Using a mature general language large language model as the basic model, and performing efficient fine-tuning through LoRA technology, the respiratory knowledge large language model can enhance its ability to understand problems in the respiratory professional field;

[0059] 3) Further optimize the model through multiple rounds of fine-tuning and reinforcement learning to improve the accuracy of question answering;

[0060] 4) Introduce a fast response mechanism and adopt a multi-threaded parallel computing strategy to speed up the response speed of the question-answering system;

[0061] 5) Through dynamic monitoring of external databases, the knowledge base is dynamically updated to ensure that the system can continue to adapt to the latest developments in the medical field.

[0062] The technical solution of the present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0063] Example 1

[0064] Embodiment 1 of the present invention proposes an intelligent question-answering method based on a large language model of respiratory knowledge, comprising the following steps:

[0065] Receiving a respiratory knowledge-related question text raised by a user and preprocessing it to obtain a numerical vector; the respiratory knowledge-related question may include: respiratory disease questions, respiratory health questions and respiratory professional knowledge questions;

[0066] The preprocessed numerical vector is input into the trained large language model of respiratory knowledge, and the answer is generated through reasoning;

[0067] When there is doubt about the answer, the professional respiratory knowledge base is updated, and the respiratory knowledge large language model is fine-tuned based on the updated professional respiratory knowledge base; a new answer is generated based on the fine-tuned respiratory knowledge large language model. The LoRA technology can be used to fine-tune the respiratory knowledge large language model.

[0068] like Figure 1 As shown, in one embodiment, the system architecture includes three terminals: a monitoring terminal, a training terminal and a user terminal:

[0069] The main function of the monitoring end is to monitor the latest research results and medical trends in the respiratory field, and import these latest respiratory data into the data preprocessing module (the sources are mainly the latest research results, medical trends, expert consensus, clinical guidelines, public cases, etc.);

[0070] The main function of the training end is to process the existing professional breathing data and then fine-tune the large language model;

[0071] The main function of the user end is to process the input of the user input interface and then perform respiratory knowledge language model inference. It should be noted that the above architecture is only an embodiment and is not a limitation. The core is to implement the following method steps.

[0072] 1. Dynamic monitoring data: responsible for monitoring the latest research results, medical trends, etc. in the respiratory field.

[0073] 2. Professional data: data related to respiratory diseases / treatment plans, including but not limited to medical literature, clinical cases, and doctor's consultation records.

[0074] 3. User input interface: used to receive user input of respiratory disease / health / professional knowledge questions.

[0075] 4. Data preprocessing module: responsible for processing dynamic monitoring, professional data and data input from the user input interface, including text cleaning, word segmentation, vectorization and other steps.

[0076] 5. Large language model fine-tuning module: Use the pre-processed data and processing system feedback optimization module to fine-tune the large language model of respiratory knowledge.

[0077] 6. Professional respiratory knowledge base: accepts professional respiratory support library data generated by the large language model fine-tuning module and updated by the processing system feedback optimization module, and stores structured and unstructured data related to respiratory knowledge.

[0078] 7. Respiratory knowledge large language model: used to receive model updates from the large language model fine-tuning module, import data from the professional respiratory knowledge base, and load user data entered from the user input interface after being processed by the preprocessing module.

[0079] 8. Respiratory knowledge large language model reasoning module: used to reason about user input data.

[0080] 9. User question and answer generation module: generates answers to user input data.

[0081] 10. System feedback optimization module: When the user has doubts about the input data, this module can be selected for feedback analysis, which can be used to fine-tune the large language model fine-tuning module to update the respiratory knowledge large language model and update the professional respiratory knowledge base.

[0082] The data preprocessing module process is as follows Figure 2 shown.

[0083] 1. Dynamic data monitoring: responsible for monitoring the latest research results, medical trends, etc. in the respiratory field. In this process, the data detected in dynamic data monitoring is automatically pushed to the text cleaning step.

[0084] 2. Professional data: data related to respiratory diseases / treatment plans, including but not limited to medical literature, clinical cases, and doctor's consultation records. In this process, professional data is manually pushed to the text cleaning step.

[0085] 3. User input interface: used to receive user input of respiratory disease / health / professional knowledge questions. In this process, the user input interface user's input data is automatically pushed to the text cleaning step.

[0086] 4. Text cleaning: Remove noise from the text received in the above three steps, such as stop words, special characters, etc.

[0087] 5. Text segmentation: decompose the cleaned data into words or phrases.

[0088] 6. Word segmentation vectorization: Convert the text after word segmentation into a numerical vector and prepare it for input into the model.

[0089] Text segmentation vector representation formula:

[0090]

[0091] Among them, V text Represents the vector representation of text segmentation, n is the number of words in the text, w i is the i-th word, E(w i ) represents word w i This formula can be used to convert input data into text segmentation vectors for subsequent training and reasoning steps.

[0092] The process of fine-tuning the large language model module is as follows Figure 3 shown.

[0093] 1. Basic universal large language model: It is the basic model when the large language model starts to be fine-tuned, and the user model is trained and fine-tuned.

[0094] 2. Final data of data preprocessing: the final product data in the data preprocessing process.

[0095] 3. Initialized large language model: After initializing the basic general large language model, the data is preprocessed and the final data is imported.

[0096] 4. Establish a training set including dynamic data in the respiratory field and professional data of the respiratory system; dynamic data in the respiratory field include: automatic monitoring of the latest research results and medical trends in the respiratory field; professional data of the respiratory system include: medical literature, clinical cases and doctor's consultation records, in addition, also include professional meeting resolutions, expert consensus, etc.

[0097] 5. The training set data is preprocessed in sequence, including text cleaning, text segmentation processing and word segmentation vectorization, to obtain the text segmentation vector.

[0098] 6. Set training parameters: Configure hyperparameters during fine-tuning, such as learning rate, batch size, etc.

[0099] 7. Training of large language model of respiratory knowledge: Use preprocessed data to fine-tune the model.

[0100] 8. Saving the large language model of respiratory knowledge: Save the fine-tuned model weights and end the training when it converges.

[0101] 9. Professional respiratory knowledge base: The professional respiratory knowledge base after successful update and fine-tuning will be used for subsequent fine-tuning.

[0102] The large language model fine-tuning formula in this embodiment is the LoRA fine-tuning formula:

[0103] ΔW=A×B T

[0104] Among them, ΔW represents the weight update after fine-tuning, A and B are matrices obtained by low-rank decomposition, and represent two low-rank approximate matrices of the weight matrix respectively.

[0105] The output formula of the fine-tuned model is:

[0106] y′=f(x;W+αΔW)

[0107] Among them, y′ is the output of the model, f is the model function, x is the input data, W is the original model weight, and α is the adjustment parameter.

[0108] Knowledge Base Update Formula

[0109] Knowledge update matching formula:

[0110]

[0111] Among them, S sim (q, d) represents the cosine similarity between query q (user input) and document d (professional respiratory knowledge base), q i and d i The vector components representing the query (user input) and document (professional respiratory knowledge base) respectively.

[0112] Large language model convergence:

[0113] In the training process of large language models, normalization is critical to quickly and stably reach convergence conditions. By reducing the scale differences between features, normalization can help the training process meet the convergence condition formula faster, thereby effectively ending the training.

[0114] Feature normalization formula:

[0115] x′=(x-μ) / σ

[0116] Among them, x is the original eigenvalue, μ is the feature mean, σ is the standard deviation of the feature, and x′ is the normalized eigenvalue.

[0117] The formula for the convergence condition of the loss function during model training is:

[0118] |L t -L t-1 |<ε

[0119] Among them, L t represents the loss function value of the tth iteration, L t-1 represents the loss function value of the t-1th iteration, and ε is a small positive number, which represents the convergence threshold. When the change in the loss function between two consecutive iterations is less than ε, the model is considered to have converged and training stops.

[0120] Gradient convergence condition formula during model training:

[0121]

[0122] in, Represents the gradient of the loss function at the tth iteration relative to the model parameter θ, δ is a small positive number, indicating the convergence threshold of the gradient. When the norm of the gradient is less than δ, the model is considered to have converged and training stops.

[0123] The system feedback optimization module process is as follows Figure 4 As shown (reinforcement learning):

[0124] 1. User questions: questions entered by users through the interface.

[0125] 2. Data preprocessing module: used to receive data input from the user input interface, including text cleaning, word segmentation, vectorization and other steps.

[0126] 3. Initialized breathing knowledge large language model: data after preprocessing of the question data received from the user interface input.

[0127] 4. Question-to-question answer output: Use the fine-tuned model to generate a preliminary answer and display it.

[0128] 5. User feedback: Users provide feedback on answers (such as answer corrections, ratings, etc.).

[0129] 6. Feedback analysis: Analyze user feedback and adjust the model’s reasoning process.

[0130] 7. Model optimization: Further fine-tune the model based on the feedback.

[0131] 8. Large language model of respiratory knowledge: A large language model of respiratory knowledge generated through fine-tuning and fine-tuned after user feedback analysis.

[0132] 9. Professional respiratory knowledge base: Professional knowledge base data generated during the fine-tuning process and updated after user feedback analysis.

[0133] The respiratory knowledge language model structure of the present invention is as follows: Figure 5 shown.

[0134] In one embodiment, Alibaba's open source large language model Qwen-1.8B is used as the basic model for fine-tuning, wherein Qwen-1.8B has the advantages of large maximum context length, small loss under higher (Int8 quantization) quantization conditions, high inference speed, high answer accuracy, and small minimum GPU usage for fine-tuning (Q-Lora).

[0135] The respiratory knowledge language model adopts the following optimized structure:

[0136] 1. Respiratory knowledge embedding module, which is an innovative point of the present invention. It includes an encoding layer and a domain attention head, which is used to construct a domain word vector through the respiratory knowledge base, and understand the special vocabulary and semantic context of the respiratory field through the domain attention head to prioritize the processing. Specifically, it includes:

[0137] (1) Medical term coding

[0138] 1) Use a specially collected respiratory knowledge base (such as guidelines, papers, and expert consensus) to build domain word vectors.

[0139] 2) A Domain-Specific Attention Head is introduced to prioritize the interactions of breathing-related terms in the context.

[0140] (2) Embedding layer optimization

[0141] Replace some common word vectors in the default embedding layer of the basic model with respiratory field-specific word vectors to improve the accurate representation of respiratory medical semantics.

[0142] 2. Dynamic adaptation module of respiratory knowledge, which is another innovation of this application. A scene classifier is introduced to adjust the model parameter weights according to the input question type and dynamically activate the scene-related knowledge path; and a multi-layer gating mechanism is used to control the interaction strength between the basic model and the respiratory domain enhancement module.

[0143] For different scenarios (such as disease, health, and professional consultation), the model's parameter weights are dynamically adjusted to improve scenario adaptation capabilities.

[0144] Adaptation mechanism:

[0145] 1) Introducing a scenario classifier: Adjust the model parameter weights according to the input question type (such as "disease" or "health") and dynamically activate the knowledge path related to the scenario.

[0146] 2) Use a multi-layer gating mechanism (Gated Fusion Layer) to control the interaction strength between the basic model and the respiratory domain enhancement module.

[0147] 3 core reasoning modules, based on the improved Transformer layer of the basic model, adopting a multi-head attention mechanism, including a feedforward network and a layer normalization module.

[0148] 4Answer generation feedback optimization module is another innovation. After generating the preliminary answer, the feedback module automatically detects potential errors in the answer and performs secondary optimization.

[0149] (1) Error detection submodule: A specially trained error detection network is used to evaluate whether the answer is inconsistent with the knowledge base or semantically incomplete.

[0150] (2) Knowledge enhancement and correction submodule: Based on the respiratory professional knowledge base, the attention mechanism is used to refine the answers to make them more suitable for actual respiratory medicine scenarios.

[0151] The present invention introduces a fine-tuning solution that combines LoRA (low rank adaptation) technology with a parameter freezing strategy: this is another innovation.

[0152] (1) Freezing strategy: During fine-tuning, only the respiratory domain-related layers (such as the expertise embedding module) are adjusted and other parts of the base model are frozen to reduce interference.

[0153] (2) Dynamic update and synchronization of knowledge base: When the respiratory knowledge base is updated, only the relevant layers are re-fine-tuned to avoid repeated training of the entire model and improve efficiency.

[0154] Alternative solutions:

[0155] Model fine-tuning alternatives: In addition to LoRA technology, other low-resource fine-tuning techniques such as Adapters or quantization techniques can also be considered to further reduce computing resource requirements.

[0156] Alternative solution for knowledge base update: Dynamic knowledge base update mechanism, through real-time monitoring of the latest external research results, medical trends, expert consensus, clinical guidelines, public cases and treatment plans, introduces an artificial intelligence-driven automatic data extraction and organization system as a substitute, thereby improving the degree of automation of knowledge updating.

[0157] Feedback optimization alternative: Meta-learning-based optimization algorithms can be introduced to further improve the adaptability of the model through rapid learning with a small amount of data.

[0158] Example 2

[0159] Embodiment 2 of the present invention proposes an intelligent question-answering system based on a large language model of respiratory knowledge, which is implemented based on the method of embodiment 1. The system includes:

[0160] A receiving preprocessing module is used to receive the respiratory knowledge-related question text raised by the user and perform preprocessing to obtain a numerical vector;

[0161] A question-answer generation module is used to input the preprocessed numerical vector into a pre-trained large language model of respiratory knowledge and generate answers through reasoning;

[0162] The feedback optimization module is used to update the professional respiratory knowledge base when there is doubt about the answer. Based on the updated professional respiratory knowledge base, the LoRA technology is used to fine-tune the respiratory knowledge language model; and a new answer is generated based on the fine-tuned respiratory knowledge language model.

[0163] The specific deployment has been described in Example 1.

[0164] Invention point:

[0165] The LoRA technology is used to fine-tune large language models, significantly reducing the demand for computing resources while improving the model's ability to handle respiratory disease problems.

[0166] The dynamically updated knowledge base mechanism ensures the timeliness and accuracy of the system's answers.

[0167] Multi-threaded parallel computing strategy speeds up the response speed of the question-answering system.

[0168] Based on the reinforcement learning feedback optimization mechanism, the quality of the model's answers in professional breathing is continuously optimized through user feedback.

[0169] The present invention significantly improves the performance of the professional respiratory knowledge question-and-answer system, and provides more accurate and real-time medical information support for medical workers, experts and patients. Compared with the existing question-and-answer system, the respiratory knowledge question-and-answer system of the present invention has significant advantages in accuracy, comprehensiveness, interpretability and adaptability, and can provide efficient and reliable respiratory knowledge consulting services for medical professionals, patients and their families, and help diagnose, treat and prevent respiratory diseases.

[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the embodiments, it should be understood by those skilled in the art that any modification or equivalent replacement of the technical solutions of the present invention does not depart from the spirit and scope of the technical solutions of the present invention and should be included in the scope of the claims of the present invention.

Claims

1. An intelligent question-answering method based on a large language model of respiratory knowledge, comprising: Receive the respiratory knowledge-related question text raised by the user and perform preprocessing to obtain a numerical vector; The preprocessed numerical vector is input into the pre-trained large language model of respiratory knowledge, and the answer is generated through reasoning; When there is doubt about the answer, the professional respiratory knowledge base is updated and the respiratory knowledge language model is fine-tuned; a new answer is generated based on the fine-tuned respiratory knowledge language model.

2. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 1 is characterized in that: The respiratory knowledge-related questions include: respiratory disease questions, respiratory health questions and respiratory expertise questions; The pre-processing comprises: The input question text is cleaned, segmented and vectorized in turn; the vectorization of word segmentation satisfies the following formula: Among them, V text Represents the vector representation of text segmentation, n is the number of words in the text, w i is the i-th word, E(w i ) represents word w i The embedding vector of .

3. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 1 is characterized in that: The respiratory knowledge large language model is based on the large language model Qwen-1.8B as the basic model, and adds a respiratory knowledge embedding module. The respiratory knowledge embedding module includes an encoding layer and a domain attention head, which is used to construct a domain word vector through a respiratory knowledge base, and understand and prioritize the special vocabulary and semantic context in the respiratory field through the domain attention head.

4. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 3 is characterized in that: The respiratory knowledge large language model also includes: a respiratory knowledge dynamic adaptation module, a core reasoning module and an answer generation feedback optimization module, wherein: The respiratory knowledge dynamic adaptation module introduces a scene classifier to adjust the model parameter weights according to the input question type and dynamically activate the scene-related knowledge path; and adopts a multi-layer gating mechanism to control the interaction intensity between the basic model and the respiratory domain enhancement module; The core reasoning module is based on an improved Transformer layer, adopts a multi-head attention mechanism, and includes a feedforward network and a layer normalization module; The answer generation feedback optimization module is used to detect errors in the generated preliminary answers, refine the answers through the attention mechanism, and perform secondary optimization.

5. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 1 is characterized in that: The method also includes a step of training a large language model of respiratory knowledge, including: Establish a training set including dynamic data in the respiratory field and professional data of the respiratory system; The training set data is preprocessed in sequence, including text cleaning, text word segmentation processing and word segmentation vectorization, to obtain the text word segmentation vector; The text segmentation vectors of the training set are input into the basic general large language model in sequence, and the hyperparameters including learning rate and batch size are set. The model is trained until the training convergence conditions are met to obtain a trained respiratory knowledge large language model.

6. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 5 is characterized in that: The feature normalization process is performed during the model training to satisfy the following formula: x′=(x-μ) / σ Among them, x is the original eigenvalue, μ is the feature mean, σ is the standard deviation of the feature, and x′ is the normalized eigenvalue; The training convergence condition is: |L t -L t-1 |<ε Among them, L t represents the loss function value of the tth iteration, L t-1 represents the loss function value of the t-1th iteration, and ε is the convergence threshold.

7. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 5 is characterized in that: The dynamic data in the respiratory field include: the latest research results and medical trends in the respiratory field obtained through automatic monitoring; the professional data of the respiratory system include: medical literature, clinical cases and doctor's consultation records.

8. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 3 is characterized in that: The fine-tuning of the respiratory knowledge large language model includes adopting any one of LoRA technology, Adapters or quantization technology; when the LoRA technology is adopted, it includes: adopting a freezing strategy to adjust only the respiratory knowledge embedding module; the fine-tuned respiratory knowledge large language model satisfies the following formula: y′=f(x;W+αΔW) Among them, y′ is the output of the model, f represents the model function, x is the input data, W is the original model weight, α is the adjustment parameter, and ΔW represents the weight update after fine-tuning, satisfying the following formula: ΔW=A×B T Among them, A and B are matrices obtained by low-rank decomposition, respectively representing two low-rank approximate matrices of the weight matrix, and T represents transpose.

9. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 1, characterized in that: The updated professional respiratory knowledge base includes: Among them, S sim (q, d) represents the cosine similarity between the user question text q and the document d of the professional respiratory knowledge base, q i and d i They represent the corresponding numerical vectors after preprocessing, i represents the entry, and n represents the total number.

10. The intelligent question-answering method based on the respiratory knowledge large language model according to claim 1, characterized in that: The method also includes: real-time monitoring and obtaining the latest research results in the respiratory field, and integrating and updating a professional respiratory knowledge base.