Rasa: slot filling issues and cannot run next action

Created on 20 Jul 2018  路  9Comments  路  Source: RasaHQ/rasa

Rasa Core version: 0.98

Python version: 3.6

Operating system (windows, osx, ...): win10

Issue:
I have problems with slot filling as I provide the debug below

  1. when I type bullying, the bot stops and does not reply
  2. when I type my topic is bullying, it fills the slot with the whole sentence instead of bullying that I have put in my train data: nlu_data.md

The steps I run RASA:
python -m rasa_nlu.train -c config_spacy.yml --data data/nlu_data.md -o models --fixed_model_name nlu --project current --verbose
python -m rasa_core.train -d domain.yml -s data/stories.md -o models/current/dialogue --epochs 200
python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --debug

What is your topic?
2018-07-19 19:26:27 DEBUG    rasa_core.processor  - Bot utterance 'BotUttered(text: What is your topic?, data: null)'
2018-07-19 19:26:27 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: requested_slot, value: essay_topic_slot)']'
2018-07-19 19:26:27 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'intent_choose_argument': 1.0, 'prev_utter_choose_topic': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}]
2018-07-19 19:26:27 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-19 19:26:27 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-19 19:26:27 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 1.00.
2018-07-19 19:26:27 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-19 19:26:27 DEBUG    rasa_core.processor  - Current topic: None
bullying
2018-07-19 19:26:29 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
2018-07-19 19:26:29 WARNING  py.warnings  - C:\Users\e8180\Anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Received user message 'bullying' with intent '{'name': 'choose_argument', 'confidence': 0.4662541373947463}' and entities '[]'
2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 19 events
2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Current slot values:
        Learner_argument_after_highlight_slot_1: None
        Learner_type_thesis_slot_1: None
        essay_topic_slot: None
        requested_slot: essay_topic_slot
2018-07-19 19:26:29 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_argument': 1.0}]
2018-07-19 19:26:29 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-19 19:26:29 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-19 19:26:29 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_topic' with prob 0.93.
2018-07-19 19:26:29 DEBUG    actions  - -------essay_topic_slot---------
2018-07-19 19:26:29 DEBUG    actions  - bullying
2018-07-19 19:26:29 DEBUG    actions  - -------essay_topic_slot---------
2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: essay_topic_slot, value: bullying)']'
2018-07-19 19:26:29 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_argument': 1.0}, {'slot_essay_topic_slot_0': 1.0, 'prev_action_topic': 1.0, 'intent_choose_argument': 1.0}]
2018-07-19 19:26:29 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-19 19:26:29 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-19 19:26:29 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 0.69.
2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-19 19:26:29 DEBUG    rasa_core.processor  - Current topic: None

