Skip to content

Commit

Permalink
fix sentiment maximum token size
Browse files Browse the repository at this point in the history
  • Loading branch information
sadeghjafari5528 committed May 27, 2024
1 parent ec74904 commit 74d68f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dadmatools/pipeline/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self, pipelines, lang='persian', cache_dir=None, gpu=True, embeddin
# sentiment if possible
if SENT in self.pipelines:
model_path = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
self._sent_model = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
self._sent_model = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path, max_length=512, truncation=True)

# self._sent_model = {}
# for lang in self.added_langs:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="dadmatools",
version="2.0.3",
version="2.0.4",
author="Dadmatech AI Company",
author_email="info@dadmatech.ir",
description="DadmaTools is a Persian NLP toolkit",
Expand Down

0 comments on commit 74d68f6

Please sign in to comment.