MergeFilter

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

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

The merge Filter merges multiple fields into a single field

Input - all input fields needs to be of type str, list [ str ] or list [ {‘body’: str} ].

Output - the output field is filled with data of type str.

Parameters
  • type (str) – merge

  • input_fields (list) – Fields to merge

  • output_field (str) – Field to merge into

  • delimiter (str, ' ') – String to merge on

Example

{
    "step": "filter",
    "type": "merge",
    "input_fields":["title","body"],
    "output_field":"text"
}

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