How to set up your classification task

With a proper set of labels describing the classification task, the model can infer by semantic similarity how to categorize a text without having been explicitly trained for that task. For example, a sentiment analysis task could be formatted as follows:

To categorize the sentence The food was delicious! into a positive or a negative label, one would define two corresponding hypotheses such as, This person expresses a positive sentiment and This person expresses a negative sentiment. The model will infer a stronger semantic relationship with the positive tag.

For the ease of use, we can create pattern templates with a curly-bracket placeholder for replacing the corresponding label each time. In the example above, it would have been This person expresses a {} sentiment.

Parameters

Parameter

Description

Parameter

Description

model

The language model to use. Call GET /zero-shot/ for the models available.

Choose symanto_brain_multilingual only if there is no specific language model for your selected languauge.

all

If true only returns the most probable label. Otherwise it returns all of them.

multi_label

If false, returned probability distribution among provided labels for each instance will sum up to 1. Otherwise it will be unnormalized.

Examples

Please head over to Use Case Examples to view some common use cases and their configurations.

Symanto Brain Knowledge Base 2022