According to this nice article, there was a new pipeline released using a different approach from the standard one (
spacy_sklearn
). I wanted to give it a try to see whether it can help with improving bot’s accuracy.After applying done, I gave an evaluation of “tensorflow_embedding”. It seemed to work better a bit. For example, I defined intents “greet” and “goodbye” with some following messages in my training data.
## intent:greet
- Hey! How are you?
- Hi! How can I help you?
- Good to see you!
- Nice to see you!
- Hi
- Hello
- Hi there
## intent:goodbye
- Bye
- Bye Bye
- See you later
- Take care
- Peace
In order to play around with Rasa NLU, I created a project here. You can have a look at this change from this pull request. Yay!When I entered message “hi bot”, then bot with “tensorflow_embedding” could detect intent “greet” with better confidence scores rather than bot with “spacy_sklearn”. The following are responses after executing
curl -X POST localhost:5000/parse -d '{"q": "Hi bot", "project": "ctraubot", "model": "nlu"}' | python -m json.tool
A response of bot with pipeline
spacy_sklearn
{
"intent": {
"name": "greet",
"confidence": 0.8687479112327237
},
"entities": [],
"intent_ranking": [
{
"name": "greet",
"confidence": 0.8687479112327237
},
{
"name": "goodbye",
"confidence": 0.13125208876727643
}
],
"text": "Hi bot",
"project": "ctraubot",
"model": "nlu"
}
A response of bot with pipeline tensorflow_embedding
{
"intent": {
"name": "greet",
"confidence": 0.9777982831001282
},
"entities": [],
"intent_ranking": [
{
"name": "greet",
"confidence": 0.9777982831001282
},
{
"name": "goodbye",
"confidence": -0.08299092948436737
}
],
"text": "Hi bot",
"project": "ctraubot",
"model": "nlu"
}
By the way, I still need modules spacy
and sklearn
for a further usage of entity extraction.
Comments
Post a Comment