How To Add Basic Hotel Booking to Chat

In the past years, we’ve seen an explosion of chat bots across multiple industries. Many times we are asked what can a chat bot do, and how would it benefit our product? In our experience, chat bots need to be tailored specifically to what a client would want otherwise, there is a very generic feeling to these bots (much like calling into an automated call center). So how can we make a bot succeed in an area crowded with thousands of existing bots?

Integrate with a natural language processing service

The first key to building a successful chat bot is by making sure the bot is powered by a natural language processing service — whether that is internal or a 3rd party service like wit.ai. This allows users to provide a variety of different questions and phrases while allowing you to focus on the decision-making process. Sometimes we see bots powered by regex expressions, this has a few issues:

  • Forces the user give specific guided questions
  • Variations in the question format are generally not handled
  • You can easily lose context when a user is talking in an abstract manner

Services like wit.ai remove the hassle of parsing and recognizing phrases. They allow you to create story-based decision trees that automatically interpret user input based on the criteria you give it. For example below is a simple “I want to book a hotel” scenario that a chatbot might need to handle.

wit.ai story example

In the example above, you can see that we will tell wit.ai the user will ask the question “I want to book a hotel in California” and then tell it to extract information from the phrase like “book a hotel,” which is our agenda item, and “California,” which is our location. With this single instruction wit.ai can already accept a wide variety of questions from the user. For example, all of the following would now be supported:

  • Can I book a hotel in Miami?
  • I want to book a hotel in New York
  • I need to book a hotel in Wisconsin

We then tell wit.ai to pass the agenda item and location to our “searchForHotels” function which will return a search result that can be sent back to our user (as seen in the bot response). All of this setup took less than 15 minutes to generate this storyboard on wit.ai.

Move beyond static answers and plain text responses

Following up from the example above a very common thing we see in chat bots is the fact most bots will simply return plain text responses without any rich media. Thankfully, messaging platforms are improving this and companies like Facebook are offering new ways to deliver rich content to users on their platform. For example, if you asked “I want to book a hotel in New York,” you would probably want a list of hotels with images, pricing, and location data rather than just a text response giving you a hotel name and phone number.

Interactive chat bot experience on Facebook Messenger

If you are implementing a custom chatbot on your site then you have even more creative freedom over what type of rich media you deliver to your end users (such as mailto:// links, anchor links to other pages, etc.)

Improve your bots accuracy and understanding by training it

After you’ve designed your bot and implemented its story and backend service you will want to train it. This is a very important step that should not be skipped. Training your bot allows it to accept a wider range of questions and increases its accuracy when parsing user input. Let’s look at a common problem that can occur on an untrained system.

In the above example, you can see the phrase “Can I book that first hotel?” we use this phrase to have the user select which hotel they want to book in the carousel images. The most important piece of information we want to extract from the phrase is “that first” which will be converted to an ordinal/index number 1. However, if the user submits “Can I book the first hotel?” wit.ai will think “the first” means “the first of the month” and convert it to a date value. Thus, we need to train the system to recognize that this phrase is expecting to find an ordinal value and not a DateTime value. These subtle differences seem small but can have a huge impact on the user experience if left unchecked.

Luckily services like wit.ai provide a simple interface to train your bots learning by providing a validation screen for user input that has been submitted to your bot.

wit.ai understanding

Therefore you can quickly adjust and reassign extracted variables into their correct categories and then hit the “validate” button to force wit.ai to preference that association.

Key takeaways

As the chatbot phenomenon continues to grow, language recognition and response will get more innovative and allow for more personal and realistic conversations between users and companies. We believe that services like wit.ai will only continue to get better and platforms like Facebook Messenger will provide the perfect groundwork for automating a lot of the daily issues facing leisure and business travelers as well as the brands accommodating them.

Categories
Technology