Skip to content

Commit

Permalink
Merge branch 'main' of github.com:disi-unibo-nlp/nlg-metricverse
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinaPieri committed Oct 24, 2023
2 parents 5a803f8 + 6986b30 commit f2f09f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nlgmetricverse/metrics/chrf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ChrF compares character n-grams in the reference and candidate sentences, instea
The precision and recall are computed over the character n-grams for various values of n (upto 6) and are combined using arithmetic averaging to get the overall precision (chrP) and recall (chrR) respectively.
In other words, chrP represents the percentage of matched character n-grams present in the hypothesis and chrR represents the percentage of character n-grams in the reference which are also present in the hypothesis.
The final chrF score is then computed as:<br>
<img src="https://render.githubusercontent.com/render/math?math={chrF_{\beta} = (1 + \beta^2) \frac{chrP chrR}{\beta^2 chrP + chrR}}##gh-light-mode-only">,<br>
where <img src="https://render.githubusercontent.com/render/math?math={\beta}##gh-light-mode-only"> indicates that recall is given <img src="https://render.githubusercontent.com/render/math?math={\beta}##gh-light-mode-only"> times more weightage than precision.
$$chrF_{\beta} = (1 + \beta^2) \frac{chrP chrR}{\beta^2 chrP + chrR}$$
where $\beta$ indicates that recall is given $\beta$ times more weightage than precision.
Popovic propose two enhanced versions of chrF: (i) chrF+, which also considers word unigrams; (ii) chrF++, which considers word unigrams and bigrams in addition to character n-grams.

We use the implementation that is already present in sacreBLEU.
Expand Down Expand Up @@ -106,4 +106,4 @@ print(scores)
```

## Further References
- See the [sacreBLEU README.md](https://github.com/mjpost/sacreBLEU#chrf--chrf) file for more information.
- See the [sacreBLEU README.md](https://github.com/mjpost/sacreBLEU#chrf--chrf) file for more information.

0 comments on commit f2f09f1

Please sign in to comment.