Python으로 배우는 Sentiment Analysis
Violeta Misheva
Data Scientist
I am happy, not sad.
I am sad, not happy.
유니그램: 단일 토큰
바이그램: 토큰의 쌍
트라이그램: 토큰의 세 개 묶음
n-그램: n개의 토큰 시퀀스
The weather today is wonderful.
유니그램: { The, weather, today, is, wonderful }
바이그램: {The weather, weather today, today is, is wonderful}
트라이그램: {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)
Python으로 배우는 Sentiment Analysis