Switch to unified view

a/README.md b/README.md
1
<p align="center" width="80%">
1
<p align="center" width="80%">
2
<img src="https://github.com/Kent0n-Li/ChatDoctor/raw/main/fig/logo.png?raw=true" style="width: 40%; min-width: 300px; display: block; margin: auto;">
2
<img src="https://github.com/Kent0n-Li/ChatDoctor/raw/main/fig/logo.png?raw=true" style="width: 40%; min-width: 300px; display: block; margin: auto;">
3
</p>
3
</p>
4
4
5
5
6
# [ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge](https://www.cureus.com/articles/152858-chatdoctor-a-medical-chat-model-fine-tuned-on-a-large-language-model-meta-ai-llama-using-medical-domain-knowledge#!/)
6
# [ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge](https://www.cureus.com/articles/152858-chatdoctor-a-medical-chat-model-fine-tuned-on-a-large-language-model-meta-ai-llama-using-medical-domain-knowledge#!/)
7
Yunxiang Li<sup>1</sup>, Zihan Li<sup>2</sup>, Kai Zhang<sup>3</sup>, Ruilong Dan<sup>4</sup>, Steve Jiang<sup>1</sup>, You Zhang<sup>1</sup>
7
Yunxiang Li<sup>1</sup>, Zihan Li<sup>2</sup>, Kai Zhang<sup>3</sup>, Ruilong Dan<sup>4</sup>, Steve Jiang<sup>1</sup>, You Zhang<sup>1</sup>
8
<h5>1 UT Southwestern Medical Center, USA</h5>
8
<h5>1 UT Southwestern Medical Center, USA</h5>
9
<h5>2 University of Illinois at Urbana-Champaign, USA</h5>
9
<h5>2 University of Illinois at Urbana-Champaign, USA</h5>
10
<h5>3 Ohio State University, USA</h5>
10
<h5>3 Ohio State University, USA</h5>
11
<h5>4 Hangzhou Dianzi University, China</h5>
11
<h5>4 Hangzhou Dianzi University, China</h5>
12
12
13
13
14
[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/HUANGLIZI/ChatDoctor/blob/main/LICENSE) 
14
[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/HUANGLIZI/ChatDoctor/blob/main/LICENSE) 
15
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/release/python-390/) 
15
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/release/python-390/) 
16
[![Page](https://img.shields.io/badge/Web-Page-yellow)](https://www.yunxiangli.top/ChatDoctor/) 
16
[![Page](https://img.shields.io/badge/Web-Page-yellow)](https://www.yunxiangli.top/ChatDoctor/) 
17
## Resources List
17
## Resources List
18
Autonomous ChatDoctor with Disease Database [Demo](https://huggingface.co/spaces/kenton-li/chatdoctor_csv).
18
Autonomous ChatDoctor with Disease Database [Demo](https://huggingface.co/spaces/kenton-li/chatdoctor_csv).
19
19
20
100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https://drive.google.com/file/d/1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt/view?usp=sharing).
20
100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https://drive.google.com/file/d/1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt/view?usp=sharing).
21
21
22
Real conversations between patients and doctors from icliniq.com [icliniq-10k](https://drive.google.com/file/d/1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA/view?usp=sharing).
22
Real conversations between patients and doctors from icliniq.com [icliniq-10k](https://drive.google.com/file/d/1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA/view?usp=sharing).
23
23
24
Checkpoints of ChatDoctor, [link](https://drive.google.com/drive/folders/11-qPzz9ZdHD6pc47wBSOUSU61MaDPyRh?usp=sharing).
24
Checkpoints of ChatDoctor, [link](https://drive.google.com/drive/folders/11-qPzz9ZdHD6pc47wBSOUSU61MaDPyRh?usp=sharing).
25
25
26
Stanford Alpaca data for basic conversational capabilities. [Alpaca link](https://github.com/Kent0n-Li/ChatDoctor/blob/main/alpaca_data.json).
26
Stanford Alpaca data for basic conversational capabilities. [Alpaca link](https://github.com/Kent0n-Li/ChatDoctor/blob/main/alpaca_data.json).
27
27
28
28
29
<p align="center" width="100%">
29
<p align="center" width="100%">
30
<img src="https://github.com/Kent0n-Li/ChatDoctor/blob/main/fig/overview.PNG?raw=true" style="width: 70%; min-width: 300px; display: block; margin: auto;">
30
<img src="https://github.com/Kent0n-Li/ChatDoctor/blob/main/fig/overview.PNG?raw=true" style="width: 70%; min-width: 300px; display: block; margin: auto;">
31
</p>
31
</p>
32
32
33
<p align="center" width="100%">
33
<p align="center" width="100%">
34
<img src="https://github.com/Kent0n-Li/ChatDoctor/raw/main/fig/wiki.PNG?raw=true" style="width: 70%; min-width: 300px; display: block; margin: auto;">
34
<img src="https://github.com/Kent0n-Li/ChatDoctor/raw/main/fig/wiki.PNG?raw=true" style="width: 70%; min-width: 300px; display: block; margin: auto;">
35
</p>
35
</p>
36
36
37
37
38
 ## Setup:
38
 ## Setup:
39
 In a conda env with pytorch available, run:
39
 In a conda env with pytorch available, run:
40
```
40
```
41
pip install -r requirements.txt
41
pip install -r requirements.txt
42
```
42
```
43
43
44
 ## Interactive Demo Page:
44
 ## Interactive Demo Page:
45
Demo Page: https://huggingface.co/spaces/kenton-li/chatdoctor_csv
45
Demo Page: https://huggingface.co/spaces/kenton-li/chatdoctor_csv
46
It is worth noting that our model has not yet achieved 100% accurate output, please do not apply it to real clinical scenarios.
46
It is worth noting that our model has not yet achieved 100% accurate output, please do not apply it to real clinical scenarios.
47
47
48
For those who want to try the online demo, please register for hugging face and fill out this form [link](https://forms.office.com/Pages/ResponsePage.aspx?id=lYZBnaxxMUy1ssGWyOw8ij06Cb8qnDJKvu2bVpV1-ANURUU0TllBWVVHUjQ1MDJUNldGTTZWV1c5UC4u).
48
For those who want to try the online demo, please register for hugging face and fill out this form [link](https://forms.office.com/Pages/ResponsePage.aspx?id=lYZBnaxxMUy1ssGWyOw8ij06Cb8qnDJKvu2bVpV1-ANURUU0TllBWVVHUjQ1MDJUNldGTTZWV1c5UC4u).
49
49
50
 ## Data and model:
50
 ## Data and model:
51
 ### 1. ChatDoctor Dataset:
51
 ### 1. ChatDoctor Dataset:
52
You can download the following training dataset
52
You can download the following training dataset
53
53
54
100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https://drive.google.com/file/d/1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt/view?usp=sharing).
54
100k real conversations between patients and doctors from HealthCareMagic.com [HealthCareMagic-100k](https://drive.google.com/file/d/1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt/view?usp=sharing).
55
55
56
10k real conversations between patients and doctors from icliniq.com [icliniq-10k](https://drive.google.com/file/d/1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA/view?usp=sharing).
56
10k real conversations between patients and doctors from icliniq.com [icliniq-10k](https://drive.google.com/file/d/1ZKbqgYqWc7DJHs3N9TQYQVPdDQmZaClA/view?usp=sharing).
57
57
58
5k generated conversations between patients and physicians from ChatGPT [GenMedGPT-5k](https://drive.google.com/file/d/1nDTKZ3wZbZWTkFMBkxlamrzbNz0frugg/view?usp=sharing) and [disease database](https://github.com/Kent0n-Li/ChatDoctor/blob/main/format_dataset.csv). 
58
5k generated conversations between patients and physicians from ChatGPT [GenMedGPT-5k](https://drive.google.com/file/d/1nDTKZ3wZbZWTkFMBkxlamrzbNz0frugg/view?usp=sharing) and [disease database](https://github.com/Kent0n-Li/ChatDoctor/blob/main/format_dataset.csv). 
59
59
60
Our model was firstly be fine-tuned by Stanford Alpaca's data to have some basic conversational capabilities. [Alpaca link](https://github.com/Kent0n-Li/ChatDoctor/blob/main/alpaca_data.json)
60
Our model was firstly be fine-tuned by Stanford Alpaca's data to have some basic conversational capabilities. [Alpaca link](https://github.com/Kent0n-Li/ChatDoctor/blob/main/alpaca_data.json)
61
61
62
 ### 2. Model Weights:
62
 ### 2. Model Weights:
63
63
64
Place the model weights file in the ./pretrained folder.
64
Place the model weights file in the ./pretrained folder.
65
65
66
 ## How to fine-tuning
66
 ## How to fine-tuning
67
67
68
 ```python
68
 ```python
69
torchrun --nproc_per_node=4 --master_port=<your_random_port> train.py \
69
torchrun --nproc_per_node=4 --master_port=<your_random_port> train.py \
70
    --model_name_or_path <your_path_to_hf_converted_llama_ckpt_and_tokenizer> \
70
    --model_name_or_path <your_path_to_hf_converted_llama_ckpt_and_tokenizer> \
71
    --data_path ./HealthCareMagic-100k.json \
71
    --data_path ./HealthCareMagic-100k.json \
72
    --bf16 True \
72
    --bf16 True \
73
    --output_dir pretrained \
73
    --output_dir pretrained \
74
    --num_train_epochs 1 \
74
    --num_train_epochs 1 \
75
    --per_device_train_batch_size 4 \
75
    --per_device_train_batch_size 4 \
76
    --per_device_eval_batch_size 4 \
76
    --per_device_eval_batch_size 4 \
77
    --gradient_accumulation_steps 8 \
77
    --gradient_accumulation_steps 8 \
78
    --evaluation_strategy "no" \
78
    --evaluation_strategy "no" \
79
    --save_strategy "steps" \
79
    --save_strategy "steps" \
80
    --save_steps 2000 \
80
    --save_steps 2000 \
81
    --save_total_limit 1 \
81
    --save_total_limit 1 \
82
    --learning_rate 2e-6 \
82
    --learning_rate 2e-6 \
83
    --weight_decay 0. \
83
    --weight_decay 0. \
84
    --warmup_ratio 0.03 \
84
    --warmup_ratio 0.03 \
85
    --lr_scheduler_type "cosine" \
85
    --lr_scheduler_type "cosine" \
86
    --logging_steps 1 \
86
    --logging_steps 1 \
87
    --fsdp "full_shard auto_wrap" \
87
    --fsdp "full_shard auto_wrap" \
88
    --fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \
88
    --fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \
89
    --tf32 True
89
    --tf32 True
90
 ```
90
 ```
91
 
91
 
92
 
92
 
93
Fine-tuning with Lora 
93
Fine-tuning with Lora 
94
```python
94
```python
95
WORLD_SIZE=6 CUDA_VISIBLE_DEVICES=0,1,2,3,4,5 torchrun --nproc_per_node=6 --master_port=4567 train_lora.py \
95
WORLD_SIZE=6 CUDA_VISIBLE_DEVICES=0,1,2,3,4,5 torchrun --nproc_per_node=6 --master_port=4567 train_lora.py \
96
  --base_model './weights-alpaca/' \
96
  --base_model './weights-alpaca/' \
97
  --data_path 'HealthCareMagic-100k.json' \
97
  --data_path 'HealthCareMagic-100k.json' \
98
  --output_dir './lora_models/' \
98
  --output_dir './lora_models/' \
99
  --batch_size 32 \
99
  --batch_size 32 \
100
  --micro_batch_size 4 \
100
  --micro_batch_size 4 \
101
  --num_epochs 1 \
101
  --num_epochs 1 \
102
  --learning_rate 3e-5 \
102
  --learning_rate 3e-5 \
103
  --cutoff_len 256 \
103
  --cutoff_len 256 \
104
  --val_set_size 120 \
104
  --val_set_size 120 \
105
  --adapter_name lora
105
  --adapter_name lora
106
 ```
106
 ```
107
 
107
 
108
 ## How to inference
108
 ## How to inference
109
 You can build a ChatDoctor model on your own machine and communicate with it.
109
 You can build a ChatDoctor model on your own machine and communicate with it.
110
 ```python
110
 ```python
111
python chat.py
111
python chat.py
112
 ```
112
 ```
113
 
113
 
114
  ```python
114
  ```python
115
cd Autonomous_ChatDoctor_csv
115
cd Autonomous_ChatDoctor_csv
116
python chat_csv.py
116
python chat_csv.py
117
 ```
117
 ```
118
 
118
 
119
  ```python
119
  ```python
120
cd Autonomous_ChatDoctor_Wikipedia
120
cd Autonomous_ChatDoctor_Wikipedia
121
python chat_wiki.py
121
python chat_wiki.py
122
 ```
122
 ```
123
 
123
 
124
## Examples:
124
## Examples:
125
We fine-tuned our model on HealthCareMagic-100K, and test our model on iCliniq-10k.
125
We fine-tuned our model on HealthCareMagic-100K, and test our model on iCliniq-10k.
126
126
127
```
127
```
128
Patient question from icliniq: Hi doctor,I am getting one-sided headache. I do not get them often. They are behind my right eye and temple area. Now this time I am also fighting with heavy cold and cough. It came on late morning today and it hurts more when I cough or shake my head or bend over. Prior to this, I had the same headache about four months ago. At that time it came on midafternoon and lasted till next morning. Prior to that, I had the same headache exactly on the right side and lasted for a day. I am on CCB and Protonix. I am scared of brain tumor. Please help
128
Patient question from icliniq: Hi doctor,I am getting one-sided headache. I do not get them often. They are behind my right eye and temple area. Now this time I am also fighting with heavy cold and cough. It came on late morning today and it hurts more when I cough or shake my head or bend over. Prior to this, I had the same headache about four months ago. At that time it came on midafternoon and lasted till next morning. Prior to that, I had the same headache exactly on the right side and lasted for a day. I am on CCB and Protonix. I am scared of brain tumor. Please help
129
129
130
Real doctor answer from icliniq: Hi. Based on what you have told, this is more likely to be due to sinusitis. Sinuses are small air filled cavities in your skull bone. They can get infected and when they are infected, you will get headaches behind eyes. Such headaches will be more common during cold and cough. Brain tumor headache will be on both sides, more in forehead and you will also have vomiting in that case. Based on what you have told, this is more likely due to simple sinus infection instead of brain tumor. CT brain and CT paranasal sinuses.
130
Real doctor answer from icliniq: Hi. Based on what you have told, this is more likely to be due to sinusitis. Sinuses are small air filled cavities in your skull bone. They can get infected and when they are infected, you will get headaches behind eyes. Such headaches will be more common during cold and cough. Brain tumor headache will be on both sides, more in forehead and you will also have vomiting in that case. Based on what you have told, this is more likely due to simple sinus infection instead of brain tumor. CT brain and CT paranasal sinuses.
131
131
132
Answer form ChatGPT: Hello! I'm sorry to hear you're experiencing these headaches. Based on the location of the pain, it sounds like it may be a tension headache or a migraine. These types of headaches can sometimes be triggered by colds or other illnesses. However, it's always best to get checked out by your doctor to rule out any other underlying conditions. In terms of a brain tumor, that is a very rare cause of headaches. Most people who experience headaches do not have a brain tumor. That being said, if you have any concerning symptoms such as vision changes, weakness, or numbness, it is important to seek medical attention right away. In the meantime, you can try taking over-the-counter pain relievers such as ibuprofen or acetaminophen to help with the headache. It's also important to get plenty of rest and stay hydrated. If the headaches persist or become more frequent, please make an appointment with your doctor. Take care!
132
Answer form ChatGPT: Hello! I'm sorry to hear you're experiencing these headaches. Based on the location of the pain, it sounds like it may be a tension headache or a migraine. These types of headaches can sometimes be triggered by colds or other illnesses. However, it's always best to get checked out by your doctor to rule out any other underlying conditions. In terms of a brain tumor, that is a very rare cause of headaches. Most people who experience headaches do not have a brain tumor. That being said, if you have any concerning symptoms such as vision changes, weakness, or numbness, it is important to seek medical attention right away. In the meantime, you can try taking over-the-counter pain relievers such as ibuprofen or acetaminophen to help with the headache. It's also important to get plenty of rest and stay hydrated. If the headaches persist or become more frequent, please make an appointment with your doctor. Take care!
133
133
134
Answer form ChatDoctor: Hi, Thank you for posting your query. First, I would like to reassure you that there is no need to worry about brain tumor. Also, we should keep migraine apart as well. The most likely cause of your headaches could be sinusitis. This can be confirmed by doing an X-ray of face. Treatment would consist of using decongestant tablets/ nasal sprays. Best wishes, Chat Doctor.
134
Answer form ChatDoctor: Hi, Thank you for posting your query. First, I would like to reassure you that there is no need to worry about brain tumor. Also, we should keep migraine apart as well. The most likely cause of your headaches could be sinusitis. This can be confirmed by doing an X-ray of face. Treatment would consist of using decongestant tablets/ nasal sprays. Best wishes, Chat Doctor.
135
```
135
```
136
ChatDoctor accurately mentions sinusitis, which is also present in the real conversation in icliniq.
136
ChatDoctor accurately mentions sinusitis, which is also present in the real conversation in icliniq.
137
137
138
138
139
## Overview
139
## Overview
140
ChatDoctor is a next-generation AI doctor model that is based on the [LLaMA](https://github.com/facebookresearch/llama) model. The goal of this project is to provide patients with an intelligent and reliable healthcare companion that can answer their medical queries and provide them with personalized medical advice.
140
ChatDoctor is a next-generation AI doctor model that is based on the [LLaMA](https://github.com/facebookresearch/llama) model. The goal of this project is to provide patients with an intelligent and reliable healthcare companion that can answer their medical queries and provide them with personalized medical advice.
141
141
142
The ChatDoctor is an advanced language model that is specifically designed for medical applications. It has been trained on a large corpus of medical literature and has a deep understanding of medical terminology, procedures, and diagnoses. This model serves as the foundation for ChatDoctor, enabling it to analyze patients' symptoms and medical history, provide accurate diagnoses, and suggest appropriate treatment options.
142
The ChatDoctor is an advanced language model that is specifically designed for medical applications. It has been trained on a large corpus of medical literature and has a deep understanding of medical terminology, procedures, and diagnoses. This model serves as the foundation for ChatDoctor, enabling it to analyze patients' symptoms and medical history, provide accurate diagnoses, and suggest appropriate treatment options.
143
143
144
The ChatDoctor model is designed to simulate a conversation between a doctor and a patient, using natural language processing (NLP) and machine learning techniques. Patients can interact with the ChatDoctor model through a chat interface, asking questions about their health, symptoms, or medical conditions. The model will then analyze the input and provide a response that is tailored to the patient's unique situation.
144
The ChatDoctor model is designed to simulate a conversation between a doctor and a patient, using natural language processing (NLP) and machine learning techniques. Patients can interact with the ChatDoctor model through a chat interface, asking questions about their health, symptoms, or medical conditions. The model will then analyze the input and provide a response that is tailored to the patient's unique situation.
145
145
146
One of the key features of the ChatDoctor model is its ability to learn and adapt over time. As more patients interact with the model, it will continue to refine its responses and improve its accuracy. This means that patients can expect to receive increasingly personalized and accurate medical advice over time.
146
One of the key features of the ChatDoctor model is its ability to learn and adapt over time. As more patients interact with the model, it will continue to refine its responses and improve its accuracy. This means that patients can expect to receive increasingly personalized and accurate medical advice over time.
147
147
148
148
149
 ## Patient-physician Conversation Dataset</h2>
149
 ## Patient-physician Conversation Dataset</h2>
150
The first step in fine-tuning is to collect a dataset of patient-physician conversations. In patient-physician conversations, the patient's descriptions of disease symptoms are often colloquial and cursory. If we manually construct the synthesized patient-physician conversation dataset, it often leads to the problem of insufficient diversity and over-specialized descriptions, which are often spaced out from real scenarios. Collecting real patient-physician conversations is a better solution. Therefore, we collected about 100k real doctor-patient conversations from an online medical consultation website HealthCareMagic(www.healthcaremagic.com). We filtered these data both manually and automatically, removed the identity information of the doctor and patient, and used language tools to correct grammatical errors, and we named this dataset HealthCareMagic-100k. In addition, we collected approximately 10k patient-physician conversations from the online medical consultation website iCliniq to evaluate the performance of our model.
150
The first step in fine-tuning is to collect a dataset of patient-physician conversations. In patient-physician conversations, the patient's descriptions of disease symptoms are often colloquial and cursory. If we manually construct the synthesized patient-physician conversation dataset, it often leads to the problem of insufficient diversity and over-specialized descriptions, which are often spaced out from real scenarios. Collecting real patient-physician conversations is a better solution. Therefore, we collected about 100k real doctor-patient conversations from an online medical consultation website HealthCareMagic(www.healthcaremagic.com). We filtered these data both manually and automatically, removed the identity information of the doctor and patient, and used language tools to correct grammatical errors, and we named this dataset HealthCareMagic-100k. In addition, we collected approximately 10k patient-physician conversations from the online medical consultation website iCliniq to evaluate the performance of our model.
151
151
152
152
153
## Autonomous ChatDoctor based on Knowledge Brain</h2>
153
## Autonomous ChatDoctor based on Knowledge Brain</h2>
154
Equipped with the external knowledge brain, i.e., Wikipedia or our constructed database encompassing over 700 diseases, ChatDoctor could retrieve the corresponding knowledge and reliable sources to answer patients' inquiries more accurately. After constructing the external knowledge brain, we need to let our ChatDoctor retrieve the knowledge he needs autonomously, which can generally be achieved in a large language model by constructing appropriate prompts. To automate this process, we design keyword mining prompts for ChatDoctor to extract key terms for relevant knowledge seeking. Then, the top-ranked relevant passages were retrieved from Knowledge Brain with a term-matching retrieval system. As for the disease database, since the model cannot read all the data at once, we first let the model read the data in batches and select for itself the data entries that might help answer the patient's question. Finally, all the data entries selected by the model are given to the model for a final answer. This approach better ensures that patients receive well-informed and precise responses backed by credible references.
154
Equipped with the external knowledge brain, i.e., Wikipedia or our constructed database encompassing over 700 diseases, ChatDoctor could retrieve the corresponding knowledge and reliable sources to answer patients' inquiries more accurately. After constructing the external knowledge brain, we need to let our ChatDoctor retrieve the knowledge he needs autonomously, which can generally be achieved in a large language model by constructing appropriate prompts. To automate this process, we design keyword mining prompts for ChatDoctor to extract key terms for relevant knowledge seeking. Then, the top-ranked relevant passages were retrieved from Knowledge Brain with a term-matching retrieval system. As for the disease database, since the model cannot read all the data at once, we first let the model read the data in batches and select for itself the data entries that might help answer the patient's question. Finally, all the data entries selected by the model are given to the model for a final answer. This approach better ensures that patients receive well-informed and precise responses backed by credible references.
155
155
156
156
157
157
158
## Limitations
158
## Limitations
159
We emphasize that ChatDoctor is for academic research only and any commercial use and clinical use is prohibited. There are three factors in this decision: First, ChatDoctor is based on LLaMA and has a non-commercial license, so we necessarily inherited this decision. Second, our model is not licensed for healthcare-related purposes. Also, we have not designed sufficient security measures, and the current model still does not guarantee the full correctness of medical diagnoses.
159
We emphasize that ChatDoctor is for academic research only and any commercial use and clinical use is prohibited. There are three factors in this decision: First, ChatDoctor is based on LLaMA and has a non-commercial license, so we necessarily inherited this decision. Second, our model is not licensed for healthcare-related purposes. Also, we have not designed sufficient security measures, and the current model still does not guarantee the full correctness of medical diagnoses.
160
160
161
161
162
162
163
163
164
## Reference
164
## Reference
165
165
166
ChatDoctor: A Medical Chat Model Fine-tuned on LLaMA Model using Medical Domain Knowledge
166
ChatDoctor: A Medical Chat Model Fine-tuned on LLaMA Model using Medical Domain Knowledge
167
167
168
```
168
```
169
@article{li2023chatdoctor,
169
@article{li2023chatdoctor,
170
  title={ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge},
170
  title={ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge},
171
  author={Li, Yunxiang and Li, Zihan and Zhang, Kai and Dan, Ruilong and Jiang, Steve and Zhang, You},
171
  author={Li, Yunxiang and Li, Zihan and Zhang, Kai and Dan, Ruilong and Jiang, Steve and Zhang, You},
172
  journal={Cureus},
172
  journal={Cureus},
173
  volume={15},
173
  volume={15},
174
  number={6},
174
  number={6},
175
  year={2023},
175
  year={2023},
176
  publisher={Cureus}
176
  publisher={Cureus}
177
}
177
}
178
```
178
```
179
179
180
180
181
181
182
182