Skip to content

Commit

Permalink
del stopword from pythainlp.sentiment
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Aug 16, 2017
1 parent 55cfcd7 commit a82e9d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pythainlp/sentiment/__init__.py
Expand Up @@ -32,9 +32,9 @@ def sentiment(text):
with open(os.path.join(templates_dir, 'sentiment.data'), 'rb') as in_strm:
classifier = dill.load(in_strm)
in_strm.close()
text=word_tokenize(text)
text=set(word_tokenize(text))-set(stopwords.words('thai'))
featurized_test_sentence = {i:(i in text) for i in vocabulary}
return classifier.classify(featurized_test_sentence)
if __name__ == '__main__':
d="ดีใจ"
d="เสียใจแย่มากเลย"
print(sentiment(d))

0 comments on commit a82e9d5

Please sign in to comment.