Skip to content

Commit

Permalink
text: re-adding Chrf implementation (#2701)
Browse files Browse the repository at this point in the history
* update licence

This reverts commit 663f06d.

---------

Co-authored-by: Maja Popovic <[email protected]>
(cherry picked from commit 773fb92)
  • Loading branch information
Borda committed Sep 13, 2024
1 parent f862c32 commit d8e91f3
Show file tree
Hide file tree
Showing 6 changed files with 875 additions and 83 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

-
- Re-adding `Chrf` implementation ([#2701](https://github.com/Lightning-AI/torchmetrics/pull/2701))


### Changed
Expand Down
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 d8e91f3

Please sign in to comment.