Datasets:
File size: 33,815 Bytes
10bf19f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 |
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load the API key and libaries."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from src.LLM_Evaluation import GPT\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load the Constants"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"PATH = 'data/Portuguese_test.csv'\n",
"MODEL = \"gpt-3.5-turbo\"\n",
"TEMPERATURE = 0.3\n",
"N_REPETITIONS = 3\n",
"REASONING = True\n",
"LANGUAGES = ['english', 'portuguese']\n",
"MAX_TOKENS = 500"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create an Instance of the model"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"model = GPT(model=MODEL, temperature=TEMPERATURE, n_repetitions=N_REPETITIONS, reasoning=REASONING, languages=LANGUAGES, path=PATH, max_tokens=MAX_TOKENS)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### See characteristics of the model"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"gpt-3.5-turbo\n"
]
}
],
"source": [
"print(model.model)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" You will be provided with medical queries in this languages: english, portuguese. The medical query will be delimited with #### characters.\n",
" Each question will have 4 possible answer options. provide the letter with the answer and a short sentence answering why the answer was selected. \n",
"\n",
" Provide your output in json format with the keys: response, reasoning.\n",
"\n",
" Responses: A, B, C, D.\n",
" \n"
]
}
],
"source": [
"print(model.system_message)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Test the model"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"question = \"\"\"What is the primary function of the cornea in the human eye?\n",
"A) Refracting light onto the retina\n",
"B) Producing aqueous humor\n",
"C) Regulating pupil size\n",
"D) Transmitting visual signals to the brain\"\"\""
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Response:\n",
"{'response': 'A', 'reasoning': 'The primary function of the cornea in the human eye is to refract light onto the retina. This is because the cornea is the clear, outermost layer of the eye that helps to focus light onto the retina, which then sends visual signals to the brain.'}\n",
"Answer: A\n",
"Reasoning: The primary function of the cornea in the human eye is to refract light onto the retina. This is because the cornea is the clear, outermost layer of the eye that helps to focus light onto the retina, which then sends visual signals to the brain.\n"
]
}
],
"source": [
"response = model.get_completion_from_messages(question)\n",
"\n",
"print('Response:')\n",
"print(response)\n",
"\n",
"print(f'Answer: {response[\"response\"]}')\n",
"print(f'Reasoning: {response[\"reasoning\"]}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Modify the model"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
" You will be provided with medical queries in this languages: english, portuguese. The medical query will be delimited with #### characters.\n",
" Each question will have 4 possible answer options. provide the letter with the answer and a short sentence answering why the answer was selected. Also print the area of the medicine to which the question refers to.\n",
"\n",
" Provide your output in json format with the keys: response, reasoning, area.\n",
"\n",
" Responses: A, B, C, D.\n",
" \n"
]
}
],
"source": [
"model.add_extra_message('Also print the area of the medicine to which the question refers to.')\n",
"model.add_output_key('area')\n",
"print(model.system_message)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Response:\n",
"{'response': 'A', 'reasoning': 'The primary function of the cornea in the human eye is to refract light onto the retina. This helps to focus the incoming light and contribute to clear vision.', 'area': 'Ophthalmology'}\n",
"Area: Ophthalmology\n",
"Answer: A\n",
"Reasoning: The primary function of the cornea in the human eye is to refract light onto the retina. This helps to focus the incoming light and contribute to clear vision.\n"
]
}
],
"source": [
"response = model.get_completion_from_messages(question)\n",
"\n",
"print('Response:')\n",
"print(response)\n",
"\n",
"print(f'Area: {response[\"area\"]}')\n",
"print(f'Answer: {response[\"response\"]}')\n",
"print(f'Reasoning: {response[\"reasoning\"]}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run multiple experiments using the csv file"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"**************************************************\n",
"Question 1: \n",
"Language: english\n",
"Question: \n",
"In which ocular region are caliciform cells physiologically found?\n",
"a) Cornea.\n",
"b) Corneoscleral limbus.\n",
"c) Gray line.\n",
"d) Semilunar fold.\n",
"Test #0: \n",
"{'response': 'b', 'reasoning': 'The correct answer is b) Corneoscleral limbus. Caliciform cells are found in the corneoscleral limbus, which is the transitional zone between the cornea and the sclera.', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'b', 'reasoning': 'The correct answer is b) Corneoscleral limbus. Caliciform cells are found in the corneoscleral limbus, which is the transition zone between the cornea and the sclera.', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'b', 'reasoning': 'The correct answer is b) Corneoscleral limbus. Caliciform cells are found in the corneoscleral limbus, which is the transitional zone between the cornea and the sclera.', 'area': 'Ophthalmology'}\n",
"Language: portuguese\n",
"Question: \n",
"Em qual região ocular células caliciformes são fisiologicamente encontradas?\n",
"a)Córnea.\n",
"b)Limbo corneoescleral.\n",
"c)Linha cinzenta.\n",
"d)Prega semilunar.\n",
"Test #0: \n",
"{'response': 'c', 'reasoning': 'As células caliciformes são encontradas na linha cinzenta.', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'c', 'reasoning': 'As células caliciformes são fisiologicamente encontradas na linha cinzenta.', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'c', 'reasoning': 'As células caliciformes são encontradas na linha cinzenta.', 'area': 'Oftalmologia'}\n",
"**************************************************\n",
"**************************************************\n",
"Question 2: \n",
"Language: english\n",
"Question: \n",
"Mark the alternative that best correlates the histological characteristics with the respective ocular tissues:\n",
"\n",
"I. Monolayer of cells tightly joined together by junctional complexes.\n",
"II. Parallel and regular striations observed under optical microscopy, perpendicular to the epithelium.\n",
"III. It contains bipolar cells, amacrine cells, horizontal cells and Muller cells.\n",
"IV. It contains magnocellular, parvocellular and coniocellular cells.\n",
"\n",
"A. Photoreceptors.\n",
"B. Retinal pigmented epithelium.\n",
"C. Retinal ganglionic layer.\n",
"D. Inner nuclear layer.\n",
"Test #0: \n",
"{'response': 'C', 'reasoning': 'The histological characteristics described in options III match the retinal ganglionic layer, which contains bipolar cells, amacrine cells, horizontal cells, and Muller cells.', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'C', 'reasoning': 'The histological characteristics described in options III and IV are consistent with the retinal ganglionic layer, which contains bipolar cells, amacrine cells, horizontal cells, Muller cells, magnocellular cells, parvocellular cells, and coniocellular cells.', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'C', 'reasoning': 'The histological characteristics described in option III, including the presence of bipolar cells, amacrine cells, horizontal cells, and Muller cells, are consistent with the retinal ganglionic layer.', 'area': 'Ophthalmology'}\n",
"Language: portuguese\n",
"Question: \n",
"Assinale a alternativa que melhor correlaciona as características histológicas com os respectivos tecidos oculares:\n",
"\n",
"I. Monocamada de células fortemente unidas por complexos juncionais.\n",
"II. Estriações paralelas e regulares observadas à microscopia óptica, perpendiculares ao epitélio.\n",
"III. Contém células bipolares, células amácrinas, células horizontais e células de Muller.\n",
"IV. Contém células magnocelulares, parvocelulares e coniocelulares.\n",
"\n",
"A. Fotorreceptores.\n",
"B. Epitélio pigmentado da pigmentado da retina.\n",
"C. Camada ganglionar retiniana.\n",
"D. Camada nuclear interna.\n",
"Test #0: \n",
"{'response': 'C', 'reasoning': 'A camada ganglionar retiniana é caracterizada por conter células bipolares, células amácrinas, células horizontais e células de Muller.', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'B', 'reasoning': 'A alternativa B é a correta, pois descreve as características histológicas do epitélio pigmentado da retina, que inclui células fortemente unidas por complexos juncionais e estriações paralelas e regulares observadas à microscopia óptica, perpendiculares ao epitélio.', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'C', 'reasoning': 'A descrição das características histológicas corresponde à camada ganglionar retiniana, que contém células bipolares, células amácrinas, células horizontais e células de Muller.', 'area': 'Oftalmologia'}\n",
"**************************************************\n",
"**************************************************\n",
"Question 3: \n",
"Language: english\n",
"Question: \n",
"Order the three cell names found in the corneal epithelium, starting with the most superficial, followed by the intermediate and the deep.\n",
"a) Flat, wing, basal.\n",
"b) wing, basal, flat.\n",
"c) Basal, flat, wing.\n",
"d) wing, flat, basal.\n",
"Test #0: \n",
"{'response': 'c', 'reasoning': 'The correct order of the three cell names found in the corneal epithelium, starting with the most superficial, followed by the intermediate and the deep, is basal, flat, wing.', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'c', 'reasoning': 'The correct order of the three cell names found in the corneal epithelium, starting with the most superficial, followed by the intermediate and the deep, is basal, flat, wing.', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'c', 'reasoning': 'The correct order of the three cell names found in the corneal epithelium, starting with the most superficial, followed by the intermediate and the deep, is basal, flat, wing.', 'area': 'Ophthalmology'}\n",
"Language: portuguese\n",
"Question: \n",
"Ordene as três denominações celulares encontradas no epitélio da córnea, iniciando pelo mais superficial, seguido do intermediário e do profundo.\n",
"a)Plana, alada, basal.\n",
"b)Alada, basal, plana.\n",
"c)Basal, plana, alada.\n",
"d)Alada, plana, basal.\n",
"Test #0: \n",
"{'response': 'c', 'reasoning': 'A ordem correta das denominações celulares encontradas no epitélio da córnea é: basal, plana, alada. Portanto, a opção c é a correta.', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'c', 'reasoning': 'A ordem correta das três denominações celulares encontradas no epitélio da córnea é: basal, plana, alada.', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'c', 'reasoning': 'A resposta correta é a letra c) Basal, plana, alada. O epitélio da córnea é composto por três camadas celulares: a camada basal, a camada plana e a camada alada. A camada basal é a mais profunda, seguida pela camada plana e, por fim, a camada alada.', 'area': 'Oftalmologia'}\n",
"**************************************************\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>ID</th>\n",
" <th>year</th>\n",
" <th>test</th>\n",
" <th>theme</th>\n",
" <th>subtheme</th>\n",
" <th>portuguese</th>\n",
" <th>english</th>\n",
" <th>answer</th>\n",
" <th>response_english_0</th>\n",
" <th>reasoning_english_0</th>\n",
" <th>...</th>\n",
" <th>area_english_2</th>\n",
" <th>response_portuguese_0</th>\n",
" <th>reasoning_portuguese_0</th>\n",
" <th>area_portuguese_0</th>\n",
" <th>response_portuguese_1</th>\n",
" <th>reasoning_portuguese_1</th>\n",
" <th>area_portuguese_1</th>\n",
" <th>response_portuguese_2</th>\n",
" <th>reasoning_portuguese_2</th>\n",
" <th>area_portuguese_2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>cornea</td>\n",
" <td>Em qual região ocular células caliciformes são...</td>\n",
" <td>In which ocular region are caliciform cells ph...</td>\n",
" <td>D</td>\n",
" <td>b</td>\n",
" <td>The correct answer is b) Corneoscleral limbus....</td>\n",
" <td>...</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>As células caliciformes são encontradas na lin...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>As células caliciformes são fisiologicamente e...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>As células caliciformes são encontradas na lin...</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>retina</td>\n",
" <td>Assinale a alternativa que melhor correlaciona...</td>\n",
" <td>Mark the alternative that best correlates the ...</td>\n",
" <td>B</td>\n",
" <td>C</td>\n",
" <td>The histological characteristics described in ...</td>\n",
" <td>...</td>\n",
" <td>Ophthalmology</td>\n",
" <td>C</td>\n",
" <td>A camada ganglionar retiniana é caracterizada ...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>B</td>\n",
" <td>A alternativa B é a correta, pois descreve as ...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>C</td>\n",
" <td>A descrição das características histológicas c...</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>cornea</td>\n",
" <td>Ordene as três denominações celulares encontra...</td>\n",
" <td>Order the three cell names found in the cornea...</td>\n",
" <td>A</td>\n",
" <td>c</td>\n",
" <td>The correct order of the three cell names foun...</td>\n",
" <td>...</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>A ordem correta das denominações celulares enc...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>A ordem correta das três denominações celulare...</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>A resposta correta é a letra c) Basal, plana, ...</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>3 rows × 26 columns</p>\n",
"</div>"
],
"text/plain": [
" ID year test theme subtheme \\\n",
"0 1 2022 Teórica I Anatomia cornea \n",
"1 2 2022 Teórica I Anatomia retina \n",
"2 3 2022 Teórica I Anatomia cornea \n",
"\n",
" portuguese \\\n",
"0 Em qual região ocular células caliciformes são... \n",
"1 Assinale a alternativa que melhor correlaciona... \n",
"2 Ordene as três denominações celulares encontra... \n",
"\n",
" english answer \\\n",
"0 In which ocular region are caliciform cells ph... D \n",
"1 Mark the alternative that best correlates the ... B \n",
"2 Order the three cell names found in the cornea... A \n",
"\n",
" response_english_0 reasoning_english_0 ... \\\n",
"0 b The correct answer is b) Corneoscleral limbus.... ... \n",
"1 C The histological characteristics described in ... ... \n",
"2 c The correct order of the three cell names foun... ... \n",
"\n",
" area_english_2 response_portuguese_0 \\\n",
"0 Ophthalmology c \n",
"1 Ophthalmology C \n",
"2 Ophthalmology c \n",
"\n",
" reasoning_portuguese_0 area_portuguese_0 \\\n",
"0 As células caliciformes são encontradas na lin... Oftalmologia \n",
"1 A camada ganglionar retiniana é caracterizada ... Oftalmologia \n",
"2 A ordem correta das denominações celulares enc... Oftalmologia \n",
"\n",
" response_portuguese_1 reasoning_portuguese_1 \\\n",
"0 c As células caliciformes são fisiologicamente e... \n",
"1 B A alternativa B é a correta, pois descreve as ... \n",
"2 c A ordem correta das três denominações celulare... \n",
"\n",
" area_portuguese_1 response_portuguese_2 \\\n",
"0 Oftalmologia c \n",
"1 Oftalmologia C \n",
"2 Oftalmologia c \n",
"\n",
" reasoning_portuguese_2 area_portuguese_2 \n",
"0 As células caliciformes são encontradas na lin... Oftalmologia \n",
"1 A descrição das características histológicas c... Oftalmologia \n",
"2 A resposta correta é a letra c) Basal, plana, ... Oftalmologia \n",
"\n",
"[3 rows x 26 columns]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = model.llm_language_evaluation(save=False)\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"**************************************************\n",
"Question 1: \n",
"Language: english\n",
"Question: \n",
"In which ocular region are caliciform cells physiologically found?\n",
"a) Cornea.\n",
"b) Corneoscleral limbus.\n",
"c) Gray line.\n",
"d) Semilunar fold.\n",
"Test #0: \n",
"{'response': 'b', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'b', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'b', 'area': 'Ophthalmology'}\n",
"Language: portuguese\n",
"Question: \n",
"Em qual região ocular células caliciformes são fisiologicamente encontradas?\n",
"a)Córnea.\n",
"b)Limbo corneoescleral.\n",
"c)Linha cinzenta.\n",
"d)Prega semilunar.\n",
"Test #0: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"**************************************************\n",
"**************************************************\n",
"Question 2: \n",
"Language: english\n",
"Question: \n",
"Mark the alternative that best correlates the histological characteristics with the respective ocular tissues:\n",
"\n",
"I. Monolayer of cells tightly joined together by junctional complexes.\n",
"II. Parallel and regular striations observed under optical microscopy, perpendicular to the epithelium.\n",
"III. It contains bipolar cells, amacrine cells, horizontal cells and Muller cells.\n",
"IV. It contains magnocellular, parvocellular and coniocellular cells.\n",
"\n",
"A. Photoreceptors.\n",
"B. Retinal pigmented epithelium.\n",
"C. Retinal ganglionic layer.\n",
"D. Inner nuclear layer.\n",
"Test #0: \n",
"{'response': 'C', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'C', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'C', 'area': 'Retina'}\n",
"Language: portuguese\n",
"Question: \n",
"Assinale a alternativa que melhor correlaciona as características histológicas com os respectivos tecidos oculares:\n",
"\n",
"I. Monocamada de células fortemente unidas por complexos juncionais.\n",
"II. Estriações paralelas e regulares observadas à microscopia óptica, perpendiculares ao epitélio.\n",
"III. Contém células bipolares, células amácrinas, células horizontais e células de Muller.\n",
"IV. Contém células magnocelulares, parvocelulares e coniocelulares.\n",
"\n",
"A. Fotorreceptores.\n",
"B. Epitélio pigmentado da pigmentado da retina.\n",
"C. Camada ganglionar retiniana.\n",
"D. Camada nuclear interna.\n",
"Test #0: \n",
"{'response': 'C', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'B', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'C', 'area': 'Oftalmologia'}\n",
"**************************************************\n",
"**************************************************\n",
"Question 3: \n",
"Language: english\n",
"Question: \n",
"Order the three cell names found in the corneal epithelium, starting with the most superficial, followed by the intermediate and the deep.\n",
"a) Flat, wing, basal.\n",
"b) wing, basal, flat.\n",
"c) Basal, flat, wing.\n",
"d) wing, flat, basal.\n",
"Test #0: \n",
"{'response': 'c', 'area': 'Ophthalmology'}\n",
"Test #1: \n",
"{'response': 'c', 'area': 'Ophthalmology'}\n",
"Test #2: \n",
"{'response': 'c', 'area': 'Ophthalmology'}\n",
"Language: portuguese\n",
"Question: \n",
"Ordene as três denominações celulares encontradas no epitélio da córnea, iniciando pelo mais superficial, seguido do intermediário e do profundo.\n",
"a)Plana, alada, basal.\n",
"b)Alada, basal, plana.\n",
"c)Basal, plana, alada.\n",
"d)Alada, plana, basal.\n",
"Test #0: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"Test #1: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"Test #2: \n",
"{'response': 'c', 'area': 'Oftalmologia'}\n",
"**************************************************\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>ID</th>\n",
" <th>year</th>\n",
" <th>test</th>\n",
" <th>theme</th>\n",
" <th>subtheme</th>\n",
" <th>portuguese</th>\n",
" <th>english</th>\n",
" <th>answer</th>\n",
" <th>response_english_0</th>\n",
" <th>area_english_0</th>\n",
" <th>response_english_1</th>\n",
" <th>area_english_1</th>\n",
" <th>response_english_2</th>\n",
" <th>area_english_2</th>\n",
" <th>response_portuguese_0</th>\n",
" <th>area_portuguese_0</th>\n",
" <th>response_portuguese_1</th>\n",
" <th>area_portuguese_1</th>\n",
" <th>response_portuguese_2</th>\n",
" <th>area_portuguese_2</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>cornea</td>\n",
" <td>Em qual região ocular células caliciformes são...</td>\n",
" <td>In which ocular region are caliciform cells ph...</td>\n",
" <td>D</td>\n",
" <td>b</td>\n",
" <td>Ophthalmology</td>\n",
" <td>b</td>\n",
" <td>Ophthalmology</td>\n",
" <td>b</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>retina</td>\n",
" <td>Assinale a alternativa que melhor correlaciona...</td>\n",
" <td>Mark the alternative that best correlates the ...</td>\n",
" <td>B</td>\n",
" <td>C</td>\n",
" <td>Ophthalmology</td>\n",
" <td>C</td>\n",
" <td>Ophthalmology</td>\n",
" <td>C</td>\n",
" <td>Retina</td>\n",
" <td>C</td>\n",
" <td>Oftalmologia</td>\n",
" <td>B</td>\n",
" <td>Oftalmologia</td>\n",
" <td>C</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>2022</td>\n",
" <td>Teórica I</td>\n",
" <td>Anatomia</td>\n",
" <td>cornea</td>\n",
" <td>Ordene as três denominações celulares encontra...</td>\n",
" <td>Order the three cell names found in the cornea...</td>\n",
" <td>A</td>\n",
" <td>c</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>Ophthalmology</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" <td>c</td>\n",
" <td>Oftalmologia</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" ID year test theme subtheme \\\n",
"0 1 2022 Teórica I Anatomia cornea \n",
"1 2 2022 Teórica I Anatomia retina \n",
"2 3 2022 Teórica I Anatomia cornea \n",
"\n",
" portuguese \\\n",
"0 Em qual região ocular células caliciformes são... \n",
"1 Assinale a alternativa que melhor correlaciona... \n",
"2 Ordene as três denominações celulares encontra... \n",
"\n",
" english answer \\\n",
"0 In which ocular region are caliciform cells ph... D \n",
"1 Mark the alternative that best correlates the ... B \n",
"2 Order the three cell names found in the cornea... A \n",
"\n",
" response_english_0 area_english_0 response_english_1 area_english_1 \\\n",
"0 b Ophthalmology b Ophthalmology \n",
"1 C Ophthalmology C Ophthalmology \n",
"2 c Ophthalmology c Ophthalmology \n",
"\n",
" response_english_2 area_english_2 response_portuguese_0 area_portuguese_0 \\\n",
"0 b Ophthalmology c Oftalmologia \n",
"1 C Retina C Oftalmologia \n",
"2 c Ophthalmology c Oftalmologia \n",
"\n",
" response_portuguese_1 area_portuguese_1 response_portuguese_2 \\\n",
"0 c Oftalmologia c \n",
"1 B Oftalmologia C \n",
"2 c Oftalmologia c \n",
"\n",
" area_portuguese_2 \n",
"0 Oftalmologia \n",
"1 Oftalmologia \n",
"2 Oftalmologia "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"### Suggestion:\n",
"# When running multiple experiments, it's recommended to change the value of REASONING to False, since running the reasoning multiple times can be time consuming.\n",
"model.change_reasoning(False)\n",
"\n",
"df = model.llm_language_evaluation(save=False)\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:nlp_bias_vpython=3_8_15]",
"language": "python",
"name": "conda-env-nlp_bias_vpython_3_8_15-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.15"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
|