Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
Co-authored-by: Justus Schock <[email protected]>
  • Loading branch information
Borda and justusschock committed Jan 5, 2022
1 parent 345cecc commit 329f324
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion torchmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@
from torchmetrics.text import ( # noqa: E402
TER,
WER,
WordErrorRate,
BLEUScore,
CharErrorRate,
CHRFScore,
MatchErrorRate,
SacreBLEUScore,
SQuAD,
WordErrorRate,
WordInfoLost,
WordInfoPreserved,
)
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -139,7 +139,7 @@
"stat_scores",
"symmetric_mean_absolute_percentage_error",
"ter",
"web",
"wer",
"word_error_rate",
"char_error_rate",
"match_error_rate",
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/functional/text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions torchmetrics/functional/text/wer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
2 changes: 1 addition & 1 deletion torchmetrics/text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 2 additions & 7 deletions torchmetrics/text/wer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
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)

0 comments on commit 329f324

Please sign in to comment.