Creating a Collection

Building your own Collection is simple! All you need is some labeled text or image data. Before we handle data, we first need to create our Collection object.

If the Collection name that you specified has already been created, the command to the right will create a new object that represents the existing Collection. If not, a new one will be created.

Note: There’s no need to create a Collection when making calls directly to our URL endpoints. In that case, simply POST the name of the Collection along with the appropriate data outlined in the following sections.

The domain argument
If you’re trying to build a Collection similar to one of indico’s existing text APIs, you may be able to improve your Collection’s performance by adapting one of our models to your domain’s use case. If you set a domain when creating a Collection, you don’t need to set it when adding data; the Collection will remember what its domain is! Currently, the following settings are valid for the domain argument:

  • "standard" – general text analysis problems
  • "topics" – text classification problems similar to Text Tags
  • "sentiment" – sentiment analysis and related problems
  • "finance" – financial news and reports
  • "elmo" – features described in “Deep contextualized word representations” by Peters, et al.
  • "ensemble" – a blend of multiple domains
  • "image_v2" – VGG-style CNN features
  • "image_v3" – CNN features with spatial pyramid pooling
  • "image_v4" – Inception-style CNN features

The shared argument
You can set shared to true to access a Collection that someone else has given you access to via the sharing methods or a publicly published Collection.

// For the sake of saving space we assume that
// the steps outlined below are done sequentially
// When making requests to endpoints, you pass the Collection
// name along with each POST. We'll be using the following
// function in the docs below

function sendToIndico(endpoint, data, callback) {
  const api_key = 'YOUR_API_KEY',
    collection = 'my_collection',
    url = `${endpoint}`,
    log = function(res) { console.log(res) };

  const callback = callback || log;

  fetch(url, {
    method: 'POST',
    body: JSON.stringify({
    .then(r => r.json())
    .catch(err => console.log(err));