Why cannot rasa core detect the intents?

Rasa version : rasa-0.15.0a1; rasa-nlu-0.15.0; rasa-core-0.14.4; rasa-core-sdk-0.14.0

Python version : 3.6.8

Operating system (windows, osx, …): CentOS 7.6.1810

Issue : Hi everyone, I meet with an issue about rasa core…It’s very wired.

I installed rasa.core through “pip install rasa.core” and trained the core model through “python -m rasa.core.train -d domain.yml -s stories.md -o models/dialogue”. Then, I ran the core model by typing “python -m rasa.core.run -d models/dialogue”. (using no nlu model)

However, when I tried to contact with rasa core model using parameters, most intents cannot get any reply. In most cases, only ‘/goodbye’ works, and sometimes, the ‘/greet’ works, too. But when I type in other intents, nothing seems to happen.

There are some warnings about Tensorflow or rasa.core, but seems to have no affections.

My stories and domain files are showed below. I tried to search but I can’t find anyone who meet with the same problem with me. I just followed the popular tutorials and it was very easy, but it failed here and I cannot find the solution. It makes me so upset…

Can anyone give me some suggestions? Thanks a lot!

Content of domain file (domain.yml) :

intents:
 - greet
 - goodbye
 - affirm
 - deny
 - food
 - restaurant_search

entities:
 - food

templates:
  utter_greet:
    - "Hello"
  utter_goodbye:
    - "Bye"
  utter_eat_query:
    - "How's dinner?"
  utter_eat_what:
    - "What did you eat?"
  utter_eat:
    - "How about go to the dinner now?"
  utter_eat_healthy:
    - "How about eat salad?"
  utter_appraise:
    - "Good."

actions:
  - utter_default
  - utter_greet
  - utter_goodbye
  - utter_eat_query
  - utter_eat
  - utter_eat_what
  - utter_eat_healthy
  - utter_appraise

Content of story file (stories.md) :

## story_1
* greet
 - utter_eat_query
* affirm
 - utter_eat_what
* food 
 - utter_eat_healthy
* affirm
 - utter_appraise
* goodbye
 - utter_goodbye

## story_2
* greet
 - utter_eat_query
* affirm 
 - utter_eat_what
* food
 - utter_appraise
* goodbye
 - utter_goodbye

## story_3
* greet
 - utter_greet
* restaurant_search
 - utter_eat_query
 
## say_hello
* greet
 - utter_greet

## say_goodbye
* goodbye
 - utter_goodbye

Can you show your NLU data?

Alrighty, first of all, welcome!

Second: I concur with Srikar. However, there’s more to this than just NLU.

Your stories are confusing for the bot. Look:

## story_2
* greet
 - utter_eat_query
## story_3
* greet
 - utter_greet

You’re telling the bot: After greet you should do the search query. But you should also greet the user back. The bot gets confused by the two conflicting stories.

You can fix this by always having the bot greet the user back first. i.e.

## story_2
* greet
 - utter_greet
 - utter_eat_query

and remove the stories that don’t have this combination.

Thank you, Remy! I tried your solution and it works.

I changed my story file to this:

## story_1
* greet
 - utter_eat_query
* affirm
 - utter_eat_what
* food 
 - utter_eat_healthy
* goodbye
 - utter_goodbye

## story_2
* greet
 - utter_eat_query
* affirm 
 - utter_eat_what
* food
 - utter_appraise
* goodbye
 - utter_goodbye

## story_3
* greet
 - utter_eat_query
* food
 - utter_eat_healthy

## story1
* greet
 - utter_eat_query
 
## story2
* goodbye
 - utter_goodbye

However, I still have some questions: I found that I have to follow the story exactly, then I can get the replies from the bot. Or there will be nothing.

For example, following story_3, when I type ‘/greet’ and ‘/food’, everything goes well. But if I add ‘/goodbye’, the bot cannot reply to me anymore. I thought the bot could learn from other stories but it seems not. So…does that mean…I have to add all possible situations to the story file?:sweat_smile:

Sure, but actually my nlu part works well when I test nlu and core separately…only rasa core has these problems.

My domain.yml is here:

intents:
 - greet
 - goodbye
 - affirm
 - deny
 - food
 - restaurant_search

entities:
 - food

templates:
  utter_greet:
    - "Hello"
  utter_goodbye:
    - "Bye"
  utter_eat_query:
    - "How's dinner?"
  utter_eat_what:
    - "What did you eat?"
  utter_eat:
    - "How about go to the dinner now?"
  utter_eat_healthy:
    - "How about eat salad?"
  utter_appraise:
    - "Good."

actions:
  - utter_default
  - utter_greet
  - utter_goodbye
  - utter_eat_query
  - utter_eat
  - utter_eat_what
  - utter_eat_healthy
  - utter_appraise

In this case, I am testing rasa core without using nlu model. Do you know if nlu model will have any influence to the core part? Thanks!!

it doesn’t. In regards to your story models: Yes, you’ll have to think of some situations. However, It’s usually better to have greetings and goodbyes as separate stories so they can be uttered at any time. The model will just switch over to that story.

## story_1
*eat_query
- utter_eat_query
*affirm etc.

and then have

greetings

  • greet
  • utter_greet

goodbye

*goodbye

  • utter_goodbye

Use the sara demo bot as inspiration!

Thanks, Remy. Your answers help me a lot:grin: I find these rasa conversation design docs, which can help. But I can’t find the demo bot.

I just wanted to see if you had enough examples and had them correctly defined. Seems like you fixed the issue which was in the stories.

NLU is responsible for intent classification and entity extraction. The core will then use this data and follows the stories for the conversation. Since you’re just using the core part, it shouldn’t have any influence.

As Remy pointed out, having greet and goodbye separately works great! I think they’ve removed the demobot, it was in the same directory earlier.

Yes this problem has been fixed. Thanks for your help!!