Closed DhruvMevada closed 5 years ago
Test your Entity Recognizer with just NLU, don't add rasa core and you will figure out why it is happening. My guess is NLU model is not able to generalize well.
Rasa NLU is working well. We tried with different entity like: Person & city. Both have different value like 3 persons and NewYork So, In this scenario its working fine. But, When more then one entity have same value
For Example :- NewJersey( NewJersey could be source_location OR Destination_location)
But, Somehow Rasa NLU could not able to identify what is context of user. Even BOT was asking for source_location then also Rasa NLU stores its value in destination_location. Due to training data.
In our example if source_location is not found in user message, BOT simply ask BOT: which source_location? User will answer : NewJersey
Here, due to this we have to set training data as below
{
"text": "NewJersey",
"intent": "inform",
"entities": [
{
"start": 0,
"end": 9,
"value": "NewJersey",
"entity": "destination_location"
}
]
},
{
"text": "NewJersey",
"intent": "inform",
"entities": [
{
"start": 0,
"end": 9,
"value": "NewJersey",
"entity": "source_location"
}
]
},
Due to this training data, Rasa NLU identifies that NewJersey is destination_location always.
So Please help us to solve this.
You should have a third entity called location
for those cases, when it's not clear from the context whether it's source or destination. And then you would need to store this in the according slots in a custom action.
@DhruvMevada did you solved it? If do, please give me some suggestion.
@jahid-ict I didn't solve that. but I have solve by creating another location
slot location and handled in the actions.py file. And also given training data for location slot.
In actions.py I handle it by putting simple condition that if source_location
slot is not filled then location
slot value will move to source_location
slot else it will go to destination_location
slot and then reset the location
slot after both condition executes.
I'll close this for now, please let us know if you have any further questions.