I have data of comments and when i am creating a word cloud out of it. It is showing me centre biggest word which has less occurrence but has high rank.
I have tried using the relative_scale option but it didn't worked out for me and instead provided me with less number of results on the word cloud.
The only way i am able to see now is to use wordcloud by frequency which i don't want to opt
Please suggest the solution
for val in df.iterrows():
# typecaste each val to string
val = str(val)
# split the value
tokens = val.split()
# Converts each token into lowercase
for i in range(len(tokens)):
tokens[i] = tokens[i].lower()
for words in tokens:
comment_words = comment_words + words + ' '
I have data of comments and when i am creating a word cloud out of it. It is showing me centre biggest word which has less occurrence but has high rank.
I have tried using the relative_scale option but it didn't worked out for me and instead provided me with less number of results on the word cloud.
The only way i am able to see now is to use wordcloud by frequency which i don't want to opt
Please suggest the solution
for val in df.iterrows():
wordcloud = WordCloud(width=800, height=800, background_color='white', stopwords=stopwords, min_font_size=10,collocations=False).generate(comment_words)
plot the WordCloud image
plt.figure(figsize=(8, 8), facecolor=None) plt.imshow(wordcloud) plt.axis("off") plt.tight_layout(pad=0)
plt.show()