HW2: VECTORIZATION (Pandas style!)

STEP 1: Import ALL the things

Import libraries

In [2]:
##########################################
# NOTE: I'm toying with the idea of requiring the library just above 
# when I use it so it makes more sense in context
##########################################
# import os
# import pandas as pd
# from nltk.tokenize import word_tokenize, sent_tokenize
# from nltk.sentiment import SentimentAnalyzer
# from nltk.sentiment.util import *
# from nltk.probability import FreqDist
# from nltk.sentiment.vader import SentimentIntensityAnalyzer
# sid = SentimentIntensityAnalyzer()

Import data from files

In [5]:
import os
def get_data_from_files(path):
    directory = os.listdir(path)
    results = []
    for file in directory:
        f=open(path+file)
        results.append(f.read())
        f.close()
    return results

# neg = get_data_from_files('../NEG_JK/')
# pos = get_data_from_files('../POS_JK/')


neg = get_data_from_files('../NEG_JK_E/')
pos = get_data_from_files('../POS_JK_E/')
# neg

STEP 2: Prep Data

STEP 2a: Turn that fresh text into a pandas DF

In [6]:
import pandas as pd
import csv

neg_df = pd.DataFrame(neg)
pos_df = pd.DataFrame(pos)
# neg_df.to_csv('neg_joker_csv.csv',quoting=csv.QUOTE_ALL, sep='\t')
# neg_df.to_csv('neg_joker_csv.csv', index=False)
all_df = neg_df.append(pos_df)
all_df
# pos_df.to_csv('pos_joker_csv.csv', index=False)
Out[6]:
0
0 Everyone praised an overrated movie.\nOverrat...
1 What idiotic FIlm\nI can say that Phoenix is ...
2 Terrible\nThe only thing good about this movi...
3 Watch Taxi Driver instead\nThis is a poor att...
4 I learned one thing.\nIt borrows a lot of ele...
... ...
45 Masterpiece.\nThe music. The intense. The rea...
46 BELIEVE THE HYPE\nJoaquin Phoenix gives Heath...
47 Joaquin 'OSCAR', Joker = best Dark suspense t...
48 Oscar for Phoenix\nI will stop watching movie...
49 Joker > Endgame\nNeed I say more? Everything ...

98 rows × 1 columns

STEP 2b: Label it

In [7]:
pos_df['PoN'] = 'P'
neg_df['PoN'] = 'N'

STEP 2c: Combine the dfs

In [8]:
all_df = neg_df.append(pos_df)
In [12]:
all_df

all_df.to_csv('all_JK_extremes_labeled.csv', index=False)
In [22]:
all_df_no_label = all_df.drop('PoN', axis=1)
all_df_no_label
# all_df
all_df_no_label.to_csv('all_JK_extremes_no_label.csv', index=False)

STEP 3: TOKENIZE (and clean)!!

In [8]:
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.sentiment import SentimentAnalyzer
from nltk.sentiment.util import *
In [9]:
## Came back and added sentences for tokinization for "Summary experiment"
def get_sentence_tokens(review):
    return sent_tokenize(review)
    
all_df['sentences'] = all_df.apply(lambda x: get_sentence_tokens(x[0]), axis=1)
all_df['num_sentences'] = all_df.apply(lambda x: len(x['sentences']), axis=1)
In [10]:
def get_tokens(sentence):
    tokens = word_tokenize(sentence)
    clean_tokens = [word.lower() for word in tokens if word.isalpha()]
    return clean_tokens

