Working with durations

Hi,

I am currently working on a bot which let’s users book hotel rooms in german. In this domain I am facing troubles when it comes to handling duration properly.

The bot is in german, but the issue I am facing should be the same in english. Image the following chat:

User: Hi
Bot: Hi, I am a bot and I can help you book hotel rooms.
User: Hi, I need a room next monday until friday.
Bot: Ok, let me check if there are free rooms . . .
(Bot queries api to check if rooms are available)

an alternative chat could be:

User: Hi
Bot: Hi, I am a bot and I can help you book hotel rooms.
User: Hi, I need a room.
Bot: Ok, can you please tell me when you need the room?
User: I need the room for next monday.
Bot: Sure, how long will you be staying? 
User: For two nights.
Bot: Ok, let me check if there are free rooms . . . 
(Bot queries api to check if rooms are available)

My Questions are:

  • How should I define the duration (as seen in both chats) properly?
  • How can I extend the parsing to understand “two nights” as a duration while using duckling?

Sidenote: I am currently using duckling which could extract an Interval from “Hi, I need a room next monday until friday”. However in the second scenario the information is split into two sentences, so using duckling would not work.

Thanks in advance,

Andreas