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

**`class WhitelistFilter(config)`**

Bases: [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.Filter)

The whitelist [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.Filter) removes a [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) or marks a [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) to be skip based on a whitelist

**Input** - all input fields need to be of type [`str`](https://docs.python.org/3.11/library/stdtypes.html#str) or [`list`](https://docs.python.org/3.11/library/stdtypes.html#list) [ [`str`](https://docs.python.org/3.11/library/stdtypes.html#str) ].

**Output** - No output specific output format due to removal or marking to skip of the whole [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – whitelist
- `replacements` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`, ``{}`) – Dictionary of replacement values for non-whitelisted field values
- `whitelists` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)) – Dictionary of fields to apply the whitelisting, each with a list of whitelisted values
- `is_unique` ([`bool`](https://docs.python.org/3.11/library/functions.html#bool)`, ``True`) – Whether values are unique or not

**Example**

```json
{
    "step": "filter",
    "type": "whitelist",
    "whitelists":{"body":["the","body","whitelists"]}
}
```

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)
