How do chatbots work?
When visiting a website or online resource, it’s increasingly common for a sound effect to herald the appearance of a pop-up window, containing a question like “Can I help?” or “What are you looking for?”. It’s often accompanied by a thumbnail photo of a person, yet you’re actually being greeted by a chatbot – reducing the need for customer-facing staff by delegating basic services to an algorithm.
The word ‘bot’ describes a piece of software that performs a single repetitive task, and chatbots are designed to simulate human conversation. They provide programmed responses to user inputs, attempting to resolve common queries. The challenge for any chatbot involves interpreting those inputs and questions, before interrogating a database of pre-prepared responses. Having matched the input string to the most appropriate response, the latter is then presented as an answer.
From simple scripts to natural language processing
Like many online services, chatbots evolved from rudimentary beginnings. Early examples were notorious for displaying irrelevant responses, while struggling to understand abbreviations or colloquialisms. The introduction of machine learning helped expand the database of predefined scripts chatbots can interrogate. For instance, modern chatbots are programmed to redirect unknown queries to a human, while simultaneously recording this failed interaction. Conversation logs are fed back into the databases powering the bots, so they can see how a transferred query was eventually handled by a human. This helps them to replicate a similar approach in future.
Basic rule-based chatbots allow users to choose from predefined options, following a hierarchical path to ensure every journey reaches a defined (if limited) conclusion. More sophisticated bots support pattern matching for open-ended inputs, with smart feedback loops seeking clarification – “did you mean X?”, for instance. Certain words or phrases act as identifying tags, which are linked to pre-programmed responses, and the bot selects what it evaluates to be the most pertinent option. Rules can also help here too; enquiries containing the word ‘complain’ might lead the bot to automatically defer to a human operator.
Modern chatbots use natural language processing (NLP) to break a statement into structured data pieces – identifying potential spelling mistakes or separating verbs from nouns. They can often distinguish tenses (“I had a booking” versus “I want to make a booking”), or recognise sentiments like frustration, which may benefit from human intervention. NLP involves two processes – converting input strings into the aforementioned structured data, before transforming that data into a written or verbal response. It also involves distinguishing intents (required actions or requested information) from entities such as booking references or account numbers.
Two related branches of software underpin modern chatbots like IBM’s Watson and Microsoft’s Language Understanding:
- Machine learning allows the bot to learn from available information and make judgements about how to respond, based on identifying tags. Machine learning bots evolve and mature through use.
- Artificial intelligence (AI) powered bots are able to evaluate context and refer back to previous statements in a conversation – such as not requiring someone to input their account details more than once.
Chatbots lend a helping hand
Cutting-edge bots combine machine learning, AL and NLP to accurately replicate the forms of interaction you might expect if a person was responding to enquiries. A cognitive behavioural therapy chatbot developed by Stanford University has successfully been used during the pandemic to improve the mental health of young people, while WHO’s Health Alert bot on WhatsApp offers everything from international travel advice to fake news myth-busting. Tech giants like eBay and Lyft have developed industry-leading chatbots that work across multiple platforms and minimise the time required to complete an action. It’s thanks to the combined power of machine learning, AI and NLP that these conversations can now successfully be outsourced to computers, rather than to people.
Keep up-to-date with Ingenia for free
SubscribeRelated content
Software & computer science
Pushing the barriers to model complex processes
In 2007, Imperial College London spinout Process Systems Enterprise Ltd won the MacRobert Award for its gPROMS (general-purpose PROcess Modelling System) software. Costas Pantelides and Mark Matzopoulos, two of the key people behind the success of gPROMS, tell how they created a way in which engineers can harness physics, chemistry and engineering knowledge within a framework that solves highly complex mathematical problems.
Compact atomic clocks
Over the last five decades, the passage of time has been defined by room-sized atomic clocks that are now stable to one second in 100 million years. Experts from the Time and Frequency Group and the past president of the Institute of Physics describe a new generation of miniature atomic clocks that promise the next revolution in timekeeping.
The rise and rise of GPUs
The technology used to bring 3D video games to the personal computer and to the mobile phone is to take on more computing duties. How have UK companies such as ARM and ImaginationTechnologies contributed to the movement?
EU clarifies the European parameters of data protection
The European Union’s General Data Protection Regulation, due for adoption this year, is intended to harmonise data protection laws across the EU. What are the engineering implications and legal ramifications of the new regulatory regime?
Other content from Ingenia
Quick read
- Environment & sustainability
- Opinion
A young engineer’s perspective on the good, the bad and the ugly of COP27
- Environment & sustainability
- Issue 95
How do we pay for net zero technologies?
Quick read
- Transport
- Mechanical
- How I got here
Electrifying trains and STEMAZING outreach
- Civil & structural
- Environment & sustainability
- Issue 95