image_output_1.png
from wordcloud import WordCloud

import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('../input/sentiment-analysis-for-financial-news/all-data.csv', encoding='ISO-8859-1')

df = df.rename(columns={'neutral': 'sentiment', 'According to Gran , the company has no plans to move all production to Russia , although that is where the company is growing .': 'statement'})

df.shape

df.drop_duplicates(subset=['statement'], keep='first', inplace=True)

text = ' '.join([x for x in df.statement])
wordcloud = WordCloud(background_color='white').generate(text)
plt.axis('off')

text = ' '.join([x for x in df.statement[df.sentiment == 'neutral']])
wordcloud = WordCloud(background_color='white').generate(text)
plt.figure(figsize=(8, 6))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')
plt.show()