4

Any pointers on how to pass a date/time reference to a basic, vanilla duckling server?

I'm using duckling for parsing text. When looking for time expressions, I need to pass in a reference date/time.

A reference date/time gives me an anchor for expressions like "yesterday" and "today."

e.g.

reference date = April 1, 2018 => "1 week ago" = March 25, 2018.

reference time = April 1, 2018, 3pm => "in 8 hours" = April 1, 2018, 11pm

The duckling repo site has instructions on how to make a basic server run locally, that you can then call with

curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_GB&text=tomorrow at eight'

but not many more examples are provided that I could find. I can see in ExampleMain.hs that dims and lang are also options as parameters along text and locale, but nothing on reference date.

arturomp
  • 28,790
  • 10
  • 43
  • 72

1 Answers1

3
curl -XPOST http://0.0.0.0:8000/parse --data 'locale=en_GB&text=tomorrow at eight&reftime=<unix epoch in millisecond>'

Reference:

https://github.com/facebook/duckling/issues/166

anas17in
  • 161
  • 9