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
"nbformat_minor": 0,
|
4 |
+
"metadata": {
|
5 |
+
"colab": {
|
6 |
+
"provenance": [],
|
7 |
+
"authorship_tag": "ABX9TyPaTngDRH7QvNA12q2tWsuc",
|
8 |
+
"include_colab_link": true
|
9 |
+
},
|
10 |
+
"kernelspec": {
|
11 |
+
"name": "python3",
|
12 |
+
"display_name": "Python 3"
|
13 |
+
},
|
14 |
+
"language_info": {
|
15 |
+
"name": "python"
|
16 |
+
},
|
17 |
+
"widgets": {
|
18 |
+
"application/vnd.jupyter.widget-state+json": {
|
19 |
+
"4bb1e341a77d41c9aca0e6680911fb43": {
|
20 |
+
"model_module": "@jupyter-widgets/controls",
|
21 |
+
"model_name": "HBoxModel",
|
22 |
+
"model_module_version": "1.5.0",
|
23 |
+
"state": {
|
24 |
+
"_dom_classes": [],
|
25 |
+
"_model_module": "@jupyter-widgets/controls",
|
26 |
+
"_model_module_version": "1.5.0",
|
27 |
+
"_model_name": "HBoxModel",
|
28 |
+
"_view_count": null,
|
29 |
+
"_view_module": "@jupyter-widgets/controls",
|
30 |
+
"_view_module_version": "1.5.0",
|
31 |
+
"_view_name": "HBoxView",
|
32 |
+
"box_style": "",
|
33 |
+
"children": [
|
34 |
+
"IPY_MODEL_1d1faa15f5564b68b948eaffa58626b3",
|
35 |
+
"IPY_MODEL_df22a67ae80b4673b708eea74646be61",
|
36 |
+
"IPY_MODEL_3657dc19b6ac477b9f05bb6519271473"
|
37 |
+
],
|
38 |
+
"layout": "IPY_MODEL_9045e402f0344428acc085d63df7ff03"
|
39 |
+
}
|
40 |
+
},
|
41 |
+
"1d1faa15f5564b68b948eaffa58626b3": {
|
42 |
+
"model_module": "@jupyter-widgets/controls",
|
43 |
+
"model_name": "HTMLModel",
|
44 |
+
"model_module_version": "1.5.0",
|
45 |
+
"state": {
|
46 |
+
"_dom_classes": [],
|
47 |
+
"_model_module": "@jupyter-widgets/controls",
|
48 |
+
"_model_module_version": "1.5.0",
|
49 |
+
"_model_name": "HTMLModel",
|
50 |
+
"_view_count": null,
|
51 |
+
"_view_module": "@jupyter-widgets/controls",
|
52 |
+
"_view_module_version": "1.5.0",
|
53 |
+
"_view_name": "HTMLView",
|
54 |
+
"description": "",
|
55 |
+
"description_tooltip": null,
|
56 |
+
"layout": "IPY_MODEL_f57a9ac0d924408fbaaac795c172862e",
|
57 |
+
"placeholder": "β",
|
58 |
+
"style": "IPY_MODEL_4cb8ba074b254e91b8877cc87ae0d279",
|
59 |
+
"value": "Parsing nodes: 100%"
|
60 |
+
}
|
61 |
+
},
|
62 |
+
"df22a67ae80b4673b708eea74646be61": {
|
63 |
+
"model_module": "@jupyter-widgets/controls",
|
64 |
+
"model_name": "FloatProgressModel",
|
65 |
+
"model_module_version": "1.5.0",
|
66 |
+
"state": {
|
67 |
+
"_dom_classes": [],
|
68 |
+
"_model_module": "@jupyter-widgets/controls",
|
69 |
+
"_model_module_version": "1.5.0",
|
70 |
+
"_model_name": "FloatProgressModel",
|
71 |
+
"_view_count": null,
|
72 |
+
"_view_module": "@jupyter-widgets/controls",
|
73 |
+
"_view_module_version": "1.5.0",
|
74 |
+
"_view_name": "ProgressView",
|
75 |
+
"bar_style": "success",
|
76 |
+
"description": "",
|
77 |
+
"description_tooltip": null,
|
78 |
+
"layout": "IPY_MODEL_cbd3e1411b2c4eeb943243c9d45245c4",
|
79 |
+
"max": 14,
|
80 |
+
"min": 0,
|
81 |
+
"orientation": "horizontal",
|
82 |
+
"style": "IPY_MODEL_04af736f84044e37aa6599aa708a77bc",
|
83 |
+
"value": 14
|
84 |
+
}
|
85 |
+
},
|
86 |
+
"3657dc19b6ac477b9f05bb6519271473": {
|
87 |
+
"model_module": "@jupyter-widgets/controls",
|
88 |
+
"model_name": "HTMLModel",
|
89 |
+
"model_module_version": "1.5.0",
|
90 |
+
"state": {
|
91 |
+
"_dom_classes": [],
|
92 |
+
"_model_module": "@jupyter-widgets/controls",
|
93 |
+
"_model_module_version": "1.5.0",
|
94 |
+
"_model_name": "HTMLModel",
|
95 |
+
"_view_count": null,
|
96 |
+
"_view_module": "@jupyter-widgets/controls",
|
97 |
+
"_view_module_version": "1.5.0",
|
98 |
+
"_view_name": "HTMLView",
|
99 |
+
"description": "",
|
100 |
+
"description_tooltip": null,
|
101 |
+
"layout": "IPY_MODEL_8d35ab8c65ba47e1be446b98f0942ac4",
|
102 |
+
"placeholder": "β",
|
103 |
+
"style": "IPY_MODEL_75e40756175f463e874630f229ef4066",
|
104 |
+
"value": " 14/14 [00:01<00:00, 10.94it/s]"
|
105 |
+
}
|
106 |
+
},
|
107 |
+
"9045e402f0344428acc085d63df7ff03": {
|
108 |
+
"model_module": "@jupyter-widgets/base",
|
109 |
+
"model_name": "LayoutModel",
|
110 |
+
"model_module_version": "1.2.0",
|
111 |
+
"state": {
|
112 |
+
"_model_module": "@jupyter-widgets/base",
|
113 |
+
"_model_module_version": "1.2.0",
|
114 |
+
"_model_name": "LayoutModel",
|
115 |
+
"_view_count": null,
|
116 |
+
"_view_module": "@jupyter-widgets/base",
|
117 |
+
"_view_module_version": "1.2.0",
|
118 |
+
"_view_name": "LayoutView",
|
119 |
+
"align_content": null,
|
120 |
+
"align_items": null,
|
121 |
+
"align_self": null,
|
122 |
+
"border": null,
|
123 |
+
"bottom": null,
|
124 |
+
"display": null,
|
125 |
+
"flex": null,
|
126 |
+
"flex_flow": null,
|
127 |
+
"grid_area": null,
|
128 |
+
"grid_auto_columns": null,
|
129 |
+
"grid_auto_flow": null,
|
130 |
+
"grid_auto_rows": null,
|
131 |
+
"grid_column": null,
|
132 |
+
"grid_gap": null,
|
133 |
+
"grid_row": null,
|
134 |
+
"grid_template_areas": null,
|
135 |
+
"grid_template_columns": null,
|
136 |
+
"grid_template_rows": null,
|
137 |
+
"height": null,
|
138 |
+
"justify_content": null,
|
139 |
+
"justify_items": null,
|
140 |
+
"left": null,
|
141 |
+
"margin": null,
|
142 |
+
"max_height": null,
|
143 |
+
"max_width": null,
|
144 |
+
"min_height": null,
|
145 |
+
"min_width": null,
|
146 |
+
"object_fit": null,
|
147 |
+
"object_position": null,
|
148 |
+
"order": null,
|
149 |
+
"overflow": null,
|
150 |
+
"overflow_x": null,
|
151 |
+
"overflow_y": null,
|
152 |
+
"padding": null,
|
153 |
+
"right": null,
|
154 |
+
"top": null,
|
155 |
+
"visibility": null,
|
156 |
+
"width": null
|
157 |
+
}
|
158 |
+
},
|
159 |
+
"f57a9ac0d924408fbaaac795c172862e": {
|
160 |
+
"model_module": "@jupyter-widgets/base",
|
161 |
+
"model_name": "LayoutModel",
|
162 |
+
"model_module_version": "1.2.0",
|
163 |
+
"state": {
|
164 |
+
"_model_module": "@jupyter-widgets/base",
|
165 |
+
"_model_module_version": "1.2.0",
|
166 |
+
"_model_name": "LayoutModel",
|
167 |
+
"_view_count": null,
|
168 |
+
"_view_module": "@jupyter-widgets/base",
|
169 |
+
"_view_module_version": "1.2.0",
|
170 |
+
"_view_name": "LayoutView",
|
171 |
+
"align_content": null,
|
172 |
+
"align_items": null,
|
173 |
+
"align_self": null,
|
174 |
+
"border": null,
|
175 |
+
"bottom": null,
|
176 |
+
"display": null,
|
177 |
+
"flex": null,
|
178 |
+
"flex_flow": null,
|
179 |
+
"grid_area": null,
|
180 |
+
"grid_auto_columns": null,
|
181 |
+
"grid_auto_flow": null,
|
182 |
+
"grid_auto_rows": null,
|
183 |
+
"grid_column": null,
|
184 |
+
"grid_gap": null,
|
185 |
+
"grid_row": null,
|
186 |
+
"grid_template_areas": null,
|
187 |
+
"grid_template_columns": null,
|
188 |
+
"grid_template_rows": null,
|
189 |
+
"height": null,
|
190 |
+
"justify_content": null,
|
191 |
+
"justify_items": null,
|
192 |
+
"left": null,
|
193 |
+
"margin": null,
|
194 |
+
"max_height": null,
|
195 |
+
"max_width": null,
|
196 |
+
"min_height": null,
|
197 |
+
"min_width": null,
|
198 |
+
"object_fit": null,
|
199 |
+
"object_position": null,
|
200 |
+
"order": null,
|
201 |
+
"overflow": null,
|
202 |
+
"overflow_x": null,
|
203 |
+
"overflow_y": null,
|
204 |
+
"padding": null,
|
205 |
+
"right": null,
|
206 |
+
"top": null,
|
207 |
+
"visibility": null,
|
208 |
+
"width": null
|
209 |
+
}
|
210 |
+
},
|
211 |
+
"4cb8ba074b254e91b8877cc87ae0d279": {
|
212 |
+
"model_module": "@jupyter-widgets/controls",
|
213 |
+
"model_name": "DescriptionStyleModel",
|
214 |
+
"model_module_version": "1.5.0",
|
215 |
+
"state": {
|
216 |
+
"_model_module": "@jupyter-widgets/controls",
|
217 |
+
"_model_module_version": "1.5.0",
|
218 |
+
"_model_name": "DescriptionStyleModel",
|
219 |
+
"_view_count": null,
|
220 |
+
"_view_module": "@jupyter-widgets/base",
|
221 |
+
"_view_module_version": "1.2.0",
|
222 |
+
"_view_name": "StyleView",
|
223 |
+
"description_width": ""
|
224 |
+
}
|
225 |
+
},
|
226 |
+
"cbd3e1411b2c4eeb943243c9d45245c4": {
|
227 |
+
"model_module": "@jupyter-widgets/base",
|
228 |
+
"model_name": "LayoutModel",
|
229 |
+
"model_module_version": "1.2.0",
|
230 |
+
"state": {
|
231 |
+
"_model_module": "@jupyter-widgets/base",
|
232 |
+
"_model_module_version": "1.2.0",
|
233 |
+
"_model_name": "LayoutModel",
|
234 |
+
"_view_count": null,
|
235 |
+
"_view_module": "@jupyter-widgets/base",
|
236 |
+
"_view_module_version": "1.2.0",
|
237 |
+
"_view_name": "LayoutView",
|
238 |
+
"align_content": null,
|
239 |
+
"align_items": null,
|
240 |
+
"align_self": null,
|
241 |
+
"border": null,
|
242 |
+
"bottom": null,
|
243 |
+
"display": null,
|
244 |
+
"flex": null,
|
245 |
+
"flex_flow": null,
|
246 |
+
"grid_area": null,
|
247 |
+
"grid_auto_columns": null,
|
248 |
+
"grid_auto_flow": null,
|
249 |
+
"grid_auto_rows": null,
|
250 |
+
"grid_column": null,
|
251 |
+
"grid_gap": null,
|
252 |
+
"grid_row": null,
|
253 |
+
"grid_template_areas": null,
|
254 |
+
"grid_template_columns": null,
|
255 |
+
"grid_template_rows": null,
|
256 |
+
"height": null,
|
257 |
+
"justify_content": null,
|
258 |
+
"justify_items": null,
|
259 |
+
"left": null,
|
260 |
+
"margin": null,
|
261 |
+
"max_height": null,
|
262 |
+
"max_width": null,
|
263 |
+
"min_height": null,
|
264 |
+
"min_width": null,
|
265 |
+
"object_fit": null,
|
266 |
+
"object_position": null,
|
267 |
+
"order": null,
|
268 |
+
"overflow": null,
|
269 |
+
"overflow_x": null,
|
270 |
+
"overflow_y": null,
|
271 |
+
"padding": null,
|
272 |
+
"right": null,
|
273 |
+
"top": null,
|
274 |
+
"visibility": null,
|
275 |
+
"width": null
|
276 |
+
}
|
277 |
+
},
|
278 |
+
"04af736f84044e37aa6599aa708a77bc": {
|
279 |
+
"model_module": "@jupyter-widgets/controls",
|
280 |
+
"model_name": "ProgressStyleModel",
|
281 |
+
"model_module_version": "1.5.0",
|
282 |
+
"state": {
|
283 |
+
"_model_module": "@jupyter-widgets/controls",
|
284 |
+
"_model_module_version": "1.5.0",
|
285 |
+
"_model_name": "ProgressStyleModel",
|
286 |
+
"_view_count": null,
|
287 |
+
"_view_module": "@jupyter-widgets/base",
|
288 |
+
"_view_module_version": "1.2.0",
|
289 |
+
"_view_name": "StyleView",
|
290 |
+
"bar_color": null,
|
291 |
+
"description_width": ""
|
292 |
+
}
|
293 |
+
},
|
294 |
+
"8d35ab8c65ba47e1be446b98f0942ac4": {
|
295 |
+
"model_module": "@jupyter-widgets/base",
|
296 |
+
"model_name": "LayoutModel",
|
297 |
+
"model_module_version": "1.2.0",
|
298 |
+
"state": {
|
299 |
+
"_model_module": "@jupyter-widgets/base",
|
300 |
+
"_model_module_version": "1.2.0",
|
301 |
+
"_model_name": "LayoutModel",
|
302 |
+
"_view_count": null,
|
303 |
+
"_view_module": "@jupyter-widgets/base",
|
304 |
+
"_view_module_version": "1.2.0",
|
305 |
+
"_view_name": "LayoutView",
|
306 |
+
"align_content": null,
|
307 |
+
"align_items": null,
|
308 |
+
"align_self": null,
|
309 |
+
"border": null,
|
310 |
+
"bottom": null,
|
311 |
+
"display": null,
|
312 |
+
"flex": null,
|
313 |
+
"flex_flow": null,
|
314 |
+
"grid_area": null,
|
315 |
+
"grid_auto_columns": null,
|
316 |
+
"grid_auto_flow": null,
|
317 |
+
"grid_auto_rows": null,
|
318 |
+
"grid_column": null,
|
319 |
+
"grid_gap": null,
|
320 |
+
"grid_row": null,
|
321 |
+
"grid_template_areas": null,
|
322 |
+
"grid_template_columns": null,
|
323 |
+
"grid_template_rows": null,
|
324 |
+
"height": null,
|
325 |
+
"justify_content": null,
|
326 |
+
"justify_items": null,
|
327 |
+
"left": null,
|
328 |
+
"margin": null,
|
329 |
+
"max_height": null,
|
330 |
+
"max_width": null,
|
331 |
+
"min_height": null,
|
332 |
+
"min_width": null,
|
333 |
+
"object_fit": null,
|
334 |
+
"object_position": null,
|
335 |
+
"order": null,
|
336 |
+
"overflow": null,
|
337 |
+
"overflow_x": null,
|
338 |
+
"overflow_y": null,
|
339 |
+
"padding": null,
|
340 |
+
"right": null,
|
341 |
+
"top": null,
|
342 |
+
"visibility": null,
|
343 |
+
"width": null
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"75e40756175f463e874630f229ef4066": {
|
347 |
+
"model_module": "@jupyter-widgets/controls",
|
348 |
+
"model_name": "DescriptionStyleModel",
|
349 |
+
"model_module_version": "1.5.0",
|
350 |
+
"state": {
|
351 |
+
"_model_module": "@jupyter-widgets/controls",
|
352 |
+
"_model_module_version": "1.5.0",
|
353 |
+
"_model_name": "DescriptionStyleModel",
|
354 |
+
"_view_count": null,
|
355 |
+
"_view_module": "@jupyter-widgets/base",
|
356 |
+
"_view_module_version": "1.2.0",
|
357 |
+
"_view_name": "StyleView",
|
358 |
+
"description_width": ""
|
359 |
+
}
|
360 |
+
},
|
361 |
+
"a0dd5f2c99b2407f9f5705587976ae76": {
|
362 |
+
"model_module": "@jupyter-widgets/controls",
|
363 |
+
"model_name": "HBoxModel",
|
364 |
+
"model_module_version": "1.5.0",
|
365 |
+
"state": {
|
366 |
+
"_dom_classes": [],
|
367 |
+
"_model_module": "@jupyter-widgets/controls",
|
368 |
+
"_model_module_version": "1.5.0",
|
369 |
+
"_model_name": "HBoxModel",
|
370 |
+
"_view_count": null,
|
371 |
+
"_view_module": "@jupyter-widgets/controls",
|
372 |
+
"_view_module_version": "1.5.0",
|
373 |
+
"_view_name": "HBoxView",
|
374 |
+
"box_style": "",
|
375 |
+
"children": [
|
376 |
+
"IPY_MODEL_8728ca516bd0474586b19e0c9b457499",
|
377 |
+
"IPY_MODEL_aac433a9a64c48dfb18d7a01f64d3b27",
|
378 |
+
"IPY_MODEL_4802a63f700e48fca16b5d89fbab333d"
|
379 |
+
],
|
380 |
+
"layout": "IPY_MODEL_3f55aef52aee4e77864d53e3197c3cc3"
|
381 |
+
}
|
382 |
+
},
|
383 |
+
"8728ca516bd0474586b19e0c9b457499": {
|
384 |
+
"model_module": "@jupyter-widgets/controls",
|
385 |
+
"model_name": "HTMLModel",
|
386 |
+
"model_module_version": "1.5.0",
|
387 |
+
"state": {
|
388 |
+
"_dom_classes": [],
|
389 |
+
"_model_module": "@jupyter-widgets/controls",
|
390 |
+
"_model_module_version": "1.5.0",
|
391 |
+
"_model_name": "HTMLModel",
|
392 |
+
"_view_count": null,
|
393 |
+
"_view_module": "@jupyter-widgets/controls",
|
394 |
+
"_view_module_version": "1.5.0",
|
395 |
+
"_view_name": "HTMLView",
|
396 |
+
"description": "",
|
397 |
+
"description_tooltip": null,
|
398 |
+
"layout": "IPY_MODEL_f41df4b6ab4c4132b0d20232002f0294",
|
399 |
+
"placeholder": "β",
|
400 |
+
"style": "IPY_MODEL_3a621edd23354ea5924189885c97dee4",
|
401 |
+
"value": "Generating embeddings: 100%"
|
402 |
+
}
|
403 |
+
},
|
404 |
+
"aac433a9a64c48dfb18d7a01f64d3b27": {
|
405 |
+
"model_module": "@jupyter-widgets/controls",
|
406 |
+
"model_name": "FloatProgressModel",
|
407 |
+
"model_module_version": "1.5.0",
|
408 |
+
"state": {
|
409 |
+
"_dom_classes": [],
|
410 |
+
"_model_module": "@jupyter-widgets/controls",
|
411 |
+
"_model_module_version": "1.5.0",
|
412 |
+
"_model_name": "FloatProgressModel",
|
413 |
+
"_view_count": null,
|
414 |
+
"_view_module": "@jupyter-widgets/controls",
|
415 |
+
"_view_module_version": "1.5.0",
|
416 |
+
"_view_name": "ProgressView",
|
417 |
+
"bar_style": "success",
|
418 |
+
"description": "",
|
419 |
+
"description_tooltip": null,
|
420 |
+
"layout": "IPY_MODEL_73d34cae940e4748a7b3127351925e65",
|
421 |
+
"max": 108,
|
422 |
+
"min": 0,
|
423 |
+
"orientation": "horizontal",
|
424 |
+
"style": "IPY_MODEL_2dc4a6c935ac4ef38ed9030608bd4b2f",
|
425 |
+
"value": 108
|
426 |
+
}
|
427 |
+
},
|
428 |
+
"4802a63f700e48fca16b5d89fbab333d": {
|
429 |
+
"model_module": "@jupyter-widgets/controls",
|
430 |
+
"model_name": "HTMLModel",
|
431 |
+
"model_module_version": "1.5.0",
|
432 |
+
"state": {
|
433 |
+
"_dom_classes": [],
|
434 |
+
"_model_module": "@jupyter-widgets/controls",
|
435 |
+
"_model_module_version": "1.5.0",
|
436 |
+
"_model_name": "HTMLModel",
|
437 |
+
"_view_count": null,
|
438 |
+
"_view_module": "@jupyter-widgets/controls",
|
439 |
+
"_view_module_version": "1.5.0",
|
440 |
+
"_view_name": "HTMLView",
|
441 |
+
"description": "",
|
442 |
+
"description_tooltip": null,
|
443 |
+
"layout": "IPY_MODEL_4fcebf4a9ef54729889cc6ad4cbe5d10",
|
444 |
+
"placeholder": "β",
|
445 |
+
"style": "IPY_MODEL_195aa202b03a42a3a674e9da2f13d878",
|
446 |
+
"value": " 108/108 [00:07<00:00, 10.36it/s]"
|
447 |
+
}
|
448 |
+
},
|
449 |
+
"3f55aef52aee4e77864d53e3197c3cc3": {
|
450 |
+
"model_module": "@jupyter-widgets/base",
|
451 |
+
"model_name": "LayoutModel",
|
452 |
+
"model_module_version": "1.2.0",
|
453 |
+
"state": {
|
454 |
+
"_model_module": "@jupyter-widgets/base",
|
455 |
+
"_model_module_version": "1.2.0",
|
456 |
+
"_model_name": "LayoutModel",
|
457 |
+
"_view_count": null,
|
458 |
+
"_view_module": "@jupyter-widgets/base",
|
459 |
+
"_view_module_version": "1.2.0",
|
460 |
+
"_view_name": "LayoutView",
|
461 |
+
"align_content": null,
|
462 |
+
"align_items": null,
|
463 |
+
"align_self": null,
|
464 |
+
"border": null,
|
465 |
+
"bottom": null,
|
466 |
+
"display": null,
|
467 |
+
"flex": null,
|
468 |
+
"flex_flow": null,
|
469 |
+
"grid_area": null,
|
470 |
+
"grid_auto_columns": null,
|
471 |
+
"grid_auto_flow": null,
|
472 |
+
"grid_auto_rows": null,
|
473 |
+
"grid_column": null,
|
474 |
+
"grid_gap": null,
|
475 |
+
"grid_row": null,
|
476 |
+
"grid_template_areas": null,
|
477 |
+
"grid_template_columns": null,
|
478 |
+
"grid_template_rows": null,
|
479 |
+
"height": null,
|
480 |
+
"justify_content": null,
|
481 |
+
"justify_items": null,
|
482 |
+
"left": null,
|
483 |
+
"margin": null,
|
484 |
+
"max_height": null,
|
485 |
+
"max_width": null,
|
486 |
+
"min_height": null,
|
487 |
+
"min_width": null,
|
488 |
+
"object_fit": null,
|
489 |
+
"object_position": null,
|
490 |
+
"order": null,
|
491 |
+
"overflow": null,
|
492 |
+
"overflow_x": null,
|
493 |
+
"overflow_y": null,
|
494 |
+
"padding": null,
|
495 |
+
"right": null,
|
496 |
+
"top": null,
|
497 |
+
"visibility": null,
|
498 |
+
"width": null
|
499 |
+
}
|
500 |
+
},
|
501 |
+
"f41df4b6ab4c4132b0d20232002f0294": {
|
502 |
+
"model_module": "@jupyter-widgets/base",
|
503 |
+
"model_name": "LayoutModel",
|
504 |
+
"model_module_version": "1.2.0",
|
505 |
+
"state": {
|
506 |
+
"_model_module": "@jupyter-widgets/base",
|
507 |
+
"_model_module_version": "1.2.0",
|
508 |
+
"_model_name": "LayoutModel",
|
509 |
+
"_view_count": null,
|
510 |
+
"_view_module": "@jupyter-widgets/base",
|
511 |
+
"_view_module_version": "1.2.0",
|
512 |
+
"_view_name": "LayoutView",
|
513 |
+
"align_content": null,
|
514 |
+
"align_items": null,
|
515 |
+
"align_self": null,
|
516 |
+
"border": null,
|
517 |
+
"bottom": null,
|
518 |
+
"display": null,
|
519 |
+
"flex": null,
|
520 |
+
"flex_flow": null,
|
521 |
+
"grid_area": null,
|
522 |
+
"grid_auto_columns": null,
|
523 |
+
"grid_auto_flow": null,
|
524 |
+
"grid_auto_rows": null,
|
525 |
+
"grid_column": null,
|
526 |
+
"grid_gap": null,
|
527 |
+
"grid_row": null,
|
528 |
+
"grid_template_areas": null,
|
529 |
+
"grid_template_columns": null,
|
530 |
+
"grid_template_rows": null,
|
531 |
+
"height": null,
|
532 |
+
"justify_content": null,
|
533 |
+
"justify_items": null,
|
534 |
+
"left": null,
|
535 |
+
"margin": null,
|
536 |
+
"max_height": null,
|
537 |
+
"max_width": null,
|
538 |
+
"min_height": null,
|
539 |
+
"min_width": null,
|
540 |
+
"object_fit": null,
|
541 |
+
"object_position": null,
|
542 |
+
"order": null,
|
543 |
+
"overflow": null,
|
544 |
+
"overflow_x": null,
|
545 |
+
"overflow_y": null,
|
546 |
+
"padding": null,
|
547 |
+
"right": null,
|
548 |
+
"top": null,
|
549 |
+
"visibility": null,
|
550 |
+
"width": null
|
551 |
+
}
|
552 |
+
},
|
553 |
+
"3a621edd23354ea5924189885c97dee4": {
|
554 |
+
"model_module": "@jupyter-widgets/controls",
|
555 |
+
"model_name": "DescriptionStyleModel",
|
556 |
+
"model_module_version": "1.5.0",
|
557 |
+
"state": {
|
558 |
+
"_model_module": "@jupyter-widgets/controls",
|
559 |
+
"_model_module_version": "1.5.0",
|
560 |
+
"_model_name": "DescriptionStyleModel",
|
561 |
+
"_view_count": null,
|
562 |
+
"_view_module": "@jupyter-widgets/base",
|
563 |
+
"_view_module_version": "1.2.0",
|
564 |
+
"_view_name": "StyleView",
|
565 |
+
"description_width": ""
|
566 |
+
}
|
567 |
+
},
|
568 |
+
"73d34cae940e4748a7b3127351925e65": {
|
569 |
+
"model_module": "@jupyter-widgets/base",
|
570 |
+
"model_name": "LayoutModel",
|
571 |
+
"model_module_version": "1.2.0",
|
572 |
+
"state": {
|
573 |
+
"_model_module": "@jupyter-widgets/base",
|
574 |
+
"_model_module_version": "1.2.0",
|
575 |
+
"_model_name": "LayoutModel",
|
576 |
+
"_view_count": null,
|
577 |
+
"_view_module": "@jupyter-widgets/base",
|
578 |
+
"_view_module_version": "1.2.0",
|
579 |
+
"_view_name": "LayoutView",
|
580 |
+
"align_content": null,
|
581 |
+
"align_items": null,
|
582 |
+
"align_self": null,
|
583 |
+
"border": null,
|
584 |
+
"bottom": null,
|
585 |
+
"display": null,
|
586 |
+
"flex": null,
|
587 |
+
"flex_flow": null,
|
588 |
+
"grid_area": null,
|
589 |
+
"grid_auto_columns": null,
|
590 |
+
"grid_auto_flow": null,
|
591 |
+
"grid_auto_rows": null,
|
592 |
+
"grid_column": null,
|
593 |
+
"grid_gap": null,
|
594 |
+
"grid_row": null,
|
595 |
+
"grid_template_areas": null,
|
596 |
+
"grid_template_columns": null,
|
597 |
+
"grid_template_rows": null,
|
598 |
+
"height": null,
|
599 |
+
"justify_content": null,
|
600 |
+
"justify_items": null,
|
601 |
+
"left": null,
|
602 |
+
"margin": null,
|
603 |
+
"max_height": null,
|
604 |
+
"max_width": null,
|
605 |
+
"min_height": null,
|
606 |
+
"min_width": null,
|
607 |
+
"object_fit": null,
|
608 |
+
"object_position": null,
|
609 |
+
"order": null,
|
610 |
+
"overflow": null,
|
611 |
+
"overflow_x": null,
|
612 |
+
"overflow_y": null,
|
613 |
+
"padding": null,
|
614 |
+
"right": null,
|
615 |
+
"top": null,
|
616 |
+
"visibility": null,
|
617 |
+
"width": null
|
618 |
+
}
|
619 |
+
},
|
620 |
+
"2dc4a6c935ac4ef38ed9030608bd4b2f": {
|
621 |
+
"model_module": "@jupyter-widgets/controls",
|
622 |
+
"model_name": "ProgressStyleModel",
|
623 |
+
"model_module_version": "1.5.0",
|
624 |
+
"state": {
|
625 |
+
"_model_module": "@jupyter-widgets/controls",
|
626 |
+
"_model_module_version": "1.5.0",
|
627 |
+
"_model_name": "ProgressStyleModel",
|
628 |
+
"_view_count": null,
|
629 |
+
"_view_module": "@jupyter-widgets/base",
|
630 |
+
"_view_module_version": "1.2.0",
|
631 |
+
"_view_name": "StyleView",
|
632 |
+
"bar_color": null,
|
633 |
+
"description_width": ""
|
634 |
+
}
|
635 |
+
},
|
636 |
+
"4fcebf4a9ef54729889cc6ad4cbe5d10": {
|
637 |
+
"model_module": "@jupyter-widgets/base",
|
638 |
+
"model_name": "LayoutModel",
|
639 |
+
"model_module_version": "1.2.0",
|
640 |
+
"state": {
|
641 |
+
"_model_module": "@jupyter-widgets/base",
|
642 |
+
"_model_module_version": "1.2.0",
|
643 |
+
"_model_name": "LayoutModel",
|
644 |
+
"_view_count": null,
|
645 |
+
"_view_module": "@jupyter-widgets/base",
|
646 |
+
"_view_module_version": "1.2.0",
|
647 |
+
"_view_name": "LayoutView",
|
648 |
+
"align_content": null,
|
649 |
+
"align_items": null,
|
650 |
+
"align_self": null,
|
651 |
+
"border": null,
|
652 |
+
"bottom": null,
|
653 |
+
"display": null,
|
654 |
+
"flex": null,
|
655 |
+
"flex_flow": null,
|
656 |
+
"grid_area": null,
|
657 |
+
"grid_auto_columns": null,
|
658 |
+
"grid_auto_flow": null,
|
659 |
+
"grid_auto_rows": null,
|
660 |
+
"grid_column": null,
|
661 |
+
"grid_gap": null,
|
662 |
+
"grid_row": null,
|
663 |
+
"grid_template_areas": null,
|
664 |
+
"grid_template_columns": null,
|
665 |
+
"grid_template_rows": null,
|
666 |
+
"height": null,
|
667 |
+
"justify_content": null,
|
668 |
+
"justify_items": null,
|
669 |
+
"left": null,
|
670 |
+
"margin": null,
|
671 |
+
"max_height": null,
|
672 |
+
"max_width": null,
|
673 |
+
"min_height": null,
|
674 |
+
"min_width": null,
|
675 |
+
"object_fit": null,
|
676 |
+
"object_position": null,
|
677 |
+
"order": null,
|
678 |
+
"overflow": null,
|
679 |
+
"overflow_x": null,
|
680 |
+
"overflow_y": null,
|
681 |
+
"padding": null,
|
682 |
+
"right": null,
|
683 |
+
"top": null,
|
684 |
+
"visibility": null,
|
685 |
+
"width": null
|
686 |
+
}
|
687 |
+
},
|
688 |
+
"195aa202b03a42a3a674e9da2f13d878": {
|
689 |
+
"model_module": "@jupyter-widgets/controls",
|
690 |
+
"model_name": "DescriptionStyleModel",
|
691 |
+
"model_module_version": "1.5.0",
|
692 |
+
"state": {
|
693 |
+
"_model_module": "@jupyter-widgets/controls",
|
694 |
+
"_model_module_version": "1.5.0",
|
695 |
+
"_model_name": "DescriptionStyleModel",
|
696 |
+
"_view_count": null,
|
697 |
+
"_view_module": "@jupyter-widgets/base",
|
698 |
+
"_view_module_version": "1.2.0",
|
699 |
+
"_view_name": "StyleView",
|
700 |
+
"description_width": ""
|
701 |
+
}
|
702 |
+
}
|
703 |
+
}
|
704 |
+
}
|
705 |
+
},
|
706 |
+
"cells": [
|
707 |
+
{
|
708 |
+
"cell_type": "markdown",
|
709 |
+
"metadata": {
|
710 |
+
"id": "view-in-github",
|
711 |
+
"colab_type": "text"
|
712 |
+
},
|
713 |
+
"source": [
|
714 |
+
"<a href=\"https://colab.research.google.com/github/towardsai/ai-tutor-rag-system/blob/main/notebooks/10-Adding_Reranking.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
715 |
+
]
|
716 |
+
},
|
717 |
+
{
|
718 |
+
"cell_type": "markdown",
|
719 |
+
"source": [
|
720 |
+
"# Install Packages and Setup Variables"
|
721 |
+
],
|
722 |
+
"metadata": {
|
723 |
+
"id": "-zE1h0uQV7uT"
|
724 |
+
}
|
725 |
+
},
|
726 |
+
{
|
727 |
+
"cell_type": "code",
|
728 |
+
"execution_count": 1,
|
729 |
+
"metadata": {
|
730 |
+
"id": "QPJzr-I9XQ7l",
|
731 |
+
"colab": {
|
732 |
+
"base_uri": "https://localhost:8080/"
|
733 |
+
},
|
734 |
+
"outputId": "440f5d93-1cac-4a70-e244-5e8af314464e"
|
735 |
+
},
|
736 |
+
"outputs": [
|
737 |
+
{
|
738 |
+
"output_type": "stream",
|
739 |
+
"name": "stdout",
|
740 |
+
"text": [
|
741 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m15.7/15.7 MB\u001b[0m \u001b[31m38.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
742 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m225.4/225.4 kB\u001b[0m \u001b[31m12.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
743 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m46.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
744 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m508.6/508.6 kB\u001b[0m \u001b[31m29.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
745 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m79.9/79.9 MB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
746 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
747 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m51.7/51.7 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
748 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m75.9/75.9 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
749 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m2.4/2.4 MB\u001b[0m \u001b[31m51.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
750 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m92.1/92.1 kB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
751 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m60.7/60.7 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
752 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m41.1/41.1 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
753 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m5.4/5.4 MB\u001b[0m \u001b[31m49.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
754 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m6.8/6.8 MB\u001b[0m \u001b[31m57.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
755 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββοΏ½οΏ½βββββββββββββ\u001b[0m \u001b[32m57.9/57.9 kB\u001b[0m \u001b[31m6.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
756 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m105.6/105.6 kB\u001b[0m \u001b[31m10.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
757 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m67.3/67.3 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
758 |
+
"\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
|
759 |
+
" Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
|
760 |
+
" Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
|
761 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m698.9/698.9 kB\u001b[0m \u001b[31m42.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
762 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m42.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
763 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m67.6/67.6 kB\u001b[0m \u001b[31m7.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
764 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m3.1/3.1 MB\u001b[0m \u001b[31m80.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
765 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m71.5/71.5 kB\u001b[0m \u001b[31m7.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
766 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m76.9/76.9 kB\u001b[0m \u001b[31m9.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
767 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
768 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m46.0/46.0 kB\u001b[0m \u001b[31m4.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
769 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m50.8/50.8 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
770 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m341.4/341.4 kB\u001b[0m \u001b[31m31.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
771 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m55.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
772 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m63.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
773 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m130.2/130.2 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
774 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m49.4/49.4 kB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
775 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m9.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
776 |
+
"\u001b[?25h Building wheel for pypika (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n"
|
777 |
+
]
|
778 |
+
}
|
779 |
+
],
|
780 |
+
"source": [
|
781 |
+
"!pip install -q llama-index==0.9.21 openai==1.6.0 tiktoken==0.5.2 chromadb==0.4.21 kaleido==0.2.1 python-multipart==0.0.6 cohere==4.39"
|
782 |
+
]
|
783 |
+
},
|
784 |
+
{
|
785 |
+
"cell_type": "code",
|
786 |
+
"source": [
|
787 |
+
"import os\n",
|
788 |
+
"\n",
|
789 |
+
"# Set the \"OPENAI_API_KEY\" in the Python environment. Will be used by OpenAI client later.\n",
|
790 |
+
"os.environ[\"OPENAI_API_KEY\"] = \"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\"\n",
|
791 |
+
"os.environ[\"COHERE_API_KEY\"] = \"58jTN5t85VlCwmg8R9wYHnqRhZCrPK5ZRGFWskDi\""
|
792 |
+
],
|
793 |
+
"metadata": {
|
794 |
+
"id": "riuXwpSPcvWC"
|
795 |
+
},
|
796 |
+
"execution_count": 2,
|
797 |
+
"outputs": []
|
798 |
+
},
|
799 |
+
{
|
800 |
+
"cell_type": "code",
|
801 |
+
"source": [
|
802 |
+
"import nest_asyncio\n",
|
803 |
+
"\n",
|
804 |
+
"nest_asyncio.apply()"
|
805 |
+
],
|
806 |
+
"metadata": {
|
807 |
+
"id": "jIEeZzqLbz0J"
|
808 |
+
},
|
809 |
+
"execution_count": 3,
|
810 |
+
"outputs": []
|
811 |
+
},
|
812 |
+
{
|
813 |
+
"cell_type": "markdown",
|
814 |
+
"source": [
|
815 |
+
"# Load a Model"
|
816 |
+
],
|
817 |
+
"metadata": {
|
818 |
+
"id": "Bkgi2OrYzF7q"
|
819 |
+
}
|
820 |
+
},
|
821 |
+
{
|
822 |
+
"cell_type": "code",
|
823 |
+
"source": [
|
824 |
+
"from llama_index.llms import OpenAI\n",
|
825 |
+
"\n",
|
826 |
+
"llm = OpenAI(temperature=0.9, model=\"gpt-3.5-turbo\", max_tokens=512)"
|
827 |
+
],
|
828 |
+
"metadata": {
|
829 |
+
"id": "9oGT6crooSSj"
|
830 |
+
},
|
831 |
+
"execution_count": 4,
|
832 |
+
"outputs": []
|
833 |
+
},
|
834 |
+
{
|
835 |
+
"cell_type": "markdown",
|
836 |
+
"source": [
|
837 |
+
"# Create a VectoreStore"
|
838 |
+
],
|
839 |
+
"metadata": {
|
840 |
+
"id": "0BwVuJXlzHVL"
|
841 |
+
}
|
842 |
+
},
|
843 |
+
{
|
844 |
+
"cell_type": "code",
|
845 |
+
"source": [
|
846 |
+
"import chromadb\n",
|
847 |
+
"\n",
|
848 |
+
"# create client and a new collection\n",
|
849 |
+
"# chromadb.EphemeralClient saves data in-memory.\n",
|
850 |
+
"chroma_client = chromadb.PersistentClient(path=\"./mini-llama-articles\")\n",
|
851 |
+
"chroma_collection = chroma_client.create_collection(\"mini-llama-articles\")"
|
852 |
+
],
|
853 |
+
"metadata": {
|
854 |
+
"id": "SQP87lHczHKc"
|
855 |
+
},
|
856 |
+
"execution_count": 5,
|
857 |
+
"outputs": []
|
858 |
+
},
|
859 |
+
{
|
860 |
+
"cell_type": "code",
|
861 |
+
"source": [
|
862 |
+
"from llama_index.vector_stores import ChromaVectorStore\n",
|
863 |
+
"\n",
|
864 |
+
"# Define a storage context object using the created vector database.\n",
|
865 |
+
"vector_store = ChromaVectorStore(chroma_collection=chroma_collection)"
|
866 |
+
],
|
867 |
+
"metadata": {
|
868 |
+
"id": "zAaGcYMJzHAN"
|
869 |
+
},
|
870 |
+
"execution_count": 6,
|
871 |
+
"outputs": []
|
872 |
+
},
|
873 |
+
{
|
874 |
+
"cell_type": "markdown",
|
875 |
+
"source": [
|
876 |
+
"# Load the Dataset (CSV)"
|
877 |
+
],
|
878 |
+
"metadata": {
|
879 |
+
"id": "I9JbAzFcjkpn"
|
880 |
+
}
|
881 |
+
},
|
882 |
+
{
|
883 |
+
"cell_type": "markdown",
|
884 |
+
"source": [
|
885 |
+
"## Download"
|
886 |
+
],
|
887 |
+
"metadata": {
|
888 |
+
"id": "ceveDuYdWCYk"
|
889 |
+
}
|
890 |
+
},
|
891 |
+
{
|
892 |
+
"cell_type": "markdown",
|
893 |
+
"source": [
|
894 |
+
"The dataset includes several articles from the TowardsAI blog, which provide an in-depth explanation of the LLaMA2 model. Read the dataset as a long string."
|
895 |
+
],
|
896 |
+
"metadata": {
|
897 |
+
"id": "eZwf6pv7WFmD"
|
898 |
+
}
|
899 |
+
},
|
900 |
+
{
|
901 |
+
"cell_type": "code",
|
902 |
+
"source": [
|
903 |
+
"!wget https://raw.githubusercontent.com/AlaFalaki/tutorial_notebooks/main/data/mini-llama-articles.csv"
|
904 |
+
],
|
905 |
+
"metadata": {
|
906 |
+
"colab": {
|
907 |
+
"base_uri": "https://localhost:8080/"
|
908 |
+
},
|
909 |
+
"id": "wl_pbPvMlv1h",
|
910 |
+
"outputId": "f844a7a8-484b-4693-8715-42506778b1de"
|
911 |
+
},
|
912 |
+
"execution_count": 7,
|
913 |
+
"outputs": [
|
914 |
+
{
|
915 |
+
"output_type": "stream",
|
916 |
+
"name": "stdout",
|
917 |
+
"text": [
|
918 |
+
"--2024-02-06 19:06:12-- https://raw.githubusercontent.com/AlaFalaki/tutorial_notebooks/main/data/mini-llama-articles.csv\n",
|
919 |
+
"Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.111.133, ...\n",
|
920 |
+
"Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.\n",
|
921 |
+
"HTTP request sent, awaiting response... 200 OK\n",
|
922 |
+
"Length: 173646 (170K) [text/plain]\n",
|
923 |
+
"Saving to: βmini-llama-articles.csvβ\n",
|
924 |
+
"\n",
|
925 |
+
"\rmini-llama-articles 0%[ ] 0 --.-KB/s \rmini-llama-articles 100%[===================>] 169.58K --.-KB/s in 0.04s \n",
|
926 |
+
"\n",
|
927 |
+
"2024-02-06 19:06:12 (4.66 MB/s) - βmini-llama-articles.csvβ saved [173646/173646]\n",
|
928 |
+
"\n"
|
929 |
+
]
|
930 |
+
}
|
931 |
+
]
|
932 |
+
},
|
933 |
+
{
|
934 |
+
"cell_type": "markdown",
|
935 |
+
"source": [
|
936 |
+
"## Read File"
|
937 |
+
],
|
938 |
+
"metadata": {
|
939 |
+
"id": "VWBLtDbUWJfA"
|
940 |
+
}
|
941 |
+
},
|
942 |
+
{
|
943 |
+
"cell_type": "code",
|
944 |
+
"source": [
|
945 |
+
"import csv\n",
|
946 |
+
"\n",
|
947 |
+
"rows = []\n",
|
948 |
+
"\n",
|
949 |
+
"# Load the file as a JSON\n",
|
950 |
+
"with open(\"./mini-llama-articles.csv\", mode=\"r\", encoding=\"utf-8\") as file:\n",
|
951 |
+
" csv_reader = csv.reader(file)\n",
|
952 |
+
"\n",
|
953 |
+
" for idx, row in enumerate( csv_reader ):\n",
|
954 |
+
" if idx == 0: continue; # Skip header row\n",
|
955 |
+
" rows.append( row )\n",
|
956 |
+
"\n",
|
957 |
+
"# The number of characters in the dataset.\n",
|
958 |
+
"len( rows )"
|
959 |
+
],
|
960 |
+
"metadata": {
|
961 |
+
"id": "0Q9sxuW0g3Gd",
|
962 |
+
"colab": {
|
963 |
+
"base_uri": "https://localhost:8080/"
|
964 |
+
},
|
965 |
+
"outputId": "473050f8-0640-4e7c-91e7-3ea3485cfb51"
|
966 |
+
},
|
967 |
+
"execution_count": 8,
|
968 |
+
"outputs": [
|
969 |
+
{
|
970 |
+
"output_type": "execute_result",
|
971 |
+
"data": {
|
972 |
+
"text/plain": [
|
973 |
+
"14"
|
974 |
+
]
|
975 |
+
},
|
976 |
+
"metadata": {},
|
977 |
+
"execution_count": 8
|
978 |
+
}
|
979 |
+
]
|
980 |
+
},
|
981 |
+
{
|
982 |
+
"cell_type": "markdown",
|
983 |
+
"source": [
|
984 |
+
"# Convert to Document obj"
|
985 |
+
],
|
986 |
+
"metadata": {
|
987 |
+
"id": "S17g2RYOjmf2"
|
988 |
+
}
|
989 |
+
},
|
990 |
+
{
|
991 |
+
"cell_type": "code",
|
992 |
+
"source": [
|
993 |
+
"from llama_index import Document\n",
|
994 |
+
"\n",
|
995 |
+
"# Convert the chunks to Document objects so the LlamaIndex framework can process them.\n",
|
996 |
+
"documents = [Document(text=row[1], metadata={\"title\": row[0], \"url\": row[2], \"source_name\": row[3]}) for row in rows]"
|
997 |
+
],
|
998 |
+
"metadata": {
|
999 |
+
"id": "YizvmXPejkJE"
|
1000 |
+
},
|
1001 |
+
"execution_count": 9,
|
1002 |
+
"outputs": []
|
1003 |
+
},
|
1004 |
+
{
|
1005 |
+
"cell_type": "markdown",
|
1006 |
+
"source": [
|
1007 |
+
"# Transforming"
|
1008 |
+
],
|
1009 |
+
"metadata": {
|
1010 |
+
"id": "qjuLbmFuWsyl"
|
1011 |
+
}
|
1012 |
+
},
|
1013 |
+
{
|
1014 |
+
"cell_type": "code",
|
1015 |
+
"source": [
|
1016 |
+
"from llama_index.text_splitter import TokenTextSplitter\n",
|
1017 |
+
"\n",
|
1018 |
+
"text_splitter = TokenTextSplitter(\n",
|
1019 |
+
" separator=\" \", chunk_size=512, chunk_overlap=128\n",
|
1020 |
+
")"
|
1021 |
+
],
|
1022 |
+
"metadata": {
|
1023 |
+
"id": "9z3t70DGWsjO"
|
1024 |
+
},
|
1025 |
+
"execution_count": 10,
|
1026 |
+
"outputs": []
|
1027 |
+
},
|
1028 |
+
{
|
1029 |
+
"cell_type": "code",
|
1030 |
+
"source": [
|
1031 |
+
"from llama_index.extractors import (\n",
|
1032 |
+
" SummaryExtractor,\n",
|
1033 |
+
" QuestionsAnsweredExtractor,\n",
|
1034 |
+
" KeywordExtractor,\n",
|
1035 |
+
")\n",
|
1036 |
+
"from llama_index.embeddings import OpenAIEmbedding\n",
|
1037 |
+
"from llama_index.ingestion import IngestionPipeline\n",
|
1038 |
+
"\n",
|
1039 |
+
"pipeline = IngestionPipeline(\n",
|
1040 |
+
" transformations=[\n",
|
1041 |
+
" text_splitter,\n",
|
1042 |
+
" QuestionsAnsweredExtractor(questions=3, llm=llm),\n",
|
1043 |
+
" SummaryExtractor(summaries=[\"prev\", \"self\"], llm=llm),\n",
|
1044 |
+
" KeywordExtractor(keywords=10, llm=llm),\n",
|
1045 |
+
" OpenAIEmbedding(),\n",
|
1046 |
+
" ],\n",
|
1047 |
+
" vector_store=vector_store\n",
|
1048 |
+
")\n",
|
1049 |
+
"\n",
|
1050 |
+
"nodes = pipeline.run(documents=documents, show_progress=True);"
|
1051 |
+
],
|
1052 |
+
"metadata": {
|
1053 |
+
"colab": {
|
1054 |
+
"base_uri": "https://localhost:8080/",
|
1055 |
+
"height": 385,
|
1056 |
+
"referenced_widgets": [
|
1057 |
+
"4bb1e341a77d41c9aca0e6680911fb43",
|
1058 |
+
"1d1faa15f5564b68b948eaffa58626b3",
|
1059 |
+
"df22a67ae80b4673b708eea74646be61",
|
1060 |
+
"3657dc19b6ac477b9f05bb6519271473",
|
1061 |
+
"9045e402f0344428acc085d63df7ff03",
|
1062 |
+
"f57a9ac0d924408fbaaac795c172862e",
|
1063 |
+
"4cb8ba074b254e91b8877cc87ae0d279",
|
1064 |
+
"cbd3e1411b2c4eeb943243c9d45245c4",
|
1065 |
+
"04af736f84044e37aa6599aa708a77bc",
|
1066 |
+
"8d35ab8c65ba47e1be446b98f0942ac4",
|
1067 |
+
"75e40756175f463e874630f229ef4066",
|
1068 |
+
"a0dd5f2c99b2407f9f5705587976ae76",
|
1069 |
+
"8728ca516bd0474586b19e0c9b457499",
|
1070 |
+
"aac433a9a64c48dfb18d7a01f64d3b27",
|
1071 |
+
"4802a63f700e48fca16b5d89fbab333d",
|
1072 |
+
"3f55aef52aee4e77864d53e3197c3cc3",
|
1073 |
+
"f41df4b6ab4c4132b0d20232002f0294",
|
1074 |
+
"3a621edd23354ea5924189885c97dee4",
|
1075 |
+
"73d34cae940e4748a7b3127351925e65",
|
1076 |
+
"2dc4a6c935ac4ef38ed9030608bd4b2f",
|
1077 |
+
"4fcebf4a9ef54729889cc6ad4cbe5d10",
|
1078 |
+
"195aa202b03a42a3a674e9da2f13d878"
|
1079 |
+
]
|
1080 |
+
},
|
1081 |
+
"id": "P9LDJ7o-Wsc-",
|
1082 |
+
"outputId": "72b67575-2d55-4145-90be-a367f128fa44"
|
1083 |
+
},
|
1084 |
+
"execution_count": 11,
|
1085 |
+
"outputs": [
|
1086 |
+
{
|
1087 |
+
"output_type": "display_data",
|
1088 |
+
"data": {
|
1089 |
+
"text/plain": [
|
1090 |
+
"Parsing nodes: 0%| | 0/14 [00:00<?, ?it/s]"
|
1091 |
+
],
|
1092 |
+
"application/vnd.jupyter.widget-view+json": {
|
1093 |
+
"version_major": 2,
|
1094 |
+
"version_minor": 0,
|
1095 |
+
"model_id": "4bb1e341a77d41c9aca0e6680911fb43"
|
1096 |
+
}
|
1097 |
+
},
|
1098 |
+
"metadata": {}
|
1099 |
+
},
|
1100 |
+
{
|
1101 |
+
"output_type": "stream",
|
1102 |
+
"name": "stdout",
|
1103 |
+
"text": [
|
1104 |
+
"464\n",
|
1105 |
+
"452\n",
|
1106 |
+
"457\n",
|
1107 |
+
"465\n",
|
1108 |
+
"448\n",
|
1109 |
+
"468\n",
|
1110 |
+
"434\n",
|
1111 |
+
"447\n",
|
1112 |
+
"455\n",
|
1113 |
+
"445\n",
|
1114 |
+
"449\n",
|
1115 |
+
"455\n",
|
1116 |
+
"431\n",
|
1117 |
+
"453\n"
|
1118 |
+
]
|
1119 |
+
},
|
1120 |
+
{
|
1121 |
+
"output_type": "stream",
|
1122 |
+
"name": "stderr",
|
1123 |
+
"text": [
|
1124 |
+
"100%|ββββββββββ| 108/108 [00:45<00:00, 2.39it/s]\n",
|
1125 |
+
"100%|ββββββββββ| 108/108 [01:01<00:00, 1.77it/s]\n",
|
1126 |
+
"100%|ββββββββββ| 108/108 [00:48<00:00, 2.24it/s]\n"
|
1127 |
+
]
|
1128 |
+
},
|
1129 |
+
{
|
1130 |
+
"output_type": "display_data",
|
1131 |
+
"data": {
|
1132 |
+
"text/plain": [
|
1133 |
+
"Generating embeddings: 0%| | 0/108 [00:00<?, ?it/s]"
|
1134 |
+
],
|
1135 |
+
"application/vnd.jupyter.widget-view+json": {
|
1136 |
+
"version_major": 2,
|
1137 |
+
"version_minor": 0,
|
1138 |
+
"model_id": "a0dd5f2c99b2407f9f5705587976ae76"
|
1139 |
+
}
|
1140 |
+
},
|
1141 |
+
"metadata": {}
|
1142 |
+
}
|
1143 |
+
]
|
1144 |
+
},
|
1145 |
+
{
|
1146 |
+
"cell_type": "code",
|
1147 |
+
"source": [
|
1148 |
+
"len( nodes )"
|
1149 |
+
],
|
1150 |
+
"metadata": {
|
1151 |
+
"colab": {
|
1152 |
+
"base_uri": "https://localhost:8080/"
|
1153 |
+
},
|
1154 |
+
"id": "mPGa85hM2P3P",
|
1155 |
+
"outputId": "4586ad85-71bd-4407-a584-326941a5f474"
|
1156 |
+
},
|
1157 |
+
"execution_count": 12,
|
1158 |
+
"outputs": [
|
1159 |
+
{
|
1160 |
+
"output_type": "execute_result",
|
1161 |
+
"data": {
|
1162 |
+
"text/plain": [
|
1163 |
+
"108"
|
1164 |
+
]
|
1165 |
+
},
|
1166 |
+
"metadata": {},
|
1167 |
+
"execution_count": 12
|
1168 |
+
}
|
1169 |
+
]
|
1170 |
+
},
|
1171 |
+
{
|
1172 |
+
"cell_type": "code",
|
1173 |
+
"source": [
|
1174 |
+
"!zip -r vectorstore.zip mini-llama-articles"
|
1175 |
+
],
|
1176 |
+
"metadata": {
|
1177 |
+
"colab": {
|
1178 |
+
"base_uri": "https://localhost:8080/"
|
1179 |
+
},
|
1180 |
+
"id": "OeeG3jxT0taW",
|
1181 |
+
"outputId": "8a2e3c63-c346-4034-8147-f2f1f996c326"
|
1182 |
+
},
|
1183 |
+
"execution_count": 13,
|
1184 |
+
"outputs": [
|
1185 |
+
{
|
1186 |
+
"output_type": "stream",
|
1187 |
+
"name": "stdout",
|
1188 |
+
"text": [
|
1189 |
+
" adding: mini-llama-articles/ (stored 0%)\n",
|
1190 |
+
" adding: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/ (stored 0%)\n",
|
1191 |
+
" adding: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/data_level0.bin (deflated 100%)\n",
|
1192 |
+
" adding: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/header.bin (deflated 61%)\n",
|
1193 |
+
" adding: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/link_lists.bin (stored 0%)\n",
|
1194 |
+
" adding: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/length.bin (deflated 48%)\n",
|
1195 |
+
" adding: mini-llama-articles/chroma.sqlite3 (deflated 65%)\n"
|
1196 |
+
]
|
1197 |
+
}
|
1198 |
+
]
|
1199 |
+
},
|
1200 |
+
{
|
1201 |
+
"cell_type": "markdown",
|
1202 |
+
"source": [
|
1203 |
+
"# Load Indexes"
|
1204 |
+
],
|
1205 |
+
"metadata": {
|
1206 |
+
"id": "OWaT6rL7ksp8"
|
1207 |
+
}
|
1208 |
+
},
|
1209 |
+
{
|
1210 |
+
"cell_type": "code",
|
1211 |
+
"source": [
|
1212 |
+
"!unzip vectorstore.zip"
|
1213 |
+
],
|
1214 |
+
"metadata": {
|
1215 |
+
"colab": {
|
1216 |
+
"base_uri": "https://localhost:8080/"
|
1217 |
+
},
|
1218 |
+
"id": "XxPMJ4tq06qx",
|
1219 |
+
"outputId": "8445e40a-b3c6-44ff-dfde-37cd4c73ffa2"
|
1220 |
+
},
|
1221 |
+
"execution_count": 17,
|
1222 |
+
"outputs": [
|
1223 |
+
{
|
1224 |
+
"output_type": "stream",
|
1225 |
+
"name": "stdout",
|
1226 |
+
"text": [
|
1227 |
+
"Archive: vectorstore.zip\n",
|
1228 |
+
" creating: mini-llama-articles/\n",
|
1229 |
+
" creating: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/\n",
|
1230 |
+
" inflating: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/data_level0.bin \n",
|
1231 |
+
" inflating: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/header.bin \n",
|
1232 |
+
" extracting: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/link_lists.bin \n",
|
1233 |
+
" inflating: mini-llama-articles/a361e92f-9895-41b6-ba72-4ad38e9875bd/length.bin \n",
|
1234 |
+
" inflating: mini-llama-articles/chroma.sqlite3 \n"
|
1235 |
+
]
|
1236 |
+
}
|
1237 |
+
]
|
1238 |
+
},
|
1239 |
+
{
|
1240 |
+
"cell_type": "code",
|
1241 |
+
"source": [
|
1242 |
+
"# Create your index\n",
|
1243 |
+
"db = chromadb.PersistentClient(path=\"./mini-llama-articles\")\n",
|
1244 |
+
"chroma_collection = db.get_or_create_collection(\"mini-llama-articles\")\n",
|
1245 |
+
"vector_store = ChromaVectorStore(chroma_collection=chroma_collection)"
|
1246 |
+
],
|
1247 |
+
"metadata": {
|
1248 |
+
"id": "mXi56KTXk2sp"
|
1249 |
+
},
|
1250 |
+
"execution_count": 18,
|
1251 |
+
"outputs": []
|
1252 |
+
},
|
1253 |
+
{
|
1254 |
+
"cell_type": "code",
|
1255 |
+
"source": [
|
1256 |
+
"# Create your index\n",
|
1257 |
+
"from llama_index import VectorStoreIndex\n",
|
1258 |
+
"\n",
|
1259 |
+
"index = VectorStoreIndex.from_vector_store(vector_store)"
|
1260 |
+
],
|
1261 |
+
"metadata": {
|
1262 |
+
"id": "jKXURvLtkuTS"
|
1263 |
+
},
|
1264 |
+
"execution_count": 19,
|
1265 |
+
"outputs": []
|
1266 |
+
},
|
1267 |
+
{
|
1268 |
+
"cell_type": "markdown",
|
1269 |
+
"source": [
|
1270 |
+
"# Query Dataset"
|
1271 |
+
],
|
1272 |
+
"metadata": {
|
1273 |
+
"id": "8JPD8yAinVSq"
|
1274 |
+
}
|
1275 |
+
},
|
1276 |
+
{
|
1277 |
+
"cell_type": "code",
|
1278 |
+
"source": [
|
1279 |
+
"from llama_index.postprocessor.cohere_rerank import CohereRerank\n",
|
1280 |
+
"\n",
|
1281 |
+
"cohere_rerank = CohereRerank(top_n=2)"
|
1282 |
+
],
|
1283 |
+
"metadata": {
|
1284 |
+
"id": "BsFfFpVgn01h"
|
1285 |
+
},
|
1286 |
+
"execution_count": 20,
|
1287 |
+
"outputs": []
|
1288 |
+
},
|
1289 |
+
{
|
1290 |
+
"cell_type": "code",
|
1291 |
+
"source": [
|
1292 |
+
"# Define a query engine that is responsible for retrieving related pieces of text,\n",
|
1293 |
+
"# and using a LLM to formulate the final answer.\n",
|
1294 |
+
"query_engine = index.as_query_engine(\n",
|
1295 |
+
" similarity_top_k=10,\n",
|
1296 |
+
" node_postprocessors=[cohere_rerank]\n",
|
1297 |
+
")\n",
|
1298 |
+
"\n",
|
1299 |
+
"res = query_engine.query(\"How many parameters LLaMA2 model has?\")"
|
1300 |
+
],
|
1301 |
+
"metadata": {
|
1302 |
+
"id": "b0gue7cyctt1"
|
1303 |
+
},
|
1304 |
+
"execution_count": 21,
|
1305 |
+
"outputs": []
|
1306 |
+
},
|
1307 |
+
{
|
1308 |
+
"cell_type": "code",
|
1309 |
+
"source": [
|
1310 |
+
"res.response"
|
1311 |
+
],
|
1312 |
+
"metadata": {
|
1313 |
+
"colab": {
|
1314 |
+
"base_uri": "https://localhost:8080/",
|
1315 |
+
"height": 53
|
1316 |
+
},
|
1317 |
+
"id": "VKK3jMprctre",
|
1318 |
+
"outputId": "3acce09e-faa2-4acd-ac8f-f62380d91567"
|
1319 |
+
},
|
1320 |
+
"execution_count": 22,
|
1321 |
+
"outputs": [
|
1322 |
+
{
|
1323 |
+
"output_type": "execute_result",
|
1324 |
+
"data": {
|
1325 |
+
"text/plain": [
|
1326 |
+
"'The LLaMA2 model has four different sizes: 7 billion, 13 billion, 34 billion, and 70 billion parameters.'"
|
1327 |
+
],
|
1328 |
+
"application/vnd.google.colaboratory.intrinsic+json": {
|
1329 |
+
"type": "string"
|
1330 |
+
}
|
1331 |
+
},
|
1332 |
+
"metadata": {},
|
1333 |
+
"execution_count": 22
|
1334 |
+
}
|
1335 |
+
]
|
1336 |
+
},
|
1337 |
+
{
|
1338 |
+
"cell_type": "code",
|
1339 |
+
"source": [
|
1340 |
+
"for src in res.source_nodes:\n",
|
1341 |
+
" print(\"Node ID\\t\", src.node_id)\n",
|
1342 |
+
" print(\"Title\\t\", src.metadata['title'])\n",
|
1343 |
+
" print(\"Text\\t\", src.text)\n",
|
1344 |
+
" print(\"Score\\t\", src.score)\n",
|
1345 |
+
" print(\"-_\"*20)"
|
1346 |
+
],
|
1347 |
+
"metadata": {
|
1348 |
+
"colab": {
|
1349 |
+
"base_uri": "https://localhost:8080/"
|
1350 |
+
},
|
1351 |
+
"id": "nvSmOtqBoCY2",
|
1352 |
+
"outputId": "052a70df-d98d-4a87-bb7c-9e56d34db7f7"
|
1353 |
+
},
|
1354 |
+
"execution_count": 23,
|
1355 |
+
"outputs": [
|
1356 |
+
{
|
1357 |
+
"output_type": "stream",
|
1358 |
+
"name": "stdout",
|
1359 |
+
"text": [
|
1360 |
+
"Node ID\t 467d71eb-c7c2-4713-8a02-4df1269424ca\n",
|
1361 |
+
"Title\t The Generative AI Revolution: Exploring the Current Landscape\n",
|
1362 |
+
"Text\t Models Meta AI, formerly known as Facebook Artificial Intelligence Research (FAIR), is an artificial intelligence laboratory that aims to share open-source frameworks, tools, libraries, and models for research exploration and large-scale production deployment. In 2018, they released the open-source PyText, a modeling framework focused on NLP systems. Then, in August 2022, they announced the release of BlenderBot 3, a chatbot designed to improve conversational skills and safety. In November 2022, Meta developed a large language model called Galactica, which assists scientists with tasks such as summarizing academic papers and annotating molecules and proteins. Released in February 2023, LLaMA (Large Language Model Meta AI) is a transformer-based foundational large language model by Meta that ventures into both the AI and academic spaces. The model aims to help researchers, scientists, and engineers advance their work in exploring AI applications. It will be released under a non-commercial license to prevent misuse, and access will be granted to academic researchers, individuals, and organizations affiliated with the government, civil society, academia, and industry research facilities on a selective case-by-case basis. The sharing of codes and weights allows other researchers to test new approaches in LLMs. The LLaMA models have a range of 7 billion to 65 billion parameters. LLaMA-65B can be compared to DeepMind's Chinchilla and Google's PaLM. Publicly available unlabeled data was used to train these models, and training smaller foundational models require less computing power and resources. LLaMA 65B and 33B have been trained on 1.4 trillion tokens in 20 different languages, and according to the Facebook Artificial Intelligence Research (FAIR) team, the model's performance varies across languages. The data sources used for training included CCNet (67%), GitHub, Wikipedia, ArXiv, Stack Exchange, and books. LLaMA, like other large scale language models, has issues related to biased & toxic generation and hallucination. 6. Eleuther's GPT-Neo Models Founded in July 2020 by Connor Leahy, Sid Black, and Leo Gao, EleutherAI is a non-profit AI research lab\n",
|
1363 |
+
"Score\t 0.9852714\n",
|
1364 |
+
"-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_\n",
|
1365 |
+
"Node ID\t d6f533e5-fef8-469c-a313-def19fd38efe\n",
|
1366 |
+
"Title\t Meta's Llama 2: Revolutionizing Open Source Language Models for Commercial Use\n",
|
1367 |
+
"Text\t I. Llama 2: Revolutionizing Commercial Use Unlike its predecessor Llama 1, which was limited to research use, Llama 2 represents a major advancement as an open-source commercial model. Businesses can now integrate Llama 2 into products to create AI-powered applications. Availability on Azure and AWS facilitates fine-tuning and adoption. However, restrictions apply to prevent exploitation. Companies with over 700 million active daily users cannot use Llama 2. Additionally, its output cannot be used to improve other language models. II. Llama 2 Model Flavors Llama 2 is available in four different model sizes: 7 billion, 13 billion, 34 billion, and 70 billion parameters. While 7B, 13B, and 70B have already been released, the 34B model is still awaited. The pretrained variant, trained on a whopping 2 trillion tokens, boasts a context window of 4096 tokens, twice the size of its predecessor Llama 1. Meta also released a Llama 2 fine-tuned model for chat applications that was trained on over 1 million human annotations. Such extensive training comes at a cost, with the 70B model taking a staggering 1720320 GPU hours to train. The context window's length determines the amount of content the model can process at once, making Llama 2 a powerful language model in terms of scale and efficiency. III. Safety Considerations: A Top Priority for Meta Meta's commitment to safety and alignment shines through in Llama 2's design. The model demonstrates exceptionally low AI safety violation percentages, surpassing even ChatGPT in safety benchmarks. Finding the right balance between helpfulness and safety when optimizing a model poses significant challenges. While a highly helpful model may be capable of answering any question, including sensitive ones like \"How do I build a bomb?\", it also raises concerns about potential misuse. Thus, striking the perfect equilibrium between providing useful information and ensuring safety is paramount. However, prioritizing safety to an extreme extent can lead to a model that struggles to effectively address a diverse range of questions. This limitation could hinder the model's practical applicability and user experience. Thus, achieving\n",
|
1368 |
+
"Score\t 0.90582335\n",
|
1369 |
+
"-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_\n"
|
1370 |
+
]
|
1371 |
+
}
|
1372 |
+
]
|
1373 |
+
},
|
1374 |
+
{
|
1375 |
+
"cell_type": "markdown",
|
1376 |
+
"source": [
|
1377 |
+
"# Evaluate"
|
1378 |
+
],
|
1379 |
+
"metadata": {
|
1380 |
+
"id": "iMkpzH7vvb09"
|
1381 |
+
}
|
1382 |
+
},
|
1383 |
+
{
|
1384 |
+
"cell_type": "code",
|
1385 |
+
"source": [
|
1386 |
+
"from llama_index.evaluation import generate_question_context_pairs\n",
|
1387 |
+
"from llama_index.llms import OpenAI\n",
|
1388 |
+
"\n",
|
1389 |
+
"llm = OpenAI(model=\"gpt-3.5-turbo\")\n",
|
1390 |
+
"rag_eval_dataset = generate_question_context_pairs(\n",
|
1391 |
+
" nodes,\n",
|
1392 |
+
" llm=llm,\n",
|
1393 |
+
" num_questions_per_chunk=1\n",
|
1394 |
+
")\n",
|
1395 |
+
"\n",
|
1396 |
+
"# We can save the dataset as a json file for later use.\n",
|
1397 |
+
"rag_eval_dataset.save_json(\"./rag_eval_dataset_rerank.json\")"
|
1398 |
+
],
|
1399 |
+
"metadata": {
|
1400 |
+
"id": "H8a3eKgKvckU",
|
1401 |
+
"colab": {
|
1402 |
+
"base_uri": "https://localhost:8080/"
|
1403 |
+
},
|
1404 |
+
"outputId": "cb004dc9-6b49-4d10-a790-1d5257318cd7"
|
1405 |
+
},
|
1406 |
+
"execution_count": 24,
|
1407 |
+
"outputs": [
|
1408 |
+
{
|
1409 |
+
"output_type": "stream",
|
1410 |
+
"name": "stderr",
|
1411 |
+
"text": [
|
1412 |
+
"100%|ββββββββββ| 108/108 [05:45<00:00, 3.20s/it]\n"
|
1413 |
+
]
|
1414 |
+
}
|
1415 |
+
]
|
1416 |
+
},
|
1417 |
+
{
|
1418 |
+
"cell_type": "code",
|
1419 |
+
"source": [
|
1420 |
+
"from llama_index.finetuning.embeddings.common import (\n",
|
1421 |
+
" EmbeddingQAFinetuneDataset,\n",
|
1422 |
+
")\n",
|
1423 |
+
"rag_eval_dataset = EmbeddingQAFinetuneDataset.from_json(\n",
|
1424 |
+
" \"./rag_eval_dataset_rerank.json\"\n",
|
1425 |
+
")"
|
1426 |
+
],
|
1427 |
+
"metadata": {
|
1428 |
+
"id": "3sA1K84U254o"
|
1429 |
+
},
|
1430 |
+
"execution_count": 26,
|
1431 |
+
"outputs": []
|
1432 |
+
},
|
1433 |
+
{
|
1434 |
+
"cell_type": "code",
|
1435 |
+
"source": [
|
1436 |
+
"import pandas as pd\n",
|
1437 |
+
"\n",
|
1438 |
+
"def display_results_retriever(name, eval_results):\n",
|
1439 |
+
" \"\"\"Display results from evaluate.\"\"\"\n",
|
1440 |
+
"\n",
|
1441 |
+
" metric_dicts = []\n",
|
1442 |
+
" for eval_result in eval_results:\n",
|
1443 |
+
" metric_dict = eval_result.metric_vals_dict\n",
|
1444 |
+
" metric_dicts.append(metric_dict)\n",
|
1445 |
+
"\n",
|
1446 |
+
" full_df = pd.DataFrame(metric_dicts)\n",
|
1447 |
+
"\n",
|
1448 |
+
" hit_rate = full_df[\"hit_rate\"].mean()\n",
|
1449 |
+
" mrr = full_df[\"mrr\"].mean()\n",
|
1450 |
+
"\n",
|
1451 |
+
" metric_df = pd.DataFrame(\n",
|
1452 |
+
" {\"Retriever Name\": [name], \"Hit Rate\": [hit_rate], \"MRR\": [mrr]}\n",
|
1453 |
+
" )\n",
|
1454 |
+
"\n",
|
1455 |
+
" return metric_df"
|
1456 |
+
],
|
1457 |
+
"metadata": {
|
1458 |
+
"id": "H7ubvcbk27vr"
|
1459 |
+
},
|
1460 |
+
"execution_count": 27,
|
1461 |
+
"outputs": []
|
1462 |
+
},
|
1463 |
+
{
|
1464 |
+
"cell_type": "code",
|
1465 |
+
"source": [
|
1466 |
+
"from llama_index.evaluation import RetrieverEvaluator\n",
|
1467 |
+
"\n",
|
1468 |
+
"# We can evaluate the retievers with different top_k values.\n",
|
1469 |
+
"for i in [2, 4, 6, 8, 10]:\n",
|
1470 |
+
" retriever = index.as_retriever(similarity_top_k=i, node_postprocessors=[cohere_rerank])\n",
|
1471 |
+
" retriever_evaluator = RetrieverEvaluator.from_metric_names(\n",
|
1472 |
+
" [\"mrr\", \"hit_rate\"], retriever=retriever\n",
|
1473 |
+
" )\n",
|
1474 |
+
" eval_results = await retriever_evaluator.aevaluate_dataset(rag_eval_dataset)\n",
|
1475 |
+
" print(display_results_retriever(f\"Retriever top_{i}\", eval_results))"
|
1476 |
+
],
|
1477 |
+
"metadata": {
|
1478 |
+
"colab": {
|
1479 |
+
"base_uri": "https://localhost:8080/"
|
1480 |
+
},
|
1481 |
+
"id": "uNLxDxoc2-Ac",
|
1482 |
+
"outputId": "f42dc98d-789f-4779-c693-0603cd43e4c9"
|
1483 |
+
},
|
1484 |
+
"execution_count": 30,
|
1485 |
+
"outputs": [
|
1486 |
+
{
|
1487 |
+
"output_type": "stream",
|
1488 |
+
"name": "stdout",
|
1489 |
+
"text": [
|
1490 |
+
" Retriever Name Hit Rate MRR\n",
|
1491 |
+
"0 Retriever top_2 0.661308 0.54716\n",
|
1492 |
+
" Retriever Name Hit Rate MRR\n",
|
1493 |
+
"0 Retriever top_4 0.773848 0.580743\n",
|
1494 |
+
" Retriever Name Hit Rate MRR\n",
|
1495 |
+
"0 Retriever top_6 0.826367 0.590014\n",
|
1496 |
+
" Retriever Name Hit Rate MRR\n",
|
1497 |
+
"0 Retriever top_8 0.856377 0.595979\n",
|
1498 |
+
" Retriever Name Hit Rate MRR\n",
|
1499 |
+
"0 Retriever top_10 0.871383 0.596152\n"
|
1500 |
+
]
|
1501 |
+
}
|
1502 |
+
]
|
1503 |
+
}
|
1504 |
+
]
|
1505 |
+
}
|