diff --git a/ammico/test/test_text.py b/ammico/test/test_text.py index 8d2a427..cfa8e6b 100644 --- a/ammico/test/test_text.py +++ b/ammico/test/test_text.py @@ -94,7 +94,7 @@ def test_text_sentiment_transformers(): mydict["text_english"] = "I am happy that the CI is working again." test_obj.text_sentiment_transformers() assert mydict["sentiment"] == "POSITIVE" - assert mydict["sentiment_score"] == pytest.approx(0.99, 0.01) + assert mydict["sentiment_score"] == pytest.approx(0.99, 0.02) @pytest.mark.win_skip diff --git a/ammico/text.py b/ammico/text.py index 0e5ed12..dc21185 100644 --- a/ammico/text.py +++ b/ammico/text.py @@ -133,7 +133,7 @@ class TextDetector(AnalysisMethod): ) result = pipe(self.subdict["text_english"]) self.subdict["sentiment"] = result[0]["label"] - self.subdict["sentiment_score"] = result[0]["score"] + self.subdict["sentiment_score"] = round(result[0]["score"], 2) def text_ner(self): """Perform named entity recognition on the text using the Transformers pipeline."""