all_df['tokens'] = all_df.apply(lambda x: get_tokens(x[0]), axis=1)
all_df['num_tokens'] = all_df.apply(lambda x: len(x['tokens']), axis=1)
In [11]:
all_df
Out[11]:
0 PoN sentences num_sentences tokens num_tokens
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124
... ... ... ... ... ... ...
118 Nerve-wracking, but in very uncomfortable way... P [ Nerve-wracking, but in very uncomfortable wa... 8 [but, in, very, uncomfortable, way, why, every... 57
119 Solid film but there are glaring problems\nOk... P [ Solid film but there are glaring problems\nO... 13 [solid, film, but, there, are, glaring, proble... 628
120 Joker > Endgame\nNeed I say more? Everything ... P [ Joker > Endgame\nNeed I say more?, Everythin... 5 [joker, endgame, need, i, say, more, everythin... 83
121 Absolutely not a 10\nStrong fanboy and hype r... P [ Absolutely not a 10\nStrong fanboy and hype ... 5 [absolutely, not, a, strong, fanboy, and, hype... 81
122 Overhyped, but it's alright\nIt's a good film... P [ Overhyped, but it's alright\nIt's a good fil... 3 [overhyped, but, it, alright, it, a, good, fil... 60

246 rows × 6 columns

STEP 4: Remove Stopwords

In [12]:
from nltk.corpus import stopwords
stop_words = set(stopwords.words("english"))
def remove_stopwords(sentence):
    filtered_text = []
    for word in sentence:
        if word not in stop_words:
            filtered_text.append(word)
    return filtered_text
all_df['no_sw'] = all_df.apply(lambda x: remove_stopwords(x['tokens']),axis=1)
all_df['num_no_sw'] = all_df.apply(lambda x: len(x['no_sw']),axis=1)
In [13]:
all_df
Out[13]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65
... ... ... ... ... ... ... ... ...
118 Nerve-wracking, but in very uncomfortable way... P [ Nerve-wracking, but in very uncomfortable wa... 8 [but, in, very, uncomfortable, way, why, every... 57 [uncomfortable, way, everybody, keep, saying, ... 33
119 Solid film but there are glaring problems\nOk... P [ Solid film but there are glaring problems\nO... 13 [solid, film, but, there, are, glaring, proble... 628 [solid, film, glaring, problems, okay, first, ... 292
120 Joker > Endgame\nNeed I say more? Everything ... P [ Joker > Endgame\nNeed I say more?, Everythin... 5 [joker, endgame, need, i, say, more, everythin... 83 [joker, endgame, need, say, everything, movie,... 53
121 Absolutely not a 10\nStrong fanboy and hype r... P [ Absolutely not a 10\nStrong fanboy and hype ... 5 [absolutely, not, a, strong, fanboy, and, hype... 81 [absolutely, strong, fanboy, hype, rush, going... 36
122 Overhyped, but it's alright\nIt's a good film... P [ Overhyped, but it's alright\nIt's a good fil... 3 [overhyped, but, it, alright, it, a, good, fil... 60 [overhyped, alright, good, film, see, like, ma... 31

246 rows × 8 columns

STEP 5: Create a Frequency Distribution

In [14]:
from nltk.probability import FreqDist
def get_most_common(tokens):
    fdist = FreqDist(tokens)
    return fdist.most_common(12)
all_df['topwords_unfil'] = all_df.apply(lambda x: get_most_common(x['tokens']),axis=1)
In [15]:
def get_most_common(tokens):
    fdist = FreqDist(tokens)
    return fdist.most_common(12)
all_df['topwords_fil'] = all_df.apply(lambda x: get_most_common(x['no_sw']),axis=1)
In [16]:
def get_fdist(tokens):
    return (FreqDist(tokens))
    
all_df['freq_dist'] = all_df.apply(lambda x: get_fdist(x['no_sw']),axis=1)
all_df['freq_dist_unfil'] = all_df.apply(lambda x: get_fdist(x['tokens']),axis=1)
In [17]:
all_df
Out[17]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil freq_dist freq_dist_unfil
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... {'missed': 2, 'opportunity': 2, 'excited': 1, ... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... {'phoenix': 1, 'think': 1, 'need': 1, 'super':... {'for': 2, 'phoenix': 1, 'i': 1, 'do': 1, 'thi...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... {'everyone': 1, 'praised': 1, 'overrated': 2, ... {'everyone': 1, 'praised': 1, 'an': 1, 'overra...
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... {'idiotic': 1, 'film': 1, 'say': 1, 'phoenix':... {'what': 1, 'idiotic': 1, 'film': 1, 'i': 1, '...
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... {'terrible': 3, 'thing': 1, 'good': 2, 'movie'... {'terrible': 3, 'the': 5, 'only': 1, 'thing': ...
... ... ... ... ... ... ... ... ... ... ... ... ...
118 Nerve-wracking, but in very uncomfortable way... P [ Nerve-wracking, but in very uncomfortable wa... 8 [but, in, very, uncomfortable, way, why, every... 57 [uncomfortable, way, everybody, keep, saying, ... 33 [(it, 4), (a, 4), (movie, 3), (in, 2), (keep, ... [(movie, 3), (keep, 2), (saying, 2), (psycho, ... {'uncomfortable': 1, 'way': 1, 'everybody': 1,... {'but': 1, 'in': 2, 'very': 1, 'uncomfortable'...
119 Solid film but there are glaring problems\nOk... P [ Solid film but there are glaring problems\nO... 13 [solid, film, but, there, are, glaring, proble... 628 [solid, film, glaring, problems, okay, first, ... 292 [(the, 35), (to, 22), (it, 16), (and, 16), (i,... [(joker, 6), (movie, 5), (film, 4), (like, 4),... {'solid': 1, 'film': 4, 'glaring': 1, 'problem... {'solid': 1, 'film': 4, 'but': 5, 'there': 3, ...
120 Joker > Endgame\nNeed I say more? Everything ... P [ Joker > Endgame\nNeed I say more?, Everythin... 5 [joker, endgame, need, i, say, more, everythin... 83 [joker, endgame, need, say, everything, movie,... 53 [(joker, 3), (movie, 3), (in, 3), (it, 3), (th... [(joker, 3), (movie, 3), (masterful, 2), (awes... {'joker': 3, 'endgame': 1, 'need': 1, 'say': 1... {'joker': 3, 'endgame': 1, 'need': 1, 'i': 1, ...
121 Absolutely not a 10\nStrong fanboy and hype r... P [ Absolutely not a 10\nStrong fanboy and hype ... 5 [absolutely, not, a, strong, fanboy, and, hype... 81 [absolutely, strong, fanboy, hype, rush, going... 36 [(the, 7), (is, 6), (a, 4), (fanboy, 2), (and,... [(fanboy, 2), (movie, 2), (absolutely, 1), (st... {'absolutely': 1, 'strong': 1, 'fanboy': 2, 'h... {'absolutely': 1, 'not': 1, 'a': 4, 'strong': ...
122 Overhyped, but it's alright\nIt's a good film... P [ Overhyped, but it's alright\nIt's a good fil... 3 [overhyped, but, it, alright, it, a, good, fil... 60 [overhyped, alright, good, film, see, like, ma... 31 [(it, 4), (but, 3), (a, 3), (good, 2), (do, 2)... [(good, 2), (overhyped, 1), (alright, 1), (fil... {'overhyped': 1, 'alright': 1, 'good': 2, 'fil... {'overhyped': 1, 'but': 3, 'it': 4, 'alright':...

246 rows × 12 columns

STEP 6: Try Different Sentiment Analysis Tools

VADER

In [18]:
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sid = SentimentIntensityAnalyzer()
def get_vader_score(review):
    return sid.polarity_scores(review)

all_df['vader_all'] = all_df.apply(lambda x: get_vader_score(x[0]),axis=1)
In [19]:
def separate_vader_score(vader_score, key):
    return vader_score[key]

all_df['v_compound'] = all_df.apply(lambda x: separate_vader_score(x['vader_all'], 'compound'),axis=1)
all_df['v_neg'] = all_df.apply(lambda x: separate_vader_score(x['vader_all'], 'neg'),axis=1)
all_df['v_neu'] = all_df.apply(lambda x: separate_vader_score(x['vader_all'], 'neu'),axis=1)
all_df['v_pos'] = all_df.apply(lambda x: separate_vader_score(x['vader_all'], 'pos'),axis=1)
In [20]:
all_df[:5]
Out[20]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil freq_dist freq_dist_unfil vader_all v_compound v_neg v_neu v_pos
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... {'missed': 2, 'opportunity': 2, 'excited': 1, ... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'... {'neg': 0.068, 'neu': 0.836, 'pos': 0.096, 'co... 0.7501 0.068 0.836 0.096
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... {'phoenix': 1, 'think': 1, 'need': 1, 'super':... {'for': 2, 'phoenix': 1, 'i': 1, 'do': 1, 'thi... {'neg': 0.069, 'neu': 0.77, 'pos': 0.16, 'comp... 0.7184 0.069 0.770 0.160
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... {'everyone': 1, 'praised': 1, 'overrated': 2, ... {'everyone': 1, 'praised': 1, 'an': 1, 'overra... {'neg': 0.0, 'neu': 0.79, 'pos': 0.21, 'compou... 0.7269 0.000 0.790 0.210
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... {'idiotic': 1, 'film': 1, 'say': 1, 'phoenix':... {'what': 1, 'idiotic': 1, 'film': 1, 'i': 1, '... {'neg': 0.138, 'neu': 0.77, 'pos': 0.092, 'com... -0.6698 0.138 0.770 0.092
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... {'terrible': 3, 'thing': 1, 'good': 2, 'movie'... {'terrible': 3, 'the': 5, 'only': 1, 'thing': ... {'neg': 0.086, 'neu': 0.778, 'pos': 0.136, 'co... 0.7184 0.086 0.778 0.136

DIY SUMMARY

In [21]:
def get_weighted_freq_dist(review, freq_dist):
    max_freq = max(freq_dist.values())
    for word in freq_dist.keys():
        freq_dist[word] = (freq_dist[word]/max_freq)
    return freq_dist

all_df['weighted_freq_dist'] = all_df.apply(lambda x: get_weighted_freq_dist(x['sentences'], x['freq_dist']),axis=1)
In [22]:
def get_sentence_score(review, freq_dist):
    sentence_scores = {}
    for sent in review:
        for word in nltk.word_tokenize(sent.lower()):
            if word in freq_dist.keys():
                if len(sent.split(' ')) < 30:
                    if sent not in sentence_scores.keys():
                        sentence_scores[sent] = freq_dist[word]
                    else:
                        sentence_scores[sent] += freq_dist[word]
    return sentence_scores

all_df['sentence_scores'] = all_df.apply(lambda x: get_sentence_score(x['sentences'], x['freq_dist']),axis=1)
In [23]:
def get_summary_sentences(sentence_scores):
    sorted_sentences = sorted(sentence_scores.items(), key=lambda kv: kv[1], reverse=True)
    return ''.join(sent[0] for sent in sorted_sentences[:5])

all_df['summary_sentences'] = all_df.apply(lambda x: get_summary_sentences(x['sentence_scores']), axis=1)
In [24]:
summaries = all_df['summary_sentences'].tolist()
In [25]:
summaries[3]
Out[25]:
'Todd Philips should maybe read some comics and don;t copy movies like taxi driver or similar.Bt this does still not make a great movie. What idiotic FIlm\nI can say that Phoenix is master actor.'

Doing VADER on the Summary Section

In [26]:
all_df['vader_sum_all'] = all_df.apply(lambda x: get_vader_score(x['summary_sentences']),axis=1)
In [27]:
all_df['v_compound_sum'] = all_df.apply(lambda x: separate_vader_score(x['vader_sum_all'], 'compound'),axis=1)
all_df['v_neg_sum'] = all_df.apply(lambda x: separate_vader_score(x['vader_sum_all'], 'neg'),axis=1)
all_df['v_neu_sum'] = all_df.apply(lambda x: separate_vader_score(x['vader_sum_all'], 'neu'),axis=1)
all_df['v_pos_sum'] = all_df.apply(lambda x: separate_vader_score(x['vader_sum_all'], 'pos'),axis=1)

Doing VADER on the Most Frequent Words

In [28]:
def get_freq_words(freq_dist):
    sorted_words = sorted(freq_dist.items(), key=lambda kv: kv[1], reverse=True)
    return ' '.join(word[0] for word in sorted_words[:50])

all_df['v_freq_words'] = all_df.apply(lambda x: get_freq_words(x['freq_dist']), axis=1)

all_df['vader_fq_all'] = all_df.apply(lambda x: get_vader_score(x['v_freq_words']),axis=1)
all_df['v_compound_fd'] = all_df.apply(lambda x: separate_vader_score(x['vader_fq_all'], 'compound'),axis=1)
all_df['v_neg_fd'] = all_df.apply(lambda x: separate_vader_score(x['vader_fq_all'], 'neg'),axis=1)
all_df['v_neu_fd'] = all_df.apply(lambda x: separate_vader_score(x['vader_fq_all'], 'neu'),axis=1)
all_df['v_pos_fd'] = all_df.apply(lambda x: separate_vader_score(x['vader_fq_all'], 'pos'),axis=1)

STEP 7: Test Step 6 with Machine Learning!!

Naive Bayes

In [29]:
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB

def get_NB(small_df, labels):
    x_train, x_test, y_train, y_test = train_test_split(small_df.values, labels, test_size=0.3, random_state = 109)

    gnb = GaussianNB()
    gnb.fit(x_train, y_train)
    y_pred = gnb.predict(x_test)
    from sklearn import metrics
    print("Accuracy:", metrics.accuracy_score(y_test, y_pred))
In [30]:
all_df[:5]
Out[30]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... v_compound_sum v_neg_sum v_neu_sum v_pos_sum v_freq_words vader_fq_all v_compound_fd v_neg_fd v_neu_fd v_pos_fd
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... 0.0000 0.000 0.000 0.000 movie said many times missed opportunity see t... {'neg': 0.181, 'neu': 0.633, 'pos': 0.187, 'co... -0.1531 0.181 0.633 0.187
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... 0.4019 0.066 0.785 0.148 dark phoenix think need super film tbh dc comi... {'neg': 0.075, 'neu': 0.594, 'pos': 0.331, 'co... 0.8020 0.075 0.594 0.331
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... 0.7269 0.000 0.790 0.210 overrated movie everyone praised time reviews ... {'neg': 0.0, 'neu': 0.596, 'pos': 0.404, 'comp... 0.7269 0.000 0.596 0.404
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... ... -0.6591 0.175 0.762 0.063 make movie idiotic film say phoenix master act... {'neg': 0.184, 'neu': 0.609, 'pos': 0.207, 'co... 0.2570 0.184 0.609 0.207
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... ... 0.7311 0.071 0.779 0.150 movie terrible acting good dont movies plot ma... {'neg': 0.193, 'neu': 0.58, 'pos': 0.227, 'com... 0.3261 0.193 0.580 0.227

5 rows × 31 columns

TEST 1: Vader Scores (Original)

In [31]:
small_df = all_df.filter(['v_compound','v_pos', 'v_neg', 'v_neu']) # 0.645
get_NB(small_df, all_df['PoN'])
Accuracy: 0.6621621621621622

TEST 2: Vader Scores (from Summary)

In [32]:
small_df = all_df.filter(['v_compound_sum','v_pos_sum', 'v_neg_sum', 'v_neu_sum']) # 0.59
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7027027027027027

TEST 3: Vader Scores (original) AND Vader Scores (summary)

In [33]:
small_df = all_df.filter(['v_compound_sum','v_pos_sum', 'v_neg_sum', 'v_neu_sum', 
                          'v_compound','v_pos', 'v_neg', 'v_neu']) # 0.618
get_NB(small_df, all_df['PoN'])
Accuracy: 0.6891891891891891

TEST 4: Vader Scores (50 most frequent -- filtered -- words)

In [34]:
small_df = all_df.filter(['v_compound_fd','v_pos_fd', 'v_neu_fd', 'v_neg_fd']) # 0.598
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7297297297297297

TEST 5: All compound Vader Scores

In [35]:
small_df = all_df.filter(['v_compound_fd','v_compound_sum', 'v_compound']) # 0.615
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7027027027027027

TEST 6: ALL THE NUMBERS!!

In [36]:
small_df = all_df.filter(['v_compound_sum','v_pos_sum', 'v_neg_sum', 'v_neu_sum', 
                          'v_compound_fd','v_pos_fd', 'v_neg_fd', 'v_neu_fd', 
                          'v_compound','v_pos', 'v_neg', 'v_neu']) # 0.613
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7027027027027027

TEST 7: Test UNFILTERED most frequent words

In [37]:
def get_freq_words(freq_dist):
    sorted_words = sorted(freq_dist.items(), key=lambda kv: kv[1], reverse=True)
    return ' '.join(word[0] for word in sorted_words[:50])

all_df['v_freq_words_unfil'] = all_df.apply(lambda x: get_freq_words(x['freq_dist_unfil']), axis=1)

all_df['vader_fd_all_unfil'] = all_df.apply(lambda x: get_vader_score(x['v_freq_words_unfil']),axis=1)

all_df['v_compound_fd_uf'] = all_df.apply(lambda x: separate_vader_score(x['vader_fd_all_unfil'], 'compound'),axis=1)
all_df['v_neg_fd_uf'] = all_df.apply(lambda x: separate_vader_score(x['vader_fd_all_unfil'], 'neg'),axis=1)
all_df['v_neu_fd_uf'] = all_df.apply(lambda x: separate_vader_score(x['vader_fd_all_unfil'], 'neu'),axis=1)
all_df['v_pos_fd_uf'] = all_df.apply(lambda x: separate_vader_score(x['vader_fd_all_unfil'], 'pos'),axis=1)
In [38]:
small_df = all_df.filter(['v_compound_sum','v_pos_sum', 'v_neg_sum', 'v_neu_sum', 
                          'v_compound_fd','v_pos_fd', 'v_neg_fd', 'v_neu_fd', 
                          'v_compound_fd_uf','v_pos_fd_uf', 'v_neg_fd_uf', 'v_neu_fd_uf',
                          'v_compound','v_pos', 'v_neg', 'v_neu']) # 0.618
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7297297297297297
In [39]:
small_df = all_df.filter(['v_compound_fd_uf','v_pos_fd_uf', 'v_neg_fd_uf', 'v_neu_fd_uf']) # 0.603
get_NB(small_df, all_df['PoN'])
Accuracy: 0.7162162162162162
In [40]:
summaries_pos = all_df[all_df['PoN'] == 'P']
summaries_neg = all_df[all_df['PoN'] == 'N']
In [41]:
summaries_pos_list = summaries_pos['summary_sentences'].tolist()
summaries_neg_list = summaries_neg['summary_sentences'].tolist()
In [42]:
summaries_pos_list[:1]
Out[42]:
['Just don\'t expect any "real" Batman references.Director Phillips delivers a film that looks and feels and sounds much different than other comic book movies.Cinematographer Lawrence Sher is a frequent Phillips collaborator (all 3 Hangover movies) and the dark look and gritty feel are present in most every shot.We are informed Arthur suffers from Pseudobulbar Affect, also known as emotional incontinence, which causes that creepy laughter to pop up at some inappropriate times.The "Smile" song is especially relevant as its origins can be traced by to Charlie Chaplin\'s MODERN TIMES, a silent movie classic featured in this film.This is not one for the younger kids, no matter how much they enjoy THE AVENGERS or WONDER WOMAN (or any other DC or Marvel film).']
In [43]:
summaries_neg_list[:1]
Out[43]:
['']
In [44]:
summaries_neg_list[:1]
Out[44]:
['']
In [45]:
### VERSION 1
#     all_words_neg = sentim_analyzer.all_words([mark_negation(doc) for doc in training_docs])
#     unigram_feats = sentim_analyzer.unigram_word_feats(all_words_neg)
#     sentim_analyzer.add_feat_extractor(extract_unigram_feats, unigrams=unigram_feats)
#     training_set = sentim_analyzer.apply_features(training_docs)
#     test_set = sentim_analyzer.apply_features(testing_docs)
sentim_analyzer = SentimentAnalyzer()

def get_nltk_negs(tokens):
    all_words_neg = sentim_analyzer.all_words([mark_negation(tokens)])
    return all_words_neg

def get_unigram_feats(neg_tokens):
    unigram_feats = sentim_analyzer.unigram_word_feats(neg_tokens)
    return unigram_feats
    
def get_bigram_feats(tokens):
    ngrams = zip(*[tokens[i:] for i in range(2)])
    return ["_".join(ngram) for ngram in ngrams]

all_df['nltk_negs'] = all_df.apply(lambda x: get_nltk_negs(x['tokens']), axis=1)
all_df['unigram_feats'] = all_df.apply(lambda x: get_unigram_feats(x['nltk_negs']), axis=1)
all_df['bigram_feats'] = all_df.apply(lambda x: get_bigram_feats(x['tokens']), axis=1)
all_df['bigram_feats_neg'] = all_df.apply(lambda x: get_bigram_feats(x['nltk_negs']), axis=1)
all_df[:5]
# all_df['nltk_unfil'] = all_df.apply(lambda x: get_nltk_data(x['tokens']), axis=1)
Out[45]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... v_freq_words_unfil vader_fd_all_unfil v_compound_fd_uf v_neg_fd_uf v_neu_fd_uf v_pos_fd_uf nltk_negs unigram_feats bigram_feats bigram_feats_neg
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... of i the that it a and to was had been very mo... {'neg': 0.041, 'neu': 0.816, 'pos': 0.143, 'co... 0.6705 0.041 0.816 0.143 [missed, opportunity, i, had, been, very, exci... [of, i, the, that, it, a, and, to, was, had, b... [missed_opportunity, opportunity_i, i_had, had... [missed_opportunity, opportunity_i, i_had, had...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... was a that for there dark in it phoenix i do t... {'neg': 0.097, 'neu': 0.732, 'pos': 0.171, 'co... 0.4427 0.097 0.732 0.171 [for, phoenix, i, do, think, there, was, a, ne... [a, for, was, dark, was_NEG, that_NEG, phoenix... [for_phoenix, phoenix_i, i_do, do_think, think... [for_phoenix, phoenix_i, i_do, do_think, think...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... overrated movie everyone praised an of all tim... {'neg': 0.0, 'neu': 0.783, 'pos': 0.217, 'comp... 0.7269 0.000 0.783 0.217 [everyone, praised, an, overrated, movie, over... [overrated, movie, everyone, praised, an, of, ... [everyone_praised, praised_an, an_overrated, o... [everyone_praised, praised_an, an_overrated, o...
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... ... and is make movie to with the what idiotic fil... {'neg': 0.208, 'neu': 0.741, 'pos': 0.051, 'co... -0.8344 0.208 0.741 0.051 [what, idiotic, film, i, can, say, that, phoen... [and_NEG, make_NEG, movie_NEG, to_NEG, with_NE... [what_idiotic, idiotic_film, film_i, i_can, ca... [what_idiotic, idiotic_film, film_i, i_can, ca...
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... ... the this movie it to terrible acting but and f... {'neg': 0.181, 'neu': 0.703, 'pos': 0.116, 'co... -0.5853 0.181 0.703 0.116 [terrible, the, only, thing, good, about, this... [it_NEG, the_NEG, to_NEG, and_NEG, for_NEG, th... [terrible_the, the_only, only_thing, thing_goo... [terrible_the, the_only, only_thing, thing_goo...

5 rows × 41 columns

In [46]:
### VERSION 2
#     all_words_neg = sentim_analyzer.all_words([mark_negation(doc) for doc in training_docs])
#     unigram_feats = sentim_analyzer.unigram_word_feats(all_words_neg)
#     sentim_analyzer.add_feat_extractor(extract_unigram_feats, unigrams=unigram_feats)
#     training_set = sentim_analyzer.apply_features(training_docs)
#     test_set = sentim_analyzer.apply_features(testing_docs)
sentim_analyzer = SentimentAnalyzer()

def get_nltk_data(tokens):
    neg_tokens = sentim_analyzer.all_words([mark_negation(tokens)])
    unigram_feats = sentim_analyzer.unigram_word_feats(neg_tokens)
    sentim_analyzer.add_feat_extractor(extract_unigram_feats, unigrams=unigram_feats)
    return sentim_analyzer.apply_features(tokens)


# def get_unigram_feats(neg_tokens):
    
#     return unigram_feats
nltk_df = pd.DataFrame()
nltk_df['nltk_data'] = all_df.apply(lambda x: get_nltk_data(x['tokens']), axis=1)

# all_df['nltk']
# all_df['unigram_feats'] = all_df.apply(lambda x: get_unigram_feats(x['nltk_negs']), axis=1)
# all_df['nltk_unfil'] = all_df.apply(lambda x: get_nltk_data(x['tokens']), axis=1)
In [47]:
all_df['nltk_all'] = 0
In [48]:
all_df['nltk_all']
Out[48]:
0      0
1      0
2      0
3      0
4      0
      ..
118    0
119    0
120    0
121    0
122    0
Name: nltk_all, Length: 246, dtype: int64
In [49]:
all_df[:3]
Out[49]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... vader_fd_all_unfil v_compound_fd_uf v_neg_fd_uf v_neu_fd_uf v_pos_fd_uf nltk_negs unigram_feats bigram_feats bigram_feats_neg nltk_all
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... {'neg': 0.041, 'neu': 0.816, 'pos': 0.143, 'co... 0.6705 0.041 0.816 0.143 [missed, opportunity, i, had, been, very, exci... [of, i, the, that, it, a, and, to, was, had, b... [missed_opportunity, opportunity_i, i_had, had... [missed_opportunity, opportunity_i, i_had, had... 0
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... {'neg': 0.097, 'neu': 0.732, 'pos': 0.171, 'co... 0.4427 0.097 0.732 0.171 [for, phoenix, i, do, think, there, was, a, ne... [a, for, was, dark, was_NEG, that_NEG, phoenix... [for_phoenix, phoenix_i, i_do, do_think, think... [for_phoenix, phoenix_i, i_do, do_think, think... 0
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... {'neg': 0.0, 'neu': 0.783, 'pos': 0.217, 'comp... 0.7269 0.000 0.783 0.217 [everyone, praised, an, overrated, movie, over... [overrated, movie, everyone, praised, an, of, ... [everyone_praised, praised_an, an_overrated, o... [everyone_praised, praised_an, an_overrated, o... 0

3 rows × 42 columns

STEP 8: Add Bag of Words to Machine Learning models

In [50]:
from nltk.tokenize import casual_tokenize
from collections import Counter
all_df['bow_nosw'] = all_df.apply(lambda x: Counter(casual_tokenize(x[0])), axis=1)
In [51]:
all_df[:3]
Out[51]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... v_compound_fd_uf v_neg_fd_uf v_neu_fd_uf v_pos_fd_uf nltk_negs unigram_feats bigram_feats bigram_feats_neg nltk_all bow_nosw
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... 0.6705 0.041 0.816 0.143 [missed, opportunity, i, had, been, very, exci... [of, i, the, that, it, a, and, to, was, had, b... [missed_opportunity, opportunity_i, i_had, had... [missed_opportunity, opportunity_i, i_had, had... 0 {'Missed': 1, 'Opportunity': 1, 'I': 14, 'had'...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... 0.4427 0.097 0.732 0.171 [for, phoenix, i, do, think, there, was, a, ne... [a, for, was, dark, was_NEG, that_NEG, phoenix... [for_phoenix, phoenix_i, i_do, do_think, think... [for_phoenix, phoenix_i, i_do, do_think, think... 0 {'5/5': 1, 'for': 2, 'Phoenix's': 1, 'acting':...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... 0.7269 0.000 0.783 0.217 [everyone, praised, an, overrated, movie, over... [overrated, movie, everyone, praised, an, of, ... [everyone_praised, praised_an, an_overrated, o... [everyone_praised, praised_an, an_overrated, o... 0 {'Everyone': 1, 'praised': 1, 'an': 1, 'overra...

3 rows × 43 columns

In [52]:
# Keeping punctuation
# def diy_cleaner(review):
#     both = review.split('\n')
#     title = both[0]
#     review = both[1]
#     cleaned = title + '.' + title + '.' + review
#     return cleaned.lower()

# Removing punctuation

# def diy_cleaner(review):
#     both = review.split('\n')
#     title = both[0]
#     review = both[1]
#     review = review.replace("\'",'')
#     review = review.replace("'",'')
#     review = review.replace(",",'')
#     cleaned = title + ' ' + title + ' ' + ' '.join(review.split('.'))
#     return cleaned.lower()

import re, string

def diy_cleaner(review):
    both = review.split('\n')
    title = both[0]
    review = both[1]
    review = review.replace("'","")
    pattern = re.compile('[\W_]+')
    review = pattern.sub(' ', review)
    cleaned = title + ' ' + title + ' ' + review
    return cleaned.lower()

all_df['diy_cleaner'] = all_df.apply(lambda x: diy_cleaner(x[0]), axis=1)
In [53]:
all_df['diy_cleaner'][0].tolist()
Out[53]:
[' missed opportunity  missed opportunity i had been very excited to see this movie ever since i had 1st heard about it and was anticipating its release but when it started getting the type of hype and press that it was i became a bit apprehensive as the things that were being said about it which seemed outrageous mostly were things that were said about other moves i had been looking forward to seeing and that had ended letting me down the joker sadly turned out to be one of those movies for me now as i know it has been said many times before phoenixs portrayal of man with mental health depression was very very good convincing but the story and the plot seemed like a big missed opportunity to deliver an anti hero origin story of one of the most coveted villains in comic book lore i liked the quasi mirroring of a failed system whose middle lower class revolt against the rich in a sort of if we burn you burn with us type of way that has been done many times before im sure people can see glimpses of that today in our us culture and who knows maybe the studio execs got their fingers involved and are the ones that watered it down a bit too much maybe there will be a directors cut that is darker than the theatrical release i certainly hope so because for all the reviews i have read that speak of people walking out of theaters because of the dark feel and psychological overtones being too much for them to stomach all i felt was a sense of wanting it to be bigger and grander than what i was seeing i would recommend seeing this movie so that you can formulate your own opinion but i gave it a low rating because when it was over i walked out feeling like i just saw a movie ive already seen many times before ',
 ' funny like a clown  funny like a clown greetings again from the darkness the first thing to know is that this is not a superhero movie in fact there are no heroes in the movie unless you would like to apply the label to a single mom who lives down the hall from arthur fleck mr fleck lives at home with his invalid mother in a grungy run down apartment he works as a clown for hire dreams of becoming a stand up comedian and depends on social services to supply the 7 medications he takes since being released from arkham state hospital its a bleak existence at a bleak time in a bleak city gotham is in the midst of a garbage workers strike only the super rats are happy political upheaval and a growing chasm between the classes and then it gets worse for arthur the second thing to know is that this is a standalone joker film and one mostly unrelated or not connected to previous projects featuring the colorful clown prince character played and voiced by such memorable actors as cesar romero jack nicholson heath ledger mark hamill jared leto and even zach galifianakis director todd phillips who co wrote the script with scott silver is best known for such extreme comedies as the hangover franchise and old school so hes a bit outside of his usual wheelhouse phillips and silver seem to embrace not just the history of the character but also the look texture and tone of filmmaking from an earlier era the gritty and outcast feel of scorceses taxi driver and the king of comedy is present and so are numerous tributes to familiar joker moments of days gone by three time oscar nominee joaquin phoenix plays arthur fleck and he delivers arthurs slow descent into madness or shall we say further descent its clear from the beginning that arthur views himself as ignored by society while all he wants to do is bring joy and laughter to others and be noticed his daydreams or visions of himself in a better world send a strong message phoenix shows us what full commitment to a role looks like he lost 50 pounds leaving a frame that contorts moves and dances in a manner unlike what weve seen before in fact its a toss up on which shows up more frequently his dances moves or his maniacal pained laughter we are informed arthur suffers from pseudobulbar affect also known as emotional incontinence which causes that creepy laughter to pop up at some inappropriate times of course the comparisons to heath ledgers oscar winning turn in the dark knight are inevitable the roles and films are written quite differently and its safe to say both actors were all in action sequences and special visual effects are both noticeably absent but the violence is sure to shock this is not one for the younger kids no matter how much they enjoy the avengers or wonder woman or any other dc or marvel film this gritty visceral approach is often a tough watch and is much more a character study of mental illness than a costume drama although arthurs clothes and make up are front and center when arthur states i have nothing but bad thoughts we believe him and the sympathetic back story explains a great deal and will likely prove quite controversial phoenix dominates the film as he should and supporting work is provided by robert de niro as murray franklin a tv talk show host in the johnny carson mode zazie beetz deadpool 2 as the single mom neighbor sophie dumond frances conroy as penny fleck arthurs mother brett cullen as a not so empathetic thomas wayne and shea whigham and bill camp as police detectives ill hesitantly mention that dante pereira olson makes a couple of brief appearances as an adolescent bruce wayne and just for fun we get a shot of the young man honing the batpole skills he will use later in life just dont expect any real batman references director phillips delivers a film that looks and feels and sounds much different than other comic book movies cinematographer lawrence sher is a frequent phillips collaborator all 3 hangover movies and the dark look and gritty feel are present in most every shot hildur guonadottir this years emmy winner for chernobyl serves up a foreboding score one that never overwhelms and one that contrasts perfectly with the more traditional songs utilized throughout stephen sondheims send in the clowns jimmy durante singing smile creams white room thats life by frank sinatra and gary glitters familiar rock and roll part 1 and 2 the smile song is especially relevant as its origins can be traced by to charlie chaplins modern times a silent movie classic featured in this film phillips even uses the saul bass designed warner bros logo to open the credits making sure we understand the time period no cell phones etc the film traces arthurs slide into crime a transition that he wasnt seeking and one that he believes was forced upon him his rise as a savior to the working class is secondary to his own journey and the chaos is handled on the perimeters of the film preventing this from becoming a super villain movie keep in mind joker played at venice telluride and toronto three prestigious festivals this is just another thing that sets it apart from others in the genre despite the 1981 time stamp the consistent anti rich message and class disparity is prevalent throughout this appears to be phillips way of including a contemporary theme in a decades old setting and its a cautionary tale that there should be no clown left behind ']

Create BOW using (1) casual_tokenize and (2) Counter

In [54]:
all_df['bow_v2'] = all_df.apply(lambda x: Counter(casual_tokenize(x['diy_cleaner'])), axis=1)
In [55]:
all_df[:3]
Out[55]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... v_neu_fd_uf v_pos_fd_uf nltk_negs unigram_feats bigram_feats bigram_feats_neg nltk_all bow_nosw diy_cleaner bow_v2
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... 0.816 0.143 [missed, opportunity, i, had, been, very, exci... [of, i, the, that, it, a, and, to, was, had, b... [missed_opportunity, opportunity_i, i_had, had... [missed_opportunity, opportunity_i, i_had, had... 0 {'Missed': 1, 'Opportunity': 1, 'I': 14, 'had'... missed opportunity missed opportunity i had ... {'missed': 3, 'opportunity': 3, 'i': 14, 'had'...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... 0.732 0.171 [for, phoenix, i, do, think, there, was, a, ne... [a, for, was, dark, was_NEG, that_NEG, phoenix... [for_phoenix, phoenix_i, i_do, do_think, think... [for_phoenix, phoenix_i, i_do, do_think, think... 0 {'5/5': 1, 'for': 2, 'Phoenix's': 1, 'acting':... 5/5 for phoenix's acting.. 5/5 for phoenix's... {'5/5': 2, 'for': 3, 'phoenix's': 2, 'acting':...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... 0.783 0.217 [everyone, praised, an, overrated, movie, over... [overrated, movie, everyone, praised, an, of, ... [everyone_praised, praised_an, an_overrated, o... [everyone_praised, praised_an, an_overrated, o... 0 {'Everyone': 1, 'praised': 1, 'an': 1, 'overra... everyone praised an overrated movie. everyon... {'everyone': 2, 'praised': 2, 'an': 2, 'overra...

3 rows × 45 columns

Get a Bag of Words from a column (for wordclouds etc!)

In [56]:
def get_bow_from_column(df, column):
    all_column_data = ' '.join(df[column].tolist())
    all_column_fd = Counter(all_column_data.split())
    return all_column_fd

Get BOW for all, BOW for positive, BOW for negative

In [57]:
big_bow = get_bow_from_column(all_df, 'diy_cleaner')
big_bow_n = get_bow_from_column(all_df[all_df['PoN'] == 'N'], 'diy_cleaner')
big_bow_p = get_bow_from_column(all_df[all_df['PoN'] == 'P'], 'diy_cleaner')
In [58]:
big_bow_n.most_common(10)
Out[58]:
[('the', 908),
 ('a', 466),
 ('and', 428),
 ('to', 398),
 ('of', 375),
 ('is', 342),
 ('i', 277),
 ('it', 268),
 ('movie', 256),
 ('this', 250)]
In [59]:
big_bow_p.most_common(10)
Out[59]:
[('the', 1161),
 ('a', 649),
 ('and', 586),
 ('of', 522),
 ('to', 474),
 ('is', 449),
 ('it', 325),
 ('that', 280),
 ('in', 273),
 ('this', 272)]
In [60]:
# Wow this is unhelpful. Removing words < 3 characters like Professor Gates does!
In [61]:
def pruner(review):
    clean_review = ' '.join([word for word in review.split() if len(word) > 3])
    return clean_review

all_df['pruned'] = all_df.apply(lambda x: pruner(x['diy_cleaner']), axis=1)
In [62]:
big_bow = get_bow_from_column(all_df, 'pruned')
big_bow_n = get_bow_from_column(all_df[all_df['PoN'] == 'N'], 'pruned')
big_bow_p = get_bow_from_column(all_df[all_df['PoN'] == 'P'], 'pruned')
In [63]:
big_bow.most_common(10)
Out[63]:
[('this', 522),
 ('movie', 508),
 ('that', 493),
 ('joker', 440),
 ('film', 283),
 ('with', 249),
 ('from', 176),
 ('just', 169),
 ('phoenix', 159),
 ('character', 153)]
In [64]:
big_bow_n.most_common(10)
Out[64]:
[('movie', 256),
 ('this', 250),
 ('that', 213),
 ('joker', 197),
 ('with', 103),
 ('just', 97),
 ('film', 79),
 ('from', 77),
 ('about', 75),
 ('character', 66)]
In [65]:
big_bow_p.most_common(10)
Out[65]:
[('that', 280),
 ('this', 272),
 ('movie', 252),
 ('joker', 243),
 ('film', 204),
 ('with', 146),
 ('phoenix', 108),
 ('from', 99),
 ('character', 87),
 ('joaquin', 80)]
In [66]:
# bow_df = all_df['pruned']
# get_NB(small_df, all_df['PoN'])
all_df['pruned']
Out[66]:
0      missed opportunity missed opportunity been ver...
1      phoenix's acting.. phoenix's acting.. dont thi...
2      everyone praised overrated movie. everyone pra...
3      what idiotic film what idiotic film that phoen...
4      terrible terrible only thing good about this m...
                             ...                        
118    nerve-wracking, very uncomfortable nerve-wrack...
119    solid film there glaring problems solid film t...
120    joker endgame joker endgame need more everythi...
121    absolutely absolutely strong fanboy hype rush ...
122    overhyped, it's alright overhyped, it's alrigh...
Name: pruned, Length: 246, dtype: object
In [67]:
all_df['bow_v3'] = all_df.apply(lambda x: Counter(casual_tokenize(x['pruned'])), axis=1)
new_df = pd.DataFrame(all_df['bow_v3'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[67]:
missed opportunity been very excited this movie ever since heard ... information follows stress overlook offers easy answers alike company acceptable
PoN
N 3 3 4 3 1 2 3 1 1 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 1 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 1 3 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 2 2 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 4 4 0 0 0 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 4249 columns

In [68]:
get_NB(new_df, new_df.index)
Accuracy: 0.6486486486486487
In [69]:
new_df = pd.DataFrame(all_df['bow_v2'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[69]:
missed opportunity i had been very excited to see this ... stress overlook > offers easy answers alike company til acceptable
PoN
N 3 3 14 4 4 3 1 6 2 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 1 0 0 1 1 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 1 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 2 0 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 2 0 0 0 0 4 0 4 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 4530 columns

In [70]:
get_NB(new_df, new_df.index)
Accuracy: 0.6486486486486487
In [71]:
new_df = pd.DataFrame(all_df['bow_nosw'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[71]:
Missed Opportunity I had been very excited to see this ... Strong iq Deff comparable knight compensate company up.Movie til acceptable
PoN
N 1 1 14 4 4 3 1 6 2 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 1 0 0 1 1 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 1 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 2 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 4 0 4 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 6168 columns

In [72]:
get_NB(new_df, new_df.index)
Accuracy: 0.6756756756756757
In [73]:
all_df['bow_v4'] = all_df.apply(lambda x: Counter(casual_tokenize(' '.join(x['nltk_negs']))), axis=1)
new_df = pd.DataFrame(all_df['bow_v4'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[73]:
missed opportunity i had been very excited to see this ... paced_NEG annoying_NEG deff_NEG comparable_NEG compensate_NEG marketing company climax strange acceptable
PoN
N 2 2 12 4 4 3 1 6 2 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 1 0 0 1 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 1 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 0 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 0 0 1 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 6406 columns

In [74]:
get_NB(new_df, new_df.index)
Accuracy: 0.6351351351351351
In [75]:
all_df['bow_v5'] = all_df.apply(lambda x: Counter(casual_tokenize(' '.join(x['bigram_feats']))), axis=1)
new_df = pd.DataFrame(all_df['bow_v5'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[75]:
missed_opportunity opportunity_i i_had had_been been_very very_excited excited_to to_see see_this this_movie ... slow_do happen_the middle_and climax_cinematography joker_acting fine_if forced_at just_strange strange_but but_acceptable
PoN
N 2 1 3 2 1 1 1 1 1 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 0 0 4 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 24658 columns

In [76]:
get_NB(new_df, new_df.index)
Accuracy: 0.581081081081081
In [77]:
all_bigrams = []
for review in all_df['bigram_feats']:
    for bigram in review:
        all_bigrams.append(bigram)
In [78]:
bigram_count = Counter(all_bigrams)
In [79]:
bigram_count.most_common(10)
Out[79]:
[('of_the', 286),
 ('the_joker', 217),
 ('this_movie', 162),
 ('in_the', 157),
 ('the_movie', 154),
 ('the_film', 129),
 ('is_a', 124),
 ('to_be', 116),
 ('to_the', 113),
 ('joker_is', 98)]

Returning to Most Frequent Words

What can we learn from the intersection of "positive" and "negative" words? Essentially creating a new "stopword" list of "words that frequently occur in both lists

In [80]:
big_bow = get_bow_from_column(all_df, 'pruned')
big_bow_n = get_bow_from_column(all_df[all_df['PoN'] == 'N'], 'pruned')
big_bow_p = get_bow_from_column(all_df[all_df['PoN'] == 'P'], 'pruned')
In [81]:
most_common_neg = [word[0] for word in big_bow_n.most_common(100)]
most_common_neg[:10]
Out[81]:
['movie',
 'this',
 'that',
 'joker',
 'with',
 'just',
 'film',
 'from',
 'about',
 'character']
In [82]:
most_common_pos = [word[0] for word in big_bow_p.most_common(100)]
most_common_pos[:10]
Out[82]:
['that',
 'this',
 'movie',
 'joker',
 'film',
 'with',
 'phoenix',
 'from',
 'character',
 'joaquin']
In [83]:
import numpy as np
print("Unique values in array1 that are not in array2:")
neg_notpos = np.setdiff1d(most_common_neg, most_common_pos)
neg_notpos
Unique values in array1 that are not in array2:
Out[83]:
array(['after', 'before', 'boring', 'characters', 'didnt', 'different',
       'down', 'everyone', 'felt', 'give', 'hype', 'interesting', 'look',
       'love', 'never', 'over', 'overrated', 'part', 'phoenixs',
       'reviews', 'same', 'their', 'them', 'then', 'things', 'want',
       'where', 'without'], dtype='<U11')
In [84]:
print("Unique values in array2 that are not in array1:")
pos_notneg = np.setdiff1d(most_common_pos, most_common_neg)
pos_notneg
Unique values in array2 that are not in array1:
Out[84]:
array(['actor', 'arthur', 'best', 'book', 'cinema', 'comic', 'could',
       'director', 'ever', 'films', 'fleck', 'going', 'here', 'life',
       'makes', 'oscar', 'perfect', 'phillips', 'score', 'slow', 'take',
       'thing', 'those', 'todd', 'violence', 'while', 'world', 'your'],
      dtype='<U11')
In [85]:
print("Common values between two arrays:")
in_both = np.intersect1d(most_common_neg, most_common_pos)
print(len(in_both))
in_both
Common values between two arrays:
72
Out[85]:
array(['about', 'acting', 'also', 'batman', 'because', 'been', 'being',
       'better', 'character', 'dark', 'does', 'doesnt', 'dont', 'driver',
       'even', 'feel', 'film', 'first', 'from', 'good', 'great', 'have',
       'heath', 'into', 'joaquin', 'joker', 'just', 'know', 'like',
       'made', 'make', 'many', 'masterpiece', 'mental', 'more', 'most',
       'movie', 'movies', 'much', 'nothing', 'only', 'origin', 'other',
       'people', 'performance', 'phoenix', 'plot', 'really', 'seen',
       'society', 'some', 'story', 'taxi', 'than', 'that', 'thats',
       'there', 'they', 'think', 'this', 'time', 'times', 'very', 'watch',
       'well', 'were', 'what', 'when', 'which', 'will', 'with', 'would'],
      dtype='<U11')
In [86]:
def get_common_words(num):
    most_common_neg = [word[0] for word in big_bow_n.most_common(num)]
    most_common_pos = [word[0] for word in big_bow_p.most_common(num)]
    in_both = np.intersect1d(most_common_neg, most_common_pos)
    neg_notpos = np.setdiff1d(most_common_neg, most_common_pos)
    pos_notneg = np.setdiff1d(most_common_pos, most_common_neg)
    return [len(in_both), len(neg_notpos), len(pos_notneg), len(in_both)/num, in_both, neg_notpos, pos_notneg]

common_100 = get_common_words(100)
common_200 = get_common_words(200)
common_300 = get_common_words(300)
common_500 = get_common_words(500)
common_1000 = get_common_words(1000)
In [87]:
common_100[:4]
Out[87]:
[72, 28, 28, 0.72]
In [88]:
common_200[:4]
Out[88]:
[141, 59, 59, 0.705]
In [89]:
common_300[:4]
Out[89]:
[204, 96, 96, 0.68]
In [90]:
common_500[:4]
Out[90]:
[308, 192, 192, 0.616]
In [91]:
common_1000[:4]
Out[91]:
[565, 435, 435, 0.565]

Only tokenizing words that aren't in the 1000 most common

In [92]:
def get_only_polarized(tokens):
#     return [token for token in tokens if token not in common_1000[4]] # 66
#     return [token for token in tokens if token not in common_100[4]] # 70
    return [token for token in tokens if token not in common_500[4]] # 70

all_df['no_shared_words'] = all_df.apply(lambda x: get_only_polarized(x['tokens']), axis=1)
In [93]:
all_df[:5]
Out[93]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... bigram_feats_neg nltk_all bow_nosw diy_cleaner bow_v2 pruned bow_v3 bow_v4 bow_v5 no_shared_words
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... [missed_opportunity, opportunity_i, i_had, had... 0 {'Missed': 1, 'Opportunity': 1, 'I': 14, 'had'... missed opportunity missed opportunity i had ... {'missed': 3, 'opportunity': 3, 'i': 14, 'had'... missed opportunity missed opportunity been ver... {'missed': 3, 'opportunity': 3, 'been': 4, 've... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'... {'missed_opportunity': 2, 'opportunity_i': 1, ... [missed, opportunity, i, had, excited, to, see...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... [for_phoenix, phoenix_i, i_do, do_think, think... 0 {'5/5': 1, 'for': 2, 'Phoenix's': 1, 'acting':... 5/5 for phoenix's acting.. 5/5 for phoenix's... {'5/5': 2, 'for': 3, 'phoenix's': 2, 'acting':... phoenix's acting.. phoenix's acting.. dont thi... {'phoenix's': 2, 'acting': 2, '..': 2, 'dont':... {'for': 2, 'phoenix': 1, 'i': 1, 'do': 1, 'thi... {'for_phoenix': 1, 'phoenix_i': 1, 'i_do': 1, ... [for, i, do, was, a, for, a, tbh, is, a, dc, h...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... [everyone_praised, praised_an, an_overrated, o... 0 {'Everyone': 1, 'praised': 1, 'an': 1, 'overra... everyone praised an overrated movie. everyon... {'everyone': 2, 'praised': 2, 'an': 2, 'overra... everyone praised overrated movie. everyone pra... {'everyone': 2, 'praised': 2, 'overrated': 3, ... {'everyone': 1, 'praised': 1, 'an': 1, 'overra... {'everyone_praised': 1, 'praised_an': 1, 'an_o... [praised, an, of, all, the, are, out, to, be, ...
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... ... [what_idiotic, idiotic_film, film_i, i_can, ca... 0 {'What': 1, 'idiotic': 1, 'FIlm': 1, 'I': 1, '... what idiotic film what idiotic film i can sa... {'what': 2, 'idiotic': 2, 'film': 2, 'i': 1, '... what idiotic film what idiotic film that phoen... {'what': 2, 'idiotic': 2, 'film': 2, 'that': 1... {'what': 1, 'idiotic': 1, 'film': 1, 'i': 1, '... {'what_idiotic': 1, 'idiotic_film': 1, 'film_i... [idiotic, i, can, say, is, master, bt, not, a,...
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... ... [terrible_the, the_only, only_thing, thing_goo... 0 {'Terrible': 1, 'The': 2, 'only': 1, 'thing': ... terrible terrible the only thing good about ... {'terrible': 4, 'the': 5, 'only': 1, 'thing': ... terrible terrible only thing good about this m... {'terrible': 4, 'only': 1, 'thing': 1, 'good':... {'terrible': 1, 'the': 1, 'only': 1, 'thing': ... {'terrible_the': 1, 'the_only': 1, 'only_thing... [terrible, the, is, but, i, and, for, entertai...

5 rows × 50 columns

In [94]:
all_df['bow_v6'] = all_df.apply(lambda x: Counter(casual_tokenize(' '.join(x['no_shared_words']))), axis=1)
new_df = pd.DataFrame(all_df['bow_v6'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[94]:
missed opportunity i had excited to see heard it and ... overlook easy answers alike iq deff comparable compensate company acceptable
PoN
N 2 2 12 4 1 6 2 1 9 7 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 1 1 0 2 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 1 0 0 1 0 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 2 0 0 0 4 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 2 0 0 4 0 0 4 3 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 4506 columns

In [95]:
get_NB(new_df, new_df.index)
Accuracy: 0.7027027027027027
In [96]:
def get_only_polarized_v2(tokens):
#     return [token for token in tokens if token in common_1000[5]] # 54
#     return [token for token in tokens if token not in common_1000[5]] # 59
#     return [token for token in tokens if token not in common_1000[6]] # 60
    return [token for token in tokens if token not in common_1000[6]] # 60

all_df['no_neg_words'] = all_df.apply(lambda x: get_only_polarized_v2(x['tokens']), axis=1)
In [97]:
all_df['bow_v7'] = all_df.apply(lambda x: Counter(casual_tokenize(' '.join(x['no_neg_words']))), axis=1)
new_df = pd.DataFrame(all_df['bow_v7'].tolist(), all_df['PoN'])
new_df = new_df.fillna(0).astype(int)
new_df[:5]
Out[97]:
missed opportunity i had been very excited to see this ... overlook easy answers alike iq deff comparable compensate company acceptable
PoN
N 2 2 12 4 4 3 1 6 2 2 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 1 0 0 1 1 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 0 0 0 0 0 1 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 1 0 0 0 0 2 0 1 ... 0 0 0 0 0 0 0 0 0 0
N 0 0 2 0 0 0 0 4 0 4 ... 0 0 0 0 0 0 0 0 0 0

5 rows × 4388 columns

In [98]:
get_NB(new_df, new_df.index)
Accuracy: 0.6081081081081081
In [99]:
all_df
Out[99]:
0 PoN sentences num_sentences tokens num_tokens no_sw num_no_sw topwords_unfil topwords_fil ... diy_cleaner bow_v2 pruned bow_v3 bow_v4 bow_v5 no_shared_words bow_v6 no_neg_words bow_v7
0 Missed Opportunity\nI had been very excited t... N [ Missed Opportunity\nI had been very excited ... 1 [missed, opportunity, i, had, been, very, exci... 306 [missed, opportunity, excited, see, movie, eve... 140 [(of, 13), (i, 12), (the, 12), (that, 10), (it... [(movie, 3), (said, 3), (many, 3), (times, 3),... ... missed opportunity missed opportunity i had ... {'missed': 3, 'opportunity': 3, 'i': 14, 'had'... missed opportunity missed opportunity been ver... {'missed': 3, 'opportunity': 3, 'been': 4, 've... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'... {'missed_opportunity': 2, 'opportunity_i': 1, ... [missed, opportunity, i, had, excited, to, see... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'... [missed, opportunity, i, had, been, very, exci... {'missed': 2, 'opportunity': 2, 'i': 12, 'had'...
1 5/5 for Phoenix's acting..\nI don't think the... N [ 5/5 for Phoenix's acting.., I don't think th... 5 [for, phoenix, i, do, think, there, was, a, ne... 59 [phoenix, think, need, super, dark, film, tbh,... 25 [(was, 4), (a, 3), (that, 3), (for, 2), (there... [(dark, 2), (phoenix, 1), (think, 1), (need, 1... ... 5/5 for phoenix's acting.. 5/5 for phoenix's... {'5/5': 2, 'for': 3, 'phoenix's': 2, 'acting':... phoenix's acting.. phoenix's acting.. dont thi... {'phoenix's': 2, 'acting': 2, '..': 2, 'dont':... {'for': 2, 'phoenix': 1, 'i': 1, 'do': 1, 'thi... {'for_phoenix': 1, 'phoenix_i': 1, 'i_do': 1, ... [for, i, do, was, a, for, a, tbh, is, a, dc, h... {'for': 2, 'i': 1, 'do': 1, 'was': 4, 'a': 3, ... [for, phoenix, i, do, think, there, was, a, ne... {'for': 2, 'phoenix': 1, 'i': 1, 'do': 1, 'thi...
2 Everyone praised an overrated movie.\nOverrat... N [ Everyone praised an overrated movie., Overra... 2 [everyone, praised, an, overrated, movie, over... 26 [everyone, praised, overrated, movie, overrate... 13 [(overrated, 2), (movie, 2), (everyone, 1), (p... [(overrated, 2), (movie, 2), (everyone, 1), (p... ... everyone praised an overrated movie. everyon... {'everyone': 2, 'praised': 2, 'an': 2, 'overra... everyone praised overrated movie. everyone pra... {'everyone': 2, 'praised': 2, 'overrated': 3, ... {'everyone': 1, 'praised': 1, 'an': 1, 'overra... {'everyone_praised': 1, 'praised_an': 1, 'an_o... [praised, an, of, all, the, are, out, to, be, ... {'praised': 1, 'an': 1, 'of': 1, 'all': 1, 'th... [everyone, praised, an, overrated, movie, over... {'everyone': 1, 'praised': 1, 'an': 1, 'overra...
3 What idiotic FIlm\nI can say that Phoenix is ... N [ What idiotic FIlm\nI can say that Phoenix is... 4 [what, idiotic, film, i, can, say, that, phoen... 66 [idiotic, film, say, phoenix, master, actor, b... 36 [(and, 4), (is, 2), (make, 2), (movie, 2), (to... [(make, 2), (movie, 2), (idiotic, 1), (film, 1... ... what idiotic film what idiotic film i can sa... {'what': 2, 'idiotic': 2, 'film': 2, 'i': 1, '... what idiotic film what idiotic film that phoen... {'what': 2, 'idiotic': 2, 'film': 2, 'that': 1... {'what': 1, 'idiotic': 1, 'film': 1, 'i': 1, '... {'what_idiotic': 1, 'idiotic_film': 1, 'film_i... [idiotic, i, can, say, is, master, bt, not, a,... {'idiotic': 1, 'i': 1, 'can': 1, 'say': 1, 'is... [what, idiotic, film, i, can, say, that, phoen... {'what': 1, 'idiotic': 1, 'film': 1, 'i': 1, '...
4 Terrible\nThe only thing good about this movi... N [ Terrible\nThe only thing good about this mov... 9 [terrible, the, only, thing, good, about, this... 124 [terrible, thing, good, movie, phoenixs, actin... 65 [(the, 5), (this, 4), (movie, 4), (it, 4), (to... [(movie, 4), (terrible, 3), (acting, 3), (good... ... terrible terrible the only thing good about ... {'terrible': 4, 'the': 5, 'only': 1, 'thing': ... terrible terrible only thing good about this m... {'terrible': 4, 'only': 1, 'thing': 1, 'good':... {'terrible': 1, 'the': 1, 'only': 1, 'thing': ... {'terrible_the': 1, 'the_only': 1, 'only_thing... [terrible, the, is, but, i, and, for, entertai... {'terrible': 3, 'the': 5, 'is': 2, 'but': 3, '... [terrible, the, only, thing, good, about, this... {'terrible': 3, 'the': 5, 'only': 1, 'thing': ...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
118 Nerve-wracking, but in very uncomfortable way... P [ Nerve-wracking, but in very uncomfortable wa... 8 [but, in, very, uncomfortable, way, why, every... 57 [uncomfortable, way, everybody, keep, saying, ... 33 [(it, 4), (a, 4), (movie, 3), (in, 2), (keep, ... [(movie, 3), (keep, 2), (saying, 2), (psycho, ... ... nerve-wracking, but in very uncomfortable way... {'nerve-wracking': 2, ',': 2, 'but': 2, 'in': ... nerve-wracking, very uncomfortable nerve-wrack... {'nerve-wracking': 2, ',': 2, 'very': 2, 'unco... {'but': 1, 'in': 1, 'very': 1, 'uncomfortable'... {'but_in': 1, 'in_very': 1, 'very_uncomfortabl... [but, in, way, why, everybody, keep, it, a, it... {'but': 1, 'in': 2, 'way': 1, 'why': 1, 'every... [but, in, very, uncomfortable, way, why, every... {'but': 1, 'in': 2, 'very': 1, 'uncomfortable'...
119 Solid film but there are glaring problems\nOk... P [ Solid film but there are glaring problems\nO... 13 [solid, film, but, there, are, glaring, proble... 628 [solid, film, glaring, problems, okay, first, ... 292 [(the, 35), (to, 22), (it, 16), (and, 16), (i,... [(joker, 6), (movie, 5), (film, 4), (like, 4),... ... solid film but there are glaring problems so... {'solid': 2, 'film': 5, 'but': 6, 'there': 4, ... solid film there glaring problems solid film t... {'solid': 2, 'film': 5, 'there': 4, 'glaring':... {'solid': 1, 'film': 3, 'but': 4, 'there': 2, ... {'solid_film': 1, 'film_but': 1, 'but_there': ... [solid, but, are, glaring, problems, okay, i, ... {'solid': 1, 'but': 5, 'are': 4, 'glaring': 1,... [film, but, there, are, glaring, problems, oka... {'film': 4, 'but': 5, 'there': 3, 'are': 4, 'g...
120 Joker > Endgame\nNeed I say more? Everything ... P [ Joker > Endgame\nNeed I say more?, Everythin... 5 [joker, endgame, need, i, say, more, everythin... 83 [joker, endgame, need, say, everything, movie,... 53 [(joker, 3), (movie, 3), (in, 3), (it, 3), (th... [(joker, 3), (movie, 3), (masterful, 2), (awes... ... joker > endgame joker > endgame need i say m... {'joker': 4, '>': 2, 'endgame': 2, 'need': 1, ... joker endgame joker endgame need more everythi... {'joker': 4, 'endgame': 2, 'need': 1, 'more': ... {'joker': 2, 'endgame': 1, 'need': 1, 'i': 1, ... {'joker_endgame': 1, 'endgame_need': 1, 'need_... [endgame, i, say, is, masterful, in, single, w... {'endgame': 1, 'i': 1, 'say': 1, 'is': 2, 'mas... [joker, need, i, say, more, everything, about,... {'joker': 3, 'need': 1, 'i': 1, 'say': 1, 'mor...
121 Absolutely not a 10\nStrong fanboy and hype r... P [ Absolutely not a 10\nStrong fanboy and hype ... 5 [absolutely, not, a, strong, fanboy, and, hype... 81 [absolutely, strong, fanboy, hype, rush, going... 36 [(the, 7), (is, 6), (a, 4), (fanboy, 2), (and,... [(fanboy, 2), (movie, 2), (absolutely, 1), (st... ... absolutely not a 10 absolutely not a 10 stro... {'absolutely': 2, 'not': 2, 'a': 2, '10': 2, '... absolutely absolutely strong fanboy hype rush ... {'absolutely': 2, 'strong': 1, 'fanboy': 1, 'h... {'absolutely': 1, 'not': 1, 'a_NEG': 4, 'stron... {'absolutely_not': 1, 'not_a': 1, 'a_strong': ... [not, a, strong, fanboy, and, rush, on, the, i... {'not': 1, 'a': 4, 'strong': 1, 'fanboy': 2, '... [absolutely, not, a, fanboy, and, hype, rush, ... {'absolutely': 1, 'not': 1, 'a': 4, 'fanboy': ...
122 Overhyped, but it's alright\nIt's a good film... P [ Overhyped, but it's alright\nIt's a good fil... 3 [overhyped, but, it, alright, it, a, good, fil... 60 [overhyped, alright, good, film, see, like, ma... 31 [(it, 4), (but, 3), (a, 3), (good, 2), (do, 2)... [(good, 2), (overhyped, 1), (alright, 1), (fil... ... overhyped, but it's alright overhyped, but i... {'overhyped': 2, ',': 2, 'but': 4, 'it's': 2, ... overhyped, it's alright overhyped, it's alrigh... {'overhyped': 2, ',': 2, 'it's': 2, 'alright':... {'overhyped': 1, 'but': 3, 'it': 4, 'alright':... {'overhyped_but': 1, 'but_it': 1, 'it_alright'... [but, it, alright, it, a, but, i, do, see, as,... {'but': 3, 'it': 4, 'alright': 1, 'a': 3, 'i':... [overhyped, but, it, alright, it, a, good, fil... {'overhyped': 1, 'but': 3, 'it': 4, 'alright':...

246 rows × 53 columns

In [100]:
big_bow_n.keys()
Out[100]:
dict_keys(['missed', 'opportunity', 'been', 'very', 'excited', 'this', 'movie', 'ever', 'since', 'heard', 'about', 'anticipating', 'release', 'when', 'started', 'getting', 'type', 'hype', 'press', 'that', 'became', 'apprehensive', 'things', 'were', 'being', 'said', 'which', 'seemed', 'outrageous', 'mostly', 'other', 'moves', 'looking', 'forward', 'seeing', 'ended', 'letting', 'down', 'joker', 'sadly', 'turned', 'those', 'movies', 'know', 'many', 'times', 'before', 'phoenixs', 'portrayal', 'with', 'mental', 'health', 'depression', 'good', 'convincing', 'story', 'plot', 'like', 'deliver', 'anti', 'hero', 'origin', 'most', 'coveted', 'villains', 'comic', 'book', 'lore', 'liked', 'quasi', 'mirroring', 'failed', 'system', 'whose', 'middle', 'lower', 'class', 'revolt', 'against', 'rich', 'sort', 'burn', 'done', 'sure', 'people', 'glimpses', 'today', 'culture', 'knows', 'maybe', 'studio', 'execs', 'their', 'fingers', 'involved', 'ones', 'watered', 'much', 'there', 'will', 'directors', 'darker', 'than', 'theatrical', 'certainly', 'hope', 'because', 'reviews', 'have', 'read', 'speak', 'walking', 'theaters', 'dark', 'feel', 'psychological', 'overtones', 'them', 'stomach', 'felt', 'sense', 'wanting', 'bigger', 'grander', 'what', 'would', 'recommend', 'formulate', 'your', 'opinion', 'gave', 'rating', 'over', 'walked', 'feeling', 'just', 'already', 'seen', "phoenix's", 'acting..', 'dont', 'think', 'need', 'super', 'film', 'comics', 'character', 'dramatized', 'effort', 'knight', 'unfortunately', 'captivating', 'inspiration', 'made', 'stuff', 'enough', 'real', 'world', 'everyone', 'praised', 'overrated', 'movie.', 'time', 'here', 'making', 'better', 'actually', 'idiotic', 'phoenix', 'master', 'actor', 'does', 'still', 'make', 'great', 'thsi', 'lives', 'from', 'blabla', 'every', 'medium', 'nothing', 'only', 'thing', 'behind', 'money', 'media', 'todd', 'philips', 'should', 'some', 'copy', 'taxi', 'driver', 'similar', 'terrible', 'acting', 'watch', 'alone', 'doesnt', 'interesting', 'entertaining', 'give', 'script', 'barely', 'development', 'characters', 'matter', 'outside', 'last', 'minutes', 'best', 'part', 'force', 'through', 'first', 'hours', 'garbage', 'punishment', 'even', 'they', 'couldve', 'condensed', 'into', 'minute', 'special', 'cant', 'believe', 'then', 'again', 'written', 'primarily', 'oscars', 'usually', 'instead', 'poor', 'attempt', 'books', 'sell', 'strays', 'smacks', 'trying', 'hard', 'awards', 'relevance', 'names', 'gotham', 'tries', 'nominations', 'criticism', 'actors', 'thought', 'given', 'wasnt', 'dragged', 'longer', 'versions', 'learned', 'thing.', 'borrows', 'elements', 'strive', 'award', 'well', 'except', 'writing', 'shamelessly', 'theatre', 'edgy', 'scary', 'brain', 'damaged', 'sissy', 'dances', 'while', 'annoying', 'rude', 'expects', 'society', 'pedestal', 'hell', 'hate', 'complete', 'crap', 'really', 'understand', 'watching', 'couldnt', 'till', 'boring', 'myself', 'extremely', 'zero', 'connection', 'joaquin', 'heath', 'ledger', 'needed', 'asking', 'these', 'freaking', 'normal', 'same', 'sentence', 'joaquins', 'never', 'isnt', 'disaster', 'slow', 'could', 'keep', 'falling', 'asleep', 'theater', 'imagine', 'future', 'films', 'alright', 'film...', 'ruined', 'masterpiece', 'raving', 'predictable', 'samey', 'theres', 'creativity', 'king', 'comedy', 'copying', 'almost', 'pointless', 'waste', 'disappointing', 'long', 'possibly', 'take', 'tell', 'audience', 'mentally', 'unwell', 'surprising', 'mother', 'imaginative', 'white', 'sock', "don't", 'review', 'movies,', 'one...', 'watched', 'site', 'absolutely', 'little', 'else', 'found', 'longish', 'fall', 'mean', 'entertain', 'yourself', 'washing', 'machine', 'going', 'straight', 'anyone', 'butt!', 'claiming', 'ridiculous', 'walk', 'happens', 'predict', 'advance', 'rather', 'relies', 'fascinated', 'antics', 'psychotic', 'nutcase', 'whilst', 'convince', 'somehow', 'heroic', 'highly', 'nice', 'excellent', 'suffers', 'three', 'uninteresting', 'dialog', 'pace', 'lengthy', 'number', 'ideas', 'combined', 'more', 'destroy', 'look', 'left', 'beside', 'genre', 'supposed', 'thriller', 'addition', 'crime', 'drama', 'cannot', 'exaggerated', 'high', 'ratings', 'want', 'fair', 'although', 'stars', 'definitely', 'worth', 'consequently', 'skip', '10/10', 'actual', 'unbiased', 'review.', 'titles', 'says', 'marvel', 'hardcore', 'check', 'profiles', 'where', 'fans', 'opposite', 'pure', 'simple', 'truth', 'horrible', 'worst', 'pretty', 'remake', 'shots', 'exactly', 'ripping', 'aside', 'illness', 'psychology', 'slapped', 'title', 'draw', 'expect', 'hoping', 'wrong', 'agree', 'portraying', 'issues', 'though', 'call', 'oscar', 'worthy', 'stretch', 'notice', 'critics', 'saying', 'different', 'perspective', 'each', 'goes', 'audio', 'music', 'certain', 'aspects', 'shot', 'camera', 'words', 'enjoy', 'critic', 'cinema', 'aspect', 'viewers', 'disappointed', 'unlike', 'fascination', 'version', 'term', 'lightly', 'indeed', 'fact', 'gone', 'kids', 'knowing', 'rated', 'graphic', 'also', 'promotes', 'violence', 'guns', 'uncomfortable', 'country', 'rent', 'lastly', 'enjoyed', 'picture', 'past', 'course', 'lets', '2001', 'kings', 'speech', 'bought', 'likely', 'probably', 'forgot', 'soon', 'after', 'list', 'didnt', 'included', 'inception', 'true', 'grit', 'once', 'raved', 'case', 'forget', 'week', 'labeled', 'labeling', 'attention', 'cheap', 'tactic', 'overhyped', 'slowwwwww', 'gladly', 'half', 'until', 'usual', 'must', 'gore', 'disney', 'hear', 'thumbs', 'question', 'below', 'reviewing', 'performance', 'storyline', 'played', 'literally', 'hats', 'discrediting', 'whatsoever', 'reason', 'drawn', 'winded', 'kept', 'agreeing', 'jumping', 'band', 'wagon', 'easily', 'create', 'within', 'hour', 'push', 'ything', 'villian', 'based', 'superhero', 'aware', 'however', 'halloween', 'meets', 'physcotic', 'escapee', 'decides', 'kill', 'sounds', 'michael', 'myers', 'proud', 'brilliant', 'love', 'pheonixs', 'ought', 'please', 'process', 'receive', 'sheep', 'write', 'compelled', 'thoughts', 'head', 'apparently', 'quite', 'peoples', 'heads', 'comes', 'perception', 'order', 'mine', 'anybody', 'elses', 'critique', 'following', 'dissapointing', 'boring!!!', 'wonderful', 'role', 'orgin', 'buffalo', 'bill', 'silence', 'lambs', 'depressing', 'limp', 'wristed', 'whith', 'feminine', 'dancing', 'masculinity', 'remember', 'dark,', 'depressing,', 'slow,', 'heavy,', 'kudos', 'tough', 'backstory', 'sorry', 'genres', 'simply', 'stay', 'heavy', 'spoon', 'point', 'depressed', 'ready', 'react', 'keith', 'comments', 'perhaps', 'paid', 'ledgers', 'inventive', 'charismatic', 'maniacal', 'creepy', 'batman', 'ecosystem', 'fills', 'relationship', 'cathartic', 'moment', 'catalyze', 'reaction', 'paced', 'told', 'choice', 'evening', 'gambling', 'addicted', 'director', 'scorsese', 'overlong', 'dull', 'feed', 'network', 'basic', 'carbon', 'plots', 'lifted', 'find', 'become', 'psyco', 'coudnt', 'entertainment', 'cinematic', 'experience', 'fantastic', 'ways', 'awful', 'blank', 'slate', 'study', 'crazy', 'over-hyped,', 'overacted', 'proper', 'millennial', 'absolute', 'disappointment', 'believed', 'fool', 'person', 'stupid', 'cringe', 'happening', 'smoking', 'around', 'action', 'substance', 'humor', 'everything', 'disturbing', 'respected', 'refer', 'powerful', 'illustration', 'loners', 'dangerous', 'themselves', 'others', 'theyre', 'untreated', 'educated', 'standpoint', 'millions', 'goers', 'cause', 'worry', 'impact', 'kind', 'societys', 'problems', 'goodness', 'driven', 'further', 'fearful', 'repercussions', 'stigmatisation', 'prejudice', 'bullying', 'right', 'seem', 'care', 'such', 'content', 'less', 'cinematography', 'otherwise', 'rehash', 'thats', 'exploitation', 'misrepresentation', 'pathologies', 'unforgiveable', 'fanboys', 'forgotten?', 'throughout', 'history', 'always', 'replaced', 'nature', 'paganism', 'translated', 'devil', 'roman', 'catholicism', 'bring', 'social', 'coherence', 'figure', 'represent', 'meticulous', 'forgotten', 'hurts', 'favorite', 'broke', 'golden', 'rule', 'laid', 'robert', 'downey', 'tropic', 'thunder', 'full', 'planning', 'cunning', 'depth', 'chaotic', 'narcissism', 'excellently', 'depicted', 'eternal', 'opening', 'scene', 'waiting', 'keyser', 'souse', 'control', 'display', 'black', 'mirror', 'pulling', 'strings', 'along', 'came', 'sorrowful', 'victim', 'threw', 'tantrum', 'lost', 'empowered', 'taking', 'becoming', 'anarchistic', 'commentator', 'forest', 'gump', 'rain', 'robot', 'depictions', 'suffering', 'writers', 'remembered', 'level', 'ingenuity', 'leaves', 'understanding', 'cognitive', 'approach', 'phillips', 'displayed', 'cruel', 'fist', 'banished', 'vulgar', 'insult', 'narrative', 'intriguing', 'dualistic', 'decades', 'meet', 'universe', 'sequel', 'jokers', 'lord', 'life', 'grudge', 'match', 'between', 'christian', 'bales', 'machinist', 'malnutritioned', 'clown', 'prince', 'threatening', 'forever', 'joaquim', 'mark', 'sorely', 'rewatch', 'something', 'extended', 'trailer', 'exposed', 'revelations', 'challenged', 'presented', 'basically', 'superlatives', 'explanations', 'adorning', 'without', 'incredible', 'shadowed', 'truly', 'went', 'night', 'positive', 'honestly', 'totally', 'bored', 'thinking', 'start', 'gruesome', 'makes', 'leave', 'short', 'leaving', 'realy', 'whit', 'happy', 'grave', 'bad...', 'whole', 'apperently', 'completely', 'acted', 'trash', 'weak', 'face', 'paint', 'drug', 'addict', 'loser', 'blames', 'everybody', 'failings', 'mediocre', 'offensive', 'ultra', 'liberal', 'preaching', 'millennials', 'reinforces', 'school', 'college', 'teachings', 'fault', 'parents', 'boss', 'government', 'neighbors', 'cops', 'imdb', 'superior', 'godfather', 'generation', 'pathetic', 'hopes', 'werent', 'amazing', 'tedious', 'experienced', 'childhood', 'trauma', 'spend', 'asylum', 'seven', 'medication', 'effect', 'metro', 'incident', 'breaking', 'chain', 'free', 'himself', 'change', 'evolve', 'beginning', 'seventy', 'percent', 'screen', 'dedicated', 'arthur', 'fleck', 'support', 'lack', 'soul', 'deniero', 'disappoints', 'aura', 'somewhere', 'nineties', 'wait', 'anything', 'espaically', 'repeated', 'space', 'alot', 'nothings', 'drag', 'suspense', 'work', 'begin', 'turns', 'unbelievable', 'smart', 'using', 'intuition', 'batmans', 'greatest', 'embarrassing', 'stand', 'unrelated', 'series', 'appreciated', 'main', 'decent', 'strictly', 'come', 'childcare', 'arrangements', 'wish', 'home', 'repeating', 'subject', 'missing', 'deserve', 'pursuing', 'career', 'talent', 'beaten', 'ridiculed', 'standard', 'rated.', 'makeup', 'reviewers', 'guess', 'disturbed', 'guys', 'demise', 'proviked', 'societal', 'fecay', 'consequential', 'violent', 'joachin', 'effeminate', 'weird', 'dance', 'demonstrate', 'evolved', 'self', 'overhyped.', 'borders', 'irritating', 'aimlessly', 'behavior', 'laughter', 'repetitious', 'wrote', 'star', 'family', 'friends', 'worked', 'years!!!', 'seriously', 'amateur', 'loved', 'outstanding', 'decided', 'leading', 'impressed', 'soundtrack', 'ending', 'phenomenal', 'deserves', 'hands', 'years', 'decaprio', 'revenant', 'next', 'weeknd', 'havent', 'flaw', 'edit', 'oscar.', 'holy', 'fine', 'pheonix', 'hair', 'winning', 'gotta', 'okay', 'intelligent', 'insane', 'holds', 'deep', 'conversations', 'prominent', 'capable', 'complicated', 'bank', 'robbery', 'step', 'ahead', 'police', 'intelligence', 'strong', 'personality', 'emotionality', 'laughed', 'controllably', "'triumph", "will'", 'nihilists', 'sick', 'disgusting', 'evil', 'total', 'piece', 'scheisse', 'affect', 'emotionally', 'troubled', 'young', 'pulled', 'suicide', 'addictive', 'behaviors', 'hopelessness', 'triumph', 'defer', 'voting', 'video', 'majorly', 'screwed', 'dude', 'alien', 'body', 'naked', 'waist', 'disquieting', 'taut', 'skin', 'stretched', 'tightly', 'bone', 'structure', 'bones', 'stick', 'angles', 'places', 'exoskeleton', 'medical', 'experiment', 'single', 'pleasant', 'beauty', 'happiness', 'catharsis', 'misery', 'churning', 'emptiness', 'fifty', 'circle', 'despair', 'humanity', 'showing', 'sane', 'live', 'gets', 'vanilla.', 'blah.', 'wasted', 'giving', 'terrible-not', 'recall', 'accurate', 'hoped', 'pitiful', 'took', 'enjoyment', 'worse', "didn't", 'screening', 'honest', 'fuss', 'expecting', 'multi', 'layered', 'descent', 'dimensional', 'means', 'bait', 'pretentious,', 'takes', 'itself', 'wants', 'smarter', 'enjoying', 'rest', 'achieve', 'toker', 'awkward', 'loner', 'stoner', 'schtick', 'surely', 'academy', 'sheer', 'scrawnyer', 'gargantuan', 'artistic', 'achievement', 'forcibly', 'sucking', 'stomack', 'reads', 'wrong.', 'travis', 'bickle', 'product', 'actions', 'justified', 'rendered', 'aspirational', 'either', 'aesthetics', 'rupert', 'pupkin', 'scorseses', 'another', 'heavily', 'insight', 'divide', 'neurological', 'glitter', 'thrown', 'disguise', 'shallow', 'adds', 'confusion', 'ends', 'none', 'poser', 'familiar', 'feels', 'fresh', 'knocks', 'socks', 'laugh', 'haunting', 'singular', 'commits', 'third', 'murder', 'obviously', 'defense', 'beta', 'ghus', 'gaye', 'ghhade', 'yahan', 'impossible', 'nikalna', 'fears', 'humorless', 'digging', 'hated', 'hbos', 'succession', 'notes', 'protagonists', 'humanize', 'maintain', 'necessary', 'ironic', 'distance', 'movie?', 'serial', 'killer', 'abused', 'child', 'attacked', 'street', 'subway', 'mass', 'murderer', 'jokes', 'famous', 'funny', 'careful', 'prevent', 'private', 'someone', 'official', 'background', 'checks', 'messed', 'logical', 'response', 'wacked', 'maniac', 'murdering', 'enjoyable', 'swimming', 'sewage', 'succeeded', 'collapses', 'putrid', 'mess', 'ultimately', 'thanks', 'lacking', 'focus', 'journey', 'constant', 'musical', 'score', 'dramatic', 'detracted', 'performed', 'entertained', 'taken', 'partner', 'finished', 'devoured', 'previous', 'horribly', 'derivative', 'repugnant', 'dramatically', 'flawed', 'excruciatingly', 'telescoped', 'lens', 'vilifies', 'points', 'consistency', 'theyd', 'guts', 'struggle', 'sexuality', 'might', 'help', 'mind', 'declared', 'profound', 'strokes', 'specifically', 'preclude', 'manifestation', 'explained', 'willed', 'seat', 'acrid', 'stinky', 'seventies', 'references', 'dessert', 'duration', 'eventually', 'slopped', 'riddle', 'promise', 'remarkably', 'banal', 'serves', 'illuminate', 'gluttonous', 'exploitative', 'villainy', 'corporations', 'production', 'values', 'comparing', 'exquisitely', 'stark', 'visions', 'nolan', 'hype!', 'wonder', 'licensed', 'brand', 'creates', 'chaos', 'manipulation', 'threat', 'explosions', 'gunpowders', 'borrowing', 'costume', 'signature', 'iconic', 'argue', 'early', 'stages', 'transforming', 'supervillain', 'whats', 'psychopath', 'patient', 'bullied', 'disregarded', 'turn', 'villain', 'justice', 'independent', 'unnecessary', 'legendary', 'inhuman', 'terrorising', 'morally', 'dislike', 'depiction', 'disturbances', 'relating', 'filmographically', 'terrorise', 'spectator', 'strip', 'narative', 'madness', 'yeah', 'driving', 'puts', 'political', 'message', 'rehashed', 'junk', 'hollywood', 'nowadays', 'twice', 'needs', 'zimmer', 'howard', 'combo', 'unpopular', 'opinion:', 'account', 'hearing', 'tons', 'praises', 'terribly', 'living', 'regards', 'climate', 'hint', 'overacting', 'galore', 'underwhelmed', 'friendly', 'surprised', 'magic', 'looong', 'imho', 'gives', 'damn', 'darth', 'vaders', 'centuries', 'boogeyman', 'overpaid', 'lalaland', 'schmocks', 'wont', 'jump', 'prequel', 'explains', 'train', 'least', 'solid', 'filmmaking', 'finesse', 'build', 'surprises', 'load', 'layman', 'olds', 'roll', 'eyes', 'cacophony', 'scenes', 'cheesy', 'moments', 'massive', 'subtle', 'sinister', 'second', 'elevator', 'joke', 'miss', 'having', 'student', 'throw', 'bunch', 'cinematographer', 'gratuitous', 'senseless', 'drool', 'dudes', 'brought', 'road', 'trip', 'hangover', 'clichés', 'hardly', 'suspenseful', 'building', 'serious?', 'imitation', 'cynical', 'taste', 'mouth', 'essential', 'viewing', 'reinvention', 'doesent', 'clever', 'banter', 'known', 'villians', 'snooze', 'fest', 'plays', 'leeway', 'mannerisms', 'spot', 'demeanor', 'capsized', 'killings', 'bland', 'desperately', 'element', 'towards', 'death', 'rebirth', 'smartest', 'dissappointment', 'billboard', 'signs', 'london', 'underground', 'learning', 'approved', 'masses', 'appeared', 'arthouse', 'interpretation', 'firstly', 'source', 'material', 'psychiatrist', 'describes', 'supersane', 'sees', 'irony', 'works', 'comedian', 'alan', 'moore', 'watchmen', 'settling', 'treats', 'conform', 'follow', 'rules', 'regulations', 'edge', 'tragedies', 'snaps', 'contrary', 'ruthless', 'daring', 'sadistic', 'twisted', 'conforming', 'societies', 'norms', 'innovative', 'somewhat', 'dissapointed', 'portrayed', 'recognition', 'stop', 'suggest', 'compromised', 'both', 'laughing', 'condition', 'uncontrollably', 'nervous', 'anxious', 'dumbs', 'origins', 'subsequently', 'pity', 'mobbed', 'refused', 'treatment', 'funding', 'cuts', 'treated', 'colleagues', 'elderly', 'issue', 'unrequited', 'neighbour', 'subsequent', 'humiliation', 'niros', 'mothers', 'leads', 'bloody', 'brutal', 'finale', 'arthurs', 'transformation', 'brutality', 'harshness', 'whether', 'caring', 'physically', 'disabled', 'shows', 'sympathy', 'dwarf', 'strongly', 'suggests', 'antithesis', 'infact', 'successfully', 'standing', 'result', 'poorly', 'redeeming', 'several', 'earlier', 'flashback', 'events', 'place', 'figment', 'imagination', 'sergio', 'leones', 'upon', 'america', 'dreamed', 'state', 'killing', 'prefers', 'multiple', 'valid', 'hypothesis', 'ponder', 'considered', 'cannon', 'prefer', 'glad', 'standalone', 'inspired', 'numerous', 'includes', 'clockwork', 'orange', 'forgives', 'drive', 'personally', 'effectiveness', 'panache', 'recently', 'indian', 'readers', 'called', 'wajood', 'starring', 'nana', 'patekar', 'franchise', 'associated', 'acting....', 'happen', 'nose,', 'silly', 'forced', 'described', 'realistic', 'despite', 'show', 'finalized', 'sustain', 'flecks', 'downfall', 'organic', 'explored', 'sufficiently', 'amalgamation', 'masterpieces', 'deal', 'matters', 'thoughtful', 'mature', "haven't", 'entire', 'movie!', '2019', 'year', 'astra', 'hellboy', 'slowness', 'accompanied', 'stringed', 'instruments', 'impression', 'carry', 'weight', 'importance', 'clearly', 'playing', 'elevates', 'compelling', 'majority', 'active', 'choices', 'context', 'running', 'beat', 'theme', 'vaguely', 'referenced', 'confusing', 'useless', 'shouldnt', 'opposed', 'whered', 'bernadette', 'important', 'useful', 'during', 'services', 'consequences', 'killed', 'imaginary', 'anarchy', 'winds', 'starting', 'movement', 'kills', 'wayne', 'enterprises', 'employees', 'interaction', 'crowd', 'seems', 'pleased', 'general', 'displeasure', 'wealthy', 'whenever', 'asked', 'keeps', 'politics', 'coming', 'across', 'confused', 'refusal', 'pick', 'side', 'surface', 'touching', 'subjects', 'determine', 'commentary', 'thinks', 'looks', 'lose', 'bargain', 'matinee', 'ripped', 'comfy', 'chairs', 'priced', 'snacks', 'lacks', 'thing-', 'value', 'albeit', 'plain', 'generally', 'criminal', 'genius', 'mastermind', 'masterful', 'comprehension', 'trickery', 'chemicals', 'delusional', 'intellect', 'diary', 'flat', 'jack', 'nicholson', 'raised', 'reached', 'respect', 'portrays', 'brazen', 'craziness', 'sake', 'locked', 'institution', 'arest', 'dtotal', 'csome', 'fake', 'hype!!!!!!!', 'wrenching', 'cried', 'kinda', 'cool', 'expectations.', 'potential', 'badly', 'directed', 'miserable', 'unpleasant', 'slog', 'news', 'clowns', 'back', 'pranksters', 'mimicking', 'pennywise', 'scare', 'viral', 'memes', 'incels', 'chooses', 'date', 'dour', 'demented', 'featured', 'nolans', 'marvelously', 'doubt', 'skinny', 'lonely', 'drugged', 'psychos', 'rushing', 'hail', 'manipulaitve', 'consumed', 'infectious', 'sometimes', 'charming', 'confidence', 'dumb', 'insecure', 'controls', 'spiral', 'pieces', 'optimism', 'starts', 'seemingly', 'theyve', 'name', 'eliminate', 'youd', 'closest', 'resemble', 'plenty', 'individuals', 'gritty', 'neither', 'word', '"masterpiece"', 'attached', 'coordinated', 'especially', 'channeling', 'confess', 'reminded', 'burrell', 'phil', 'dunphy', 'modern', 'harmless', 'regardless', 'impressive', 'unreliable', 'narrator', 'necessarily', 'showcase', 'line', 'serious', 'afterward', 'disconnected', 'overall', 'fairly', 'bubble', 'glorified', 'fiction', 'begs', 'anyway', 'urge', 'cents', "''joker", 'culture.', 'instead,', "it's", 'prime', 'example', "it''", 'stole', 'hits', 'nail', 'impulse', 'stories', 'constantly', 'repeat', 'chance', 'rejected', 'angry', 'fails', 'becomes', 'plus', 'various', 'cartoons', 'subtly', 'dialogues', 'league', 'claim', 'fully', 'reflects', 'successful', 'cast', 'spell', 'reality', 'meaning', 'exist', 'tried', 'chose', 'form', 'inside', 'lines', 'russian', 'babushka', 'empty', 'open', 'layers', 'doll', 'technical', 'exercise', 'quote', 'exposing', 'shallowness', 'pseudo', 'scott', 'silver', 'gifs', 'strung', 'together', 'fired', 'struts', 'clock', 'deadpans', 'punch', 'dangles', 'wall', 'note', 'youll', 'twitter', 'facebook', 'feeds', 'cracks', 'practically', 'stuffed', 'phony', 'philosophy', 'stupidly', 'adolescent', 'imparting', 'cultural', 'wisdom', 'tirades', 'muses', 'screams', 'nobodys', 'civil', 'anymore', 'observation', 'truisms', 'slides', 'aims', 'able', 'combine', 'features', 'commercial', 'mainstream', 'authentic', 'accusation', 'haters', 'often', 'pretentious', 'trilogy', 'whereas', 'philiphs', 'quintessence', 'pretentiousness', 'collection', 'fanfiction', 'quotes', 'poured', 'sauce', 'tricks', 'battered', 'twists', 'creation', 'goodbye', 'stable', 'ceased', 'popular', 'darkness', 'father', 'bale', 'showed', 'masterfully', 'ambivalence', 'fascinating', 'wounded', 'nihilist', '...:', 'psycho', 'saves', 'marketing', 'illnesses...', 'lead', 'torturing', 'children', 'relation', 'somebody', 'scared', 'underwhelming', 'frankly', 'unbelivably', 'breathtaking', 'divisive', 'initial', 'excitement', 'rate', 'disappoint', 'film.', 'nearly', 'expected', 'apart', 'whos', 'dealing', 'bipolar', 'disorder', 'including', 'negative', 'passing', 'popularity', 'centered', 'heaths', 'alleged', 'confirmed', 'gossip', 'queen', 'regain', 'therefore', 'slowly', 'began', 'offbeat', 'rogue', 'allowed', 'profit', 'cooked', 'close', 'moaning', 'ordinary', 'spread', 'naturally', 'capitalize', 'zooming', 'unstable', 'viewesr', 'decide', 'hand', 'unexplainable', 'holes', 'recommended', 'adversary', 'wicked', 'notch', 'brillance', 'ability', 'compete', 'equal', 'power', 'pychopath', 'embarressment', 'blaiming', 'thomas', 'bullies', 'sleezeball', 'stock', 'trader', 'types', 'deserved', 'defence', 'hunted', 'away', 'horror', 'clownface', 'upset', 'mobs', 'tired', 'trump', 'preachy', 'tired,', 'tragic', 'turkey', 'miss!', 'jokerwords', 'fail', 'alcoholic', 'judy', 'lunatic', 'informed', 'utter', 'cobblers', 'void', 'ultimate', 'columbus', 'purported', 'extraordinaire', 'zilch', 'henchmen', 'chase', 'arch', 'nemesis', 'small', 'contemporaries', 'incoherent', 'nonsense', 'dominated', 'unfocused', 'struggling', 'problem', 'revolting', 'characterisation', 'rested', 'physicality', 'contorted', 'inference', 'duped', 'obvious', 'trick', 'raging', 'bull', 'dallas', 'buyers', 'club', 'wanted', 'pass', 'raise', 'funds', 'shirt', 'wear', 'method', 'style', 'largely', 'improvised', 'fill', 'behaviour', 'meaningless', 'unsurprisingly', 'pathos', 'unremittingly', 'morose', 'nicholsons', 'captured', 'absent', 'instantly', 'forgettable', 'lacked', 'stream', 'sold', 'poke', 'aladdin', 'misleading', 'lite', 'edition', 'postmodern', 'fight', 'lifts', 'reactions', 'herd', 'mentality', 'play', 'groundbreaking', 'pulls', 'seriousness', 'posturing', 'backbone', 'consistent', 'themes', 'essentially', 'hollow', 'description', 'timid', 'pretends', 'proto', 'dozen', 'suitable', 'untalented', 'smoker', 'ratcatcher', 'calendar', 'weaker', 'foes', 'named', 'otis', 'flannegan', 'julian', 'credit', 'dare', 'impostor', 'afterthought', 'irrelevant', 'genuinely', 'overly', 'eager', 'proclaim', 'manages', 'weakest', 'direction', 'average', 'describe', 'subtlety', 'nuance', 'wouldnt', 'cared', 'characterization', 'addressed', 'group', 'happened', 'lyrics', 'song', 'repertoire', 'limitations', 'wherein', 'liberties', 'filled', 'brim', 'convenience', 'move', 'particular', 'manner', 'unnatural', 'telling', 'lazy', 'shoe', 'horn', 'figured', 'pretended', 'inflated', 'estimation', 'mentioned', 'lining', 'earn', 'nomination', 'roles', 'effortless', 'strain', 'natural', 'extent', 'owing', 'physical', 'whoever', 'ageing', 'later', 'cbms', 'logan', 'alright,', 'directing', 'clothes', 'unwatchable', 'talking', 'twenty', 'hitler', 'heroes', 'fictional', 'vader', 'episodes', 'wars', 'galaxys', 'terrorized', 'mercy', 'human', 'endeavor', 'understood', 'circumstances', 'stayed', 'acts', 'reviled', 'spoiler', 'alert', 'gratified', 'redemption', "let's", 'math', 'afraid', 'clouded', 'everyones', 'judgement', 'flaws', 'original', 'pull', 'bringing', 'major', 'glowing', 'talk', 'uneven', 'jumpy', 'beyond', 'tiny', 'comics?', 'idea', 'liking', 'norm', 'automatically', 'praise', 'shake', 'expectations', 'peak', 'crying', 'existence', 'thousand', 'struggled', 'personal', 'common', 'betray', 'attitude', 'kidding', 'horse', 'filth', 'flaming', 'shooter', 'severely', 'insanely', 'immature', 'stops', 'hitting', 'ugly', 'unique', 'memorable', 'faulting', 'terrific', 'screw', 'considering', 'harder', 'recent', 'memory', 'born', 'languorous', 'psychopathic', 'intent', 'failure', 'providing', 'shoddy', 'construct', 'vision', 'nihilistic', 'nowhere', 'meant', 'empathize', 'disgruntled', 'easier', 'motivations', 'disgruntlement', 'propped', 'relevant', 'novel', 'hasnt', 'million', 'focused', 'sequences', 'gary', 'bombastic', 'incongruent', 'deadweight', 'lambast', 'embrace', 'amorality', 'biting', 'satire', 'motivation', 'superficial', 'dreck', 'trade', 'reigns', 'knock', 'shoved', 'assed', 'unintelligent', 'unnecessarily', 'aggressively', 'steals', 'handle', 'influences', 'worries', 'overblown', 'mainly', 'view', 'exploration', 'occasionally', 'rumblings', 'weve', 'niro', 'slightest', 'esque', 'woman', 'finds', 'boyfriend', 'neighbor', 'rarely', 'logic', 'conservative', 'protests', 'remotely', 'convoluted', 'mile', 'huge', 'buildup', 'relationships', 'unearned', 'mere', 'pawns', 'machinations', 'arent', 'retard', 'encourages', 'knew', 'questionable', 'image', 'convinced', 'commit', 'tyler', 'durden', 'boredom', 'patrick', 'bateman', 'american', 'plan', 'inseparably', 'connected', 'symbol', 'hide', 'judiciary', 'requires', 'implied', 'broken', 'deeply', 'hurt', 'inspire', 'imitators', 'generous', 'flawless', 'board', 'boasts', 'mirely', 'handed', 'choppy', 'flow', 'decisions', 'wildly', 'highlghts', 'illnesses', 'handled', 'sprinkle', 'light', 'hearted', 'remind', 'strained', 'angle', 'difficult', 'introspection', 'youre', 'danger', 'poses', 'blunder', 'handling', 'harm', 'existential', 'pandering', 'categorize', 'consider', "wasn't", 'joker!', 'avoid', 'beloved', 'tactician', 'conscience', 'enjoys', 'game', 'tortured', 'inconsistencies', 'bruce', 'shown', 'qualities', 'compassion', 'fringe', 'changed', 'alert!', 'rotten', 'lenient', 'brings', 'validity', 'unreasonable', 'gloomy', 'treat', 'difficulty', 'protest', 'senator', 'candidate', 'president', 'position', 'highligts', 'biased', 'disorders', 'drops', 'hustlers', 'haah', 'haaah', 'haaaah', 'haaaaah', 'haaaaaah', 'what?', 'berate', 'bspw', 'borat', 'blend', 'normally', 'manchilds', 'favored', 'exception', 'category', 'advise', 'difference', 'nonetheless', 'haaaaaaah', 'used', 'sccenes', 'cringed', 'cheaply', 'express', 'girlfriend', 'added', 'manage', 'squeezed', 'noble', 'effort,', 'substance.', 'unusual', 'remains', 'cipher', 'loves', 'enlightening', 'traumatic', 'injury', 'delusions', 'schizophrenia', 'ourselves', 'sorta', 'douglas', 'shades', 'touches', 'earned', 'soliloquy', 'awareness', 'developed', 'cooky', 'spectacular', 'hints', 'displeased', 'annoyed', 'waynes', 'deaths', 'situation', 'indirectly', 'created', 'unhappy', 'serious,', 'tense...', 'bad!', 'darkest', 'highest', 'thrilling', 'instructions', 'flipped', 'boundaries', 'audiences', 'clear', 'fundemental', 'formula', 'blow', 'intense', 'perfect', 'dropping', 'mega', 'bore', 'imbd', 'assumed', 'murdered', 'moved', 'mill', 'granddaughter', 'great,', "can't", 'rest.', 'lackluster', 'color', 'random', 'center', 'creams', 'room', 'masculine', 'spent', 'masterclass', 'avid', 'goer', 'parts.', 'extraordinary', 'grasp', 'tells', 'haaaaaaah!', 'bullsheiße'])
In [101]:
import wordcloud
from wordcloud import WordCloud, ImageColorGenerator
from PIL import Image
import seaborn as sns
import matplotlib.pyplot as plt 
def create_word_cloud_with_mask(path_of_mask_image, dictionary, 
                                max_num_words, title):
        mask = np.array(Image.open(path_of_mask_image))
        #creating the word cloud 
        word_cloud = WordCloud(background_color = "white", 
                               max_words = max_num_words, 
                              mask = mask, max_font_size = 125, 
                              random_state = 1006)
        word_cloud.generate_from_frequencies(dictionary)
        #creating the coloring for the word cloud 
        image_colors = ImageColorGenerator(mask)
        plt.figure(figsize = [8,8])
        plt.imshow(word_cloud.recolor(color_func = image_colors), 
                  interpolation = "bilinear")
        plt.title(title)
        sns.set_context("poster")
        plt.axis("off")
        return plt
In [102]:
# import sys
# print(sys.executable)
In [103]:
# mask = np.array(Image.open('../questionmark.png'))
# mask
In [104]:
create_word_cloud_with_mask('thumbup.png', big_bow_n, 750, "Pre-clean")
Out[104]:
<module 'matplotlib.pyplot' from '/usr/local/lib/python3.7/site-packages/matplotlib/pyplot.py'>
In [105]:
big_bow_n
Out[105]:
Counter({'missed': 5,
         'opportunity': 4,
         'been': 35,
         'very': 27,
         'excited': 5,
         'this': 250,
         'movie': 256,
         'ever': 6,
         'since': 6,
         'heard': 2,
         'about': 75,
         'anticipating': 1,
         'release': 2,
         'when': 25,
         'started': 4,
         'getting': 7,
         'type': 5,
         'hype': 21,
         'press': 1,
         'that': 213,
         'became': 8,
         'apprehensive': 1,
         'things': 14,
         'were': 26,
         'being': 26,
         'said': 12,
         'which': 32,
         'seemed': 3,
         'outrageous': 1,
         'mostly': 1,
         'other': 21,
         'moves': 3,
         'looking': 6,
         'forward': 4,
         'seeing': 11,
         'ended': 1,
         'letting': 3,
         'down': 14,
         'joker': 197,
         'sadly': 6,
         'turned': 2,
         'those': 11,
         'movies': 38,
         'know': 22,
         'many': 22,
         'times': 22,
         'before': 18,
         'phoenixs': 14,
         'portrayal': 13,
         'with': 103,
         'mental': 30,
         'health': 9,
         'depression': 2,
         'good': 52,
         'convincing': 2,
         'story': 59,
         'plot': 18,
         'like': 54,
         'deliver': 1,
         'anti': 2,
         'hero': 6,
         'origin': 15,
         'most': 15,
         'coveted': 1,
         'villains': 6,
         'comic': 13,
         'book': 9,
         'lore': 2,
         'liked': 2,
         'quasi': 1,
         'mirroring': 1,
         'failed': 8,
         'system': 3,
         'whose': 2,
         'middle': 3,
         'lower': 2,
         'class': 4,
         'revolt': 1,
         'against': 2,
         'rich': 4,
         'sort': 4,
         'burn': 3,
         'done': 8,
         'sure': 7,
         'people': 49,
         'glimpses': 1,
         'today': 2,
         'culture': 4,
         'knows': 2,
         'maybe': 13,
         'studio': 1,
         'execs': 1,
         'their': 20,
         'fingers': 1,
         'involved': 3,
         'ones': 2,
         'watered': 1,
         'much': 51,
         'there': 47,
         'will': 26,
         'directors': 1,
         'darker': 1,
         'than': 26,
         'theatrical': 1,
         'certainly': 4,
         'hope': 5,
         'because': 48,
         'reviews': 21,
         'have': 62,
         'read': 10,
         'speak': 2,
         'walking': 3,
         'theaters': 1,
         'dark': 30,
         'feel': 17,
         'psychological': 5,
         'overtones': 1,
         'them': 14,
         'stomach': 3,
         'felt': 18,
         'sense': 7,
         'wanting': 1,
         'bigger': 1,
         'grander': 1,
         'what': 62,
         'would': 40,
         'recommend': 4,
         'formulate': 1,
         'your': 11,
         'opinion': 6,
         'gave': 4,
         'rating': 9,
         'over': 19,
         'walked': 1,
         'feeling': 6,
         'just': 97,
         'already': 7,
         'seen': 29,
         "phoenix's": 2,
         'acting..': 2,
         'dont': 27,
         'think': 27,
         'need': 9,
         'super': 4,
         'film': 79,
         'comics': 10,
         'character': 66,
         'dramatized': 1,
         'effort': 7,
         'knight': 11,
         'unfortunately': 6,
         'captivating': 1,
         'inspiration': 2,
         'made': 20,
         'stuff': 5,
         'enough': 14,
         'real': 11,
         'world': 12,
         'everyone': 16,
         'praised': 2,
         'overrated': 16,
         'movie.': 2,
         'time': 31,
         'here': 13,
         'making': 6,
         'better': 31,
         'actually': 13,
         'idiotic': 2,
         'phoenix': 51,
         'master': 4,
         'actor': 11,
         'does': 28,
         'still': 8,
         'make': 21,
         'great': 28,
         'thsi': 1,
         'lives': 1,
         'from': 77,
         'blabla': 1,
         'every': 7,
         'medium': 1,
         'nothing': 32,
         'only': 26,
         'thing': 14,
         'behind': 5,
         'money': 10,
         'media': 1,
         'todd': 9,
         'philips': 2,
         'should': 13,
         'some': 24,
         'copy': 3,
         'taxi': 27,
         'driver': 26,
         'similar': 4,
         'terrible': 10,
         'acting': 45,
         'watch': 29,
         'alone': 3,
         'doesnt': 21,
         'interesting': 19,
         'entertaining': 7,
         'give': 15,
         'script': 10,
         'barely': 3,
         'development': 2,
         'characters': 17,
         'matter': 6,
         'outside': 2,
         'last': 6,
         'minutes': 9,
         'best': 13,
         'part': 16,
         'force': 3,
         'through': 8,
         'first': 17,
         'hours': 8,
         'garbage': 1,
         'punishment': 1,
         'even': 34,
         'they': 45,
         'couldve': 2,
         'condensed': 1,
         'into': 17,
         'minute': 4,
         'special': 7,
         'cant': 10,
         'believe': 9,
         'then': 18,
         'again': 11,
         'written': 7,
         'primarily': 1,
         'oscars': 2,
         'usually': 4,
         'instead': 13,
         'poor': 14,
         'attempt': 3,
         'books': 3,
         'sell': 1,
         'strays': 1,
         'smacks': 1,
         'trying': 8,
         'hard': 6,
         'awards': 3,
         'relevance': 1,
         'names': 3,
         'gotham': 1,
         'tries': 10,
         'nominations': 1,
         'criticism': 2,
         'actors': 6,
         'thought': 12,
         'given': 6,
         'wasnt': 10,
         'dragged': 3,
         'longer': 2,
         'versions': 1,
         'learned': 3,
         'thing.': 2,
         'borrows': 2,
         'elements': 2,
         'strive': 1,
         'award': 5,
         'well': 31,
         'except': 5,
         'writing': 6,
         'shamelessly': 1,
         'theatre': 4,
         'edgy': 2,
         'scary': 1,
         'brain': 3,
         'damaged': 3,
         'sissy': 1,
         'dances': 1,
         'while': 9,
         'annoying': 3,
         'rude': 1,
         'expects': 1,
         'society': 19,
         'pedestal': 1,
         'hell': 6,
         'hate': 2,
         'complete': 4,
         'crap': 4,
         'really': 55,
         'understand': 10,
         'watching': 10,
         'couldnt': 7,
         'till': 3,
         'boring': 47,
         'myself': 7,
         'extremely': 9,
         'zero': 1,
         'connection': 2,
         'joaquin': 42,
         'heath': 15,
         'ledger': 11,
         'needed': 5,
         'asking': 2,
         'these': 12,
         'freaking': 1,
         'normal': 3,
         'same': 16,
         'sentence': 1,
         'joaquins': 3,
         'never': 17,
         'isnt': 7,
         'disaster': 1,
         'slow': 8,
         'could': 11,
         'keep': 2,
         'falling': 4,
         'asleep': 3,
         'theater': 2,
         'imagine': 2,
         'future': 1,
         'films': 13,
         'alright': 2,
         'film...': 2,
         'ruined': 3,
         'masterpiece': 16,
         'raving': 1,
         'predictable': 7,
         'samey': 1,
         'theres': 11,
         'creativity': 1,
         'king': 12,
         'comedy': 12,
         'copying': 1,
         'almost': 8,
         'pointless': 6,
         'waste': 7,
         'disappointing': 5,
         'long': 13,
         'possibly': 2,
         'take': 9,
         'tell': 5,
         'audience': 9,
         'mentally': 13,
         'unwell': 1,
         'surprising': 1,
         'mother': 8,
         'imaginative': 1,
         'white': 3,
         'sock': 1,
         "don't": 12,
         'review': 12,
         'movies,': 2,
         'one...': 2,
         'watched': 3,
         'site': 1,
         'absolutely': 6,
         'little': 13,
         'else': 7,
         'found': 6,
         'longish': 1,
         'fall': 5,
         'mean': 10,
         'entertain': 3,
         'yourself': 1,
         'washing': 1,
         'machine': 1,
         'going': 11,
         'straight': 1,
         'anyone': 4,
         'butt!': 2,
         'claiming': 1,
         'ridiculous': 3,
         'walk': 6,
         'happens': 10,
         'predict': 1,
         'advance': 1,
         'rather': 7,
         'relies': 1,
         'fascinated': 3,
         'antics': 3,
         'psychotic': 3,
         'nutcase': 1,
         'whilst': 1,
         'convince': 1,
         'somehow': 3,
         'heroic': 1,
         'highly': 8,
         'nice': 3,
         'excellent': 5,
         'suffers': 1,
         'three': 4,
         'uninteresting': 3,
         'dialog': 1,
         'pace': 2,
         'lengthy': 1,
         'number': 1,
         'ideas': 5,
         'combined': 2,
         'more': 45,
         'destroy': 1,
         'look': 17,
         'left': 12,
         'beside': 1,
         'genre': 1,
         'supposed': 4,
         'thriller': 3,
         'addition': 1,
         'crime': 3,
         'drama': 2,
         'cannot': 4,
         'exaggerated': 3,
         'high': 9,
         'ratings': 4,
         'want': 23,
         'fair': 1,
         'although': 7,
         'stars': 7,
         'definitely': 4,
         'worth': 6,
         'consequently': 1,
         'skip': 3,
         '10/10': 2,
         'actual': 9,
         'unbiased': 2,
         'review.': 2,
         'titles': 2,
         'says': 6,
         'marvel': 2,
         'hardcore': 1,
         'check': 1,
         'profiles': 1,
         'where': 15,
         'fans': 2,
         'opposite': 1,
         'pure': 3,
         'simple': 3,
         'truth': 1,
         'horrible': 6,
         'worst': 4,
         'pretty': 5,
         'remake': 2,
         'shots': 3,
         'exactly': 1,
         'ripping': 1,
         'aside': 1,
         'illness': 14,
         'psychology': 2,
         'slapped': 2,
         'title': 8,
         'draw': 2,
         'expect': 2,
         'hoping': 3,
         'wrong': 10,
         'agree': 3,
         'portraying': 1,
         'issues': 5,
         'though': 10,
         'call': 1,
         'oscar': 12,
         'worthy': 8,
         'stretch': 1,
         'notice': 3,
         'critics': 5,
         'saying': 11,
         'different': 21,
         'perspective': 3,
         'each': 5,
         'goes': 6,
         'audio': 1,
         'music': 1,
         'certain': 3,
         'aspects': 1,
         'shot': 5,
         'camera': 3,
         'words': 2,
         'enjoy': 2,
         'critic': 3,
         'cinema': 7,
         'aspect': 3,
         'viewers': 4,
         'disappointed': 12,
         'unlike': 1,
         'fascination': 1,
         'version': 11,
         'term': 2,
         'lightly': 2,
         'indeed': 4,
         'fact': 8,
         'gone': 4,
         'kids': 3,
         'knowing': 1,
         'rated': 2,
         'graphic': 3,
         'also': 20,
         'promotes': 1,
         'violence': 13,
         'guns': 2,
         'uncomfortable': 4,
         'country': 1,
         'rent': 2,
         'lastly': 1,
         'enjoyed': 2,
         'picture': 1,
         'past': 3,
         'course': 4,
         'lets': 3,
         '2001': 1,
         'kings': 3,
         'speech': 2,
         'bought': 1,
         'likely': 2,
         'probably': 7,
         'forgot': 2,
         'soon': 1,
         'after': 15,
         'list': 1,
         'didnt': 17,
         'included': 2,
         'inception': 2,
         'true': 9,
         'grit': 1,
         'once': 5,
         'raved': 1,
         'case': 3,
         'forget': 1,
         'week': 1,
         'labeled': 1,
         'labeling': 1,
         'attention': 3,
         'cheap': 3,
         'tactic': 2,
         'overhyped': 10,
         'slowwwwww': 1,
         'gladly': 1,
         'half': 13,
         'until': 5,
         'usual': 6,
         'must': 6,
         'gore': 1,
         'disney': 1,
         'hear': 2,
         'thumbs': 2,
         'question': 6,
         'below': 1,
         'reviewing': 1,
         'performance': 37,
         'storyline': 12,
         'played': 2,
         'literally': 2,
         'hats': 1,
         'discrediting': 1,
         'whatsoever': 1,
         'reason': 10,
         'drawn': 3,
         'winded': 2,
         'kept': 3,
         'agreeing': 1,
         'jumping': 1,
         'band': 1,
         'wagon': 1,
         'easily': 4,
         'create': 1,
         'within': 2,
         'hour': 7,
         'push': 1,
         'ything': 1,
         'villian': 1,
         'based': 7,
         'superhero': 6,
         'aware': 3,
         'however': 11,
         'halloween': 1,
         'meets': 1,
         'physcotic': 1,
         'escapee': 1,
         'decides': 2,
         'kill': 8,
         'sounds': 1,
         'michael': 3,
         'myers': 2,
         'proud': 1,
         'brilliant': 9,
         'love': 15,
         'pheonixs': 1,
         'ought': 1,
         'please': 2,
         'process': 2,
         'receive': 1,
         'sheep': 2,
         'write': 2,
         'compelled': 1,
         'thoughts': 3,
         'head': 2,
         'apparently': 2,
         'quite': 6,
         'peoples': 1,
         'heads': 1,
         'comes': 1,
         'perception': 2,
         'order': 3,
         'mine': 1,
         'anybody': 1,
         'elses': 1,
         'critique': 1,
         'following': 1,
         'dissapointing': 4,
         'boring!!!': 2,
         'wonderful': 2,
         'role': 12,
         'orgin': 2,
         'buffalo': 2,
         'bill': 2,
         'silence': 2,
         'lambs': 2,
         'depressing': 8,
         'limp': 2,
         'wristed': 2,
         'whith': 1,
         'feminine': 2,
         'dancing': 7,
         'masculinity': 1,
         'remember': 1,
         'dark,': 6,
         'depressing,': 2,
         'slow,': 2,
         'heavy,': 2,
         'kudos': 1,
         'tough': 1,
         'backstory': 1,
         'sorry': 6,
         'genres': 2,
         'simply': 8,
         'stay': 2,
         'heavy': 4,
         'spoon': 2,
         'point': 14,
         'depressed': 5,
         'ready': 1,
         'react': 1,
         'keith': 2,
         'comments': 1,
         'perhaps': 5,
         'paid': 1,
         'ledgers': 11,
         'inventive': 1,
         'charismatic': 2,
         'maniacal': 2,
         'creepy': 1,
         'batman': 26,
         'ecosystem': 1,
         'fills': 1,
         'relationship': 3,
         'cathartic': 1,
         'moment': 11,
         'catalyze': 1,
         'reaction': 3,
         'paced': 3,
         'told': 6,
         'choice': 2,
         'evening': 1,
         'gambling': 2,
         'addicted': 2,
         'director': 7,
         'scorsese': 6,
         'overlong': 1,
         'dull': 3,
         'feed': 1,
         'network': 3,
         'basic': 1,
         'carbon': 1,
         'plots': 1,
         'lifted': 1,
         'find': 6,
         'become': 7,
         'psyco': 1,
         'coudnt': 1,
         'entertainment': 9,
         'cinematic': 2,
         'experience': 2,
         'fantastic': 3,
         'ways': 4,
         'awful': 3,
         'blank': 2,
         'slate': 1,
         'study': 6,
         'crazy': 10,
         'over-hyped,': 2,
         'overacted': 3,
         'proper': 5,
         'millennial': 2,
         'absolute': 5,
         'disappointment': 2,
         'believed': 1,
         'fool': 1,
         'person': 14,
         'stupid': 3,
         'cringe': 4,
         'happening': 1,
         'smoking': 2,
         'around': 10,
         'action': 2,
         'substance': 3,
         'humor': 2,
         'everything': 9,
         'disturbing': 2,
         'respected': 1,
         'refer': 1,
         'powerful': 2,
         'illustration': 1,
         'loners': 1,
         'dangerous': 1,
         'themselves': 4,
         'others': 1,
         'theyre': 4,
         'untreated': 1,
         'educated': 2,
         'standpoint': 1,
         'millions': 1,
         'goers': 1,
         'cause': 2,
         'worry': 1,
         'impact': 3,
         'kind': 4,
         'societys': 1,
         'problems': 2,
         'goodness': 1,
         'driven': 3,
         'further': 3,
         'fearful': 1,
         'repercussions': 1,
         'stigmatisation': 1,
         'prejudice': 1,
         'bullying': 1,
         'right': 2,
         'seem': 9,
         'care': 3,
         'such': 12,
         'content': 2,
         'less': 5,
         'cinematography': 7,
         'otherwise': 5,
         'rehash': 2,
         'thats': 16,
         'exploitation': 1,
         'misrepresentation': 1,
         'pathologies': 1,
         'unforgiveable': 1,
         'fanboys': 2,
         'forgotten?': 2,
         'throughout': 3,
         'history': 3,
         'always': 10,
         'replaced': 1,
         'nature': 4,
         'paganism': 1,
         'translated': 1,
         'devil': 2,
         'roman': 1,
         'catholicism': 1,
         'bring': 3,
         'social': 3,
         'coherence': 1,
         'figure': 1,
         'represent': 3,
         'meticulous': 2,
         'forgotten': 3,
         'hurts': 1,
         'favorite': 2,
         'broke': 1,
         'golden': 1,
         'rule': 1,
         'laid': 1,
         'robert': 4,
         'downey': 1,
         'tropic': 1,
         'thunder': 1,
         'full': 5,
         'planning': 2,
         'cunning': 2,
         'depth': 6,
         'chaotic': 1,
         'narcissism': 2,
         'excellently': 2,
         'depicted': 1,
         'eternal': 1,
         'opening': 1,
         'scene': 8,
         'waiting': 6,
         'keyser': 1,
         'souse': 1,
         'control': 5,
         'display': 2,
         'black': 1,
         'mirror': 2,
         'pulling': 1,
         'strings': 1,
         'along': 3,
         'came': 3,
         'sorrowful': 1,
         'victim': 2,
         'threw': 2,
         'tantrum': 1,
         'lost': 5,
         'empowered': 1,
         'taking': 3,
         'becoming': 4,
         'anarchistic': 1,
         'commentator': 1,
         'forest': 1,
         'gump': 1,
         'rain': 1,
         'robot': 1,
         'depictions': 1,
         'suffering': 1,
         'writers': 1,
         'remembered': 3,
         'level': 5,
         'ingenuity': 1,
         'leaves': 3,
         'understanding': 2,
         'cognitive': 1,
         'approach': 1,
         'phillips': 7,
         'displayed': 2,
         'cruel': 1,
         'fist': 1,
         'banished': 1,
         'vulgar': 1,
         'insult': 1,
         'narrative': 3,
         'intriguing': 3,
         'dualistic': 1,
         'decades': 3,
         'meet': 1,
         'universe': 8,
         'sequel': 1,
         'jokers': 7,
         'lord': 1,
         'life': 9,
         'grudge': 1,
         'match': 1,
         'between': 6,
         'christian': 1,
         'bales': 1,
         'machinist': 1,
         'malnutritioned': 1,
         'clown': 14,
         'prince': 1,
         'threatening': 2,
         'forever': 1,
         'joaquim': 1,
         'mark': 1,
         'sorely': 1,
         'rewatch': 2,
         'something': 5,
         'extended': 1,
         'trailer': 6,
         'exposed': 1,
         'revelations': 1,
         'challenged': 6,
         'presented': 1,
         'basically': 7,
         'superlatives': 1,
         'explanations': 1,
         'adorning': 1,
         'without': 16,
         'incredible': 2,
         'shadowed': 1,
         'truly': 2,
         'went': 3,
         'night': 4,
         'positive': 2,
         'honestly': 4,
         'totally': 9,
         'bored': 7,
         'thinking': 2,
         'start': 3,
         'gruesome': 1,
         'makes': 13,
         'leave': 3,
         'short': 5,
         'leaving': 1,
         'realy': 3,
         'whit': 1,
         'happy': 4,
         'grave': 2,
         'bad...': 2,
         'whole': 8,
         'apperently': 1,
         'completely': 5,
         'acted': 6,
         'trash': 3,
         'weak': 2,
         'face': 7,
         'paint': 1,
         'drug': 1,
         'addict': 1,
         'loser': 3,
         'blames': 1,
         'everybody': 2,
         'failings': 1,
         'mediocre': 3,
         'offensive': 2,
         'ultra': 2,
         'liberal': 2,
         'preaching': 1,
         'millennials': 2,
         'reinforces': 1,
         'school': 1,
         'college': 1,
         'teachings': 1,
         'fault': 1,
         'parents': 1,
         'boss': 2,
         'government': 1,
         'neighbors': 1,
         'cops': 1,
         'imdb': 2,
         'superior': 2,
         'godfather': 1,
         'generation': 5,
         'pathetic': 3,
         'hopes': 4,
         'werent': 1,
         'amazing': 2,
         'tedious': 3,
         'experienced': 1,
         'childhood': 3,
         'trauma': 2,
         'spend': 1,
         'asylum': 1,
         'seven': 1,
         'medication': 1,
         'effect': 4,
         'metro': 1,
         'incident': 1,
         'breaking': 4,
         'chain': 1,
         'free': 2,
         'himself': 5,
         'change': 2,
         'evolve': 1,
         'beginning': 4,
         'seventy': 1,
         'percent': 1,
         'screen': 4,
         'dedicated': 1,
         'arthur': 13,
         'fleck': 9,
         'support': 1,
         'lack': 4,
         'soul': 2,
         'deniero': 1,
         'disappoints': 1,
         'aura': 2,
         'somewhere': 3,
         'nineties': 1,
         'wait': 4,
         'anything': 8,
         'espaically': 1,
         'repeated': 2,
         'space': 1,
         'alot': 1,
         'nothings': 1,
         'drag': 1,
         'suspense': 1,
         'work': 7,
         'begin': 2,
         'turns': 2,
         'unbelievable': 1,
         'smart': 4,
         'using': 2,
         'intuition': 1,
         'batmans': 2,
         'greatest': 1,
         'embarrassing': 1,
         'stand': 2,
         'unrelated': 2,
         'series': 3,
         'appreciated': 1,
         'main': 7,
         'decent': 8,
         'strictly': 1,
         'come': 5,
         'childcare': 1,
         'arrangements': 1,
         'wish': 1,
         'home': 2,
         'repeating': 1,
         'subject': 2,
         'missing': 3,
         'deserve': 3,
         'pursuing': 1,
         'career': 1,
         'talent': 1,
         'beaten': 1,
         'ridiculed': 1,
         'standard': 1,
         'rated.': 2,
         'makeup': 6,
         'reviewers': 3,
         'guess': 2,
         'disturbed': 7,
         'guys': 1,
         ...})
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]: