VoteFilter

class squirro.lib.nlp.steps.filters.VoteFilter(config)

Bases: squirro.lib.nlp.steps.filters.Filter

Given a list of values, assign a single value by majority voting. In case of a tie, pick the first element of the list. Input field examples supported by this filter: [[“positive”],[“negative”],[“positive”]] -> [“positive”], [“positive”, “negative”, “negative”] -> [“negative”],

Parameters
  • field (str, None) – Field to vote

  • fields (list, None) – List of fields to vote

  • input_fields (list, None) – List of fields to vote from

  • output_fields (list, None) – List of fields to vote 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