VaderSentiment

class squirro.lib.nlp.steps.classifiers.VaderSentiment(config)

Bases: squirro.lib.nlp.steps.classifiers.Classifier

Vader Sentiment Applies rule based sentiment analysis (positive, neutral, negative) on each document. The vader sentiment provides the polarity score of a text string, we take the compound score to detect sentiment. example output from vader analyzer: {‘neg’: 0.0, ‘neu’: 0.432, ‘pos’: 0.568, ‘compound’: 0.8476}

Following strategy has been applied:

positive: compound score>=0.05 neutral: compound score between -0.05 and 0.05 negative: compound score<=-0.05

Parameters
  • type (str) – vadersentiment

  • input_fields (list) – Fields to use to detect sentiment. The text fragments from all the element of the string is joined.

  • output_field (str) – Field to assign sentiment to

Methods Summary

process_doc(doc)

Process a document

Methods Documentation

process_doc(doc)

Process a document

Parameters

doc (Document) – Document

Returns

Processed document

Return type

Document