Dialogue agent is able to handle multi-domain data. The model is end-to-end differentiable and does not need to explicitly model dialogue state or belief trackers.
We also used a new Stanford NLP Group released dataset of 3,031 dialogues [2] that are grounded through underlying knowledge bases and span three distinct tasks in the in-car personal assistant space: calendar scheduling, weather information retrieval, and point-of-interest navigation.
Here is a simple example of interaction with a trained dialogue bot (can be downloaded with deeppavlov/download.py
):
x_text:: Where's the nearest parking garage?
>> the nearest is dish parking at dish_parking_address. is that okay?
x_text:: Yes, please set directions via a route that avoids all heavy traffic if possible.
>> it looks like there is a road block being reported on the route but i will still find the quickest route to dish_parking_address.
x_text:: Thanks so much for your help.
>> you're welcome. have a good day. end_of_dialogue
x_text:: Will it be warm in Camarillo over the next 2 days?
>> no, it's not gon na be warm in camarillo over the next 2 days
x_text:: Thank you car!
>> you're welcome! end_of_dialogue
x_text:: What day is my lab appointment, and who all will be there?
>> your lab appointment is on lab_appointment_date at lab_appointment_time with lab_appointment_party.
x_text:: Thanks!
>> you're welcome.
To use a seq2seq_go_bot model you should have a pretrained goal-oriented bot model
- config
deeppavlov/configs/seq2seq_go_bot/bot_kvret_infer.json
is recommended to be used in inference mode - config
deeppavlov/configs/seq2seq_go_bot/bot_kvret.json
is recommended to be used in train mode
name
always equals to"seq2seq_go_bot"
source_vocab
— vocabulary of tokens from context (source) utterancestarget_vocab
— vocabulary of tokens from response (target) utterancesstart_of_sequence_token
— token corresponding to the start of sequence during decodingend_of_sequence_token
— token corresponding to the end of sequence during decodingbow_encoder
— one of bag-of-words encoders fromdeeppavlov.models.encoders.bow
modulename
— encoder name- other arguments specific to your encoder
debug
— whether to display debug output (defaults tofalse
) (optional)network
— reccurent network that handles encoder-decoder mechanismname
equals to"seq2seq_go_bot_nn"
learning_rate
— learning rate during trainingtarget_start_of_sequence_index
— index ofstart_of_sequence_token
in decoder vocabularytarget_end_of_sequence_index
— index ofend_of_sequence_token
in decoder vocabularysource_vocab_size
— size of encoder token vocabulary (size ofsource_vocab
is recommended)target_vocab_size
— size of decoder token vocabulary (size oftarget_vocab
is recommended)hidden_size
— LSTM hidden state size equal for encoder and decoder
- To infer from a pretrained model with config path equal to
path/to/config.json
:
from deeppavlov.core.commands.infer import build_model_from_config
from deeppavlov.core.common.file import read_json
CONFIG_PATH = 'path/to/config.json'
model = build_model_from_config(read_json(CONFIG_PATH))
utterance = ""
while utterance != 'exit':
print(">> " + model([utterance])[0])
utterance = input(':: ')
- To interact via command line use
deeppavlov/deep.py
script:
cd deeppavlov
python3 deep.py interact path/to/config.json
[1] A New Multi-Turn, Multi-Domain, Task-Oriented Dialogue Dataset