updating ChatDoctor-data.ipynb
Browse files- 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 |
-
"
|
|
|
|
|
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>
|
|
|
|
|
62 |
" </tr>\n",
|
63 |
" </thead>\n",
|
64 |
" <tbody>\n",
|
65 |
" <tr>\n",
|
66 |
" <th>0</th>\n",
|
67 |
-
" <td>
|
68 |
-
" <td>
|
69 |
-
" <td>
|
|
|
70 |
" </tr>\n",
|
71 |
" <tr>\n",
|
72 |
" <th>1</th>\n",
|
73 |
-
" <td>
|
74 |
-
" <td>
|
75 |
-
" <td>
|
|
|
76 |
" </tr>\n",
|
77 |
" <tr>\n",
|
78 |
" <th>2</th>\n",
|
79 |
-
" <td>
|
80 |
-
" <td>Hello
|
81 |
-
" <td>Hello
|
|
|
82 |
" </tr>\n",
|
83 |
" <tr>\n",
|
84 |
" <th>3</th>\n",
|
85 |
-
" <td>
|
86 |
-
" <td>
|
87 |
-
" <td>
|
|
|
88 |
" </tr>\n",
|
89 |
" <tr>\n",
|
90 |
" <th>4</th>\n",
|
91 |
-
" <td>
|
92 |
-
" <td>
|
93 |
-
" <td>
|
|
|
94 |
" </tr>\n",
|
95 |
" <tr>\n",
|
96 |
" <th>5</th>\n",
|
97 |
-
" <td>
|
98 |
-
" <td>
|
99 |
-
" <td>
|
|
|
100 |
" </tr>\n",
|
101 |
" <tr>\n",
|
102 |
" <th>6</th>\n",
|
103 |
-
" <td>
|
104 |
-
" <td>
|
105 |
-
" <td>
|
|
|
106 |
" </tr>\n",
|
107 |
" <tr>\n",
|
108 |
" <th>7</th>\n",
|
109 |
-
" <td>
|
110 |
-
" <td>
|
111 |
-
" <td>
|
|
|
112 |
" </tr>\n",
|
113 |
" <tr>\n",
|
114 |
" <th>8</th>\n",
|
115 |
-
" <td>
|
116 |
-
" <td>
|
117 |
-
" <td>
|
|
|
118 |
" </tr>\n",
|
119 |
" <tr>\n",
|
120 |
" <th>9</th>\n",
|
121 |
-
" <td>
|
122 |
-
" <td>
|
123 |
-
" <td>
|
|
|
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
|
144 |
-
"1
|
145 |
-
"2 Hello,
|
146 |
-
"3
|
147 |
-
"4 I
|
148 |
-
"5 I
|
149 |
-
"6
|
150 |
-
"7
|
151 |
-
"8
|
152 |
-
"9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
"\n",
|
154 |
-
"
|
155 |
-
"0
|
156 |
-
"1
|
157 |
-
"2
|
158 |
-
"3
|
159 |
-
"4
|
160 |
-
"5 Hi,
|
161 |
-
"6
|
162 |
-
"7
|
163 |
-
"8
|
164 |
-
"9
|
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,
|