Duckling, and filling slots

Hi People,

I am relatively new to using rasa, and I am presently using duckling to extract values, and I was expecting to have such value assigned to intended slot:

Please see below log from the terminal:

Here the correct intent has been identified, and, the entity has been extracted and interpreted correctly, but it is not being assigned to the slot, as I would expect.

Other extractors work fine (for example if in the above case I wrote “about a hundred”, or “about 50”), but duckling doesn’t seem to assign the interpreted value to the desired slot:

NB: In the above case, training data is arranged as follows:

## intent:inform_budget_approximate
- around [150.00](budget_approximate) bucks
- something like [100](budget_approximate)
- [50.00](budget_approximate)
- [60](budget_approximate) approx.
- approx [75.00](budget_approximate)
- I dunno, something like $[50](budget_approximate)
- something around [60.00](budget_approximate)
- in the vicinity of [200.00](budget_approximate)
- [100](budget_approximate) ballpark 
- ballpark figure of [100.00](budget_approximate) 
- about [150](budget_approximate)
- something about [100.0](budget_approximate)
- [10000.00](budget_approximate)
- [1000](budget_approximate)
- [100](budget_approximate)
- [10](budget_approximate)
- [1](budget_approximate)
- approximately [100](budget_approximate)
- about [one hundred](budget_approximate:100)
- i want to spend about a [hundred](budget_approximate:100)
- something like [fifty](budget_approximate:50)
- [one hundred](budget_approximate:100)
- [fifty](budget_approximate:50)

I would greatly appreciate some instructions / advise here.

Many Thanks. Love rasa so far.

Hi! If you’re using duckling to extract the numbers, you actually don’t need to label the training data. what you should do is have a custom action that will check for e.g. a number entity and fill the slot with that entity. or you could use forms, and in the slot mappings, fill the slot from the “number” entity.


For example, if you let duckling extract a “duration”, your slot_mapping method could implement:

return {
    "duration": self.from_entity(entity="duration")

then it would be extracted and set automatically, but only if you set this entity up in config.yml:

- dimensions:
  - time
  - duration
  locale: de_DE
  name: DucklingHTTPExtractor
  timezone: Europe/Berlin
  url: http://localhost:8001

Hope that helps aswell!


@ADPowers @JulianGerhard is correct, and what I mean by not having the names match up is that your slot mapping could be, e.g.

return {
    "budget_approximate": [

this use case is very similar to something we do in our demobot here

1 Like