`` What is your topic? 2018-07-19 19:23:22 DEBUG rasa_core.processor - Bot utterance 'BotUttered(text: What is your topic?, data: null)' 2018-07-19 19:23:22 DEBUG rasa_core.processor - Action 'action_topic' ended with events '['SlotSet(key: requested_slot, value: essay_topic_slot)']' 2018-07-19 19:23:22 DEBUG rasa_core.policies.memoization - Current tracker state [{'intent_choose_argument': 1.0, 'prev_utter_choose_topic': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}] 2018-07-19 19:23:22 DEBUG rasa_core.policies.memoization - There is no memorised next action 2018-07-19 19:23:22 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_KerasPolicy 2018-07-19 19:23:22 DEBUG rasa_core.policies.ensemble - Predicted next action 'action_listen' with prob 1.00. 2018-07-19 19:23:22 DEBUG rasa_core.processor - Action 'action_listen' ended with events '[]' 2018-07-19 19:23:22 DEBUG rasa_core.processor - Current topic: None my topic is bullying 2018-07-19 19:23:37 DEBUG rasa_core.tracker_store - Recreating tracker for id 'default' 2018-07-19 19:23:37 WARNING py.warnings - C:\Users\e8180\Anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Usearray.size > 0` to check that an array is not empty.
if diff:

2018-07-19 19:23:37 DEBUG rasa_core.processor - Received user message 'my topic is bullying' with intent '{'name': 'choose_topic_yes_confirm', 'confidence': 0.2355609701897772}' and entities '[]'
2018-07-19 19:23:37 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 19 events
2018-07-19 19:23:37 DEBUG rasa_core.processor - Current slot values:
Learner_argument_after_highlight_slot_1: None
Learner_type_thesis_slot_1: None
essay_topic_slot: None
requested_slot: essay_topic_slot
2018-07-19 19:23:37 DEBUG rasa_core.policies.memoization - Current tracker state [{'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}]
2018-07-19 19:23:37 DEBUG rasa_core.policies.memoization - There is no memorised next action
2018-07-19 19:23:37 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_KerasPolicy
2018-07-19 19:23:37 DEBUG rasa_core.policies.ensemble - Predicted next action 'action_topic' with prob 0.94.
2018-07-19 19:23:37 DEBUG actions - -------essay_topic_slot---------
2018-07-19 19:23:37 DEBUG actions - my topic is bullying
2018-07-19 19:23:37 DEBUG actions - -------essay_topic_slot---------
2018-07-19 19:23:37 DEBUG rasa_core.processor - Action 'action_topic' ended with events '['SlotSet(key: essay_topic_slot, value: my topic is bullying)']'
2018-07-19 19:23:37 DEBUG rasa_core.policies.memoization - Current tracker state [{'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_topic_yes_confirm': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_topic_yes_confirm': 1.0, 'slot_essay_topic_slot_0': 1.0}]
2018-07-19 19:23:37 DEBUG rasa_core.policies.memoization - There is no memorised next action
2018-07-19 19:23:37 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_KerasPolicy
2018-07-19 19:23:37 DEBUG rasa_core.policies.ensemble - Predicted next action 'utter_read_highlight_topic_of_choice' with prob 0.58.
Now go back to the module with articles about my topic is bullying. Start hghlighting parts that interest you. Let me know when you are done. (type DONE)

**Content of domain file** (if used & relevant):
```yaml
intents:
  - greet
  - request_essay_help
  - choose_argument
  - choose_yes
  - choose_no
  - confirm_completion
  - learner_typetopic
  - Learner_type_argument_after_highlights
  - Learner_type_thesis
  - goodbye

actions:
- utter_greet
- utter_type_of_paper
- utter_choose_topic
- utter_ask_essay_topic
- utter_access_reading
- utter_skim_articles
- utter_read_highlight_topic_of_choice
- utter_show_highlights
- utter_ask_Learner_argument_after_highlight_slot_1
- utter_knowledge_what_thesis_statement
- utter_definition_thesis_statement
- utter_need_example_thesis_statement
- utter_ask_Learner_type_thesis_slot_1
- utter_confirm_thesis_arguable
- utter_whether_knowing_arguable
- utter_confirm_thesis_focused
- utter_whether_knowing_focused
- utter_definition_arguable_thesis
- utter_definition_focused_thesis
- utter_request_help_teacher
- utter_good_bye
- actions.ActionTopic
- actions.ActionArgument
- actions.ActionThesis

entities:
  - essay_topic
  - Learner_argument_after_highlight_slot_1
  - Learner_type_thesis_slot_1

slots:
  essay_topic:
    type: text
  Learner_argument_after_highlight_slot_1:
    type: text
  Learner_type_thesis_slot_1:
    type: text  
  requested_slot:
    type: unfeaturized

