From 045c703232c5c38ec4664c09663b751c9058c30f Mon Sep 17 00:00:00 2001 From: Nicki Skafte Date: Thu, 8 Apr 2021 15:12:12 +0200 Subject: [PATCH 1/3] nltk --- torchmetrics/functional/nlp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/torchmetrics/functional/nlp.py b/torchmetrics/functional/nlp.py index 53f5e47e40c..50e39e5762c 100644 --- a/torchmetrics/functional/nlp.py +++ b/torchmetrics/functional/nlp.py @@ -101,6 +101,7 @@ def bleu_score( if smooth: precision_scores = torch.add(numerator, torch.ones(n_gram)) / torch.add(denominator, torch.ones(n_gram)) + precision_scores[0] = numerator[0] / denominator[0] else: precision_scores = numerator / denominator From 308e2606b568b8f5554d3b13269565a705e3864e Mon Sep 17 00:00:00 2001 From: Nicki Skafte Date: Thu, 8 Apr 2021 15:39:00 +0200 Subject: [PATCH 2/3] latest nltk --- requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index 2f79ef04731..ff77d9bc3b3 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -14,4 +14,4 @@ yapf>=0.29.0 cloudpickle>=1.3 scikit-learn>0.22.1 scikit-image>0.17.1 -nltk>=3.3 +nltk>=3.6 From 67356ae84cfd87cb62874743c6d817453fbe32ee Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Fri, 9 Apr 2021 10:22:43 +0200 Subject: [PATCH 3/3] chlog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6200571f0ac..1fbf0b1c90d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed when `_stable_1d_sort` to work when n >= N ([PL^6177](https://github.com/PyTorchLightning/pytorch-lightning/pull/6177)) - Fixed `_computed` attribute not being correctly reset ([#147](https://github.com/PyTorchLightning/metrics/pull/147)) +- Fixed to blau score ([#165](https://github.com/PyTorchLightning/metrics/pull/165)) ## [0.2.0] - 2021-03-12