course icon indicating copy to clipboard operation
course copied to clipboard

Bug in chapter 7, section 2: return parameters are swapped

Open xlenstra opened this issue 2 years ago • 0 comments

In the line below, the function postprocess returns first the labels and then the predictions.

https://github.com/huggingface/course/blob/198345755d4e2b1e61a394c6df03c36319258fda/chapters/en/chapter7/2.mdx#L877

However, when this function is called, the first variable instead catches the predictions and the second catches the labels.

https://github.com/huggingface/course/blob/198345755d4e2b1e61a394c6df03c36319258fda/chapters/en/chapter7/2.mdx#L923

This results in an incorrect calculation for the precision, recall and f1 for the provided dataset. People copying this example will also unknowingly copy this bug into their code.

xlenstra avatar Nov 07 '23 14:11 xlenstra