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

**`class CSVSaver(config)`**

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

Saves all [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) to a specified output_file in CSV format

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – csv
- `output_file` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – path to output CSV file (relative to ml workflow path)

**Example**

```json
{
    "step": "saver",
    "type": "csv",
    "fields": [ "text", "prediction" ],
    "output_file": "data.csv"
}
```

Methods SummaryMethods Documentation

**`process_batch(batch)`**

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