Skip to main content

Algorithm comparison

General information

How it worksRequires Caila connection
Transformer ruUses logistic regression + embeddings optimized for RussianYes. Service: text-classifier-logreg-caila-roberta
Transformer multiUses logistic regression + multilingual embeddings for 109 languagesYes. Service: text-classifier-logreg-labse
Deep LearningUses convolutional neural network + pre-trained BPEmb embeddingsNo
Classic MLUses logistic regression + linguistic preprocessingNo
STSUses phrase similarity scoringNo

Quality and performance

Average accuracyModel training speedYou can check why the intent was triggered
Transformer ru80–90%A few minutes for datasets with over 10,000 phrasesNo
Transformer multi80–90%A few minutes for datasets with over 10,000 phrasesNo
Deep Learning75–85%LongNo
Classic ML70–80%Fast on datasets up to 5,000 phrasesNo
STS65–75%Very fastThe request mapping to the closest training phrase is available

Number of phrases and thresholds

Recommended intent thresholdRecommended number of phrases in an intentTotal number of phrasesThe same number of phrases is required in intents
Transformer ru0.3–0.5

10+

The larger the dataset, the more accurate the classification
Limited only by Caila memoryNo
Transformer multi0.3–0.5

10+

The larger the dataset, the more accurate the classification
Limited only by Caila memoryNo
Deep Learning0.4–0.7

50+

The larger the dataset, the more accurate the classification. See a possible solution for small datasets
No restrictionsNo
Classic ML0.1–0.2

20+

The larger the dataset, the more accurate the classification
No restrictionsMight perform unpredictably if an intent’s phrase count deviates significantly from the average. See a possible solution
STS0.2–0.6

5–7+

The algorithm will function even if there is only one phrase in the intent
No more than 1000No
Recommendations for phrase length
  • Recommended training phrase length: 1–10 words. Long phrases aren’t ideal for intent recognition because it’s harder to extract meaning from them.

  • If the bot is under heavy load, reduce the length and number of phrases in intents, or choose a classifier algorithm that can handle the load, such as Classic ML.

Impact of phrase count on training time

The Just AI team conducted an internal study to compare how quickly different classifiers train on datasets of various sizes.

The study used datasets with varying numbers of intents and training phrases. The data was in different languages.

  • Training time and number of phrases in the dataset:

    Training time and dataset size
  • Training time and average number of phrases per intent:

    Training time and average number of phrases per intent

Impact of request length and phrase count on classification speed

Speed depends on the client request lengthSpeed depends on the number of phrases in intents
Transformer ruNoNo
Transformer multiNoNo
Deep LearningNoNo
Classic MLNoNo
STSYesYes

Languages

LanguagesMultilingual supportLemmas and stems
Transformer ruOptimized for Russian. Supports around 50 languages as well, with lower accuracy than Transformer multiYes, but for multilingual support we recommend using Transformer multiDoes not consider lemmas and stems, but compensates with embeddings
Transformer multiSupports 109 languagesYesDoes not consider lemmas and stems, but compensates with embeddings
Deep learningAll JAICP languagesYou can set "lang" = "multi"Uses subwords from BPEmb
Classic MLRussian, English, Chinese, PortugueseNoStems:
  • Snowball stemmer for Russian, English, and Portuguese
  • Not available for Chinese.
Lemmas:
  • Mystem for Russian, spaCy for Portuguese.
  • Not available for Chinese and English.
STSAll JAICP languagesNoConsiders lemmas

Text Analysis

SemanticsSupports entities in training phrasesIdentifying important wordsWorking with negative examples
Transformer ruPretrained caila-roberta embeddingsNoUnknown. See a possible solutionPerforms well
Transformer multiPretrained LaBSE embeddingsNoUnknown. See a possible solutionPerforms very poorly with negative examples. See a possible solution
Deep learningPretrained BPEmb embeddingsNoCan theoretically identify them. See a possible solutionPerforms poorly. See a possible solution
Classic MLNot supported. See a possible solutionNoTF-IDF to determine word importance based on intent phrases. It is necessary to monitor the balance of secondary words in the dataset. See a possible solutionPerforms well
STS

Built-in synonym dictionary for Russian only.

Use the advanced NLU settings to adjust the algorithm for your project. For example, configure the synonymMatch parameter to adjust the weight of synonym matches
YesPretrained TF-IDF to determine word importance. The weights might not be relevant to your project topicPerforms well

Text format

Case sensitiveConsiders punctuationDistinguishes e and ё
Transformer ruCan be configured with toLowercaseCan be configured with doRemovePunctuationsIn training phrases, but not in requests
Transformer multiCan be configured with toLowercaseCan be configured with doRemovePunctuationsIn training phrases, but not in requests
Deep learningNoYesIn training phrases, but not in requests
Classic MLCan be configured with lowerNoIn training phrases, but not in requests
STSNoYesYes

Classifier behavior in complex cases

Multi-label classificationIntents have similar phrasesSimilar intents
Transformer ruNoNot recommended. Either one intent will receive a high weight, or the weight will be split between them. See a possible solutionNot recommended. See a possible solution
Transformer multiNoNot recommended. Either one intent will receive a high weight, or the weight will be split between themNot recommended. See a possible solution
Deep learningNoNot recommended. Either one intent will receive a high weight, or the weight will be split between themIntents will have equal weight, but that weight will be lower. See a possible solution
Classic MLNoNot recommended. Both intents will have low weight for these phrasesThe intents will have equal weight, but their weight will be lower. See a possible solution
STSYesAcceptable, both intents will have equal weightAcceptable, both intents will have equal weight