Knowledge Base Actions still relevant?

Hi, I tried to use the Knowledge Base Bot from the Rasa Tutorial on Knowledge Base Actions: rasa/examples/knowledgebasebot at master · RasaHQ/rasa · GitHub

And I found that when asking the question: “what is the price range of Berlin Burrito Company?” the bot does not recognize it. Eventhough it is stated this way 1:1 in the NLU data. So is it possible that knowledge base actions are not supported anymore by the newest version of rasa?

Thanks

Welcome Emildeon,

We still support actions. Can you send the debug output when you enter the utterance.

Greg

Hi, thanks for the quick response. Here is the debug output:

Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input ->  what is the price range of Berlin Burrito Company?
2020-07-26 16:05:47 DEBUG    rasa.core.tracker_store  - Creating a new tracker for id '5756d386a2274c8da129b6e2652914af'.
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Starting a new session for conversation ID '5756d386a2274c8da129b6e2652914af'.
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.core.events.SessionStarted object at 0x000001DC652CEA20>, <rasa.core.events.ActionExecuted object at 0x000001DC652CEEF0>]'.
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Current slot values:
        attribute: None
        city: None
        cuisine: None
        hotel: None
        knowledge_base_last_object: None
        knowledge_base_last_object_type: None
        knowledge_base_listed_objects: None
        mention: None
        object_type: None
        restaurant: None
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Received user message 'what is the price range of Berlin Burrito Company?' with intent '{'name': 'query_knowledge_base', 'confidence': 1.0}' and entities '[{'entity': 'attribute', 'start': 12, 'end': 23, 'value': 'price-range', 'extractor': 'DIETClassifier', 'processors': ['EntitySynonymMapper']}, {'entity': 'restaurant', 'start': 27, 'end': 49, 'value': 'Berlin Burrito Company', 'extractor': 'DIETClassifier'}]'
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Current slot values:
        attribute: price-range
        city: None
        cuisine: None
        hotel: None
        knowledge_base_last_object: None
        knowledge_base_last_object_type: None
        knowledge_base_listed_objects: None
        mention: None
        object_type: None
        restaurant: Berlin Burrito Company
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 6 events.
2020-07-26 16:05:47 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, None, None, {}, {'entity_restaurant': 1.0, 'entity_attribute': 1.0, 'intent_query_knowledge_base': 1.0, 'prev_action_listen': 1.0}]
2020-07-26 16:05:47 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2020-07-26 16:05:47 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_TEDPolicy
2020-07-26 16:05:47 DEBUG    rasa.core.processor  - Predicted next action 'action_query_knowledge_base' with confidence 0.76.
2020-07-26 16:05:47 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'action_query_knowledge_base'.
2020-07-26 16:05:50 DEBUG    rasa.core.processor  - Action 'action_query_knowledge_base' ended with events '[BotUttered('Sorry, I'm not sure I understand. Can you rephrase?', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1595772350.3741302)]'.
2020-07-26 16:05:50 DEBUG    rasa.core.processor  - Current slot values:
        attribute: price-range
        city: None
        cuisine: None
        hotel: None
        knowledge_base_last_object: None
        knowledge_base_last_object_type: None
        knowledge_base_listed_objects: None
        mention: None
        object_type: None
        restaurant: Berlin Burrito Company
2020-07-26 16:05:50 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, None, {}, {'entity_restaurant': 1.0, 'entity_attribute': 1.0, 'intent_query_knowledge_base': 1.0, 'prev_action_listen': 1.0}, {'entity_restaurant': 1.0, 'entity_attribute': 1.0, 'prev_action_query_knowledge_base': 1.0, 'intent_query_knowledge_base': 1.0}]
2020-07-26 16:05:50 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2020-07-26 16:05:50 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_TEDPolicy
2020-07-26 16:05:50 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 0.97.
2020-07-26 16:05:50 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2020-07-26 16:05:50 DEBUG    rasa.core.lock_store  - Deleted lock for conversation '5756d386a2274c8da129b6e2652914af'.
Sorry, I'm not sure I understand. Can you rephrase?

Or can someone tell me at which version Knowledge Base Actions worked flawlessly? Because I wanted to use this feature for my Bot with a different Knowledge Base, but unfortunately it does seem like at least attribute queries do not work in the latest Rasa version.

I see that the Knowledge Base Bot has been updated 2 days ago. Now when I try “rasa train” with the newest version, it says “No training data given. Please provide stories and NLU data in order to train a Rasa model using the ‘–data’ argument.”. Never got that error before. Also I saw that in the data folder the files nlu.md and stories.md have been both changed to nlu.yaml and rules.yaml. Why is that?

EDIT 1: @b-quachtran Maybe you can help here :slight_smile:

EDIT 2: I just saw now that the new format was edited to adhere to Rasa 2.0 standards, so I installed the latest version of Rasa which is 2.0.0a1. Now the command “rasa train” works without problems, but the knowledge base bot still doesn’t understand the sentence "what is the price range of Berlin Burrito Company? :frowning: It seems like the Bot does not understand questions where a specific attribute of a specific restaurant/hotel is needed. If instead of a specific restaurant I first ask for a list of restaurants and then ask about a specific attribute of the last restaurant in the list via mentions, the Bot understands that and gives me the right answer.

Ok now after some testing I found out, that everything works if first you ask for a list of objects (restaurants or hotels). Then the bot is able to extract specific attribute values for the objects. But if you start the conversation with a question for a specific attribute the bot does not understand the question. Is this bot or knowledge base actions meant to work this way?

Yep, that’s how it works for me. I assume that it is an example of how each mechanism in the knowledge Base - can work, not how it should work.

Ah alright, thank you. Good to know :slight_smile: