* round sentiment score

* Update test_text.py

increased assert range
Этот коммит содержится в:
GwydionJon 2023-06-23 14:09:10 +02:00 коммит произвёл GitHub
родитель 7d650caaef
Коммит ceec46a91c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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."""