Search:
|
Access:
» Making chatbots usefulRelated categories: Artificial intelligence | Programming in generall David BurdenViewed: 3778 | Article date: 2006-05-13 17:32:48 There are a wide number of approaches to the development of AI systems. Most fall into one of two camps - systems that have programmed responses for given inputs, and those which learn from user inputs. A key technology over the last decade for AI programmes - more properly here described as chatbots - has been the Artificial Intelligence Markup Language - AIML - developed by Dr Richard Wallace and used in his award winning ALICE chatbot.
There are a wide number of approaches to the development of AI systems. Most fall into one of two camps - systems that have programmed responses for given inputs, and those which learn from user inputs. A key technology over the last decade for AI programmes - more properly here described as chatbots - has been the Artificial Intelligence Markup Language - AIML - developed by Dr Richard Wallace and used in his award winning ALICE chatbot. About the authorDavid Burden is Managing Director of AI specialists Advanced Chatbot Solutions. The author can be contacted at david.burden@chatbots.co.uk. With an AIML chatbot possible user inputs (questions, statements etc) are programmed as Patterns together with the correct response - called a Template. AIML enables patterns to have wildcards (so that a pattern such as Have you been to * matches Have you been to London and Have you been to Paris), allows examination and incorporation of previous inputs and outputs, and random selections from a range of possible alternative replies. Being an XML based language AIML has the benefits of being both human and machine readable. AIML reflects much of the early work on artificial intelligence. Eliza, one of the first chatbots, was designed to act as a virtual psychiatrist - querying users' statements and thoughts. Eliza herself was not really expected to know anything. Whilst this strand of development is still of interest to some AI developers, for many the emphasis is now on creating AIs that can act as virtual assistants - either as a personal virtual advisor and assistant, or as a virtual sales or support agent.
Figure 1. HNF darmstadt hand Moving out of the Closed SystemAt Advanced Chatbot Solutions (ACS) we have been developing AIML based systems for several years now. Whilst AIML is a wonderful way of capturing the smalltalk that makes up a large part of many human conversation, and of providing a general control to the conversation, we find it less useful when we want the chatbot to answer factual questions. For instance if we wanted the chatbot to answer the question what is the capital of * we would in theory have to write a separate question/answer pair for every country in the world. And at least capitals don't change too often. If we wanted to ask the chatbot how much a book cost, or what the value of a stock is then we'd be stumped because AIML is primarily a closed system. However AIML is an XML based language - and the X stands for Extensible. As long as we don't want to exchange all our AIML with another chatbot we are free to create new AIML tags for new functions, without breaking the fundamental model of how AIML works. Using Web ServicesFaced with the problem of accessing real world data we have introduced a simple but powerful new tag to our AIML called <module>. This lets us call a new code module to conduct a specific function. The tag is embedded in a standard question/answer pair in the same way as any other AIML tag. For instance: <category> <pattern>What does Amazon charge for *</pattern> <template>Amazon charges <module name="amazon" action="getPrice" value="<star/>"/> for <star/> </template> </category> In plain english this:
Traditionally we would need to write a new module for every system we wanted to access, and may need lengthy negotiations with the system owners to achieve the link. However the growth of web services has opened up many systems (including Amazon, the BBC and Google) to external computer access. Web services are simply a way of enabling one computer programme on the web to access the data and functionality of another programme on the web. It is machine-to-machine (M2M) communications, not the man-machine interface of the web browser. There are currently 3 main web service protocols in widespread use on the web. REST is the simplest of them all. The calling programme simply issues a standard HTTP GET call to the target programme with the request's parameters embedded in the URL in the same way that a web browser makes an HTTP GET call to retrieve a web page. However instead of sending back an HTML page for human consumption the target programme sends back a simple XML document containing the required data. Amazon for instance uses REST. A special form of REST is RSS - Really Simple Syndication. This defines the XML response for news and information feeds and is widely used by bloggers and media organisations to disseminate news between sites. Next up is RPC/XML. Here the request itself is an XML document which is sent by HTTP POST (the same protocol that submits web forms), and the response is again an XML document, but with a more specifically defined structure. Finally there is SOAP, which is tending to supplant RPC/XML since it also uses XML documents and HTTP POST, but provides a layer of meta-data which allows the request/response formats to be created more automatically by generic SOAP application, rather than being hand coded each time. Google supports the SOAP interface. Armed with these three interfaces and a <module> AIML tag it becomes far simpler to start interfacing a chatbot to the outside world. We have developed modules which interface to major web services such as Google, to e-commerce sites such as Amazon, and to news and information sites like the BBC. Where sites do not support web services, but display their information in a clearly defined way then we can use the older screenscrape technology to extract the key data, and still access it through our AIML <module>. Having these interfaces in place means that we can now allow the chatbot to respond to a wide range of fact based questions. As well as the Amazon pricing question above we can also handle stock queries, news queries, searches and a wide range of other requests, with each type of request requiring ultimately only one AIML pattern to handle it (although in practice we need to capture the user asking the question in a wide variety of way, handle error conditions and so on). The chatbot has access to knowledge that we could never hope to code in AIML. For commercial clients it also opens the way for chatbots to access inventory, CRM, trouble ticketing and other operational systems, allowing the chatbot to become a very useful virtual sales assistant or customer care representative.
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.







SDJ Users:
Shopping Cart









