Hello,
I use the DucklingEntityExtractor for extracting money amount statements, and struggling with extracting the currency into a slot.
Duckling pipeline definition:
- name: DucklingEntityExtractor
url: http://localhost:8000
dimensions:
- amount-of-money
locale:
- nl_NL
- en_US
amount-of-money
entity contains the following information:
[{'start': 0, 'end': 7, 'text': '€444.44', 'value': 444.44, 'confidence': 1.0, 'additional_info': {'value': 444.44, 'type': 'value', 'unit': 'EUR'}, 'entity': 'amount-of-money', 'extractor': 'DucklingEntityExtractor'}]
(
I’ve extracted it by running the following command:
tracker.__dict__['latest_message']['entities']
)
I write the amount-of-money
entity into a slot, using the following slot definition:
amount_of_money:
type: any
mappings:
- type: from_entity
entity: amount-of-money
As you can see, the currency is properly detected and stored in ['additional info']['unit']
.
My question is how can I extract the currency into a slot? What is the most recommended way? Is there a native way of doing it, without having to use a custom action?