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

**`class SquirroItemSaver(config)`**

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

Converts libNLP [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) to Squirro items and saves them to a Squirrinstance

**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_item
- `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
- `create_facets` ([`bool`](https://docs.python.org/3.11/library/functions.html#bool)`, ``True`) – whether or not to create new facets of detected type
- `tracking_facet_name` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``'ml_workflow'`) – Facet used to track whether or not an item has been seen
- `tracking_facet_value` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Facet value to apply to tracking facet

**Example**

```json
{
    "step": "saver",
    "type": "squirro_item",
    "cluster": "CLUSTER",
    "token": "TOKEN",
    "project_id": "PROJECT_ID",
    "fields":["keywords.prediction"]
}
```

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))
