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|
7 |
+
"# F1 Scores"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {
|
14 |
+
"vscode": {
|
15 |
+
"languageId": "r"
|
16 |
+
}
|
17 |
+
},
|
18 |
+
"outputs": [],
|
19 |
+
"source": [
|
20 |
+
"library(\"ggpubr\")\n",
|
21 |
+
"library(readr)\n",
|
22 |
+
"library(ggplot2)\n",
|
23 |
+
"library(tidyverse)\n",
|
24 |
+
"library(ARTool)\n",
|
25 |
+
"library(emmeans)\n",
|
26 |
+
"library(multcomp)\n",
|
27 |
+
"library(car)\n",
|
28 |
+
"library(rstatix)"
|
29 |
+
]
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"cell_type": "code",
|
33 |
+
"execution_count": 10,
|
34 |
+
"metadata": {
|
35 |
+
"vscode": {
|
36 |
+
"languageId": "r"
|
37 |
+
}
|
38 |
+
},
|
39 |
+
"outputs": [
|
40 |
+
{
|
41 |
+
"name": "stderr",
|
42 |
+
"output_type": "stream",
|
43 |
+
"text": [
|
44 |
+
"New names:\n",
|
45 |
+
"* `` -> ...1\n",
|
46 |
+
"\n",
|
47 |
+
"\u001b[1mRows: \u001b[22m\u001b[34m59\u001b[39m \u001b[1mColumns: \u001b[22m\u001b[34m5\u001b[39m\n",
|
48 |
+
"\u001b[36m--\u001b[39m \u001b[1mColumn specification\u001b[22m \u001b[36m--------------------------------------------------------\u001b[39m\n",
|
49 |
+
"\u001b[1mDelimiter:\u001b[22m \",\"\n",
|
50 |
+
"\u001b[32mdbl\u001b[39m (5): ...1, faiss_dpr, faiss_longformer, es_dpr, es_longformer\n",
|
51 |
+
"\n",
|
52 |
+
"\u001b[36mi\u001b[39m Use `spec()` to retrieve the full column specification for this data.\n",
|
53 |
+
"\u001b[36mi\u001b[39m Specify the column types or set `show_col_types = FALSE` to quiet this message.\n"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"data": {
|
58 |
+
"text/html": [
|
59 |
+
"<table class=\"dataframe\">\n",
|
60 |
+
"<caption>A tibble: 6 × 4</caption>\n",
|
61 |
+
"<thead>\n",
|
62 |
+
"\t<tr><th scope=col>question</th><th scope=col>retriever</th><th scope=col>reader</th><th scope=col>f1</th></tr>\n",
|
63 |
+
"\t<tr><th scope=col><dbl></th><th scope=col><fct></th><th scope=col><fct></th><th scope=col><dbl></th></tr>\n",
|
64 |
+
"</thead>\n",
|
65 |
+
"<tbody>\n",
|
66 |
+
"\t<tr><td>0</td><td>faiss</td><td>dpr </td><td>0.0000000</td></tr>\n",
|
67 |
+
"\t<tr><td>0</td><td>faiss</td><td>longformer</td><td>0.0000000</td></tr>\n",
|
68 |
+
"\t<tr><td>0</td><td>es </td><td>dpr </td><td>0.1300813</td></tr>\n",
|
69 |
+
"\t<tr><td>0</td><td>es </td><td>longformer</td><td>0.7692308</td></tr>\n",
|
70 |
+
"\t<tr><td>1</td><td>faiss</td><td>dpr </td><td>0.0000000</td></tr>\n",
|
71 |
+
"\t<tr><td>1</td><td>faiss</td><td>longformer</td><td>0.0000000</td></tr>\n",
|
72 |
+
"</tbody>\n",
|
73 |
+
"</table>\n"
|
74 |
+
],
|
75 |
+
"text/latex": [
|
76 |
+
"A tibble: 6 × 4\n",
|
77 |
+
"\\begin{tabular}{llll}\n",
|
78 |
+
" question & retriever & reader & f1\\\\\n",
|
79 |
+
" <dbl> & <fct> & <fct> & <dbl>\\\\\n",
|
80 |
+
"\\hline\n",
|
81 |
+
"\t 0 & faiss & dpr & 0.0000000\\\\\n",
|
82 |
+
"\t 0 & faiss & longformer & 0.0000000\\\\\n",
|
83 |
+
"\t 0 & es & dpr & 0.1300813\\\\\n",
|
84 |
+
"\t 0 & es & longformer & 0.7692308\\\\\n",
|
85 |
+
"\t 1 & faiss & dpr & 0.0000000\\\\\n",
|
86 |
+
"\t 1 & faiss & longformer & 0.0000000\\\\\n",
|
87 |
+
"\\end{tabular}\n"
|
88 |
+
],
|
89 |
+
"text/markdown": [
|
90 |
+
"\n",
|
91 |
+
"A tibble: 6 × 4\n",
|
92 |
+
"\n",
|
93 |
+
"| question <dbl> | retriever <fct> | reader <fct> | f1 <dbl> |\n",
|
94 |
+
"|---|---|---|---|\n",
|
95 |
+
"| 0 | faiss | dpr | 0.0000000 |\n",
|
96 |
+
"| 0 | faiss | longformer | 0.0000000 |\n",
|
97 |
+
"| 0 | es | dpr | 0.1300813 |\n",
|
98 |
+
"| 0 | es | longformer | 0.7692308 |\n",
|
99 |
+
"| 1 | faiss | dpr | 0.0000000 |\n",
|
100 |
+
"| 1 | faiss | longformer | 0.0000000 |\n",
|
101 |
+
"\n"
|
102 |
+
],
|
103 |
+
"text/plain": [
|
104 |
+
" question retriever reader f1 \n",
|
105 |
+
"1 0 faiss dpr 0.0000000\n",
|
106 |
+
"2 0 faiss longformer 0.0000000\n",
|
107 |
+
"3 0 es dpr 0.1300813\n",
|
108 |
+
"4 0 es longformer 0.7692308\n",
|
109 |
+
"5 1 faiss dpr 0.0000000\n",
|
110 |
+
"6 1 faiss longformer 0.0000000"
|
111 |
+
]
|
112 |
+
},
|
113 |
+
"metadata": {},
|
114 |
+
"output_type": "display_data"
|
115 |
+
}
|
116 |
+
],
|
117 |
+
"source": [
|
118 |
+
"f1_scores <- read_csv(\"f1_scores.csv\") %>%\n",
|
119 |
+
" rename(question = `...1`) %>%\n",
|
120 |
+
" pivot_longer(!question, names_to=c(\"retriever\", \"reader\"), names_sep=\"_\", values_to=\"f1\")\n",
|
121 |
+
"\n",
|
122 |
+
"f1_scores$retriever = as.factor(f1_scores$retriever)\n",
|
123 |
+
"f1_scores$reader = as.factor(f1_scores$reader)\n",
|
124 |
+
"\n",
|
125 |
+
"head(f1_scores)"
|
126 |
+
]
|
127 |
+
},
|
128 |
+
{
|
129 |
+
"cell_type": "markdown",
|
130 |
+
"metadata": {},
|
131 |
+
"source": [
|
132 |
+
"To test which tests we can use, we need to check for normality. For this, we use a Shapiro-Wilk test of normality. As you can see in the results below, all $p$-values are lower than 0.001, so we reject the null-hypothesis of normality and now know that none of the f1-scores are normally distributed."
|
133 |
+
]
|
134 |
+
},
|
135 |
+
{
|
136 |
+
"cell_type": "code",
|
137 |
+
"execution_count": 21,
|
138 |
+
"metadata": {
|
139 |
+
"vscode": {
|
140 |
+
"languageId": "r"
|
141 |
+
}
|
142 |
+
},
|
143 |
+
"outputs": [
|
144 |
+
{
|
145 |
+
"data": {
|
146 |
+
"text/html": [
|
147 |
+
"<table class=\"dataframe\">\n",
|
148 |
+
"<caption>A tibble: 1 × 3</caption>\n",
|
149 |
+
"<thead>\n",
|
150 |
+
"\t<tr><th scope=col>variable</th><th scope=col>statistic</th><th scope=col>p</th></tr>\n",
|
151 |
+
"\t<tr><th scope=col><chr></th><th scope=col><dbl></th><th scope=col><dbl></th></tr>\n",
|
152 |
+
"</thead>\n",
|
153 |
+
"<tbody>\n",
|
154 |
+
"\t<tr><td>f1</td><td>0.5086706</td><td>3.999447e-18</td></tr>\n",
|
155 |
+
"</tbody>\n",
|
156 |
+
"</table>\n"
|
157 |
+
],
|
158 |
+
"text/latex": [
|
159 |
+
"A tibble: 1 × 3\n",
|
160 |
+
"\\begin{tabular}{lll}\n",
|
161 |
+
" variable & statistic & p\\\\\n",
|
162 |
+
" <chr> & <dbl> & <dbl>\\\\\n",
|
163 |
+
"\\hline\n",
|
164 |
+
"\t f1 & 0.5086706 & 3.999447e-18\\\\\n",
|
165 |
+
"\\end{tabular}\n"
|
166 |
+
],
|
167 |
+
"text/markdown": [
|
168 |
+
"\n",
|
169 |
+
"A tibble: 1 × 3\n",
|
170 |
+
"\n",
|
171 |
+
"| variable <chr> | statistic <dbl> | p <dbl> |\n",
|
172 |
+
"|---|---|---|\n",
|
173 |
+
"| f1 | 0.5086706 | 3.999447e-18 |\n",
|
174 |
+
"\n"
|
175 |
+
],
|
176 |
+
"text/plain": [
|
177 |
+
" variable statistic p \n",
|
178 |
+
"1 f1 0.5086706 3.999447e-18"
|
179 |
+
]
|
180 |
+
},
|
181 |
+
"metadata": {},
|
182 |
+
"output_type": "display_data"
|
183 |
+
},
|
184 |
+
{
|
185 |
+
"data": {
|
186 |
+
"text/html": [
|
187 |
+
"<table class=\"dataframe\">\n",
|
188 |
+
"<caption>A tibble: 1 × 3</caption>\n",
|
189 |
+
"<thead>\n",
|
190 |
+
"\t<tr><th scope=col>variable</th><th scope=col>statistic</th><th scope=col>p</th></tr>\n",
|
191 |
+
"\t<tr><th scope=col><chr></th><th scope=col><dbl></th><th scope=col><dbl></th></tr>\n",
|
192 |
+
"</thead>\n",
|
193 |
+
"<tbody>\n",
|
194 |
+
"\t<tr><td>f1</td><td>0.7704567</td><td>2.671656e-12</td></tr>\n",
|
195 |
+
"</tbody>\n",
|
196 |
+
"</table>\n"
|
197 |
+
],
|
198 |
+
"text/latex": [
|
199 |
+
"A tibble: 1 × 3\n",
|
200 |
+
"\\begin{tabular}{lll}\n",
|
201 |
+
" variable & statistic & p\\\\\n",
|
202 |
+
" <chr> & <dbl> & <dbl>\\\\\n",
|
203 |
+
"\\hline\n",
|
204 |
+
"\t f1 & 0.7704567 & 2.671656e-12\\\\\n",
|
205 |
+
"\\end{tabular}\n"
|
206 |
+
],
|
207 |
+
"text/markdown": [
|
208 |
+
"\n",
|
209 |
+
"A tibble: 1 × 3\n",
|
210 |
+
"\n",
|
211 |
+
"| variable <chr> | statistic <dbl> | p <dbl> |\n",
|
212 |
+
"|---|---|---|\n",
|
213 |
+
"| f1 | 0.7704567 | 2.671656e-12 |\n",
|
214 |
+
"\n"
|
215 |
+
],
|
216 |
+
"text/plain": [
|
217 |
+
" variable statistic p \n",
|
218 |
+
"1 f1 0.7704567 2.671656e-12"
|
219 |
+
]
|
220 |
+
},
|
221 |
+
"metadata": {},
|
222 |
+
"output_type": "display_data"
|
223 |
+
},
|
224 |
+
{
|
225 |
+
"data": {
|
226 |
+
"text/html": [
|
227 |
+
"<table class=\"dataframe\">\n",
|
228 |
+
"<caption>A tibble: 1 × 3</caption>\n",
|
229 |
+
"<thead>\n",
|
230 |
+
"\t<tr><th scope=col>variable</th><th scope=col>statistic</th><th scope=col>p</th></tr>\n",
|
231 |
+
"\t<tr><th scope=col><chr></th><th scope=col><dbl></th><th scope=col><dbl></th></tr>\n",
|
232 |
+
"</thead>\n",
|
233 |
+
"<tbody>\n",
|
234 |
+
"\t<tr><td>f1</td><td>0.6741031</td><td>7.912632e-15</td></tr>\n",
|
235 |
+
"</tbody>\n",
|
236 |
+
"</table>\n"
|
237 |
+
],
|
238 |
+
"text/latex": [
|
239 |
+
"A tibble: 1 × 3\n",
|
240 |
+
"\\begin{tabular}{lll}\n",
|
241 |
+
" variable & statistic & p\\\\\n",
|
242 |
+
" <chr> & <dbl> & <dbl>\\\\\n",
|
243 |
+
"\\hline\n",
|
244 |
+
"\t f1 & 0.6741031 & 7.912632e-15\\\\\n",
|
245 |
+
"\\end{tabular}\n"
|
246 |
+
],
|
247 |
+
"text/markdown": [
|
248 |
+
"\n",
|
249 |
+
"A tibble: 1 × 3\n",
|
250 |
+
"\n",
|
251 |
+
"| variable <chr> | statistic <dbl> | p <dbl> |\n",
|
252 |
+
"|---|---|---|\n",
|
253 |
+
"| f1 | 0.6741031 | 7.912632e-15 |\n",
|
254 |
+
"\n"
|
255 |
+
],
|
256 |
+
"text/plain": [
|
257 |
+
" variable statistic p \n",
|
258 |
+
"1 f1 0.6741031 7.912632e-15"
|
259 |
+
]
|
260 |
+
},
|
261 |
+
"metadata": {},
|
262 |
+
"output_type": "display_data"
|
263 |
+
},
|
264 |
+
{
|
265 |
+
"data": {
|
266 |
+
"text/html": [
|
267 |
+
"<table class=\"dataframe\">\n",
|
268 |
+
"<caption>A tibble: 1 × 3</caption>\n",
|
269 |
+
"<thead>\n",
|
270 |
+
"\t<tr><th scope=col>variable</th><th scope=col>statistic</th><th scope=col>p</th></tr>\n",
|
271 |
+
"\t<tr><th scope=col><chr></th><th scope=col><dbl></th><th scope=col><dbl></th></tr>\n",
|
272 |
+
"</thead>\n",
|
273 |
+
"<tbody>\n",
|
274 |
+
"\t<tr><td>f1</td><td>0.6558935</td><td>3.037616e-15</td></tr>\n",
|
275 |
+
"</tbody>\n",
|
276 |
+
"</table>\n"
|
277 |
+
],
|
278 |
+
"text/latex": [
|
279 |
+
"A tibble: 1 × 3\n",
|
280 |
+
"\\begin{tabular}{lll}\n",
|
281 |
+
" variable & statistic & p\\\\\n",
|
282 |
+
" <chr> & <dbl> & <dbl>\\\\\n",
|
283 |
+
"\\hline\n",
|
284 |
+
"\t f1 & 0.6558935 & 3.037616e-15\\\\\n",
|
285 |
+
"\\end{tabular}\n"
|
286 |
+
],
|
287 |
+
"text/markdown": [
|
288 |
+
"\n",
|
289 |
+
"A tibble: 1 × 3\n",
|
290 |
+
"\n",
|
291 |
+
"| variable <chr> | statistic <dbl> | p <dbl> |\n",
|
292 |
+
"|---|---|---|\n",
|
293 |
+
"| f1 | 0.6558935 | 3.037616e-15 |\n",
|
294 |
+
"\n"
|
295 |
+
],
|
296 |
+
"text/plain": [
|
297 |
+
" variable statistic p \n",
|
298 |
+
"1 f1 0.6558935 3.037616e-15"
|
299 |
+
]
|
300 |
+
},
|
301 |
+
"metadata": {},
|
302 |
+
"output_type": "display_data"
|
303 |
+
}
|
304 |
+
],
|
305 |
+
"source": [
|
306 |
+
"f1_scores %>%\n",
|
307 |
+
" filter(retriever == \"faiss\") %>%\n",
|
308 |
+
" shapiro_test(f1)\n",
|
309 |
+
"\n",
|
310 |
+
"f1_scores %>%\n",
|
311 |
+
" filter(retriever == \"es\") %>%\n",
|
312 |
+
" shapiro_test(f1)\n",
|
313 |
+
"\n",
|
314 |
+
"f1_scores %>%\n",
|
315 |
+
" filter(reader == \"dpr\") %>%\n",
|
316 |
+
" shapiro_test(f1)\n",
|
317 |
+
"\n",
|
318 |
+
"f1_scores %>%\n",
|
319 |
+
" filter(reader == \"longformer\") %>%\n",
|
320 |
+
" shapiro_test(f1)\n"
|
321 |
+
]
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"cell_type": "markdown",
|
325 |
+
"metadata": {},
|
326 |
+
"source": [
|
327 |
+
"Since our data is not normally distributed, we cannot use an ANOVA to compare our results. Therefore, we use an aligned-rank test, which is a non-parameteric version of a factorial repeated measures ANOVA."
|
328 |
+
]
|
329 |
+
},
|
330 |
+
{
|
331 |
+
"cell_type": "code",
|
332 |
+
"execution_count": 22,
|
333 |
+
"metadata": {
|
334 |
+
"vscode": {
|
335 |
+
"languageId": "r"
|
336 |
+
}
|
337 |
+
},
|
338 |
+
"outputs": [
|
339 |
+
{
|
340 |
+
"data": {
|
341 |
+
"text/html": [
|
342 |
+
"<table class=\"dataframe\">\n",
|
343 |
+
"<caption>A anova.art: 3 × 7</caption>\n",
|
344 |
+
"<thead>\n",
|
345 |
+
"\t<tr><th></th><th scope=col>Term</th><th scope=col>Df</th><th scope=col>Df.res</th><th scope=col>Sum Sq</th><th scope=col>Sum Sq.res</th><th scope=col>F value</th><th scope=col>Pr(>F)</th></tr>\n",
|
346 |
+
"\t<tr><th></th><th scope=col><chr></th><th scope=col><dbl></th><th scope=col><dbl></th><th scope=col><dbl></th><th scope=col><dbl></th><th scope=col><dbl></th><th scope=col><dbl></th></tr>\n",
|
347 |
+
"</thead>\n",
|
348 |
+
"<tbody>\n",
|
349 |
+
"\t<tr><th scope=row>retriever</th><td>retriever </td><td>1</td><td>232</td><td>200452.90</td><td>793168.0</td><td>58.63206</td><td>5.105423e-13</td></tr>\n",
|
350 |
+
"\t<tr><th scope=row>reader</th><td>reader </td><td>1</td><td>232</td><td> 66045.36</td><td>944311.6</td><td>16.22613</td><td>7.620176e-05</td></tr>\n",
|
351 |
+
"\t<tr><th scope=row>retriever:reader</th><td>retriever:reader</td><td>1</td><td>232</td><td>158290.44</td><td>843714.0</td><td>43.52587</td><td>2.804257e-10</td></tr>\n",
|
352 |
+
"</tbody>\n",
|
353 |
+
"</table>\n"
|
354 |
+
],
|
355 |
+
"text/latex": [
|
356 |
+
"A anova.art: 3 × 7\n",
|
357 |
+
"\\begin{tabular}{r|lllllll}\n",
|
358 |
+
" & Term & Df & Df.res & Sum Sq & Sum Sq.res & F value & Pr(>F)\\\\\n",
|
359 |
+
" & <chr> & <dbl> & <dbl> & <dbl> & <dbl> & <dbl> & <dbl>\\\\\n",
|
360 |
+
"\\hline\n",
|
361 |
+
"\tretriever & retriever & 1 & 232 & 200452.90 & 793168.0 & 58.63206 & 5.105423e-13\\\\\n",
|
362 |
+
"\treader & reader & 1 & 232 & 66045.36 & 944311.6 & 16.22613 & 7.620176e-05\\\\\n",
|
363 |
+
"\tretriever:reader & retriever:reader & 1 & 232 & 158290.44 & 843714.0 & 43.52587 & 2.804257e-10\\\\\n",
|
364 |
+
"\\end{tabular}\n"
|
365 |
+
],
|
366 |
+
"text/markdown": [
|
367 |
+
"\n",
|
368 |
+
"A anova.art: 3 × 7\n",
|
369 |
+
"\n",
|
370 |
+
"| <!--/--> | Term <chr> | Df <dbl> | Df.res <dbl> | Sum Sq <dbl> | Sum Sq.res <dbl> | F value <dbl> | Pr(>F) <dbl> |\n",
|
371 |
+
"|---|---|---|---|---|---|---|---|\n",
|
372 |
+
"| retriever | retriever | 1 | 232 | 200452.90 | 793168.0 | 58.63206 | 5.105423e-13 |\n",
|
373 |
+
"| reader | reader | 1 | 232 | 66045.36 | 944311.6 | 16.22613 | 7.620176e-05 |\n",
|
374 |
+
"| retriever:reader | retriever:reader | 1 | 232 | 158290.44 | 843714.0 | 43.52587 | 2.804257e-10 |\n",
|
375 |
+
"\n"
|
376 |
+
],
|
377 |
+
"text/plain": [
|
378 |
+
" Term Df Df.res Sum Sq Sum Sq.res F value \n",
|
379 |
+
"retriever retriever 1 232 200452.90 793168.0 58.63206\n",
|
380 |
+
"reader reader 1 232 66045.36 944311.6 16.22613\n",
|
381 |
+
"retriever:reader retriever:reader 1 232 158290.44 843714.0 43.52587\n",
|
382 |
+
" Pr(>F) \n",
|
383 |
+
"retriever 5.105423e-13\n",
|
384 |
+
"reader 7.620176e-05\n",
|
385 |
+
"retriever:reader 2.804257e-10"
|
386 |
+
]
|
387 |
+
},
|
388 |
+
"metadata": {},
|
389 |
+
"output_type": "display_data"
|
390 |
+
},
|
391 |
+
{
|
392 |
+
"name": "stderr",
|
393 |
+
"output_type": "stream",
|
394 |
+
"text": [
|
395 |
+
"NOTE: Results may be misleading due to involvement in interactions\n",
|
396 |
+
"\n"
|
397 |
+
]
|
398 |
+
},
|
399 |
+
{
|
400 |
+
"data": {
|
401 |
+
"text/plain": [
|
402 |
+
" contrast estimate SE df t.ratio p.value\n",
|
403 |
+
" es - faiss 58.3 7.61 232 7.657 <.0001\n",
|
404 |
+
"\n",
|
405 |
+
"Results are averaged over the levels of: reader "
|
406 |
+
]
|
407 |
+
},
|
408 |
+
"metadata": {},
|
409 |
+
"output_type": "display_data"
|
410 |
+
},
|
411 |
+
{
|
412 |
+
"name": "stderr",
|
413 |
+
"output_type": "stream",
|
414 |
+
"text": [
|
415 |
+
"NOTE: Results may be misleading due to involvement in interactions\n",
|
416 |
+
"\n"
|
417 |
+
]
|
418 |
+
},
|
419 |
+
{
|
420 |
+
"data": {
|
421 |
+
"text/plain": [
|
422 |
+
" contrast estimate SE df t.ratio p.value\n",
|
423 |
+
" dpr - longformer -33.5 8.31 232 -4.028 0.0001\n",
|
424 |
+
"\n",
|
425 |
+
"Results are averaged over the levels of: retriever "
|
426 |
+
]
|
427 |
+
},
|
428 |
+
"metadata": {},
|
429 |
+
"output_type": "display_data"
|
430 |
+
}
|
431 |
+
],
|
432 |
+
"source": [
|
433 |
+
"model.acc <- art(f1 ~ retriever * reader, data = f1_scores)\n",
|
434 |
+
"anova(model.acc)\n",
|
435 |
+
"art.con(model.acc, ~ retriever)\n",
|
436 |
+
"art.con(model.acc, ~ reader)"
|
437 |
+
]
|
438 |
+
},
|
439 |
+
{
|
440 |
+
"cell_type": "markdown",
|
441 |
+
"metadata": {},
|
442 |
+
"source": [
|
443 |
+
"From these results, we can see that both the retriever and the reader have a significant effect on the F1 score ($F = 58.63$ and $F = 16.23$ respectively, $p < 0.0001$ for both). However, there is also an interaction between the retriever and reader ($F = 43.53$, $p < 0.0001$). The post-hoc analysis of contrasts shows that ElasticSearch performs better than FAISS ($p < 0.0001$) and Longformer performs better than DPR ($p < 0.0001$)."
|
444 |
+
]
|
445 |
+
}
|
446 |
+
],
|
447 |
+
"metadata": {
|
448 |
+
"kernelspec": {
|
449 |
+
"display_name": "R",
|
450 |
+
"language": "R",
|
451 |
+
"name": "ir"
|
452 |
+
},
|
453 |
+
"language_info": {
|
454 |
+
"codemirror_mode": "r",
|
455 |
+
"file_extension": ".r",
|
456 |
+
"mimetype": "text/x-r-source",
|
457 |
+
"name": "R",
|
458 |
+
"pygments_lexer": "r",
|
459 |
+
"version": "4.1.2"
|
460 |
+
},
|
461 |
+
"orig_nbformat": 4
|
462 |
+
},
|
463 |
+
"nbformat": 4,
|
464 |
+
"nbformat_minor": 2
|
465 |
+
}
|