Notebook to create the CI tables in latex
Browse files- CriaTabelaLatex-CI.ipynb +67 -35
CriaTabelaLatex-CI.ipynb
CHANGED
@@ -51,13 +51,14 @@
|
|
51 |
" dic[key] += print_string\n",
|
52 |
" return dic\n",
|
53 |
"\n",
|
54 |
-
"def printar_final(dic, modelo):\n",
|
55 |
-
"
|
56 |
-
"
|
57 |
-
"
|
58 |
-
"
|
59 |
"\n",
|
60 |
"def filtrar_dfs(perf, boot, modelo, final=\"\"):\n",
|
|
|
61 |
" filtro_perf = perf[perf['id'].str.startswith(modelo) & perf['id'].str.endswith(final)]\n",
|
62 |
" filtro_boot = boot[boot['experiment_id'].str.startswith(modelo) & boot['experiment_id'].str.endswith(final)]\n",
|
63 |
" dic = {'C1': {}, 'C2': {}, 'C3': {}, 'C4': {}, 'C5': {}}\n",
|
@@ -72,17 +73,31 @@
|
|
72 |
" for key in dic:\n",
|
73 |
" if key in row['experiment_id']:\n",
|
74 |
" dic[key]['QWK_mean'] = row['QWK_mean']\n",
|
75 |
-
" dic[key][
|
76 |
-
" dic[key][
|
77 |
-
" print(dic)\n",
|
78 |
" string = \"\"\n",
|
79 |
" for key in dic:\n",
|
80 |
-
" string += f\"{dic[key][
|
81 |
-
" print(f\"{modelo}-{final} & {string[:-2]}
|
82 |
"\n",
|
83 |
-
"modelos = [
|
84 |
-
"
|
85 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
"for (modelo, final) in modelos:\n",
|
87 |
" filtrar_dfs(df, df1, modelo, final=final)"
|
88 |
],
|
@@ -91,7 +106,7 @@
|
|
91 |
"base_uri": "https://localhost:8080/"
|
92 |
},
|
93 |
"id": "2_4fdVNNARGi",
|
94 |
-
"outputId": "
|
95 |
},
|
96 |
"execution_count": null,
|
97 |
"outputs": [
|
@@ -99,24 +114,19 @@
|
|
99 |
"output_type": "stream",
|
100 |
"name": "stdout",
|
101 |
"text": [
|
102 |
-
"
|
103 |
-
"
|
104 |
-
"
|
105 |
-
"
|
106 |
-
"
|
107 |
-
"
|
108 |
-
"
|
109 |
-
"
|
110 |
-
"
|
111 |
-
"
|
112 |
-
"
|
113 |
-
"
|
114 |
-
"
|
115 |
-
"jbcs2025_Phi-3.5-mini-instruct-full_context & 0.15 & 0.42 &0.15 & 0.42 &0.58 & 0.77 &0.35 & 0.58 &0.35 & 0.61\n",
|
116 |
-
"{'C1': {'Micro_F1': 0.6376811594202898, 'Weighted_F1': 0.6354643426463825, 'QWK': 0.642614752634399, 'QWK_mean': 0.6417455296636442, 'QWK_upper_95ci': 0.7221995154900485, 'QWK_lower_95ci': 0.5534959702303135}, 'C2': {'Micro_F1': 0.4420289855072464, 'Weighted_F1': 0.3727858293075684, 'QWK': 0.4587224505042959, 'QWK_mean': 0.4544687530156993, 'QWK_upper_95ci': 0.5738800252215724, 'QWK_lower_95ci': 0.325822690895961}, 'C3': {'Micro_F1': 0.4565217391304347, 'Weighted_F1': 0.4145905872632278, 'QWK': 0.6404105501849862, 'QWK_mean': 0.6368017049735983, 'QWK_upper_95ci': 0.7283785107281081, 'QWK_lower_95ci': 0.5336049056396244}, 'C4': {'Micro_F1': 0.7318840579710145, 'Weighted_F1': 0.6872463768115942, 'QWK': 0.5601593625498008, 'QWK_mean': 0.5622525366238156, 'QWK_upper_95ci': 0.6667808258369575, 'QWK_lower_95ci': 0.4570995751571452}, 'C5': {'Micro_F1': 0.3623188405797101, 'Weighted_F1': 0.3672380004905022, 'QWK': 0.5073723420766724, 'QWK_mean': 0.5024746726275736, 'QWK_upper_95ci': 0.6317146430085705, 'QWK_lower_95ci': 0.3566272536367714}}\n",
|
117 |
-
"jbcs2025_phi-4-phi4-full_context & 0.55 & 0.72 &0.33 & 0.57 &0.53 & 0.73 &0.46 & 0.67 &0.36 & 0.63\n",
|
118 |
-
"{'C1': {'Micro_F1': 0.6811594202898551, 'Weighted_F1': 0.655233980808711, 'QWK': 0.6525276002324231, 'QWK_mean': 0.6513882888286967, 'QWK_upper_95ci': 0.745725728701958, 'QWK_lower_95ci': 0.5488248441997104}, 'C2': {'Micro_F1': 0.3768115942028985, 'Weighted_F1': 0.3372856483605482, 'QWK': 0.3204971475142625, 'QWK_mean': 0.3171723261367537, 'QWK_upper_95ci': 0.4365708703636233, 'QWK_lower_95ci': 0.1914638191605268}, 'C3': {'Micro_F1': 0.3550724637681159, 'Weighted_F1': 0.3410931961351028, 'QWK': 0.3373259954677889, 'QWK_mean': 0.3340102348845638, 'QWK_upper_95ci': 0.4823077722195361, 'QWK_lower_95ci': 0.1776691149012335}, 'C4': {'Micro_F1': 0.5869565217391305, 'Weighted_F1': 0.5764511923932214, 'QWK': 0.4831460674157303, 'QWK_mean': 0.4792630651774341, 'QWK_upper_95ci': 0.6020372960585834, 'QWK_lower_95ci': 0.3507696538121665}, 'C5': {'Micro_F1': 0.2391304347826087, 'Weighted_F1': 0.2215770027405685, 'QWK': 0.1835841058368659, 'QWK_mean': 0.1818097905579081, 'QWK_upper_95ci': 0.3405974422544362, 'QWK_lower_95ci': 0.012417733580868}}\n",
|
119 |
-
"jbcs2025_Llama-3.1-8B-llama31-full_context & 0.55 & 0.75 &0.19 & 0.44 &0.18 & 0.48 &0.35 & 0.60 &0.01 & 0.34\n"
|
120 |
]
|
121 |
}
|
122 |
]
|
@@ -124,13 +134,35 @@
|
|
124 |
{
|
125 |
"cell_type": "code",
|
126 |
"source": [
|
127 |
-
"
|
|
|
|
|
128 |
],
|
129 |
"metadata": {
|
130 |
-
"id": "dhyTkpR2ARwp"
|
|
|
|
|
|
|
|
|
131 |
},
|
132 |
"execution_count": null,
|
133 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
},
|
135 |
{
|
136 |
"cell_type": "code",
|
|
|
51 |
" dic[key] += print_string\n",
|
52 |
" return dic\n",
|
53 |
"\n",
|
54 |
+
"# def printar_final(dic, modelo):\n",
|
55 |
+
"# string = f\"{modelo} \"\n",
|
56 |
+
"# for key in dic:\n",
|
57 |
+
"# string += f\"& {dic[key]} \"\n",
|
58 |
+
"# print(f\"{string[:-2]} \\\\\\\\\")\n",
|
59 |
"\n",
|
60 |
"def filtrar_dfs(perf, boot, modelo, final=\"\"):\n",
|
61 |
+
" global SELECT\n",
|
62 |
" filtro_perf = perf[perf['id'].str.startswith(modelo) & perf['id'].str.endswith(final)]\n",
|
63 |
" filtro_boot = boot[boot['experiment_id'].str.startswith(modelo) & boot['experiment_id'].str.endswith(final)]\n",
|
64 |
" dic = {'C1': {}, 'C2': {}, 'C3': {}, 'C4': {}, 'C5': {}}\n",
|
|
|
73 |
" for key in dic:\n",
|
74 |
" if key in row['experiment_id']:\n",
|
75 |
" dic[key]['QWK_mean'] = row['QWK_mean']\n",
|
76 |
+
" dic[key][SELECT[1]] = row[SELECT[1]]\n",
|
77 |
+
" dic[key][SELECT[0]] = row[SELECT[0]]\n",
|
78 |
+
" #print(dic)\n",
|
79 |
" string = \"\"\n",
|
80 |
" for key in dic:\n",
|
81 |
+
" string += f\"{dic[key][SELECT[0]]:.2f} & {dic[key][SELECT[1]]:.2f} &\"\n",
|
82 |
+
" print(f\"{modelo}-{final} & {string[:-2]} \\\\\\\\\")\n",
|
83 |
"\n",
|
84 |
+
"modelos = [\n",
|
85 |
+
" #Encoders\n",
|
86 |
+
" (\"jbcs2025_mbert_base\", \"\"), (\"jbcs2025_bertimbau_base-\", \"\"), (\"jbcs2025_bertimbau-large\", \"\"),\n",
|
87 |
+
" #Decoders\n",
|
88 |
+
" #(\"jbcs2025_llama31_8b-balanced\", \"essay_only\"), (\"jbcs2025_phi35-balanced\", \"essay_only\"), (\"jbcs2025_phi4-balanced\", \"essay_only\"),\n",
|
89 |
+
" # (\"jbcs2025_Llama-3.1-8B-llama31\", \"full_context\"), (\"jbcs2025_Phi-3.5-mini-instruct\", \"full_context\"), (\"jbcs2025_phi-4-phi4\", \"full_context\"),\n",
|
90 |
+
" #Sabias\n",
|
91 |
+
" (\"sabia-3-zero-shot\", \"essay_only\"), (\"sabia-3-zero-shot\", \"full_context\"),\n",
|
92 |
+
" #(\"sabia-3-grader-zero-shot\", \"essay_only\"),\n",
|
93 |
+
" (\"sabia-3-grader-zero-shot\", \"full_context\"),\n",
|
94 |
+
" #Gpts\n",
|
95 |
+
" (\"gpt-4o-2024-11-20-zero-shot\", \"essay_only\"), (\"gpt-4o-2024-11-20-zero-shot\", \"full_context\"),\n",
|
96 |
+
" (\"gpt-4o-2024-11-20-grader-zero-shot\", \"essay_only\"), (\"gpt-4o-2024-11-20-grader-zero-shot\", \"full_context\"),\n",
|
97 |
+
" #Deepseeks\n",
|
98 |
+
" (\"deepseek-reasoner-zero-shot-\", \"essay_only\"), (\"deepseek-reasoner-zero-shot-\", \"full_context\"),\n",
|
99 |
+
" (\"Deepseek-reasoner-grader-zero-shot-\", \"essay_only\") ]\n",
|
100 |
+
"SELECT = [\"QWK_lower_95ci\", \"QWK_upper_95ci\"]\n",
|
101 |
"for (modelo, final) in modelos:\n",
|
102 |
" filtrar_dfs(df, df1, modelo, final=final)"
|
103 |
],
|
|
|
106 |
"base_uri": "https://localhost:8080/"
|
107 |
},
|
108 |
"id": "2_4fdVNNARGi",
|
109 |
+
"outputId": "6e6b6032-97e7-495d-993c-9f5c8a8f49d3"
|
110 |
},
|
111 |
"execution_count": null,
|
112 |
"outputs": [
|
|
|
114 |
"output_type": "stream",
|
115 |
"name": "stdout",
|
116 |
"text": [
|
117 |
+
"jbcs2025_mbert_base- & 0.33 & 0.56 &0.00 & 0.29 &0.10 & 0.42 &0.12 & 0.42 &0.46 & 0.67 \\\\\n",
|
118 |
+
"jbcs2025_bertimbau_base-- & 0.58 & 0.76 &0.28 & 0.55 &0.21 & 0.48 &0.51 & 0.73 &0.34 & 0.59 \\\\\n",
|
119 |
+
"jbcs2025_bertimbau-large- & 0.61 & 0.79 &0.27 & 0.57 &0.13 & 0.40 &0.46 & 0.67 &0.35 & 0.60 \\\\\n",
|
120 |
+
"sabia-3-zero-shot-essay_only & 0.61 & 0.75 &-0.03 & 0.06 &0.16 & 0.43 &0.39 & 0.62 &0.37 & 0.63 \\\\\n",
|
121 |
+
"sabia-3-zero-shot-full_context & 0.47 & 0.66 &0.31 & 0.60 &0.32 & 0.56 &0.23 & 0.52 &0.40 & 0.65 \\\\\n",
|
122 |
+
"sabia-3-grader-zero-shot-full_context & 0.40 & 0.58 &0.35 & 0.62 &0.42 & 0.65 &0.39 & 0.64 &0.34 & 0.63 \\\\\n",
|
123 |
+
"gpt-4o-2024-11-20-zero-shot-essay_only & 0.43 & 0.58 &0.05 & 0.34 &0.24 & 0.51 &0.40 & 0.60 &0.41 & 0.67 \\\\\n",
|
124 |
+
"gpt-4o-2024-11-20-zero-shot-full_context & 0.39 & 0.56 &0.38 & 0.63 &0.42 & 0.63 &0.38 & 0.58 &0.20 & 0.49 \\\\\n",
|
125 |
+
"gpt-4o-2024-11-20-grader-zero-shot-essay_only & 0.40 & 0.56 &0.15 & 0.42 &0.15 & 0.41 &0.40 & 0.60 &0.41 & 0.66 \\\\\n",
|
126 |
+
"gpt-4o-2024-11-20-grader-zero-shot-full_context & 0.47 & 0.63 &0.43 & 0.68 &0.32 & 0.56 &0.39 & 0.60 &0.33 & 0.61 \\\\\n",
|
127 |
+
"deepseek-reasoner-zero-shot--essay_only & 0.27 & 0.43 &-0.14 & 0.11 &0.23 & 0.53 &0.41 & 0.61 &0.41 & 0.67 \\\\\n",
|
128 |
+
"deepseek-reasoner-zero-shot--full_context & 0.27 & 0.43 &0.30 & 0.53 &0.65 & 0.80 &0.39 & 0.58 &0.45 & 0.69 \\\\\n",
|
129 |
+
"Deepseek-reasoner-grader-zero-shot--essay_only & 0.36 & 0.51 &-0.01 & 0.08 &0.23 & 0.54 &0.37 & 0.56 &0.40 & 0.68 \\\\\n"
|
|
|
|
|
|
|
|
|
|
|
130 |
]
|
131 |
}
|
132 |
]
|
|
|
134 |
{
|
135 |
"cell_type": "code",
|
136 |
"source": [
|
137 |
+
"SELECT = [\"Macro_F1_lower_95ci\", \"Macro_F1_upper_95ci\"]\n",
|
138 |
+
"for (modelo, final) in modelos:\n",
|
139 |
+
" filtrar_dfs(df, df1, modelo, final=final)"
|
140 |
],
|
141 |
"metadata": {
|
142 |
+
"id": "dhyTkpR2ARwp",
|
143 |
+
"colab": {
|
144 |
+
"base_uri": "https://localhost:8080/"
|
145 |
+
},
|
146 |
+
"outputId": "68fd310f-a620-4e32-ea7a-b1855c592f3b"
|
147 |
},
|
148 |
"execution_count": null,
|
149 |
+
"outputs": [
|
150 |
+
{
|
151 |
+
"output_type": "stream",
|
152 |
+
"name": "stdout",
|
153 |
+
"text": [
|
154 |
+
"jbcs2025_mbert_base- & 0.26 & 0.46 &0.16 & 0.33 &0.11 & 0.23 &0.13 & 0.29 &0.25 & 0.40 \\\\\n",
|
155 |
+
"jbcs2025_bertimbau_base-- & 0.36 & 0.62 &0.22 & 0.40 &0.20 & 0.37 &0.29 & 0.59 &0.15 & 0.27 \\\\\n",
|
156 |
+
"jbcs2025_bertimbau-large- & 0.39 & 0.66 &0.21 & 0.37 &0.14 & 0.29 &0.23 & 0.43 &0.23 & 0.41 \\\\\n",
|
157 |
+
"jbcs2025_llama31_8b-balanced-essay_only & 0.37 & 0.64 &0.16 & 0.29 &0.21 & 0.38 &0.27 & 0.52 &0.16 & 0.29 \\\\\n",
|
158 |
+
"jbcs2025_phi35-balanced-essay_only & 0.42 & 0.70 &0.16 & 0.37 &0.20 & 0.38 &0.24 & 0.48 &0.22 & 0.34 \\\\\n",
|
159 |
+
"jbcs2025_phi4-balanced-essay_only & 0.39 & 0.65 &0.23 & 0.39 &0.15 & 0.31 &0.23 & 0.40 &0.14 & 0.25 \\\\\n",
|
160 |
+
"jbcs2025_Llama-3.1-8B-llama31-full_context & 0.35 & 0.56 &0.17 & 0.32 &0.19 & 0.34 &0.23 & 0.46 &0.14 & 0.35 \\\\\n",
|
161 |
+
"jbcs2025_Phi-3.5-mini-instruct-full_context & 0.09 & 0.18 &0.09 & 0.18 &0.33 & 0.56 &0.21 & 0.43 &0.19 & 0.33 \\\\\n",
|
162 |
+
"jbcs2025_phi-4-phi4-full_context & 0.30 & 0.53 &0.18 & 0.31 &0.22 & 0.35 &0.24 & 0.40 &0.25 & 0.45 \\\\\n"
|
163 |
+
]
|
164 |
+
}
|
165 |
+
]
|
166 |
},
|
167 |
{
|
168 |
"cell_type": "code",
|