Hi, I am trying to use deeppavlov. I want to get the results of its intent detection and slot filling while talking to the robot. What should I do?
Did you take a look at our latest tutorial? It gives you examples
Check out here:
More specifically, in the end of the tutorial we show examples which help in getting the output you wanted:
The line
bot(["What is the harvesters status?"])[0][0].actions_tuple
Returns a tuple where first item is the name of the action, and the second item is information about detected slots (empty in this particular case).
The line
bot(["Which harvester requires repairs?"])[0][0].get_nlu_info()["intent"]
Returns you the detected intent’s name.
Let me know if this helps!
Thank you so much!
But I got this error:
from deeppavlov import build_model, configs
bot = build_model(configs.go_bot.gobot_dstc2_best, download=True)
print(bot([“start”])[0][0].get_nlu_info()[“intent”]
Error:
AttributeError: ‘str’ object has no attribute ‘get_nlu_info’
What should I do?
Thanks, there’s a small bug in the tutorial.
However, we welcome you to use code from this demos repo:
Take a look at 214-216 lines:
uttr_resp, conf = gobot(sentence)
intents = uttr_resp["intents"]
slots = uttr_resp["slots"]
response = gobot.getNlg(uttr_resp)
Let me know if this works!
I have tried repalce the “sentence” as [“start”] or “start”, none of these works.
Wait I’m sure you didn’t follow all steps cause we didn’t publish full tutorial (yet).
In general, you need to:
- follow Google Colab Tutorial
- train model in it
- download model
- clone repo above
- switch to gobot_gone branch
- copy downloaded model’s folder to corresponding folder in skills/harvesters_maintenance_gobot_skill/
- edit server.py in the same folder of the gobot-based skill to output both
intents
andslots
; maybe add additional endpoint to server.py if you want - build entire solution with docker-compose build
- run entire solution with docker-compose up