From 329f324c6f06ed0fb53f3b671afa27255330efde Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Wed, 5 Jan 2022 13:07:31 +0100 Subject: [PATCH] typo Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com> --- torchmetrics/__init__.py | 2 +- torchmetrics/functional/__init__.py | 4 ++-- torchmetrics/functional/text/__init__.py | 2 +- torchmetrics/functional/text/wer.py | 6 +++--- torchmetrics/text/__init__.py | 2 +- torchmetrics/text/wer.py | 9 ++------- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/torchmetrics/__init__.py b/torchmetrics/__init__.py index 80ebd882511..959c7b368fa 100644 --- a/torchmetrics/__init__.py +++ b/torchmetrics/__init__.py @@ -69,13 +69,13 @@ from torchmetrics.text import ( # noqa: E402 TER, WER, - WordErrorRate, BLEUScore, CharErrorRate, CHRFScore, MatchErrorRate, SacreBLEUScore, SQuAD, + WordErrorRate, WordInfoLost, WordInfoPreserved, ) diff --git a/torchmetrics/functional/__init__.py b/torchmetrics/functional/__init__.py index 6831927fa85..acfcb53eec8 100644 --- a/torchmetrics/functional/__init__.py +++ b/torchmetrics/functional/__init__.py @@ -73,7 +73,7 @@ from torchmetrics.functional.text.sacre_bleu import sacre_bleu_score from torchmetrics.functional.text.squad import squad from torchmetrics.functional.text.ter import ter -from torchmetrics.functional.text.wer import web, word_error_rate +from torchmetrics.functional.text.wer import wer, word_error_rate from torchmetrics.functional.text.wil import word_information_lost from torchmetrics.functional.text.wip import word_information_preserved @@ -139,7 +139,7 @@ "stat_scores", "symmetric_mean_absolute_percentage_error", "ter", - "web", + "wer", "word_error_rate", "char_error_rate", "match_error_rate", diff --git a/torchmetrics/functional/text/__init__.py b/torchmetrics/functional/text/__init__.py index 0faba97be9d..d760bb5642f 100644 --- a/torchmetrics/functional/text/__init__.py +++ b/torchmetrics/functional/text/__init__.py @@ -19,6 +19,6 @@ from torchmetrics.functional.text.sacre_bleu import sacre_bleu_score # noqa: F401 from torchmetrics.functional.text.squad import squad # noqa: F401 from torchmetrics.functional.text.ter import ter # noqa: F401 -from torchmetrics.functional.text.wer import web, word_error_rate # noqa: F401 +from torchmetrics.functional.text.wer import wer, word_error_rate # noqa: F401 from torchmetrics.functional.text.wil import word_information_lost # noqa: F401 from torchmetrics.functional.text.wip import word_information_preserved # noqa: F401 diff --git a/torchmetrics/functional/text/wer.py b/torchmetrics/functional/text/wer.py index 08fad5e3e63..25dafcb2b98 100644 --- a/torchmetrics/functional/text/wer.py +++ b/torchmetrics/functional/text/wer.py @@ -87,7 +87,7 @@ def word_error_rate( return _wer_compute(errors, total) -def web( +def wer( predictions: Union[str, List[str]], references: Union[str, List[str]], ) -> Tensor: @@ -99,8 +99,8 @@ def web( Examples: >>> predictions = ["this is the prediction", "there is an other sample"] >>> references = ["this is the reference", "there is another one"] - >>> web(predictions=predictions, references=references) + >>> wer(predictions=predictions, references=references) tensor(0.5000) """ - warn("`web` was renamed to `word_error_rate` in v0.7 and it will be removed in v0.8", DeprecationWarning) + warn("`wer` was renamed to `word_error_rate` in v0.7 and it will be removed in v0.8", DeprecationWarning) return word_error_rate(predictions, references) diff --git a/torchmetrics/text/__init__.py b/torchmetrics/text/__init__.py index 0f69601c5d3..50cc0526f12 100644 --- a/torchmetrics/text/__init__.py +++ b/torchmetrics/text/__init__.py @@ -18,6 +18,6 @@ from torchmetrics.text.sacre_bleu import SacreBLEUScore # noqa: F401 from torchmetrics.text.squad import SQuAD # noqa: F401 from torchmetrics.text.ter import TER # noqa: F401 -from torchmetrics.text.wer import WordErrorRate, WER # noqa: F401 +from torchmetrics.text.wer import WER, WordErrorRate # noqa: F401 from torchmetrics.text.wil import WordInfoLost # noqa: F401 from torchmetrics.text.wip import WordInfoPreserved # noqa: F401 diff --git a/torchmetrics/text/wer.py b/torchmetrics/text/wer.py index ca7e4dfa16c..7eea21fbf68 100644 --- a/torchmetrics/text/wer.py +++ b/torchmetrics/text/wer.py @@ -125,10 +125,5 @@ def __init__( process_group: Optional[Any] = None, dist_sync_fn: Callable = None, ): - warn("`WEB` was renamed to `WordErrorRate` in v0.7 and it will be removed in v0.8", DeprecationWarning) - super().__init__( - compute_on_step, - dist_sync_on_step, - process_group, - dist_sync_fn - ) \ No newline at end of file + warn("`WER` was renamed to `WordErrorRate` in v0.7 and it will be removed in v0.8", DeprecationWarning) + super().__init__(compute_on_step, dist_sync_on_step, process_group, dist_sync_fn)