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

**`class RemoteQuestionAnswering(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) to qa remote service 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_qa"`) – remote_qa
- `input_field__question` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"qa_question"`) – Input field containing the question
- `input_field__context` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"qa_context"`) – Input field containing the context
- `output_field__answer` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"qa_answer"`) – 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)`, ``"accurate"`) – Default worker that is used to read service URL from the configuration service if detected language is not found in the language_service_mapping.

**Example**

```json
{
    "step": "external",
    "type": "remote_qa",
    "language_service_mapping": {
        "en": "http://localhost:8000"
    },
    "default_worker: "accurate"
}
```

Methods SummaryMethods Documentation

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

Return type

`QAClient`

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