AggregateFilter

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

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

Aggregates fields of docs

Parameters
  • type (str) – aggregate

  • aggregated_fields (list) – Fields to aggregate

  • aggregating_field (str) – Field to aggregate into

  • output_field (str, None) – Field to store the aggregation (defaults to aggregating_field)

  • use_separate_docs (bool, True) – Whether or not to use a separate doc for each aggregating value

Methods Summary

process(docs)

Process a set of documents

train(docs)

Train on a step of a set of documents

Methods Documentation

process(docs)

Process a set of documents

Parameters

docs (generator(Document)) – Generator of documents

Returns

Generator of processed documents

Return type

generator(Document)

train(docs)

Train on a step of a set of documents

Parameters

docs (generator(Document)) – Generator of documents

Returns

Generator of processed documents

Return type

generator(Document)