mirror of
https://github.com/Steffo99/unimore-bda-6.git
synced 2025-02-16 14:13:59 +00:00
Completely remove language
parameter from VanillaSA
This commit is contained in:
parent
c212be37c3
commit
a34baebeb5
1 changed files with 2 additions and 2 deletions
|
@ -22,11 +22,11 @@ class VanillaSA(BaseSA, metaclass=abc.ABCMeta):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.model: nltk.sentiment.SentimentAnalyzer = nltk.sentiment.SentimentAnalyzer()
|
self.model: nltk.sentiment.SentimentAnalyzer = nltk.sentiment.SentimentAnalyzer()
|
||||||
|
|
||||||
def _tokenize_text(self, text: str, language: str = "english") -> list[str]:
|
def _tokenize_text(self, text: str) -> list[str]:
|
||||||
"""
|
"""
|
||||||
Convert a text string into a list of tokens, using the language of the model.
|
Convert a text string into a list of tokens, using the language of the model.
|
||||||
"""
|
"""
|
||||||
tokens = nltk.word_tokenize(text, language=language)
|
tokens = nltk.word_tokenize(text)
|
||||||
nltk.sentiment.util.mark_negation(tokens, shallow=True)
|
nltk.sentiment.util.mark_negation(tokens, shallow=True)
|
||||||
return tokens
|
return tokens
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue