Python ile Duygu Analizi
Violeta Misheva
Data Scientist
Durdurma kelimeleri: Çok sık geçen ve bilgi taşımadığı düşünülen kelimeler
Çoğu dilde durdurma kelimesi listeleri vardır
{'the', 'a', 'an', 'and', 'but', 'for', 'on', 'in', 'at' ...}
Bağlam önemlidir
{'movie', 'movies', 'film', 'films', 'cinema'}


# Kütüphaneleri içe aktar
from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt
# Durdurma kelimeleri listesini tanımla
my_stopwords = set(STOPWORDS)
my_stopwords.update(["movie", "movies", "film", "films", "watch", "br"])
# Kelime bulutunu oluştur ve göster
my_cloud = WordCloud(background_color='white', stopwords=my_stopwords).generate(name_string)
plt.imshow(my_cloud, interpolation='bilinear')
from sklearn.feature_extraction.text import CountVectorizer, ENGLISH_STOP_WORDS
# Durdurma kelimeleri kümesini tanımla
my_stop_words = ENGLISH_STOP_WORDS.union(['film', 'movie', 'cinema', 'theatre'])
vect = CountVectorizer(stop_words=my_stop_words)
vect.fit(movies.review)
X = vect.transform(movies.review)
Python ile Duygu Analizi