# Duckling Time Extraction

**URL:** <https://forum.rasa.com/t/duckling-time-extraction/48479>\
**Category:** Rasa Open Source\
**Created:** [October 13, 2021, 5:35pm UTC](https://forum.rasa.com/t/duckling-time-extraction/48479 "2021-10-13T17:35:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhi](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@abhi](https://forum.rasa.com/u/abhi)\
**Post date:** [October 13, 2021, 5:35pm UTC](https://forum.rasa.com/t/duckling-time-extraction/48479/1 "2021-10-13T17:35:46Z")

</div>

Hello!

I am currently using duckling to extract time values to create appointment. Since a person is allowed to send this message as two different messages, there are time when the messages come as the following:

– Can I come in tomorrow

– Sure what time?

– 3PM

This would create an appointment at 3PM tomorrow b/c duckling is able to extract tomorrow in the first message and 3PM in the second message.

However, if the time is given as just ‘3’, the time entity is not extracted by duckling.

Is it possible to have duckling recognize a single number (such as 3) as a time?

Thank you!!

Abhi

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [October 14, 2021, 10:55am UTC](https://forum.rasa.com/t/duckling-time-extraction/48479/2 "2021-10-14T10:55:09Z")

</div>

Hey @abhi, great question! Whether `3` is a time or a number of pizza slices, and whether it means `3pm` or `3am`, depends on the context. And Duckling doesn’t know this context, so it can’t help you directly 😉

What you can do is to extract not just times but also numbers with Duckling (i.e. `dimensions: ["time", "number", ...]`. Assuming your bot asks about the time within a form, you’d then create a form validation action in which you can do some clever post-processing of the extracted `number` entity (e.g. add `pm` or `am` to it) and fill your `time` slot accordingly.

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![abhi](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@abhi](https://forum.rasa.com/u/abhi)\
**Post date:** [October 14, 2021, 5:05pm UTC](https://forum.rasa.com/t/duckling-time-extraction/48479/3 "2021-10-14T17:05:14Z")

</div>

Hey @SamS!

That makes a lot of sense. That is one of the routes I realized I might have to take. I wanted to be sure there wasn’t something else that I could do beyond treating it like a number and processing it. I will make that change and see how it works!

Thank you for the help!!!

Abhi

---

<div class="post-metadata">

**Author:** ![AdamMuello](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@AdamMuello](https://forum.rasa.com/u/AdamMuello)\
**Post date:** [October 18, 2021, 10:10am UTC](https://forum.rasa.com/t/duckling-time-extraction/48479/4 "2021-10-18T10:10:10Z")

</div>

Hey thanks for the super helpful reply. I’m not sure how I missed that thread. I haven’t quite mastered the search function on here. The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. Thanks I am going to bookmark this [http://forum.rasa.com/t/duckling-time-extraction/48479/](http://forum.rasa.com/t/duckling-time-extraction/48479-)[reviews/](https://eightyreviews.com/).
