SentimentTermNormalizer

class squirro.lib.nlp.steps.normalizers.SentimentTermNormalizer(config)

Bases: squirro.lib.nlp.steps.normalizers.Normalizer

Extract positive and negative terms/phrases from given text. Tries to detect negations and phrases based on detected Vader-Valence-Terms. Extracted phrases are ranked according to their sentiment-polarity (valence score).

Parameters
  • step (str, "normalizer") – The step

  • type (str, "sentiment_terms") – Custom extractor

  • input_fields (list, ['title', 'body']) – Input text

  • output_fields (list, ['positive_terms','negative_terms']) – Fields to store sentiment terms

  • take_top_n_terms (int, 10) – Extract top-N positive / negative ranked phrases (by polarity)

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