phosseini commited on
Commit
e20935b
·
1 Parent(s): 5d61750

updating ChatDoctor-data.ipynb

Browse files
Files changed (1) hide show
  1. notebooks/ChatDoctor-data.ipynb +91 -66
notebooks/ChatDoctor-data.ipynb CHANGED
@@ -23,7 +23,9 @@
23
  "outputs": [],
24
  "source": [
25
  "# Reading data from Lavita's Hugging Face\n",
26
- "data_hf_name = \"lavita/ChatDoctor-HealthCareMagic-100k\"\n",
 
 
27
  "dataset = load_dataset(data_hf_name)\n",
28
  "\n",
29
  "# Converting data to pandas DataFrame\n",
@@ -56,112 +58,135 @@
56
  " <thead>\n",
57
  " <tr style=\"text-align: right;\">\n",
58
  " <th></th>\n",
59
- " <th>instruction</th>\n",
60
  " <th>input</th>\n",
61
- " <th>output</th>\n",
 
 
62
  " </tr>\n",
63
  " </thead>\n",
64
  " <tbody>\n",
65
  " <tr>\n",
66
  " <th>0</th>\n",
67
- " <td>If you are a doctor, please answer the medical...</td>\n",
68
- " <td>I woke up this morning feeling the whole room ...</td>\n",
69
- " <td>Hi, Thank you for posting your query. The most...</td>\n",
 
70
  " </tr>\n",
71
  " <tr>\n",
72
  " <th>1</th>\n",
73
- " <td>If you are a doctor, please answer the medical...</td>\n",
74
- " <td>My baby has been pooing 5-6 times a day for a ...</td>\n",
75
- " <td>Hi... Thank you for consulting in Chat Doctor....</td>\n",
 
76
  " </tr>\n",
77
  " <tr>\n",
78
  " <th>2</th>\n",
79
- " <td>If you are a doctor, please answer the medical...</td>\n",
80
- " <td>Hello, My husband is taking Oxycodone due to a...</td>\n",
81
- " <td>Hello, and I hope I can help you today.First, ...</td>\n",
 
82
  " </tr>\n",
83
  " <tr>\n",
84
  " <th>3</th>\n",
85
- " <td>If you are a doctor, please answer the medical...</td>\n",
86
- " <td>lump under left nipple and stomach pain (male)...</td>\n",
87
- " <td>HI. You have two different problems. The lump ...</td>\n",
 
88
  " </tr>\n",
89
  " <tr>\n",
90
  " <th>4</th>\n",
91
- " <td>If you are a doctor, please answer the medical...</td>\n",
92
- " <td>I have a 5 month old baby who is very congeste...</td>\n",
93
- " <td>Thank you for using Chat Doctor. I would sugge...</td>\n",
 
94
  " </tr>\n",
95
  " <tr>\n",
96
  " <th>5</th>\n",
97
- " <td>If you are a doctor, please answer the medical...</td>\n",
98
- " <td>I am F 38 in good shape work out (do triathlon...</td>\n",
99
- " <td>Hi, From history it seems that you might be ha...</td>\n",
 
100
  " </tr>\n",
101
  " <tr>\n",
102
  " <th>6</th>\n",
103
- " <td>If you are a doctor, please answer the medical...</td>\n",
104
- " <td>sir, MY uncle has ILD-Interstitial Lung diseas...</td>\n",
105
- " <td>Thanks for your question on Chat Doctor. I can...</td>\n",
 
106
  " </tr>\n",
107
  " <tr>\n",
108
  " <th>7</th>\n",
109
- " <td>If you are a doctor, please answer the medical...</td>\n",
110
- " <td>my husband was working on a project in the hou...</td>\n",
111
- " <td>Hello. It could be a blood collection due to m...</td>\n",
 
112
  " </tr>\n",
113
  " <tr>\n",
114
  " <th>8</th>\n",
115
- " <td>If you are a doctor, please answer the medical...</td>\n",
116
- " <td>hi my nine year old son had a cough and flu sy...</td>\n",
117
- " <td>Hi, If the symptoms persist that long this sug...</td>\n",
 
118
  " </tr>\n",
119
  " <tr>\n",
120
  " <th>9</th>\n",
121
- " <td>If you are a doctor, please answer the medical...</td>\n",
122
- " <td>gyno problemsfor the past few months, I have b...</td>\n",
123
- " <td>Dear Friend. Welcome to Chat Doctor. I am Chat...</td>\n",
 
124
  " </tr>\n",
125
  " </tbody>\n",
126
  "</table>\n",
127
  "</div>"
128
  ],
