Update README.md
Browse files
README.md
CHANGED
@@ -1,202 +1,102 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
|
|
|
|
9 |
|
|
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
-
|
37 |
|
38 |
-
|
39 |
|
40 |
-
###
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
|
46 |
-
###
|
|
|
|
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
###
|
|
|
|
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
200 |
-
### Framework versions
|
201 |
-
|
202 |
-
- PEFT 0.13.0
|
|
|
1 |
---
|
2 |
+
datasets:
|
3 |
+
- medic/diseaseJson.json
|
4 |
+
- medic/medicinesJson.json
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
pipeline_tag: conversational
|
8 |
+
tags:
|
9 |
+
- medical
|
10 |
---
|
11 |
+
# [Medic AI: A Medical Chat Model Fine-tuned on LLaMA 3.2 Model using Medical Domain Knowledge]
|
12 |
+
## BY TEAM PHOENIX
|
13 |
+
<h5>1. Mayur Jadhav 2. Ameya Kalgutkar 3. Pratham Gupta</h5>
|
14 |
|
15 |
+
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/release/python-390/)
|
16 |
|
17 |
+
## News
|
18 |
+
We uploaded both datasets on Drive, [MEDIC](https://drive.google.com/drive/folders/1XGu6hJOu3UDlIjeDBii4VRThOplNLcW_?usp=drive_link)
|
19 |
+
mail us on ([email protected]) for access.
|
20 |
|
21 |
+
## Overview
|
22 |
+
MedicAI is a next-generation AI doctor model that is based on the [LLaMA](https://huggingface.co/meta-llama/Llama-3.2-1B) 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.
|
23 |
|
24 |
+
The MedicAI 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 MedicAI, enabling it to analyze patients' symptoms and medical history, provide accurate diagnoses, and suggest appropriate treatment options.
|
25 |
|
26 |
+
The MedicAI 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 MedicAI 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.
|
27 |
|
28 |
+
One of the key features of the MedicAI 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.
|
29 |
|
|
|
30 |
|
31 |
+
## Inference:
|
32 |
+
use this Colab, run:
|
33 |
+
(https://colab.research.google.com/drive/1VYOdBSokimxUKFjJipPk3kSX3Ov3Xy49?usp=sharing)
|
34 |
|
35 |
|
36 |
+
## Examples:
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
Below are some example that describes the medical conversational task.
|
39 |
+
```
|
40 |
+
### Patient: I've been experiencing a burning sensation in my chest and a sour taste in my mouth. What could be causing these symptoms?
|
41 |
+
|
42 |
+
### Medic: These symptoms are likely due to gastroesophageal reflux disease (GERD) or acidity. It is characterized by the backflow of acidic stomach contents into the esophagus.
|
43 |
|
44 |
+
### Patient: What usually causes acidity? I don't always eat spicy food, but it still happens.
|
45 |
|
46 |
+
### Medic: It can be caused by factors like eating spicy food, acidic drinks, and certain medications, and even it can happen without any known triggers.
|
|
|
|
|
47 |
|
48 |
+
### Patient: How can I prevent acidity from happening?
|
49 |
|
50 |
+
### Medic: To reduce acidity, limit dairy and sugar intake, and consume alkaline-rich foods.
|
51 |
|
52 |
+
### Patient:Are there any home remedies that might help?
|
53 |
|
54 |
+
### Medic: Honey and lemon can be beneficial, but consult a healthcare provider for personalized advice.
|
55 |
|
56 |
+
### Patient: Can I take any over-the-counter medicines for this?
|
57 |
|
58 |
+
### Medic: Omeprazole is often used to manage indigestion and heartburn. You may also want to consider taking ginger, which can aid digestion.
|
59 |
+
```
|
60 |
+
|
61 |
|
62 |
+
## Data and model:
|
63 |
+
### 1. Medic Training Dataset:
|
64 |
+
You can download the following training dataset
|
65 |
+
1. Data Scraped from Web : (https://drive.google.com/drive/folders/1XGu6hJOu3UDlIjeDBii4VRThOplNLcW_?usp=drive_link)
|
66 |
+
For scraping engine refer (https://github.com/m-spunky/medic/tree/main/_MedicChatbot/scraper_engine)
|
67 |
|
68 |
+
2. Curated Dataset : (https://drive.google.com/file/d/1lyfqIwlLSClhgrCutWuEe_IACNq6XNUt/view)
|
69 |
+
|
70 |
+
### 2. Model Weights:
|
71 |
+
You can download the following model weights .bin file:
|
72 |
+
Medic Version 1.0: available on huggingface
|
73 |
|
74 |
+
### 3. Model Preparation & Fine Tuning:
|
75 |
+
Follow process of below Colab:
|
76 |
+
(https://colab.research.google.com/drive/1YkCdco1XTSTtcTmQUCws1mHE_Y0kCfb-?usp=sharing)
|
77 |
|
78 |
+
## Hyperparameters
|
79 |
+
```python
|
80 |
+
args = TrainingArguments(
|
81 |
+
per_device_train_batch_size = 2,
|
82 |
+
gradient_accumulation_steps = 4,
|
83 |
+
warmup_steps = 5,
|
84 |
+
# num_train_epochs = 1,
|
85 |
+
max_steps = 60,
|
86 |
+
learning_rate = 2e-4,
|
87 |
+
fp16 = not is_bfloat16_supported(),
|
88 |
+
bf16 = is_bfloat16_supported(),
|
89 |
+
logging_steps = 1,
|
90 |
+
optim = "adamw_8bit",
|
91 |
+
weight_decay = 0.01,
|
92 |
+
lr_scheduler_type = "linear",
|
93 |
+
seed = 3407,
|
94 |
+
output_dir = "outputs",
|
95 |
+
)
|
96 |
+
```
|
97 |
+
|
98 |
|
99 |
+
## Reference
|
100 |
|
101 |
+
github : (https://github.com/m-spunky/medic/)
|
102 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|