NLU engine for Bot program
Bot NLU is a tiny NLU engine for bot program. It only performs the slot filling among SLU tasks using a bidirectional RNN with TensorFlow.
There are 3 steps to use Bot NLU such belows.
All of contents for bot definitions should be stored on mongoDB. Submission is a step to upload contents on mongoDB.
The followings are files which should be included in submission.
config.json (required)
{
"name": "hello_bot",
"hyper_params": {
"batch_size": 100,
"steps": 501,
"cell_size": 50,
"text_embedding_size": 50,
"ne_embedding_size": 50
}
}
training (required)
show me (chinese)[foodType] restaurants
find (spicy)[taste] food
find restaurants nearby (new york)[location] city
{named_entity}.ne (optional)
itailan
chinese
korean
seafood
...
When files are ready we can submit them by python script below.
python3 bot.py submit {path}
Training step performs generating model with a submitted bot. A trained model is stored on local by submission time of bot. So model should be generated whenever we submit a bot newly.
We can perform this step by python script below.
python3 bot.py train {bot_name}
It’s possible to extract slots from input utterance when trained model for bot is ready.
We can predict slots with utterance by python script below.
python3 bot.py predict {bot_name} {utterance}