Sentiment Analysis con Python
Violeta Misheva
Data Scientist
Io sono felice, non triste.
Io sono triste, non felice.
Unigrammi: token singoli
Bigrammi: coppie di token
Trigrammi: triple di token
n-grammi: sequenze di n token
The weather today is wonderful.
Unigrammi: { The, weather, today, is, wonderful }
Bigrammi: {The weather, weather today, today is, is wonderful}
Trigrammi: {The weather today, weather today is, today is wonderful}
from sklearn.feature_extraction.text import CountVectorizer
vect = CountVectorizer(ngram_range=(min_n, max_n))
# Solo unigrammi
ngram_range=(1, 1)
# Uni- e bigrammi
ngram_range=(1, 2)
CountVectorizer(max_features, max_df, min_df)
Sentiment Analysis con Python