mirror of
https://github.com/Steffo99/unimore-bda-6.git
synced 2024-11-21 15:34:18 +00:00
Fix access to ratings instead of tokens
This commit is contained in:
parent
bf193bcd93
commit
d4373f8c02
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ class NLTKSentimentAnalyzer(BaseSentimentAnalyzer):
|
|||
Register the `nltk.sentiment.util.extract_unigram_feats` feature extrator on the model.
|
||||
"""
|
||||
# Ignore the category and only access the tokens
|
||||
tokenbags = map(lambda r: r.rating, dataset)
|
||||
tokenbags = map(lambda r: r.tokens, dataset)
|
||||
# Get all words in the documents
|
||||
all_words = self.model.all_words(tokenbags, labeled=False)
|
||||
# Create unigram `contains(*)` features from the previously gathered words
|
||||
|
|
Loading…
Reference in a new issue