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

**`class SquirroEntityCleaner(config)`**

Bases: [`Saver`](squirro.lib.nlp.steps.savers.Saver.md#squirro.lib.nlp.steps.savers.Saver)

Removes Squirro entities that match the field properties. This is used to ensure that no duplicate entities show up when a ml workflow
is rerun on the same items.

**Note** - The fields client_id,  client_secret, cluster, token and project_id do not need to be set if it is used inside the Squirro machinelearning service

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – squirro_entity_cleaner
- `client_id` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Squirro client id
- `client_secret` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Squirro client secret
- `cluster` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Squirro cluster URL
- `token` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Squirro token
- `project_id` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – id of Squirro project
- `properties` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`, ``{}`) – Properties that need to match for entities to be removed. If left empty, all entities for the items are removed.
- `delete_batch_size` ([`int`](https://docs.python.org/3.11/library/functions.html#int)`, ``500`) – How many entities to delete per deletion request.

**Example**

```json
{
    "step": "saver",
    "type": "squirro_entity_cleaner",
    "cluster": "CLUSTER",
    "token": "TOKEN",
    "project_id": "PROJECT_ID",
    "properties": {"model_id":"MODEL_ID"}
}
```

Methods SummaryMethods Documentation

**`process_batch(docs)`**

Process a batch of documents. If not defined will default to using
self.process_doc for each document in the batch.

Parameters

`batch` ([`list`](https://docs.python.org/3.11/library/stdtypes.html#list)`(`[`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)`)`) – List of documents

Returns

List of processed documents

Return type

[list](https://docs.python.org/3.11/library/stdtypes.html#list)([Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document))
