Slot not getting filled with slot mappings in Form Action

Hi Team, While executing the rasa with two entity extractors (CRFEntityExtractor & DucklingHTTPExtractor), entities are detected correctly. But the detected values are not getting assigned to the slots through slot mappings in FormAction. Following are the entities detected.

        "intent": {
            "name": "add_status",
            "confidence": 1.0
        }, 
        "entities": [
            {
                "start": 0,
                "end": 5,
                "value": "Today",
                "entity": "status_date",
                "confidence": 0.8229099433,
                "extractor": "CRFEntityExtractor"
            },
            {
                "start": 18,
                "end": 30,
                "value": "rasa chatbot",
                "entity": "status_description",
                "confidence": 0.8650443331,
                "extractor": "CRFEntityExtractor"
            },
            {
                "start": 35,
                "end": 45,
                "value": "four hours",
                "entity": "status_time_spent",
                "confidence": 0.6227528202,
                "extractor": "CRFEntityExtractor"
            },
            {
                "start": 49,
                "end": 65,
                "value": "AI/ML enablement",
                "entity": "status_project_details",
                "confidence": 0.8778220438,
                "extractor": "CRFEntityExtractor"
            },
            {
                "start": 0,
                "end": 5,
                "text": "Today",
                "value": "2019-12-31T00:00:00.000-08:00",
                "confidence": 1.0,
                "additional_info": {
                    "values": [
                        {
                            "value": "2019-12-31T00:00:00.000-08:00",
                            "grain": "day",
                            "type": "value"
                        }
                    ],
                    "value": "2019-12-31T00:00:00.000-08:00",
                    "grain": "day",
                    "type": "value"
                },
                "entity": "time",
                "extractor": "DucklingHTTPExtractor"
            },
            {
                "start": 35,
                "end": 45,
                "text": "four hours",
                "value": 4,
                "confidence": 1.0,
                "additional_info": {
                    "value": 4,
                    "hour": 4,
                    "type": "value",
                    "unit": "hour",
                    "normalized": {
                        "value": 14400,
                        "unit": "second"
                    }
                },
                "entity": "duration",
                "extractor": "DucklingHTTPExtractor"
            }
        ],
        "intent_ranking": [
            {
                "name": "add_status",
                "confidence": 1.0
            },
            {
                "name": "goodbye",
                "confidence": 0.0000000012
            },
            {
                "name": "greet",
                "confidence": 0.0
            }
        ],
        "text": "Today i worked on rasa chatbot for four hours in AI/ML enablement"

Following is my actions.py file

Any suggestions would be really helpful.

@Tobias_Wochinger @JulianGerhard @stephens

Regards Hari

Hi @harieharaan,

can you please show the corresponding domain.yml entry for those slots - meaning how you defined them?

Regards Julian

Hi @JulianGerhard ,

Following are the contents of my domain.yml

intents:
- greet
- goodbye
- add_status

entities:
- status_date
- status_description
- status_time_spent
- status_project_details
- time
- duration

slots:
  time:
    type: unfeaturized
  status_description:
    type: unfeaturized
  status_project_details:
    type: unfeaturized
  duration:
    type: unfeaturized

templates:
  utter_greet:
  - text: Hey! How are you?
  utter_goodbye:
  - text: Bye
  utter_ask_status_date:
  - text: Enter the date that you worked for...
  utter_ask_status_description:
  - text: Enter the status description...
  utter_ask_status_time_spent:
  - text: Enter the number of hours spent...
  utter_ask_status_project_details:
  - text: Enter the project details please...

actions:
- utter_greet
- utter_goodbye
- utter_ask_status_date
- utter_ask_status_description
- utter_ask_status_time_spent
- utter_ask_status_project_details

forms:
- status_form

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

Thanks

Hi @harieharaan,

can you please - just as one example - change the definition of time to:

slots:
  time:
    type: unfeaturized
    auto_fill: 1

and see if it works? If not, could you please start the bot with the "-vv" flag and post the conversation here for the given slot? Also could you please post the content of your config.yml ?

Regards
Julian

Try changing the line

"status_date": [self.from_entity(entity="time")],

to

"status_date": [self.from_entity(entity="time"), self.from_entity(entity="status_date")],

Hi @JulianGerhard,

I got the point if the slot name and entity name are the same, the slot will get filled automatically when it encounters the entity with entity name. But in my Use case, I want the status date extracted by the duckling extractor with the entity name “time” to be set in status date slot rather than the one extracted by the CRF entity extractor. That’s what I’m trying to achieve using slot mappings. Correct me if my approach is wrong

Following are the logs and contents of config file

Logs:

Config:

23%20AM

Domain file: domain.yml (1.0 KB)

Thanks

Hi @harieharaan,

I got it. After investigating your logs, everything is set fine - isn’t it?

But in my Use case, I want the status date extracted by the duckling extractor with the entity name “time” to be set in status date slot rather than the one extracted by the CRF entity extractor.

The slot mapping:

"status_date": [self.from_entity(entity="time")],

would cause the slot status_date ONLY be set with an entity called time - no matter what the CRFEntityExtractor would extract - except the case that you defined a custom slot called time aswell - I’d avoid that if I were you.

So does everything work now? If not, please describe again (with an example) what is not working at the moment - then we could properly help you.

Kind regards
Julian

1 Like