text_plain_output_1.png image_output_1.png
from wordcloud import WordCloud,STOPWORDS

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

data_train = pd.read_csv('../input/nlp-getting-started/train.csv')
data_test = pd.read_csv('../input/nlp-getting-started/test.csv')

data_train = data_train[['id', 'text', 'target']]
data_test = data_test[['id', 'text']]

s = data_train.target.value_counts()

text = list(data_train[data_train['target'] == 0].text.values)
wordcloud = WordCloud(stopwords=STOPWORDS).generate(str(text))
plt.axis('off')

text = list(data_train[data_train['target'] == 1].text.values)
wordcloud = WordCloud(stopwords=STOPWORDS).generate(str(text))
plt.figure(figsize=(15, 7))
plt.imshow(wordcloud)
plt.axis('off')
plt.title('Wordcloud for Disaster tweets')
plt.show()