129
  "text/plain": [
130
- " instruction \\\n",
131
- "0 If you are a doctor, please answer the medical... \n",
132
- "1 If you are a doctor, please answer the medical... \n",
133
- "2 If you are a doctor, please answer the medical... \n",
134
- "3 If you are a doctor, please answer the medical... \n",
135
- "4 If you are a doctor, please answer the medical... \n",
136
- "5 If you are a doctor, please answer the medical... \n",
137
- "6 If you are a doctor, please answer the medical... \n",
138
- "7 If you are a doctor, please answer the medical... \n",
139
- "8 If you are a doctor, please answer the medical... \n",
140
- "9 If you are a doctor, please answer the medical... \n",
141
- "\n",
142
  " input \\\n",
143
- "0 I woke up this morning feeling the whole room ... \n",
144
- "1 My baby has been pooing 5-6 times a day for a ... \n",
145
- "2 Hello, My husband is taking Oxycodone due to a... \n",
146
- "3 lump under left nipple and stomach pain (male)... \n",
147
- "4 I have a 5 month old baby who is very congeste... \n",
148
- "5 I am F 38 in good shape work out (do triathlon... \n",
149
- "6 sir, MY uncle has ILD-Interstitial Lung diseas... \n",
150
- "7 my husband was working on a project in the hou... \n",
151
- "8 hi my nine year old son had a cough and flu sy... \n",
152
- "9 gyno problemsfor the past few months, I have b... \n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  "\n",
154
- " output \n",
155
- "0 Hi, Thank you for posting your query. The most... \n",
156
- "1 Hi... Thank you for consulting in Chat Doctor.... \n",
157
- "2 Hello, and I hope I can help you today.First, ... \n",
158
- "3 HI. You have two different problems. The lump ... \n",
159
- "4 Thank you for using Chat Doctor. I would sugge... \n",
160
- "5 Hi, From history it seems that you might be ha... \n",
161
- "6 Thanks for your question on Chat Doctor. I can... \n",
162
- "7 Hello. It could be a blood collection due to m... \n",
163
- "8 Hi, If the symptoms persist that long this sug... \n",
164
- "9 Dear Friend. Welcome to Chat Doctor. I am Chat... "
165
  ]
166
  },
167
  "execution_count": 3,
 
23
  "outputs": [],
