OffsetMappingFilter#

class OffsetMappingFilter(config)#

Bases: Filter

Takes a prediction field of the form:

[ { “start”: int, “end”: int, “label”: str, “text”: str }, … ]

and adjusts the start and end offsets according to the mapping

Parameters:
  • entities_field (str) – Field with list of ner entities

  • index_mapping_field (str) – Field with mapping information

  • output_field (str, 'entities') – Field to write resulting entities

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