EndpointStep#
- class EndpointStep(config)#
Bases:
BatchedStep
Step that uses an external API endpoint.
It sends a batch of
Document
in the shape of {“docs”:LIST_OF_DOCS, “fields”:LIST_OF_FIELDS} to the endpoint and returns the received batch ofDocument
- Parameters:
Example
{ "name": "endpoint", "step": "endpoint", "type": "endpoint", "fields": ["title","body"], "process_endpoint": "https://localhost:<PORT>/process", "train_endpoint": "https://localhost:<PORT>/train" }
Methods Summary
process_batch
(batch)Process a batch of documents.
train_batch
(batch)Train on a batch of documents
Methods 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.