|
32 | 32 | }, |
33 | 33 | { |
34 | 34 | "cell_type": "code", |
35 | | - "execution_count": 62, |
| 35 | + "execution_count": 1, |
36 | 36 | "id": "7bfb2480", |
37 | 37 | "metadata": {}, |
38 | | - "outputs": [], |
| 38 | + "outputs": [ |
| 39 | + { |
| 40 | + "name": "stderr", |
| 41 | + "output_type": "stream", |
| 42 | + "text": [ |
| 43 | + "/opt/anaconda3/envs/alerts/lib/python3.8/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", |
| 44 | + " from .autonotebook import tqdm as notebook_tqdm\n" |
| 45 | + ] |
| 46 | + } |
| 47 | + ], |
39 | 48 | "source": [ |
40 | 49 | "import json\n", |
41 | 50 | "from datasets import load_dataset\n", |
|
55 | 64 | "metadata": {}, |
56 | 65 | "outputs": [], |
57 | 66 | "source": [ |
58 | | - "os.chdir(\"/Users/shahules/belar/\")" |
| 67 | + "os.chdir('/Users/shahules/belar/src/')" |
59 | 68 | ] |
60 | 69 | }, |
61 | 70 | { |
|
135 | 144 | }, |
136 | 145 | { |
137 | 146 | "cell_type": "code", |
138 | | - "execution_count": 129, |
| 147 | + "execution_count": 7, |
139 | 148 | "id": "f9f4280e", |
140 | 149 | "metadata": {}, |
141 | 150 | "outputs": [ |
|
144 | 153 | "output_type": "stream", |
145 | 154 | "text": [ |
146 | 155 | "Found cached dataset parquet (/Users/shahules/.cache/huggingface/datasets/explodinggradients___parquet/explodinggradients--ragas-wikiqa-5b5116e5cb909aca/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec)\n", |
147 | | - "100%|█| 1/1 [00:00<00:00, 58.\n" |
| 156 | + "100%|████████████████████████████████████████████████████| 1/1 [00:00<00:00, 242.78it/s]\n" |
148 | 157 | ] |
149 | 158 | } |
150 | 159 | ], |
|
162 | 171 | }, |
163 | 172 | { |
164 | 173 | "cell_type": "code", |
165 | | - "execution_count": 153, |
| 174 | + "execution_count": 8, |
166 | 175 | "id": "eca20daf", |
167 | 176 | "metadata": {}, |
168 | 177 | "outputs": [], |
|
184 | 193 | }, |
185 | 194 | { |
186 | 195 | "cell_type": "code", |
187 | | - "execution_count": 8, |
| 196 | + "execution_count": 9, |
188 | 197 | "id": "f3e35532", |
189 | 198 | "metadata": {}, |
190 | 199 | "outputs": [], |
|
216 | 225 | }, |
217 | 226 | { |
218 | 227 | "cell_type": "code", |
219 | | - "execution_count": 9, |
| 228 | + "execution_count": 10, |
220 | 229 | "id": "335081e3", |
221 | 230 | "metadata": {}, |
222 | 231 | "outputs": [], |
|
252 | 261 | }, |
253 | 262 | { |
254 | 263 | "cell_type": "code", |
255 | | - "execution_count": 18, |
| 264 | + "execution_count": 11, |
256 | 265 | "id": "b2642e5b", |
257 | 266 | "metadata": {}, |
258 | 267 | "outputs": [], |
|
267 | 276 | }, |
268 | 277 | { |
269 | 278 | "cell_type": "code", |
270 | | - "execution_count": 19, |
| 279 | + "execution_count": 13, |
271 | 280 | "id": "26ca4af4", |
272 | 281 | "metadata": {}, |
273 | 282 | "outputs": [ |
|
284 | 293 | "0" |
285 | 294 | ] |
286 | 295 | }, |
287 | | - "execution_count": 19, |
| 296 | + "execution_count": 13, |
288 | 297 | "metadata": {}, |
289 | 298 | "output_type": "execute_result" |
290 | 299 | } |
|
305 | 314 | }, |
306 | 315 | { |
307 | 316 | "cell_type": "code", |
308 | | - "execution_count": null, |
| 317 | + "execution_count": 14, |
309 | 318 | "id": "ca1c56d6", |
310 | 319 | "metadata": {}, |
311 | 320 | "outputs": [], |
|
327 | 336 | }, |
328 | 337 | { |
329 | 338 | "cell_type": "code", |
330 | | - "execution_count": null, |
| 339 | + "execution_count": 15, |
331 | 340 | "id": "cd7fed9c", |
332 | 341 | "metadata": {}, |
333 | 342 | "outputs": [], |
|
343 | 352 | }, |
344 | 353 | { |
345 | 354 | "cell_type": "code", |
346 | | - "execution_count": null, |
| 355 | + "execution_count": 16, |
347 | 356 | "id": "35113558", |
348 | 357 | "metadata": {}, |
349 | 358 | "outputs": [], |
|
354 | 363 | }, |
355 | 364 | { |
356 | 365 | "cell_type": "code", |
357 | | - "execution_count": 16, |
| 366 | + "execution_count": 17, |
358 | 367 | "id": "4e82d0df", |
359 | 368 | "metadata": {}, |
360 | 369 | "outputs": [ |
|
368 | 377 | { |
369 | 378 | "data": { |
370 | 379 | "text/plain": [ |
371 | | - "3.514920235612768" |
| 380 | + "3.5533440372846865" |
372 | 381 | ] |
373 | 382 | }, |
374 | | - "execution_count": 16, |
| 383 | + "execution_count": 17, |
375 | 384 | "metadata": {}, |
376 | 385 | "output_type": "execute_result" |
377 | 386 | } |
|
399 | 408 | }, |
400 | 409 | { |
401 | 410 | "cell_type": "code", |
402 | | - "execution_count": 124, |
| 411 | + "execution_count": 13, |
403 | 412 | "id": "cc263805", |
404 | 413 | "metadata": {}, |
405 | 414 | "outputs": [], |
406 | 415 | "source": [ |
407 | | - "from experimental.relevance import QGen" |
| 416 | + "from ragas.metrics.answer_relevance import QGen" |
408 | 417 | ] |
409 | 418 | }, |
410 | 419 | { |
411 | 420 | "cell_type": "code", |
412 | | - "execution_count": 125, |
| 421 | + "execution_count": 14, |
413 | 422 | "id": "38deaf06", |
414 | 423 | "metadata": {}, |
415 | | - "outputs": [ |
416 | | - { |
417 | | - "name": "stderr", |
418 | | - "output_type": "stream", |
419 | | - "text": [ |
420 | | - "/opt/anaconda3/envs/alerts/lib/python3.8/site-packages/transformers/models/t5/tokenization_t5_fast.py:155: FutureWarning: This tokenizer was incorrectly instantiated with a model max length of 512 which will be corrected in Transformers v5.\n", |
421 | | - "For now, this behavior is kept to avoid breaking backwards compatibility when padding/encoding with `truncation is True`.\n", |
422 | | - "- Be aware that you SHOULD NOT rely on t5-base automatically truncating your input to 512 when padding/encoding.\n", |
423 | | - "- If you want to encode/pad to sequences longer than 512 you can either instantiate this tokenizer with `model_max_length` or pass `max_length` when encoding/padding.\n", |
424 | | - "- To avoid this warning, please instantiate this tokenizer with `model_max_length` set to your preferred value.\n", |
425 | | - " warnings.warn(\n" |
426 | | - ] |
427 | | - } |
428 | | - ], |
| 424 | + "outputs": [], |
429 | 425 | "source": [ |
430 | 426 | "t5_qgen = QGen(\"t5-base\", \"cpu\")" |
431 | 427 | ] |
432 | 428 | }, |
433 | 429 | { |
434 | 430 | "cell_type": "code", |
435 | | - "execution_count": 126, |
| 431 | + "execution_count": 15, |
436 | 432 | "id": "45942810", |
437 | 433 | "metadata": {}, |
438 | 434 | "outputs": [], |
|
457 | 453 | }, |
458 | 454 | { |
459 | 455 | "cell_type": "code", |
460 | | - "execution_count": 127, |
| 456 | + "execution_count": 16, |
461 | 457 | "id": "ab00e4fe", |
462 | 458 | "metadata": {}, |
463 | 459 | "outputs": [], |
|
522 | 518 | }, |
523 | 519 | { |
524 | 520 | "cell_type": "code", |
525 | | - "execution_count": 23, |
| 521 | + "execution_count": 17, |
526 | 522 | "id": "b6d76ae2", |
527 | 523 | "metadata": {}, |
528 | 524 | "outputs": [], |
529 | 525 | "source": [ |
530 | | - "## import cross encoder" |
| 526 | + "from ragas.metrics.context_relevance import context_relavancy" |
531 | 527 | ] |
532 | 528 | }, |
533 | 529 | { |
|
0 commit comments