24
  "source": [
25
  "# Reading data from Lavita's Hugging Face\n",
26
+ "\n",
27
+ "# data_hf_name = \"lavita/ChatDoctor-HealthCareMagic-100k\"\n",
28
+ "data_hf_name = \"lavita/ChatDoctor-iCliniq\"\n",
29
  "dataset = load_dataset(data_hf_name)\n",
30
  "\n",
31
  "# Converting data to pandas DataFrame\n",
 
58
  " <thead>\n",
59
  " <tr style=\"text-align: right;\">\n",
60
  " <th></th>\n",
 
61
  " <th>input</th>\n",
62
+ " <th>answer_icliniq</th>\n",
63
+ " <th>answer_chatgpt</th>\n",
64
+ " <th>answer_chatdoctor</th>\n",
65
  " </tr>\n",
66
  " </thead>\n",
67
  " <tbody>\n",
68
  " <tr>\n",
69
  " <th>0</th>\n",
70
+ " <td>Hello doctor,I had mumps five months ago and a...</td>\n",
71
+ " <td>Hello, Welcome to Chat Doctor forum. I can und...</td>\n",
72
+ " <td>It is possible that you still have an infectio...</td>\n",
73
+ " <td>1) There is no need to worry about reinfection...</td>\n",
74
  " </tr>\n",
75
  " <tr>\n",
76
  " <th>1</th>\n",
77
+ " <td>Hello doctor,I am trying to conceive but my hu...</td>\n",
78
+ " <td>Hello, Wellcome to ChatDoctor. There are few r...</td>\n",
79
+ " <td>Hello! Thank you for reaching out.\\n\\nCocaine ...</td>\n",
80
+ " <td>1) Cocaine use can affect fertility by causing...</td>\n",
81
  " </tr>\n",
82
  " <tr>\n",
83
  " <th>2</th>\n",
84
+ " <td>Hello doctor,I am currently on the Yaz contrac...</td>\n",
85
+ " <td>Hello. The brown discharge should be temporary...</td>\n",
86
+ " <td>Hello! It's not uncommon to experience some ir...</td>\n",
87
+ " <td>1) The brown discharge is due to the hormonal ...</td>\n",
88
  " </tr>\n",
89
  " <tr>\n",
90
  " <th>3</th>\n",
91
+ " <td>Hello doctor,My son aged 13 years has got his ...</td>\n",
92
+ " <td>Hello, Welcome to Chat Doctor forum. I have go...</td>\n",
93
+ " <td>As an AI language model, I am not a doctor and...</td>\n",
94
+ " <td>Hi, welcome to Chat Doctor forum. I understand...</td>\n",
95
  " </tr>\n",
96
  " <tr>\n",
97
  " <th>4</th>\n",
98
+ " <td>Hello doctor,I just got one side of my wisdom ...</td>\n",
99
+ " <td>Hello. The lump is mostly a hard swelling whic...</td>\n",
100
+ " <td>Hello,\\n\\nIt is normal to have some swelling a...</td>\n",
101
+ " <td>Hi, Thanks for your query. It appears that you...</td>\n",
102
  " </tr>\n",
103
  " <tr>\n",
104
  " <th>5</th>\n",
105
+ " <td>Hello doctor,I had deep unprotected sex for th...</td>\n",
106
+ " <td>Hi. Firstly, I want to tell you that the tests...</td>\n",
107
+ " <td>Hello,\\n\\nI understand your concern about poss...</td>\n",
108
+ " <td>Hi, welcome to Chat Doctor forum. As your sex ...</td>\n",
109
  " </tr>\n",
110
  " <tr>\n",
111
  " <th>6</th>\n",
112
+ " <td>Hello doctor,I need advice after my second CT ...</td>\n",
113
+ " <td>Hi. According to guidelines when there is a si...</td>\n",
114
+ " <td>Hello,\\n\\nBased on your CT results, it appears...</td>\n",
115
+ " <td>1) The nodules are probably benign and unlikel...</td>\n",
116
  " </tr>\n",
117
  " <tr>\n",
118
  " <th>7</th>\n",
119
+ " <td>Hi doctor,I had sex for the first time. After ...</td>\n",
120
+ " <td>Hello. As the serum beta hCG levels are less t...</td>\n",
121
+ " <td>There are many possible reasons for late perio...</td>\n",
122
+ " <td>1. The delay in periods is usually due to stre...</td>\n",
123
  " </tr>\n",
124
  " <tr>\n",
125
  " <th>8</th>\n",
126
+ " <td>Hello doctor,My friend aged 30 had two drops o...</td>\n",
127
+ " <td>Hi. I want to assure you not to worry as every...</td>\n",
128
+ " <td>I'm sorry to hear about your friend's situatio...</td>\n",
129
+ " <td>1. The side effects of phenol include irritati...</td>\n",
130
  " </tr>\n",
131
  " <tr>\n",
132
  " <th>9</th>\n",
133
+ " <td>Hello doctor,Some mornings during the week I g...</td>\n",
134
+ " <td>Hello. I understand your concern and would ex...</td>\n",
135
+ " <td>Hello! It's difficult to give a definitive dia...</td>\n",
136
+ " <td>Hi, Welcome to Chat Doctor forum. The symptoms...</td>\n",
137
  " </tr>\n",
138
  " </tbody>\n",
139
  "</table>\n",
140
  "</div>"
141
  ],
