<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.filters.OffsetMappingFilter.html -->
# OffsetMappingFilter

**`class OffsetMappingFilter(config)`**

Bases: [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.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`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Field with list of ner entities
- `index_mapping_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Field with mapping information
- `output_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``'entities'`) – Field to write resulting entities

Methods SummaryMethods Documentation

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)
