huggingface / huggingface/course

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

Open
#641 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
4.2k
Forks
1.4k
Avg merge
13m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.