0
from deeppavlov import build_model, configs

snips_model = build_model(configs.classifiers.intents_snips , download=True)
snips_model(["Hello! What is the weather in Boston tomorrow?"])

Hello All - I can use deeppavlov's pretrained model above for intent classification with pre-created intents. However, I want to use deeppavlov to create my own intent classification model with my own intents and own text. There will be 5 to 7 total intents.

How would I go about doing this?

ie sample data i've got with text and intents

text,intent
Where is McDonald's?, resturant
What is the weather today, weather
Where is the closest Burger King?, restaurant
Is it sunny today?, weather
What is the temperature today?, weather
com
  • 2,606
  • 6
  • 29
  • 44

3 Answers3

2

Sorry for the late answer. If still relevant, you may consider the following tutorial for custom classification: https://github.com/deepmipt/DeepPavlov/blob/master/examples/classification_tutorial.ipynb

There are several different embedding methods and models. You may also try to implement your own dataset as in the tutorial, and use model more actual models like BERT- based classification, see _bert configs in the directory https://github.com/deepmipt/DeepPavlov/tree/master/deeppavlov/configs/classifiers

2

We have a new model/NLP component called Intent Catcher shipped in v0.14 of DeepPavlov Library. With it, you can provide your own intents (currently within the JSON format but we'll provide a more human-readable format in YML soon), and then train classification model based on your intents. The good thing is you can use it to also auto-generate more examples by using RegEx.

You can learn more about Intent Catcher here:

http://docs.deeppavlov.ai/en/master/features/models/intent_catcher.html

Here's the tutorial on how to use it: https://colab.research.google.com/drive/1l6Fhj3rEVup0N-n9Jy5z_iA3b1W53V6m?usp=sharing

Let us know if that works or not for you

0

Training intents_snips model requires a training dataset. I would recommend, before collecting the data, try using lightweight the FAQ model, where few training examples per class is enough.

from deeppavlov import configs, train_model

faq = train_model(configs.faq.tfidf_logreg_en_faq)

a = faq(["I need help"])

Details can found here

com
  • 2,606
  • 6
  • 29
  • 44