How to use DucklingHTTPExtractor?

I’m trying to extract entities using `DucklingHTTPExtractor. Here is the relevant code:

pipeline: 
- name: "SpacyNLP"
- name: "SpacyTokenizer"
- name: "RegexFeaturizer"
- name: "SpacyFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "SklearnIntentClassifier"
- name: "DucklingHTTPExtractor"
  # url of the running duckling server
  url: "http://localhost:8000"
  # dimensions to extract
  dimensions: ["email", "time", "date", "amount-of-money", "distance", "currency"]
  # allows you to configure the locale, by default the language is
  # used
  locale: "NL_Nothing"
  # if not set the default timezone of Duckling is going to be used
  # needed to calculate dates from relative expressions like "tomorrow"
  timezone: "US/Pacific"

domain :

intents:
- input_date

entities:
- date

slots:
  date:
    type: unfeaturized

templates:
  utter_date:
  - text: '{date}'

Stories:

## test
* input_date{"date" : "tomorrow"}
 - utter_date

Duckling server is running on 8000.

When i enter “tomorrow” - the bot sets the date slot to “tomorrow”.

How do i make duckling set it to the tomorrow’s date : Wednesday, 21 August 2019 as it does here : https://duckling.wit.ai/

Thanks!

Can you run the server with --debug? Is there any log output in there?

I got this one to work Trying to extract another entity type - money.

Input value : $3356

Getting the value for the slot amount-of-money in a custom action, can we get the currency in a slot as well ?

Thanks

@souvikg10 suggestions please ?

We did it through a custom action , setting the currency after extracting it from the entities object of the tracker.

Did you define an entity and add annotated examples for the currency? Couldn’t make that work with duckling plugged in.

Weird, for us we used duckling and it provided amount-of-money, i even wrote the duckling regex in the official repo for amount-of-money (for dutch and french)

1 Like