Skip to content

Commit

Permalink
text: re-adding Chrf implementation (#2697)
Browse files Browse the repository at this point in the history
* Revert "text: temp drop `Chrf` implementation (#2668)"

This reverts commit 663f06d.

* update licence

---------

Co-authored-by: Maja Popovic <[email protected]>
Co-authored-by: Daniel Stancl <[email protected]>
  • Loading branch information
3 people authored Aug 28, 2024
1 parent ef22554 commit d9d37d8
Show file tree
Hide file tree
Showing 5 changed files with 871 additions and 82 deletions.
9 changes: 8 additions & 1 deletion src/torchmetrics/functional/text/_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@ def _chrf_score(
whitespace: bool = False,
return_sentence_level_score: bool = False,
) -> Union[Tensor, Tuple[Tensor, Tensor]]:
"""Wrapper for deprecated import."""
"""Wrapper for deprecated import.
>>> preds = ['the cat is on the mat']
>>> target = [['there is a cat on the mat', 'a cat is on the mat']]
>>> _chrf_score(preds, target)
tensor(0.8640)
"""
_deprecated_root_import_func("chrf_score", "text")
return chrf_score(
preds=preds,
Expand Down
Loading

0 comments on commit d9d37d8

Please sign in to comment.