142
  "text/plain": [
 
 
 
 
 
 
 
 
 
 
 
 
143
  " input \\\n",
144
+ "0 Hello doctor,I had mumps five months ago and a... \n",
145
+ "1 Hello doctor,I am trying to conceive but my hu... \n",
146
+ "2 Hello doctor,I am currently on the Yaz contrac... \n",
147
+ "3 Hello doctor,My son aged 13 years has got his ... \n",
148
+ "4 Hello doctor,I just got one side of my wisdom ... \n",
149
+ "5 Hello doctor,I had deep unprotected sex for th... \n",
150
+ "6 Hello doctor,I need advice after my second CT ... \n",
151
+ "7 Hi doctor,I had sex for the first time. After ... \n",
152
+ "8 Hello doctor,My friend aged 30 had two drops o... \n",
153
+ "9 Hello doctor,Some mornings during the week I g... \n",
154
+ "\n",
155
+ " answer_icliniq \\\n",
156
+ "0 Hello, Welcome to Chat Doctor forum. I can und... \n",
157
+ "1 Hello, Wellcome to ChatDoctor. There are few r... \n",
158
+ "2 Hello. The brown discharge should be temporary... \n",
159
+ "3 Hello, Welcome to Chat Doctor forum. I have go... \n",
160
+ "4 Hello. The lump is mostly a hard swelling whic... \n",
161
+ "5 Hi. Firstly, I want to tell you that the tests... \n",
162
+ "6 Hi. According to guidelines when there is a si... \n",
163
+ "7 Hello. As the serum beta hCG levels are less t... \n",
164
+ "8 Hi. I want to assure you not to worry as every... \n",
165
+ "9 Hello. I understand your concern and would ex... \n",
166
+ "\n",
167
+ " answer_chatgpt \\\n",
168
+ "0 It is possible that you still have an infectio... \n",
169
+ "1 Hello! Thank you for reaching out.\\n\\nCocaine ... \n",
170
+ "2 Hello! It's not uncommon to experience some ir... \n",
171
+ "3 As an AI language model, I am not a doctor and... \n",
172
+ "4 Hello,\\n\\nIt is normal to have some swelling a... \n",
173
+ "5 Hello,\\n\\nI understand your concern about poss... \n",
174
+ "6 Hello,\\n\\nBased on your CT results, it appears... \n",
175
+ "7 There are many possible reasons for late perio... \n",
176
+ "8 I'm sorry to hear about your friend's situatio... \n",
177
+ "9 Hello! It's difficult to give a definitive dia... \n",
178
  "\n",
179
+ " answer_chatdoctor \n",
180
+ "0 1) There is no need to worry about reinfection... \n",
181
+ "1 1) Cocaine use can affect fertility by causing... \n",
182
+ "2 1) The brown discharge is due to the hormonal ... \n",
183
+ "3 Hi, welcome to Chat Doctor forum. I understand... \n",
184
+ "4 Hi, Thanks for your query. It appears that you... \n",
185
+ "5 Hi, welcome to Chat Doctor forum. As your sex ... \n",
186
+ "6 1) The nodules are probably benign and unlikel... \n",
187
+ "7 1. The delay in periods is usually due to stre... \n",
188
+ "8 1. The side effects of phenol include irritati... \n",
189
+ "9 Hi, Welcome to Chat Doctor forum. The symptoms... "
190
  ]
191
  },
192
  "execution_count": 3,