Adding Data – Multi-label

Use this model type when any number of the supplied labels can apply to each example (i.e. each label is independent from the others). This is equivalent to training a separate classifier to predict whether or not each possible label applies to a provided document. The probabilities returned by a call to `predict()` can each range from 0. to 1. and are not required to sum to 1. Examples of multi-label classification include predicting the topics an article covers or predicting what themes a user mentioned in a review.

In this case you can supply multiple labels per data point when adding data to your custom collection.

# String data
collection.add_data(["string1", ["label-1", "label-2"]])

# Image data
collection.add_data(["image-url or b64-image",  ["label-1", "label-2"]])

# Batch add data
collection.add_data(
    [
        ["string1", ["label-1"]], 
        ["string2", ["label-2"]], 
        ["string3", ["label-1", "label-2" ]],
        ["string4", []]
    ]
)

# Specifying domain
collection.add_data(
    [
        ["string1", ["label-1"]], 
        ["string2", ["label-2"]], 
        ["string3", ["label-1", "label-2" ]],
        ["string4", []]
    ],
    {domain: "topics"}
)