pysentimentanalyzer.generate_wordcloud

Module Contents

Functions

generate_wordcloud(df, col)

Generate the word cloud of the most common positive and negative words from a given survey in the form of a

pysentimentanalyzer.generate_wordcloud.generate_wordcloud(df, col)[source]

Generate the word cloud of the most common positive and negative words from a given survey in the form of a data frame and create a word cloud.

Parameters:
  • df (Pandas DataFrame) – DataFrame containing the survey comments

  • col (string) – Name of the column of text in the Dataframe

Returns:

A list of three images in the following order: postive, neutral, negative A word cloud instance that can be later plotted or saved as an image

Return type:

List

Examples

>>> imgs= generate_wordcloud(df, col)
>>> imgs[0].show() # positive
>>> imgs[1].show() # negative
>>> imgs[2].show() # neutral