templates:
  utter_greet:
  - text: "How may I help you?"
  utter_type_of_paper:
  - text: "Okay, what type of paper? Here are some options of different types of essays that I can help you with"
    buttons:
    - title: "Compare & Contrast Essay"
      payload: "compare_contrast"
    - title: "Argumentative Essay"
      payload: "argue"
    - title: "Cause and Effect Essay"
      payload: "cause"
    - title: "Problem & Solution Essay"
      payload: "problem"
  utter_choose_topic:
  - text: "Okay, do you have a topic in mind?"
  utter_ask_essay_topic:
  - text: "What is your topic?"
  utter_access_reading:
  - text: "Access reading resources provided by your instructor ..link to canvas.. As you can see the articles are grouped into different modules. choose one or two modules you would be interested in. Let me know when you are done."
    buttons: 
    - title: "I am done"
      payload: "done"
  utter_skim_articles:
  - text: "Now skim the titles of articles under each module. Choose 3 to 4 articles under each module. Read each article. Let me know when you are done."
    buttons: 
    - title: "I am done"
      payload: "done"
  utter_read_highlight_topic_of_choice:
  - text: "Now go back to the module with articles about {essay_topic}. Start hghlighting parts that interest you. Let me know when you are done."
    buttons: 
    - title: "I am done"
      payload: "done"
  utter_show_highlights:
  - text: "Now Hers is the list of all the highlights you made. ..link to highlights... Now review the highlights to decide whether your position is for or against the topic about {essay_topic}. Let me know when you are done."
    buttons: 
    - title: "I am done"
      payload: "done"
...
...

nlu_data.md

## intent:Learner_type_topic
- [peer review](essay_topic)
- [motivation](essay_topic)
- [bullying](essay_topic)

## intent:Learner_type_argument_after_highlights
- [Bullying has negative impacts](Learner_argument_after_highlight_slot_1)
- [peer review helps improving critical thinking](Learner_argument_after_highlight_slot_1)
- [When learners highlight a text, there must be some metacognitive standards in their mind](Learner_argument_after_highlight_slot_1)

