-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathn_visualizing_terms.py
164 lines (137 loc) · 36.8 KB
/
n_visualizing_terms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Import core libraries
import pandas as pd
import re # Obtain expressions
from gensim.models import Word2Vec #Import gensim Word2Fec
from sklearn.decomposition import PCA #Grab PCA functions
import numpy as np
#Plot helpers
import matplotlib
import matplotlib.pyplot as plt
#Enable matplotlib to be interactive (zoom etc)
import ast
df = pd.read_csv(r'E:\Projects\Emotion_detection_gihan\finbert_experiments\data_processed\term_emb_label\all_emo.csv')
df = pd.read_csv(r'E:\Projects\Emotion_detection_gihan\finbert_experiments\data_processed\through_bert.csv')
df.columns = ['index','word','label','embedding']
print(df.head())
print(df.columns)
df = df.dropna()
# labels = [s for s in df['label']]
# embs = [ast.literal_eval(s) for s in df['embedding']]
labels = []
embs = []
words = []
for i,row in df.iterrows():
if(row['label']=='trust'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'joy'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'sad'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'disgust'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'anger'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'anticipation'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'fear'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
if (row['label'] == 'surprise'):
labels.append(row['label'])
embs.append(ast.literal_eval(row['embedding']))
words.append(row['word'])
# labels
# embs
# words
def visualize_embs(labels,embs,words):
label_color_dict = {'input':'black','anticipation':'green','anger':'red','disgust':'red','fear':'red','sad':'red','joy':'green','surprise':'green','trust':'green'}
X = embs
pca = PCA(n_components=2)
result = pca.fit_transform(X)
# print(type(result))
# print(result)
print(len(result))
print(len(words))
print(len(labels))
print(len(embs))
# filtered_words = []
# filtered_emb = []
# filtered_label = []
# for i,j in enumerate(result):
# if(j[1] < -0.05 and labels[i] in ['joy','anticipation','trust','surprise']):
# filtered_emb.append(j)
# filtered_label.append(labels[i])
#
# filtered_words.append(words[i])
#
# if (j[1] > 0.05 and labels[i] in ['sad','disgust','anger','fear']):
# filtered_emb.append(j)
# filtered_label.append(labels[i])
# filtered_words.append(words[i])
# result = np.array([x for x in filtered_emb])
# labels = filtered_label
cvec = [label_color_dict[label] for label in labels]
# print('filtered words')
# print(filtered_words)
# print('filtered labels')
# print(filtered_label)
# fig, ax = plt.subplots()
# ax.plot(result[:, 0], result[:, 1], 'o')
# ax.set_title('Tweets')
# plt.show()
# Create the scatter plot
plt.figure(figsize=(8,8))
plt.scatter(result[:,0], result[:,1],c=cvec, edgecolor='', alpha=0.5)
# selected_names = ['sad','joy']
# names = ['sad','joy','surprise','trust','anticipation','anger','disgust','fear']
# # Add the labels
# for name in selected_names:
#
# # Get the index of the name
# i = names.index(name)
#
# # Add the text label
# labelpad = 0.01 # Adjust this based on your dataset
# plt.text(result[i,0]+labelpad, result[i,1]+labelpad, name, fontsize=9)
#
# # Mark the labeled observations with a star marker
# plt.scatter(result[i,0], result[i,1],
# c=cvec[i], vmin=min(cvec), vmax=max(cvec),
# edgecolor='', marker='*', s=100)
# Add the axis labels
plt.xlabel('PC 1 (%.2f%%)' % (pca.explained_variance_ratio_[0]*100))
plt.ylabel('PC 2 (%.2f%%)' % (pca.explained_variance_ratio_[1]*100))
plt.title('all positive vs all negative')
# Done
plt.show()
# sad_joy = ['amazingly', 'trophies', 'commemorates', 'refurbished', 'terrific', 'amazed', 'gatherings', 'serene', 'adorned', 'optimism', 'comedians', 'flawless', 'adored', 'upbeat', 'picturesque', 'illustrious', 'sublime', 'caressed', 'accolades', 'mastery', 'thanking', 'enthusiastically', 'musically', 'heroic', 'encouraging', 'celebration', 'triumphant', 'solemnly', 'celebrating', 'befriended', 'energetic', 'accomplishments', 'intrigued', 'elegance', 'tenderly', 'delighted', 'exquisite', 'chuckle', 'thankful', 'textures', 'celebrations', 'inspirational', 'calmed', 'cheerful', 'eager', 'gorgeous', 'spacious', 'mischievous', 'exemplary', 'giggle', 'stimulate', 'gleam', 'yearning', 'incredible', 'commemoration', 'commemorated', 'delicious', 'hopeful', 'wonderful', 'orchestral', 'shimmering', 'spirituality', 'fascinating', 'relaxed', 'blessings', 'majestic', 'praising', 'expansive', 'admiration', 'delicately', 'sparkled', 'amazement', 'confidently', 'beaming', 'reassured', 'gracefully', 'compassionate', 'seductive', 'chuckles', 'miraculous', 'complimented', 'stillness', 'philanthropic', 'lured', 'lullaby', 'delight', 'cheerfully', 'treasures', 'mentoring', 'heavenly', 'fascinated', 'reassuring', 'tenderness', 'pious', 'magnificent', 'intimately', 'caress', 'commemorating', 'encourages', 'commemorate', 'inspire', 'soothing', 'marvelous', 'showcased', 'heroism', 'imaginative', 'memorable', 'commemorative', 'friendships', 'decorate', 'relaxing', 'celebrate', 'chants', 'intimacy', 'vocalists', 'entertainer', 'artisans', 'proficiency', 'facilitates', 'enthusiastic', 'inspiring', 'splendid', 'prowess', 'thrilled', 'humorous', 'harmonies', 'playful', 'philanthropy', 'intriguing', 'honoring', 'optimistic', 'educators', 'amusing', 'effortlessly', 'praises', 'luxurious', 'celebrates', 'peacefully', 'glittering', 'lauded', 'festivities', 'comforting', 'pleased', 'encouraged', 'stimulated', 'graceful', 'astonishment', 'enthusiast', 'sparkle', 'beautifully', 'amused', 'creamy', 'hilarious', 'palaces', 'peaceful', 'elegant', 'excitedly', 'adorable', 'encourage', 'relaxation', 'aristocratic', 'sweetly', 'glistening', 'playfully', 'delightful', 'embracing', 'subtly', 'passionate', 'giggled', 'calming', 'fabulous', 'lovely', 'ornate', 'thrilling', 'enjoyable', 'giggles', 'eagerly', 'excelled', 'glorious', 'victorious', 'revered', 'celestial', 'smirk', 'astonished', 'giggling', 'warmly', 'accomplishment', 'glided', 'empathy', 'antics', 'witty', 'jubilee', 'beam', 'excellent', 'medal', 'meritorious', 'goodness', 'gift', 'kiss', 'inspired', 'refreshing', 'orchestra', 'kidding', 'loyal', 'sweetheart', 'graduation', 'masterpiece', 'warm', 'happy', 'privileged', 'romance', 'comfortable', 'peace', 'unbeaten', 'clap', 'bouquet', 'sunshine', 'laugh', 'friendship', 'positively', 'bounty', 'harmony', 'embrace', 'generosity', 'trophy', 'perfect', 'inspiration', 'devoted', 'calm', 'amazing', 'meditation', 'procession', 'fantastic', 'thanksgiving', 'fun', 'generous', 'appreciation', 'fancy', 'shining', 'princely', 'evergreen', 'liking', 'gratitude', 'praise', 'comfort', 'awesome', 'excel', 'entertainment', 'musical', 'hymn', 'glory', 'heavens', 'authentic', 'satisfied', 'accompaniment', 'beauty', 'entertaining', 'marrow', 'cheer', 'ceremony', 'bliss', 'honest', 'lucky', 'hug', 'joy', 'sunny', 'entertained', 'sensual', 'impressed', 'salute', 'elevation', 'communion', 'enlightenment', 'marry', 'love', 'excellence', 'ecstasy', 'achievement', 'enchanted', 'laughing', 'excited', 'reward', 'excitement', 'dance', 'compliment', 'glad', 'nice', 'intimate', 'twinkle', 'affection', 'loved', 'immaculate', 'alright', 'picnic', 'oasis', 'scholarship', 'praised', 'applause', 'grateful', 'loving', 'happiness', 'flirt', 'lyrical', 'precious', 'leisure', 'curious', 'friendly', 'thrill', 'heroes', 'blessed', 'hoping', 'sing', 'cool', 'glitter', 'illumination', 'laughter', 'enjoying', 'glow', 'relieved', 'symphony', 'cheering', 'enjoy', 'miracle', 'celebrated', 'pleasant', 'esteem', 'festival', 'pray', 'celebrity', 'treasure', 'chant', 'magical', 'radiant', 'proud', 'smile', 'intuitive', 'lover', 'smiling', 'wow', 'humanity', 'brilliant', 'enthusiasm', 'freely', 'caring', 'superstar', 'ordination', 'emancipation', 'spirits', 'bride', 'interested', 'buddy', 'glide', 'engaging', 'pride', 'clever', 'charitable', 'sweet', 'inauguration', 'merry', 'worship', 'beautiful', 'attracted', 'fortunate', 'blessing', 'coronation', 'choir', 'entertain', 'happily', 'bless', 'choral', 'holiness', 'blossom', 'passion', 'relax', 'perfection', 'mighty', 'complement', 'award', 'exciting', 'confident', 'bloom', 'priesthood', 'romantic', 'inability', 'dismissing', 'died', 'disagreements', 'restricting', 'poorer', 'horribly', 'collapses', 'hurts', 'indifference', 'harmful', 'exploding', 'suicidal', 'eliminating', 'paranoia', 'faltered', 'attacking', 'problematic', 'terrible', 'denounced', 'mistakenly', 'alarmed', 'ousted', 'persecuted', 'shitty', 'fatally', 'thwarted', 'meaningless', 'dying', 'injuring', 'miserable', 'sickness', 'devastation', 'betray', 'difficulties', 'catastrophe', 'declines', 'ambiguity', 'filippo', 'dismay', 'horrible', 'hurting', 'collapsing', 'fails', 'dreadful', 'limitation', 'disrupted', 'assaults', 'onslaught', 'despair', 'distraught', 'fatalities', 'constrained', 'despised', 'stabbing', 'overcoming', 'vanishing', 'disdain', 'discourage', 'rejects', 'frightened', 'insurrection', 'deteriorated', 'blindly', 'harassed', 'restrict', 'demoted', 'resisting', 'slaughtered', 'frustrated', 'insignificant', 'outdated', 'opposes', 'detachments', 'disappears', 'resentment', 'confinement', 'flees', 'deaths', 'illnesses', 'unsuitable', 'fragmented', 'decreases', 'confusing', 'defective', 'disagreement', 'hostility', 'whimpered', 'contradictory', 'death', 'undermine', 'murderers', 'ruining', 'unsuccessful', 'disliked', 'impoverished', 'breakup', 'refuses', 'poisonous', 'refusing', 'oppressive', 'radically', 'misunderstanding', 'destroying', 'collapse', 'denies', 'crumpled', 'unacceptable', 'unbearable', 'horrific', 'disturbances', 'incorrectly', 'awful', 'deterioration', 'knotted', 'insults', 'disused', 'crazed', 'condemn', 'perpetrators', 'violently', 'rebelled', 'removes', 'criticisms', 'unhappy', 'powerless', 'demise', 'slain', 'slump', 'lifeless', 'incompatible', 'outraged', 'fearful', 'failures', 'worthless', 'mortality', 'bruised', 'abandoning', 'hardship', 'murdering', 'weaken', 'reworked', 'unfit', 'pointless', 'loses', 'turmoil', 'penultimate', 'unpleasant', 'hesitant', 'embarrassing', 'crashes', 'faulty', 'deposed', 'anguish', 'fractured', 'dissatisfaction', 'eroded', 'toppled', 'detrimental', 'wrongly', 'dies', 'dilapidated', 'oppression', 'ravaged', 'contentious', 'disadvantaged', 'abandonment', 'misleading', 'shredded', 'forbade', 'crumbling', 'destroy', 'condemning', 'falling', 'incarcerated', 'abnormalities', 'rejected', 'deteriorating', 'prohibiting', 'panicked', 'crippled', 'frustrating', 'destroys', 'yanking', 'murderous', 'instability', 'resigning', 'criticizing', 'wrenched', 'betrayal', 'damaging', 'distressed', 'reject', 'discouraged', 'unfortunate', 'misunderstood', 'inaccurate', 'worsened', 'devastating', 'baffled', 'dissatisfied', 'erroneously', 'futile', 'distorted', 'pressured', 'humiliated', 'catastrophic', 'rebellious', 'ineffective', 'jailed', 'deceased', 'crises', 'markedly', 'refusal', 'tormented', 'rejecting', 'painful', 'disastrous', 'outlawed', 'illness', 'perished', 'hospitalized', 'harshly', 'harmed', 'ignores', 'disappointing', 'humiliating', 'hampered', 'injured', 'doomed', 'shortage', 'sore', 'nasty', 'terminate', 'scar', 'surrender', 'disabled', 'abuse', 'bleeding', 'fell', 'deprivation', 'difficulty', 'hard', 'desperate', 'leave', 'intervention', 'disturbed', 'invalid', 'die', 'worse', 'failed', 'negative', 'conflict', 'fault', 'suffering', 'dark', 'mistake', 'grounded', 'denied', 'losing', 'unemployed', 'criticism', 'ruined', 'disease', 'deadly', 'shot', 'discrimination', 'unfortunately', 'wound', 'sensitive', 'isolation', 'disappointed', 'worry', 'lose', 'stab', 'badly', 'tough', 'forgotten', 'violation', 'forbid', 'hollow', 'broke', 'restriction', 'absence', 'confused', 'dull', 'wasting', 'prisoner', 'difficult', 'exhausted', 'concerned', 'unfair', 'crash', 'runaway', 'poison', 'vulnerability', 'trash', 'rob', 'elimination', 'broken', 'unrest', 'damages', 'flaw', 'struggle', 'failing', 'depressed', 'crushed', 'flop', 'destroyed', 'misery', 'grief', 'sick', 'homeless', 'isolated', 'cry', 'disaster', 'upset', 'loss', 'suicide', 'dead', 'unable', 'grave', 'poverty', 'delay', 'damage', 'absent', 'regret', 'downfall', 'tragedy', 'buried', 'abandoned', 'insult', 'adverse', 'debt', 'isolate', 'speculation', 'interrupted', 'suppress', 'rejection', 'shattered', 'captive', 'refused', 'mad', 'depression', 'lie', 'handicap', 'prison', 'evil', 'missing', 'contaminated', 'lost', 'ill', 'traumatic', 'ruin', 'disappointment', 'fall', 'obstacle', 'hurt', 'exhaustion', 'confined', 'limited', 'disability', 'abandon', 'sabotage', 'departure', 'terminal', 'injury', 'wreck', 'neglected', 'doubt', 'deserted', 'distress', 'victim', 'vulnerable', 'disconnected', 'bad', 'failure', 'guilty', 'accident', 'shrink', 'inadequate', 'fatal', 'tremor', 'fragile', 'disturbance']
# anger_anticipation = ['dismissing', 'objected', 'punishments', 'abnormalities', 'awful', 'frustrating', 'poisonous', 'irritating', 'scares', 'hating', 'insulting', 'resented', 'furious', 'appalled', 'destroying', 'horrible', 'likened', 'exasperated', 'annoying', 'sabotage', 'curses', 'oppression', 'sting', 'deprived', 'attackers', 'cursed', 'fraudulent', 'denounced', 'fucked', 'cancers', 'resentment', 'accusations', 'cursing', 'weaken', 'brutality', 'wasted', 'prick', 'condemn', 'blame', 'stinging', 'betrayal', 'harmful', 'growling', 'dreadful', 'dictatorship', 'grotesque', 'humiliating', 'prisoner', 'hideous', 'accuse', 'beheaded', 'insults', 'yells', 'unlawful', 'furiously', 'hostile', 'threat', 'yanking', 'stung', 'supermarkets', 'hysterical', 'insane', 'toxin', 'harshly', 'perpetrators', 'angry', 'annoyed', 'ripping', 'moans', 'invasions', 'frightening', 'inappropriate', 'attacks', 'horrific', 'brutally', 'irritated', 'murderous', 'rampage', 'revoked', 'scowled', 'alleging', 'criticizing', 'insanity', 'destructive', 'atrocities', 'ridiculous', 'assaulted', 'threaten', 'sucked', 'disgusted', 'outraged', 'bastards', 'suck', 'intimidating', 'ngos', 'criticisms', 'menacing', 'unpleasant', 'deprivation', 'malaria', 'shortages', 'forbade', 'writhing', 'prosecuted', 'parasitic', 'threatening', 'irrational', 'pained', 'screwing', 'deposed', 'sneaking', 'poverty', 'hostility', 'protesting', 'attacking', 'idiots', 'hates', 'offended', 'yanked', 'hissing', 'coldly', 'tainted', 'lesions', 'accused', 'victim', 'accusation', 'decreases', 'dislike', 'smashed', 'psychologists', 'stigma', 'attacked', 'ruthless', 'angrily', 'blaming', 'disagreements', 'complained', 'stupid', 'threatens', 'hostage', 'explode', 'disgusting', 'poisoned', 'dilapidated', 'authoritarian', 'condemning', 'terrible', 'wrenched', 'bitterness', 'threatened', 'shredded', 'vicious', 'intimidated', 'asshole', 'complaints', 'enraged', 'provoked', 'ignores', 'irritation', 'unacceptable', 'malicious', 'incarcerated', 'inequality', 'bitch', 'detrimental', 'horribly', 'threats', 'madman', 'unbearable', 'alcoholism', 'huffed', 'unreasonable', 'stabbed', 'distrust', 'punished', 'despised', 'outlawed', 'offenses', 'disastrous', 'terrifying', 'insulted', 'destroy', 'slapping', 'prohibits', 'clashes', 'brawl', 'blamed', 'erroneously', 'humiliated', 'undermine', 'mercenaries', 'damaging', 'murdering', 'grimaced', 'destroys', 'jerked', 'annoyance', 'stupidity', 'tyrant', 'sucks', 'worsened', 'homeless', 'whimpered', 'angered', 'psychotic', 'shitty', 'banging', 'sobbed', 'diseases', 'enforcing', 'explodes', 'prohibiting', 'illnesses', 'disliked', 'unsuitable', 'wrecked', 'screwed', 'bothering', 'inmate', 'implicated', 'oppressive', 'growls', 'rebelled', 'poison', 'harmed', 'complain', 'ambushed', 'accusing', 'criticized', 'abusive', 'stabbing', 'detainees', 'outrageous', 'violently', 'powerless', 'messed', 'persecuted', 'lunatic', 'sucking', 'deportation', 'ruining', 'criticised', 'jerking', 'complaining', 'discrimination', 'sarcastic', 'pissed', 'sarcasm', 'ruined', 'paranoid', 'disease', 'destroyed', 'feud', 'distracting', 'arrogant', 'spite', 'rude', 'holocaust', 'bully', 'hate', 'screaming', 'evil', 'criminal', 'punishment', 'pretending', 'adverse', 'wrongly', 'curse', 'insult', 'jerk', 'scream', 'jealous', 'violent', 'killing', 'torture', 'bloody', 'steal', 'raging', 'misunderstanding', 'deny', 'abuse', 'frustration', 'damn', 'aggression', 'fraud', 'offense', 'dispute', 'disagree', 'tolerate', 'bitter', 'complaint', 'confront', 'anger', 'deadly', 'brutal', 'fatal', 'suspicious', 'betray', 'violation', 'whip', 'offensive', 'unfair', 'worse', 'lying', 'worst', 'shortage', 'injustice', 'boiling', 'shit', 'stolen', 'witch', 'selfish', 'nasty', 'skepticism', 'speculated', 'expect', 'upbeat', 'delightful', 'magical', 'attaining', 'championed', 'enjoyable', 'endeavor', 'celebrations', 'predicted', 'exciting', 'cadiz', 'invited', 'eager', 'gatherings', 'reforming', 'celebrate', 'acknowledges', 'intent', 'enthusiast', 'showcasing', 'illustrious', 'anticipated', 'mystical', 'undertake', 'celebrates', 'seek', 'reconstructed', 'northwards', 'ambition', 'mentoring', 'showcases', 'highlighting', 'eagerly', 'delighted', 'provocative', 'showcased', 'dazzling', 'willing', 'beautifully', 'radically', 'amazement', 'endeavors', 'spearheaded', 'yearning', 'futuristic', 'utilize', 'prediction', 'expansive', 'invites', 'progressing', 'experimentation', 'initiating', 'daring', 'festivities', 'encouraging', 'artisans', 'ambitions', 'influencing', 'expectation', 'energetic', 'markedly', 'expecting', 'willingness', 'celebrating', 'confident', 'revered', 'inspire', 'ambitious', 'upgrading', 'innovative', 'emphasizing', 'pious', 'facilitating', 'thrilling', 'imaginative', 'predicting', 'apprehension', 'stimulate', 'sited', 'memorable', 'assessing', 'stimulated', 'cheerful', 'expectations', 'hesitantly', 'hopefully', 'anxious', 'enthusiastically', 'accomplishment', 'profoundly', 'warmly', 'routinely', 'formulated', 'constructing', 'luxurious', 'reassured', 'marvelous', 'expects', 'admiration', 'explorers', 'facilitated', 'expected', 'triggering', 'picturesque', 'seeks', 'subtly', 'securely', 'adventurous', 'requesting', 'successes', 'intending', 'achievements', 'optimistic', 'thrilled', 'astonishment', 'revolutionaries', 'brilliance', 'inspiring', 'lauded', 'aspirations', 'hurrying', 'noteworthy', 'intends', 'succeed', 'exemplary', 'anxiously', 'enthusiastic', 'intrigued', 'refurbished', 'splendid', 'contemplating', 'invite', 'recreated', 'integrating', 'accelerating', 'inviting', 'facilitates', 'shimmering', 'remodeled', 'anticipating', 'desires', 'curving', 'prosperous', 'astonished', 'astonishing', 'journeys', 'bewildered', 'glistening', 'theoretically', 'excited', 'pulsing', 'predict', 'lured', 'urging', 'invitation', 'excitedly', 'secluded', 'informally', 'courageous', 'accomplishments', 'empowered', 'engages', 'spectacular', 'cautious', 'proposing', 'acknowledging', 'visionary', 'optimism', 'success', 'relocating', 'inspirational', 'utilizes', 'adorned', 'welcoming', 'confidently', 'amazingly', 'extravagant', 'refurbishment', 'analyzing', 'excitement', 'celebration', 'await', 'intriguing', 'researches', 'evaluating', 'adventurer', 'modernized', 'advising', 'hesitant', 'advocating', 'utilizing', 'invitations', 'enthusiasm', 'predictions', 'envisioned', 'spacious', 'succeeds', 'hopeful', 'leisure', 'forming', 'planning', 'peaceful', 'bold', 'recreation', 'voyage', 'adventure', 'faith', 'youth', 'perfection', 'determined', 'forecast', 'experiment', 'inspiration', 'church', 'anticipation', 'rehabilitation', 'successful', 'recreational', 'vision', 'inspired', 'reconstruction', 'expedition', 'entertainment', 'luck', 'entertaining', 'appeal', 'engaged', 'hope', 'perfect', 'blessing', 'vacation', 'magnificent', 'god', 'achievement', 'brave', 'glow', 'curiosity', 'alive', 'explore', 'healing', 'spirits', 'keen', 'celebrated', 'embrace']
# joy_disgust = ['oppression', 'confronting', 'collapses', 'paranoia', 'ill', 'harassed', 'crumbling', 'contentious', 'unsuitable', 'garbage', 'hamid', 'tyrant', 'destroys', 'moaning', 'catastrophe', 'insults', 'impoverished', 'collapsing', 'insurrection', 'deterioration', 'humiliating', 'harmful', 'indifference', 'menacing', 'murderous', 'munchen', 'rebellious', 'spoil', 'violently', 'deteriorated', 'despair', 'hissing', 'jerking', 'thwarted', 'disturbances', 'crap', 'corpses', 'persecuted', 'declines', 'deteriorating', 'crazed', 'dreadful', 'defective', 'assaults', 'opaque', 'irrational', 'gut', 'perpetrators', 'unbearable', 'controversies', 'unreasonable', 'abuses', 'stigma', 'tormented', 'vomit', 'condemnation', 'groaning', 'dorchester', 'vulgar', 'detrimental', 'disdain', 'repression', 'denounced', 'shitty', 'carnage', 'harshly', 'crippled', 'hog', 'cynical', 'brutally', 'shredded', 'horrors', 'outraged', 'catastrophic', 'dilapidated', 'obscene', 'grimace', 'southend', 'terrifying', 'rejecting', 'sour', 'fabio', 'ignorant', 'contaminated', 'rouen', 'spit', 'humiliated', 'horribly', 'shit', 'angered', 'disliked', 'hostility', 'poorer', 'ferocious', 'horrific', 'resigning', 'faulty', 'gall', 'grotesque', 'ravaged', 'condemning', 'pig', 'poisonous', 'psychotic', 'raging', 'weaken', 'nasty', 'provocative', 'gothenburg', 'failures', 'vicious', 'ousted', 'brutality', 'trash', 'horrible', 'worsened', 'rodents', 'distorted', 'stain', 'monstrous', 'ruthless', 'fearful', 'filthy', 'fat', 'despised', 'tortured', 'bulky', 'fulham', 'hideous', 'stink', 'rubbish', 'abandoning', 'rejection', 'distrust', 'awful', 'crises', 'condemn', 'soil', 'hardened', 'hate', 'destructive', 'failure', 'toxic', 'lunatic', 'poison', 'devil', 'mad', 'rebellion', 'messy', 'abuse', 'elimination', 'bloody', 'flop', 'suffering', 'disaster', 'ugly', 'hostile', 'defiance', 'taboo', 'interior', 'torture', 'poisoning', 'lying', 'spider', 'unpleasant', 'dirty', 'rash', 'threatening', 'horror', 'devastating', 'intense', 'hanging', 'delay', 'evil', 'violent', 'dislike', 'dying', 'disease', 'criminal', 'neglected', 'finally', 'clumsy', 'betrayal', 'slug', 'wasted', 'distress', 'enemy', 'dirt', 'misery', 'gross', 'trophies', 'commemorates', 'amazed', 'adorned', 'comedians', 'adored', 'accomplish', 'caressed', 'accolades', 'thanking', 'enthusiastically', 'musically', 'celebration', 'solemnly', 'celebrating', 'befriended', 'accomplishments', 'intrigued', 'tenderly', 'delighted', 'exquisite', 'chuckle', 'thankful', 'textures', 'celebrations', 'calmed', 'cheerful', 'eager', 'gorgeous', 'mischievous', 'giggle', 'stimulate', 'gleam', 'commemoration', 'commemorated', 'delicious', 'wonderful', 'orchestral', 'spirituality', 'fascinating', 'relaxed', 'blessings', 'praising', 'admiration', 'sparkled', 'amazement', 'confidently', 'beaming', 'reassured', 'gracefully', 'insisting', 'victories', 'chuckles', 'miraculous', 'complimented', 'philanthropic', 'delight', 'cheerfully', 'heavenly', 'fascinated', 'reassuring', 'squinting', 'tenderness', 'intimately', 'caress', 'commemorating', 'encourages', 'commemorate', 'inspire', 'soothing', 'acknowledging', 'heroism', 'commemorative', 'friendships', 'decorate', 'relaxing', 'celebrate', 'intimacy', 'vocalists', 'artisans', 'facilitates', 'enthusiastic', 'inspiring', 'thrilled', 'harmonies', 'playful', 'philanthropy', 'honoring', 'amusing', 'effortlessly', 'praises', 'celebrates', 'glittering', 'festivities', 'comforting', 'pleased', 'encouraged', 'graceful', 'astonishment', 'sparkle', 'beautifully', 'amused', 'creamy', 'hilarious', 'excitedly', 'adorable', 'encourage', 'sweetly', 'glistening', 'playfully', 'delightful', 'passionate', 'giggled', 'lovely', 'enjoyable', 'giggles', 'eagerly', 'excelled', 'improves', 'smirk', 'surpassing', 'astonished', 'giggling', 'warmly', 'accomplishment', 'glided', 'antics', 'witty', 'jubilee', 'medal', 'meritorious', 'goodness', 'kiss', 'refreshing', 'orchestra', 'kidding', 'sweetheart', 'graduation', 'happy', 'comfortable', 'unbeaten', 'bouquet', 'sunshine', 'laugh', 'friendship', 'positively', 'bounty', 'embrace', 'generosity', 'trophy', 'inspiration', 'devoted', 'amazing', 'thanksgiving', 'generous', 'appreciation', 'princely', 'liking', 'gratitude', 'praise', 'awesome', 'hymn', 'achieve', 'heavens', 'satisfied', 'entertaining', 'marrow', 'expecting', 'cheer', 'ceremony', 'bliss', 'honest', 'lucky', 'hug', 'entertained', 'sensual', 'impressed', 'salute', 'elevation', 'communion', 'succeed', 'marry', 'excellence', 'ecstasy', 'achievement', 'enchanted', 'laughing', 'excited', 'reward', 'excitement', 'compliment', 'engaged', 'glad', 'twinkle', 'affection', 'loved', 'immaculate', 'alright', 'picnic', 'scholarship', 'praised', 'applause', 'grateful', 'loving', 'happiness', 'flirt', 'lyrical', 'thrill', 'blessed', 'hoping', 'winning', 'glitter', 'absorbed', 'laughter', 'enjoying', 'glow', 'relieved', 'symphony', 'cheering', 'enjoy', 'miracle', 'celebrated', 'pleasant', 'esteem', 'pray', 'celebrity', 'radiant', 'proud', 'smile', 'intuitive', 'smiling', 'wow', 'enthusiasm', 'caring', 'bride', 'interested', 'charitable', 'inauguration', 'truce', 'merry', 'worship', 'attracted', 'fortunate', 'blessing', 'coronation', 'entertain', 'happily', 'bless', 'choral', 'holiness', 'informed', 'relax', 'award', 'confident', 'priesthood']
# trust_fear = ['oppression', 'ferocious', 'illnesses', 'impoverished', 'hurting', 'startled', 'awful', 'alarmed', 'attacker', 'catastrophe', 'hostile', 'turbulent', 'insurrection', 'damaging', 'screams', 'horrific', 'instability', 'prosecuted', 'invading', 'outraged', 'rebellious', 'shudder', 'harshly', 'tremendous', 'adversary', 'scary', 'yells', 'groaning', 'onslaught', 'moans', 'writhing', 'shocks', 'abandoned', 'destructive', 'murdering', 'stabbing', 'hysteria', 'shuddering', 'ruining', 'anguish', 'insulting', 'slaughtered', 'deteriorating', 'combatants', 'injuring', 'terrified', 'enraged', 'villains', 'pained', 'disturbances', 'horrors', 'despised', 'scares', 'discarded', 'crumbling', 'exploding', 'terrific', 'denounced', 'insurgency', 'crippled', 'angered', 'disused', 'cursing', 'shocking', 'brutal', 'humiliating', 'failure', 'collapse', 'tremor', 'disturbance', 'confronting', 'harassed', 'harmed', 'infection', 'baffled', 'turmoil', 'devastating', 'destroying', 'sabotage', 'monstrous', 'illness', 'drastically', 'harmful', 'astonishing', 'looted', 'shriek', 'injured', 'futile', 'twitching', 'weaponry', 'hideous', 'tormented', 'murderous', 'abducted', 'abandonment', 'dazzling', 'suicidal', 'distraught', 'insults', 'gangster', 'invasions', 'seizing', 'insurgents', 'shredded', 'beheaded', 'fled', 'detrimental', 'perpetrators', 'oppressive', 'collapses', 'frightening', 'attackers', 'hissing', 'fearful', 'appalled', 'poisonous', 'frightened', 'unbearable', 'despair', 'terrorists', 'destroys', 'stabbed', 'explodes', 'assaulted', 'explode', 'abandoning', 'horrible', 'moaning', 'psychotic', 'aggressively', 'defective', 'scare', 'uninhabited', 'explosions', 'seizures', 'unsafe', 'disgusted', 'crises', 'ambushed', 'disrupted', 'punishments', 'dreadful', 'catastrophic', 'failures', 'taunting', 'humiliated', 'terrifying', 'reworked', 'crashes', 'dismay', 'radically', 'flees', 'grimace', 'disastrous', 'attacking', 'malicious', 'groans', 'sobbed', 'criminals', 'incarcerated', 'demonic', 'brutally', 'trembling', 'insulted', 'provocative', 'powerless', 'contentious', 'irrational', 'grotesque', 'hysterical', 'menacing', 'counterattack', 'gasping', 'fleeing', 'outlawed', 'ruthless', 'ravaged', 'crazed', 'perished', 'horribly', 'fraudulent', 'worsened', 'assaults', 'sobbing', 'faulty', 'horrified', 'persecuted', 'screaming', 'scream', 'invaders', 'collapsing', 'abnormalities', 'revolutionaries', 'fright', 'dilapidated', 'deserted', 'wrecked', 'villain', 'devastation', 'derelict', 'condemn', 'panicked', 'tragedy', 'ruin', 'ruined', 'monster', 'criminal', 'curse', 'abuse', 'destroyed', 'injury', 'contaminated', 'failing', 'threatening', 'unstable', 'accident', 'shocked', 'raging', 'threaten', 'avalanche', 'panic', 'deprivation', 'danger', 'evil', 'punishment', 'crushing', 'bully', 'suicide', 'devil', 'deadly', 'disease', 'plunge', 'disaster', 'violently', 'intruder', 'shock', 'flood', 'combat', 'downfall', 'suffering', 'unnatural', 'attack', 'horror', 'rebellion', 'traumatic', 'wreck', 'unrest', 'stab', 'dying', 'worst', 'terrible', 'vulnerability', 'punch', 'terror', 'eruption', 'nightmare', 'seizure', 'violent', 'seize', 'ill', 'domination', 'kill', 'conflict', 'die', 'killing', 'scar', 'threat', 'beating', 'broken', 'shaking', 'haunt', 'victim', 'struggle', 'insane', 'doomed', 'explosion', 'torture', 'poison', 'hurt', 'mortality', 'dangerous', 'fatal', 'assault', 'cursed', 'crushed', 'enemy', 'harm', 'cooperation', 'solidarity', 'securely', 'trusting', 'protected', 'theology', 'straightforward', 'proponents', 'reassuring', 'verify', 'plausible', 'friendships', 'educators', 'authenticity', 'cooperative', 'conscience', 'facilitated', 'authentication', 'encouraging', 'alliances', 'secluded', 'bedfordshire', 'legitimacy', 'succeeds', 'confident', 'orthodoxy', 'agree', 'acknowledging', 'ensure', 'agreements', 'persuade', 'verified', 'devout', 'overseen', 'ensured', 'encourages', 'optimistic', 'authentic', 'stipulated', 'believer', 'vowed', 'improves', 'warmly', 'assure', 'advisers', 'shielding', 'mentoring', 'credibility', 'ensures', 'skepticism', 'predicting', 'sincerity', 'ecclesiastical', 'attaining', 'convinces', 'stimulated', 'persuaded', 'advised', 'assured', 'guarded', 'empathy', 'enforcing', 'facilitating', 'convince', 'pact', 'strengthening', 'acknowledges', 'compassionate', 'complied', 'durable', 'encourage', 'reliable', 'feasible', 'vow', 'agrees', 'accountable', 'advise', 'preserving', 'specifies', 'advises', 'reliability', 'privileged', 'recommends', 'subtly', 'soothing', 'proponent', 'credible', 'morality', 'chaplain', 'thoughtful', 'calming', 'guarantee', 'strengthen', 'satisfactory', 'hopeful', 'friendship', 'supervise', 'evaluating', 'advocacy', 'caretaker', 'guarantees', 'spearheaded', 'facilitates', 'alleviate', 'generosity', 'reiterated', 'helpful', 'advising', 'convinced', 'comforting', 'consistency', 'confirming', 'caressing', 'safeguard', 'authoritative', 'acquaintances', 'exemplary', 'religion', 'reconciled', 'disclose', 'cooperate', 'gratitude', 'confidently', 'ambition', 'believers', 'protecting', 'reassure', 'befriended', 'sturdy', 'ideological', 'protector', 'aiding', 'caress', 'respectful', 'coordinating', 'praises', 'confirms', 'guarding', 'optimism', 'reinforcement', 'insisting', 'collaborate', 'effortlessly', 'approve', 'ensuring', 'closeness', 'advocating', 'promises', 'imaginative', 'urging', 'efficacy', 'assertion', 'validation', 'assurance', 'protects', 'formulated', 'agreeing', 'beliefs', 'regulating', 'escorting', 'overseeing', 'soothe', 'preached', 'caressed', 'shielded', 'understands', 'reassured', 'congregations', 'appointing', 'confidence', 'honest', 'coach', 'heal', 'guidance', 'intimate', 'guardian', 'freely', 'goodness', 'expert', 'strength', 'proven', 'affection', 'efficient', 'evident', 'comfortable', 'cathedral', 'accountability', 'sympathetic', 'responsible', 'succeed', 'esteem', 'respects', 'modest', 'convincing', 'positive', 'agreed', 'promise', 'hope', 'church', 'appreciation', 'friendly', 'definitive', 'healing', 'comfort', 'wisdom', 'successful', 'respect', 'believing', 'united', 'advocate', 'understanding', 'believed', 'veteran', 'faith', 'agreement', 'inspire', 'charitable', 'effective', 'repay', 'trust', 'dignity', 'independence', 'confidential', 'blessing', 'sage', 'inspired']
# all_filtered = list(set(sad_joy+anger_anticipation+joy_disgust+trust_fear))
#
# print(all_filtered)
# print(len(all_filtered))
#
# joy_only = ['amazingly', 'trophies', 'commemorates', 'refurbished', 'terrific', 'amazed', 'gatherings', 'serene', 'adorned', 'optimism', 'comedians', 'flawless', 'adored', 'upbeat', 'picturesque', 'markedly', 'illustrious', 'sublime', 'caressed', 'accolades', 'mastery', 'thanking', 'enthusiastically', 'musically', 'heroic', 'encouraging', 'celebration', 'triumphant', 'solemnly', 'celebrating', 'befriended', 'energetic', 'accomplishments', 'intrigued', 'elegance', 'tenderly', 'delighted', 'exquisite', 'chuckle', 'thankful', 'textures', 'celebrations', 'inspirational', 'calmed', 'cheerful', 'eager', 'gorgeous', 'spacious', 'mischievous', 'exemplary', 'giggle', 'stimulate', 'gleam', 'yearning', 'incredible', 'commemoration', 'commemorated', 'delicious', 'hopeful', 'wonderful', 'orchestral', 'shimmering', 'spirituality', 'fascinating', 'relaxed', 'blessings', 'majestic', 'praising', 'expansive', 'admiration', 'delicately', 'sparkled', 'amazement', 'confidently', 'beaming', 'reassured', 'gracefully', 'compassionate', 'seductive', 'chuckles', 'miraculous', 'complimented', 'stillness', 'philanthropic', 'lured', 'lullaby', 'delight', 'cheerfully', 'treasures', 'mentoring', 'heavenly', 'fascinated', 'reassuring', 'tenderness', 'pious', 'magnificent', 'intimately', 'caress', 'commemorating', 'encourages', 'commemorate', 'inspire', 'soothing', 'marvelous', 'showcased', 'heroism', 'imaginative', 'memorable', 'commemorative', 'friendships', 'decorate', 'relaxing', 'celebrate', 'chants', 'intimacy', 'overcoming', 'vocalists', 'entertainer', 'artisans', 'proficiency', 'facilitates', 'enthusiastic', 'inspiring', 'splendid', 'prowess', 'thrilled', 'humorous', 'harmonies', 'reworked', 'playful', 'philanthropy', 'intriguing', 'honoring', 'optimistic', 'educators', 'amusing', 'effortlessly', 'praises', 'luxurious', 'celebrates', 'peacefully', 'glittering', 'lauded', 'festivities', 'comforting', 'pleased', 'encouraged', 'stimulated', 'graceful', 'astonishment', 'enthusiast', 'sparkle', 'beautifully', 'amused', 'creamy', 'hilarious', 'palaces', 'peaceful', 'elegant', 'excitedly', 'adorable', 'encourage', 'relaxation', 'aristocratic', 'sweetly', 'glistening', 'playfully', 'delightful', 'embracing', 'subtly', 'passionate', 'contentious', 'giggled', 'calming', 'fabulous', 'lovely', 'ornate', 'thrilling', 'enjoyable', 'giggles', 'eagerly', 'excelled', 'glorious', 'victorious', 'revered', 'celestial', 'smirk', 'astonished', 'giggling', 'warmly', 'accomplishment', 'glided', 'empathy', 'antics', 'witty', 'jubilee', 'beam', 'excellent', 'medal', 'meritorious', 'goodness', 'gift', 'kiss', 'inspired', 'refreshing', 'orchestra', 'kidding', 'loyal', 'sweetheart', 'graduation', 'masterpiece', 'warm', 'happy', 'privileged', 'romance', 'comfortable', 'peace', 'unbeaten', 'clap', 'bouquet', 'sunshine', 'laugh', 'friendship', 'positively', 'bounty', 'harmony', 'embrace', 'generosity', 'trophy', 'perfect', 'inspiration', 'devoted', 'calm', 'amazing', 'meditation', 'procession', 'fantastic', 'thanksgiving', 'fun', 'generous', 'appreciation', 'fancy', 'shining', 'princely', 'evergreen', 'liking', 'gratitude', 'praise', 'comfort', 'awesome', 'excel', 'entertainment', 'musical', 'sensitive', 'hymn', 'glory', 'heavens', 'authentic', 'satisfied', 'accompaniment', 'beauty', 'entertaining', 'marrow', 'cheer', 'ceremony', 'bliss', 'honest', 'lucky', 'hug', 'joy', 'sunny', 'entertained', 'sensual', 'impressed', 'salute', 'elevation', 'communion', 'enlightenment', 'marry', 'love', 'excellence', 'ecstasy', 'achievement', 'enchanted', 'laughing', 'excited', 'reward', 'excitement', 'dance', 'grounded', 'compliment', 'glad', 'nice', 'intimate', 'twinkle', 'affection', 'loved', 'immaculate', 'alright', 'picnic', 'oasis', 'scholarship', 'praised', 'applause', 'grateful', 'loving', 'happiness', 'flirt', 'lyrical', 'precious', 'leisure', 'curious', 'friendly', 'thrill', 'heroes', 'blessed', 'hoping', 'sing', 'cool', 'glitter', 'illumination', 'laughter', 'enjoying', 'glow', 'relieved', 'symphony', 'cheering', 'enjoy', 'miracle', 'celebrated', 'pleasant', 'esteem', 'festival', 'pray', 'celebrity', 'treasure', 'chant', 'magical', 'radiant', 'concerned', 'proud', 'smile', 'intuitive', 'lover', 'smiling', 'wow', 'humanity', 'brilliant', 'enthusiasm', 'freely', 'caring', 'superstar', 'ordination', 'emancipation', 'spirits', 'bride', 'interested', 'buddy', 'glide', 'engaging', 'pride', 'clever', 'charitable', 'sweet', 'inauguration', 'merry', 'worship', 'beautiful', 'attracted', 'fortunate', 'blessing', 'coronation', 'choir', 'entertain', 'happily', 'bless', 'choral', 'holiness', 'blossom', 'passion', 'relax', 'perfection', 'mighty', 'complement', 'award', 'exciting', 'confident', 'bloom', 'priesthood', 'romantic']
#
# for i,row in df.iterrows():
# if((row['word'] in sad_joy) and (row['label'] =='joy' )):
# joy_only.append(row['word'])
#
# print('joy only')
# print(joy_only)
# visualize_embs(labels,embs,words)