A WhatsApp travel chatbot for live train information across 2,500 stations

A WhatsApp travel chatbot for live train information across 2,500 stations

Key Technologies
  • Azure Cognitive Services
  • Azure Service Bus
  • Cosmos DB
  • Azure Application Insights
  • WhatsApp Integration

Client 

Northern Trains is a train operating company that provides services across the North of England. With over 500 calling stations, the company connects major cities like Manchester, Leeds and Newcastle. The company plays a crucial role in facilitating transportation and commuting for thousands of passengers every day.

Background 

Northern Trains was facing a high volume of customer service calls related to journey planning. This involved supporting passengers not only during their train journey but also assisting them in reaching their final destination, which could include remote locations where arranging transportation like taxis was necessary. The company, therefore, recognised the need to enhance their customer service offerings by providing a more robust end-to-end transport experience. 

While the immediate focus would be providing real-time train departure information specific to destination stations, the transport provider also aimed to enhance signposting for various types of assistance, with improved capabilities for handling general customer requests, complaints, refunds and more. 

The main objective of this project was to create a tool which could reduce the workload on the customer service team while maintaining a seamless customer experience. To help with this initiative, Northern partnered with leading software development company Audacia, whose experience delivering large-scale technology projects and expertise in artificial intelligence and machine learning made them a suitable collaborator for this project. 

Solution

Audacia partnered with Northern to create a WhatsApp chatbot using natural language processing that is capable of handling customer requests related to live train data. Akin to a live departure board found at a train station, the tool is tailored to display relevant train schedules, including any disruptions. The WhatsApp chatbot can, additionally, provide contact details for local taxi operators at a customer's destination station. 

This functionality enables customers to, for example, receive live departure information with a message such as:

“When is the next train from Leeds to Manchester?”

Azure Cognitive Services, specifically the Language Studio component, was chosen as the preferred technology for this project due to its advanced conversational language understanding capabilities and ease-of-use. 

Azure Cognitive Services is a part of the Azure AI Cloud Services, and its Language Studio component provides a robust and intuitive platform for building, training and deploying language models. 

This tool also aligned with the client’s existing technology stack, which would give them the flexibility to integrate the solution with other technologies in the future. The chatbot was built by creating intents and utterances that define how the model processes customer requests.

Here is a breakdown of how the chatbot was built using Azure Cognitive Services:

1. Adding data

The data input process into Language Studio involved creating intents related to requests for journey planning:

Northern AI Chatbot Project Example Table

2. Labelling the data

Language Studio requires labelled examples to improve its understanding of these utterances. At this stage an example utterance was provided, and relevant entities were labelled (e.g. departure destination and arrival destination). The model is then able to gain a better understanding of the different entities that make up each request.

For this project, state management was implemented in order to deliver a customer experience that replicated the service provided by the support team. Conversation context is handled manually in code, which enables the model to more accurately the context of the ongoing conversation. 

3. Training the model

Utterances are split into a training set and a testing set. The model uses phrases in the testing set to test whether it can correctly identify entities within an utterance. Users can then monitor model performance according to how accurately it identifies intents and entities.

Language Studio provides the functionality to evaluate testing sets. This allows users to see where the model is struggling to correctly identify entities. This information can then be used to improve the model’s accuracy by refining the utterances and entities within the training set.

For instance, during the evaluation, a noticeable pattern emerged that a significant number of failures are associated with text containing brackets. This issue was proactively addressed by augmenting the training set with additional cases that included brackets in the station names. This approach then facilitated the model’s ability to learn and adapt to such patterns, further improving its performance in handling queries involving bracketed text.

4. Refining the model

Language Studio’s insights and metrics help to evaluate the model’s recall and decision stats. These features enabled the chatbot to be iteratively refined, in turn, enhancing its accuracy in understanding and responding to user queries. Two training options, basic and advanced are available, with advanced offering greater capabilities at a higher cost and longer training duration. 

Results

Live arrival and departure information for over 2500 stations across the UK
Capable of recognising all CRS station codes
Trained and tested on 22,000 utterances relating to customer interaction

By leveraging Language Studio’s natural language processing capabilities within Azure Cognitive Services, the WhatsApp chatbot can understand and interpret customer queries relating to live train data.

With the release of this tool, Northern has simplified the process of accessing live train information for customers. This automated chat function provides customers with immediate access to live train updates, particularly important during instances of service disruptions, to significantly streamline the journey planning process. This responsiveness empowers passengers to make informed decisions and adapt their plans in a timely manner.

The chatbot’s capabilities extend beyond real-time journey updates, too. Through seamless integration with Northern's website, customers can access additional information and answers to their queries. This holistic approach to customer support further enriches the passenger experience to ensure a fully informative interaction. 

The current implementation focuses on providing immediate information about live train data, prioritising real-time updates and enabling customers to receive contact details for onward connections by local taxi at their destination station. However, the future potential of the chatbot is significant. 

By analysing user inputs, the system could identify common queries and intents, enabling further improvements and personalised services. For example, recognising frequent requests for booking assistance at destination stations, the model could offer a specific option to book passenger assistance, simplifying the process for customers.

AI Chatbot Project WhatsApp Screenshot

Find out more about the Northern WhatsApp service.

Users can get started with the WhatsApp service by adding 07870 606060 as a contact and starting a conversation on WhatsApp by messaging a simple “Hi” or “Hello”.

From here you can select from a menu to get live information on trains and taxis by sending a message based on departure and arrival stations. For example:

When is the next train from Leeds to London Kings Cross”.