## intent:Learner_type_thesis
- [Bullying has negative impacts because bullying will damage students' socio-emotional development](Learner_type_thesis_slot_1)
- [In my essay, I will argue that technology will not help learners in real classrooms](Learner_type_thesis_slot_1)
- [When learners enagage in peer review, they should be able to learn how others can write](Learner_type_thesis_slot_1)

the story

## Generated Story 1420804508927600322
* greet
    - utter_greet
* request_essay_help
    - utter_type_of_paper
* choose_argument
    - utter_choose_topic
* choose_yes
    - action_topic
    - slot{"requested_slot": "essay_topic"}
* learner_typetopic
    - action_topic
    - slot{"essay_topic": "bullying"}
    - utter_read_highlight_topic_of_choice
* confirm_completion
    - utter_show_highlights
* confirm_completion
    - action_argument
    - slot{"requested_slot": "Learner_argument_after_highlight_slot_1"}
* Learner_type_argument_after_highlights
    - action_argument
    - slot{"Learner_argument_after_highlight_slot_1": "Bullying has negative impacts"}
    - utter_knowledge_what_thesis_statement
* choose_yes
    - action_thesis
    - slot{"requested_slot": "Learner_type_thesis_slot_1"}
* Learner_type_thesis
    - action_thesis
    - slot{"Learner_type_thesis_slot_1": "Bullying has negative impacts because bullying will damage students' socio-emotional development"}
    - utter_confirm_thesis_arguable
* choose_yes
    - utter_confirm_thesis_focused
* choose_yes
    - utter_good_bye

action.py

class BookingInfo(object):
    def save(self, essay_topic):
        logger.debug("-------essay_topic---------")
        logger.debug(format(essay_topic))
        logger.debug("-------essay_topic---------")

        return
...
...
...
class ActionTopic(FormAction):

    RANDOMIZE = False


    @staticmethod
    def required_fields():
        return [
            EntityFormField("essay_topic", "essay_topic")

        ]

    def name(self):
        return 'action_topic'

    def submit(self, dispatcher, tracker, domain):

        Bookinginfo = BookingInfo()
        booking = Bookinginfo.save(tracker.get_slot("essay_topic"))
        return
class ActionArgument(FormAction):

    RANDOMIZE = False


    @staticmethod
    def required_fields():
        return [
            FreeTextFormField("Learner_argument_after_highlight_slot_1")

        ]

    def name(self):
        return 'action_argument'

    def submit(self, dispatcher, tracker, domain):

        Argumenta_Info = ArgumentafInfo()
        booking = Argumenta_Info.save(tracker.get_slot("Learner_argument_after_highlight_slot_1"))

        return

class ActionThesis(FormAction):

    RANDOMIZE = False


    @staticmethod
    def required_fields():
        return [
            FreeTextFormField("Learner_type_thesis_slot_1")

        ]

    def name(self):
        return 'action_thesis'

    def submit(self, dispatcher, tracker, domain):

        Thesis_info = ThesisInfo()
        booking = Thesis_info.save(tracker.get_slot("Learner_type_thesis_slot_1"))

        return

my config_spacy.yml

language: "en"

pipeline:
- name: "nlp_spacy"
- name: "tokenizer_spacy"
- name: "ner_crf"
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"

Most helpful comment

I'm not sure what exactly you mean. But the way that's merged now is good. Given your whole sentence is an entity here, I'd say you can just get rid of entities completely and take the whole user utterance in your custom actions. e.g.

class ActionStoreTopic(Action):
  def name(self):
    return "action_store_topic"
  def run(self, dispatcher, tracker, domain):
    essay_topic = tracker.latest_message.text
    return([SlotSet('essay_topic', essay_topic)])

All 9 comments

It looks like you've labeled your NLU data incorrectly: please look at the examples here: http://rasa.com/docs/nlu/master/dataformat/

Thank you @akelad
We made a typo for the nlu data, we should use () instead

@akelad I'm not sure why it's not working again :\
I have updated the code of domain, nlu data, stories above.
But this time after I type bullying, the intent is wrong and the bot stops replying, it chose Learner_type_argument_after_highlights instead of learner_typetopic

What is your topic?
2018-07-20 02:07:34 DEBUG    rasa_core.processor  - Bot utterance 'BotUttered(text: What is your topic?, data: null)'
2018-07-20 02:07:34 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: requested_slot, value: essay_topic)']'
2018-07-20 02:07:34 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_utter_choose_topic': 1.0, 'intent_choose_argument': 1.0}, {'intent_choose_yes': 1.0, 'prev_action_listen': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}]
2018-07-20 02:07:34 DEBUG    rasa_core.policies.memoization  - There is a memorised next action '0'
2018-07-20 02:07:34 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2018-07-20 02:07:34 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 1.00.
2018-07-20 02:07:34 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-20 02:07:34 DEBUG    rasa_core.processor  - Current topic: None
bullying
2018-07-20 02:07:36 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
2018-07-20 02:07:36 WARNING  py.warnings  - C:\Users\e8180\Anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Received user message 'bullying' with intent '{'name': 'Learner_type_argument_after_highlights', 'confidence': 0.47189765157686125}' and entities '[]'
2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 19 events
2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Current slot values:
        Learner_argument_after_highlight_slot_1: None
        Learner_type_thesis_slot_1: None
        essay_topic: None
        requested_slot: essay_topic
2018-07-20 02:07:36 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'intent_choose_yes': 1.0, 'prev_action_listen': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}, {'intent_Learner_type_argument_after_highlights': 1.0, 'prev_action_listen': 1.0}]
2018-07-20 02:07:36 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-20 02:07:36 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-20 02:07:36 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_topic' with prob 0.97.
2018-07-20 02:07:36 DEBUG    actions  - -------essay_topic---------
2018-07-20 02:07:36 DEBUG    actions  - bullying
2018-07-20 02:07:36 DEBUG    actions  - -------essay_topic---------
2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: essay_topic, value: bullying)']'
2018-07-20 02:07:36 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}, {'intent_Learner_type_argument_after_highlights': 1.0, 'prev_action_listen': 1.0}, {'prev_action_topic': 1.0, 'slot_essay_topic_0': 1.0, 'intent_Learner_type_argument_after_highlights': 1.0}]
2018-07-20 02:07:36 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-20 02:07:36 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-20 02:07:36 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 0.61.
2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-20 02:07:36 DEBUG    rasa_core.processor  - Current topic: None

