show_extreme_posts module

show_extreme_posts.annotated_text(args, color=None)

> annotated_text takes a list of strings and a color and returns a string of HTML that displays the strings in a list with the color of your choice

Parameters
  • args – a list of strings, where each string is a word in the text

  • color – The color of the annotation.

show_extreme_posts.annotation(body, label='', background=None, color=None, **style)

It takes a string, and returns a span element with a background color and a label

Parameters
  • body – The text to be annotated.

  • label – The label to display in the annotation.

  • background – The background color of the annotation.

  • color – The color of the text.

Returns

A span element with a style attribute.

show_extreme_posts.get_annotated_html(args, color)

It takes a list of strings and HtmlElement objects, and returns a single HtmlElement object

Parameters
  • args – a list of strings and tuples.

  • color – The color of the annotation.

Returns

A string of html code.

show_extreme_posts.postExtremeComments(data, keywords, color, extreme)

It takes in a dataframe, a list of keywords, and a color, and returns a list of lists of strings, where each list of strings is a comment with the keywords highlighted

Parameters
  • data – the dataframe containing the comments

  • keywords – a list of keywords to search for in the comments

  • color – The color of the text.

  • extreme – “positive” or “negative”