Sentiment Analysis ด้วย Python
Violeta Misheva
Data Scientist
ฉัน มีความสุข, ไม่ใช่เศร้า.
ฉัน เศร้า, ไม่ใช่มีความสุข.
Unigrams : โทเคนเดี่ยว
Bigrams: คู่ของโทเคน
Trigrams: ชุดสามโทเคน
n-grams: ลำดับของ n โทเคน
สภาพอากาศวันนี้ช่างสดใส
Unigrams : { The, weather, today, is, wonderful }
Bigrams: {The weather, weather today, today is, is wonderful}
Trigrams: {The weather today, weather today is, today is wonderful}
from sklearn.feature_extraction.text import CountVectorizer
vect = CountVectorizer(ngram_range=(min_n, max_n))
# Only unigrams
ngram_range=(1, 1)
# Uni- and bigrams
ngram_range=(1, 2)
CountVectorizer(max_features, max_df, min_df)
Sentiment Analysis ด้วย Python