You probably don't have a story for this yet. In the story you provided there's no part where the intent Learner_type_argument_after_highlights follows the action action_topic.
So I guess the intent was misclassified - I'd say you have too few NLU examples. And the training data you posted all seems to overlap a bit - is there any reason not to just merge them into one?

@akelad Hi, I do have those actions but I didn't post before. Sorry about that, now I have updated them ActionArgument & ActionThesis in the actions.py part in my first comment.
So from my story, after the user types bullying, it should run action_topic to store the slot and - utter_read_highlight_topic_of_choice. Then ask a user to confirm >> * confirm_completion. But it stops and it chose the wrong intent for the essay topic Learner_type_argument_after_highlights and the debug says rasa_core.policies.memoization - There is no memorised next action.

So I have three examples for each intent:


    • learner_typetopic


    • Learner_type_argument_after_highlights


    • Learner_type_thesis

To answer your question about

is there any reason not to just merge them into one?

Yes, because essay topic is different to an essay argument or thesis statement.
An essay argument or thesis statement could have 1 or 2 sentences, but essay topic could only have one word or one sentence like "my topic is xxx". That's why we did not merge them. And a keyword in an essay topic can overlap in the essay argument or thesis statement since when we write an essay, we have to refer back to the topic.
Is there another way to solve this problem?

I've checked the debug document you told me.
This time I also added a few more nlu data into intent:learner_typetopic
So it looks like:

## intent:learner_typetopic
- [peer review](essay_topic)
- [motivation](essay_topic)
- [bullying](essay_topic)
- My topic is [bullying](essay_topic)
- the topic is [bullying](essay_topic)
- [bullying](essay_topic) is my topic 
- topic is [bullying](essay_topic)
- My topic is [peer review](essay_topic)
- the topic is [peer review](essay_topic)
- [peer review](essay_topic) is my topic 
- topic is [peer review](essay_topic)
- My topic is [motivation](essay_topic)
- the topic is [motivation](essay_topic)
- [motivation](essay_topic) is my topic 
- topic is [motivation](essay_topic)

My question is that is it okay to build the nlu data like this format? sometimes it only has a keyword, but sometimes it is with a sentence because when I added more sentences into this intent instead of only one keyword. It does not run to the next path and it shows policy_1_KerasPolicy issue.
I have also updated my spacy model in my first comment, so if I use the model with only three nlu data (single keyword) in the intent:learner_typetopic, the bot can run.
Also, in my stories, should I use 1 or 2 to fill in the slot?

1.
* learner_typetopic
    - action_topic
    - slot{"essay_topic": "bullying"}
    - utter_read_highlight_topic_of_choice
2.
* learner_typetopic
    - action_topic
    - slot{"essay_topic": "/learner_typetopic"}
    - utter_read_highlight_topic_of_choice

debug mode:

What is your topic?
2018-07-20 15:20:45 DEBUG    rasa_core.processor  - Bot utterance 'BotUttered(text: What is your topic?, data: null)'
2018-07-20 15:20:45 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: requested_slot, value: essay_topic)']'
2018-07-20 15:20:45 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_utter_choose_topic': 1.0, 'intent_choose_argument': 1.0}, {'prev_action_listen': 1.0, 'intent_choose_yes': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}]
2018-07-20 15:20:45 DEBUG    rasa_core.policies.memoization  - There is a memorised next action '0'
2018-07-20 15:20:45 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2018-07-20 15:20:45 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 1.00.
2018-07-20 15:20:45 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-20 15:20:45 DEBUG    rasa_core.processor  - Current topic: None
bullying
2018-07-20 15:20:49 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Received user message 'bullying' with intent '{'name': 'learner_typetopic', 'confidence': 0.9535120725631714}' and entities '[{'start': 0, 'end': 8, 'value': 'bullying', 'entity': 'essay_topic', 'confidence': 0.7322899434676684, 'extractor': 'ner_crf'}]'
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 20 events
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Current slot values:
        Learner_argument_after_highlight_slot_1: None
        Learner_type_thesis_slot_1: None
        essay_topic: bullying
        requested_slot: essay_topic
