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

**`class RemoteSpacy(config)`**

Bases: [`BatchedStep`](../technical/libnlp/steps/standard.md#squirro.lib.nlp.steps.batched_step.BatchedStep)

Step that uses an external API endpoint.

It sends a batch of [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document) in the shape of {“docs”:LIST_OF_DOCS, “fields”:LIST_OF_FIELDS}
to spaCy and returns the annotated batch of [`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)

Parameters

- `step` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"external"`) – external
- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"remote_spacy"`) – remote_spacy
- `field_mapping` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)) – Mapping of input field to output field
- `max_concurrent` ([`int`](https://docs.python.org/3.11/library/functions.html#int)`, ``10`) – Maximum concurrent requests
- `language_service_mapping` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`,``{}`) – Define custom service URL that should be used for the detected language.
  If the language is not found in the mapping, the default_worker is used and the service URL is read from the configuration service.
- `default_worker` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"fast"`) – Default worker that is used to read service URL from the configuration service if detected language is not found in the language_service_mapping.
- `disable_pipes__field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Programmatic selection of disabled pipelines (read disabled pipelines from field). Uses disable_pipes__default if empty.
- `disable_pipes__default` ([`list`](https://docs.python.org/3.11/library/stdtypes.html#list)`, ``[``]`) – specified pipes are disabled by default, if no disable_pipes__field specified or value is null

**Example**

```json
{
    "step": "external",
    "type": "remote_spacy",
    "field_mapping": {"body": "nlp__body", "title": "nlp__title"},
    "language_service_mapping": {
        "en": "http://localhost:8000"
    },
    "default_worker: "fast",
    "disable_pipes__default": ["ner"]
}
```

Methods SummaryMethods Documentation

**`get_client(language, worker)`**

Return type

`SpacyClient`

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