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
require 'indico'
Indico.api_key =  'YOUR_API_KEY'

collection = Indico::Collection.new("my_collection", {domain: "sentiment"})

# Accessing a shared Collection
collection = Indico::Collection.new("shared_collection", {domain: "sentiment", shared: True})