May-18-2020, 02:10 AM
Hey Guys,
I'm newbie to the ML world and I'm confronting an annoying problem which is when I run the code, nothing happens, just an empty screen. The code is below:
And I'm using PyCharm, Any Ideas?
I'm newbie to the ML world and I'm confronting an annoying problem which is when I run the code, nothing happens, just an empty screen. The code is below:
import pandas as pd import numpy as np import gensim import spacy import nltk import text_normalizer as tn from afinn import Afinn np.set_printoptions(precision=2, linewidth=80) dataset = pd.read_csv(r'movie_reviews.csv') reviews = np.array(dataset['review']) sentiments = np.array(dataset['sentiment']) # extract data for model evaluation test_reviews = reviews[35000:] test_sentiments = sentiments[35000:] sample_review_ids = [7626, 3533, 13010] # normalize dataset norm_test_reviews = tn.normalize_corpus(test_reviews) afn = Afinn(emoticons=True) for review, sentiment in zip(test_reviews[sample_review_ids], test_sentiments[sample_review_ids]): print('REVIEW:', review) print('Actual Sentiment:', sentiment) print('Predicted Sentiment polarity:', afn.score(review)) print('-'*60)
And I'm using PyCharm, Any Ideas?