Batch Requests

Each indicoio function can be called with a batch of data for analyzing many examples with a single network request. This can improve the speed of using the indico APIs significantly. Simply pass in a list of inputs and receive a list of results in return. The optimal balance between the size of the batch requests and the amount of network requests varies case by case, but performance is usually optimal between 20-100 examples.

Not using the latest package?
If you’re using an older version of our client libraries the syntax for batch calls is different. Namely, you’ll need to call a separate batch function as shown below.

require 'indico'
config = {api_key: "YOUR_API_KEY"}

# Version > v0.4.0
Indico.sentiment(["indico is so easy to use!", "Still really easy, yiss"], config)
# [0.9782025594088044, 0.9895808115135271]

# Version <= v0.4.0
Indico.batch_sentiment(["indico is so easy to use!", "Still really easy, yiss"], config)
# [0.9782025594088044, 0.9895808115135271]