2018-07-20 15:20:49 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_action_listen': 1.0, 'intent_choose_yes': 1.0}, {'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}, {'entity_essay_topic': 1.0, 'slot_essay_topic_0': 1.0, 'prev_action_listen': 1.0, 'intent_learner_typetopic': 1.0}]
2018-07-20 15:20:49 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-20 15:20:49 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-20 15:20:49 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_topic' with prob 0.91.
2018-07-20 15:20:49 DEBUG    actions  - -------essay_topic---------
2018-07-20 15:20:49 DEBUG    actions  - bullying
2018-07-20 15:20:49 DEBUG    actions  - -------essay_topic---------
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Action 'action_topic' ended with events '['SlotSet(key: essay_topic, value: bullying)']'
2018-07-20 15:20:49 DEBUG    rasa_core.policies.memoization  - Current tracker state [{'prev_action_topic': 1.0, 'intent_choose_yes': 1.0}, {'entity_essay_topic': 1.0, 'slot_essay_topic_0': 1.0, 'prev_action_listen': 1.0, 'intent_learner_typetopic': 1.0}, {'entity_essay_topic': 1.0, 'slot_essay_topic_0': 1.0, 'intent_learner_typetopic': 1.0, 'prev_action_topic': 1.0}]
2018-07-20 15:20:49 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2018-07-20 15:20:49 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2018-07-20 15:20:49 DEBUG    rasa_core.policies.ensemble  - Predicted next action 'action_listen' with prob 0.74.
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
2018-07-20 15:20:49 DEBUG    rasa_core.processor  - Current topic: None

I understand that essay topic and essay argument etc are different things, but from the flow of your conversation I don't see a reason not to merge those intents. You can just make it a general intent like provide_essay_information for example. This will make NLU a lot more consistent. If you want to make sure the topic/argument are of the correct length or similar, then this should be done in a custom action.

@akelad thanks for getting back to me.
Isn't the way I construct action.py a custom action for getting slots of essay topic, argument, and thesis statement?

Also, when you suggested merge them into one intent, will it look like this?? But isn't in this way, still need to use a custome action to get the slot value like the way I did?

Intent:provide_essay_information
## intent:Learner_type_topic
- [peer review](essay_topic)
- [motivation](essay_topic)
- [bullying](essay_topic)
- [Bullying has negative impacts](Learner_argument_after_highlight_slot_1)
- [peer review helps improving critical thinking](Learner_argument_after_highlight_slot_1)
- [When learners highlight a text, there must be some metacognitive standards in their mind](Learner_argument_after_highlight_slot_1)
- [Bullying has negative impacts because bullying will damage students' socio-emotional development](Learner_type_thesis_slot_1)
- [In my essay, I will argue that technology will not help learners in real classrooms](Learner_type_thesis_slot_1)
- [When learners enagage in peer review, they should be able to learn how others can write](Learner_type_thesis_slot_1)

I'm not sure what exactly you mean. But the way that's merged now is good. Given your whole sentence is an entity here, I'd say you can just get rid of entities completely and take the whole user utterance in your custom actions. e.g.

class ActionStoreTopic(Action):
  def name(self):
    return "action_store_topic"
  def run(self, dispatcher, tracker, domain):
    essay_topic = tracker.latest_message.text
    return([SlotSet('essay_topic', essay_topic)])
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nahidalam picture nahidalam  路  3Comments

nikhilcss97 picture nikhilcss97  路  3Comments

Jasperty picture Jasperty  路  3Comments

Poojan66 picture Poojan66  路  3Comments

yondu22 picture yondu22  路  3Comments