SlideShare a Scribd company logo
Languages to write a chatbot
AIML (1995)
ChatScript (2010) RiveScript (2009)
Hanoi, 6 - 2018
1
Contents
1
2
3
4
5
2
1. AIML
• AIML is rule-based, matching a sequence of words to generate either a
completely canned response or a response involving substitution of input
words into an output template.
• A chatbot like A.L.I.C.E. is an expert system. A.L.I.C.E. data is defined using
AIML, an expert system can perform interesting to significant tasks when it
has a limited domain and 30,000 to 50,000 rules for a brain.
• We can teach aiml bot by using learn/learnf tags.
3
1. AIML
• #1 Flaw of AIML
▫ The biggest flaw of AIML is that it is simply too wordy and requires huge numbers
of effectively redundant categories.
▫ Since the pattern matching of AIML is so primitive and generic, it takes a lot of
category information to perform a single general task. If you want the system to
respond to a keyword, either alone or as a prefix, infix, or suffix in a sentence, it
takes you four categories to do so, one for each condition (with three of them
remapping using SRAI to the fourth ).
<category>
<pattern>MOTHER</pattern>
<template> Tell me more about your family. </template>
</category>
<category>
<pattern>* MOTHER</pattern>
<template><srai>MOTHER</srai> </template>
</category>
<category>
<pattern>MOTHER *</pattern>
<template><srai>MOTHER</srai> </template>
</category>
<category>
<pattern>* MOTHER *</pattern>
<template><srai>MOTHER</srai> </template>
</category>
4
1. AIML
• #2 Flaw of AIML
▫ Similarly, the pattern uses an exact word. It would be nice if you could match a list
of synonyms in a single specification.
<category><pattern>I AM JACK</pattern><template><srai>call me
jack</srai></template></category>
<category><pattern>I AM JAKE</pattern><template><srai>call me
jake</srai></template></category>
<category><pattern>I AM JAMES</pattern><template><srai>call me
james</srai></template></category>
<category><pattern>I AM JANE</pattern><template><srai>call me
jane</srai></template></category>
I would much rather write a synonym set for a list of names and write
this as a single pattern
5
1. AIML
• #3 Flaw of AIML
▫ Because you can't use wildcard sets of words, you cannot easily handle generic
set-based sentences. Google, for example, has no problem taking in what is two
hundred plus twelve thousand and 2 and then spitting out the correct answer
<category> <pattern>* PLUS *</pattern> <template><think><set name="x"> <star/></set> <set
name="y"><person><star index="2"/></person></set></think> The answer is
<script language="JavaScript"> var result = <get name="x"/> + <get name="y"/>;
document.write("<br/>result = " + result, "<br/>");</script> </template> </category>
That is, the AIML reference guide says: As soon as the first complete
match is found, the process stops, and the template that belongs to
the category whose pattern was matched is processed by the AIML
interpreter to construct the output. It seems to say nothing about what
happens if the result of the execution of the template is nada. So
seems to me, you really want to have a more reliable match BEFORE
you commit to the template.
6
1. AIML
• #4 Flaw of AIML
▫ AIML creates a system with the potential for many rules that overlap and mask
each other.
▫ <srai> are hard to connect visually to the categories they are remapping to,
making it impossible to see or guess what will happen.
<pattern> DO YOU WANT * </pattern> < template> No, I do not want * </template>
<pattern>DO YOU WANT MOVIES </pattern> < template> <srai> Want Movies </srai></template>
7
2. Rivescript
• Here are all of the things RiveScript has which AIML simply does
not at all:
▫ ! Definition command; Alice bots need a handful of configuration files,
separate from the actual AIML files, to define things such as the bot's
name and other variables. These features are built right in to RiveScript
itself.
▫ Weighted random responses.
▫ Object macros.
▫ Topics can inherit other topics.
▫ Tags that AIML doesn't have:
 add
 sub
 mult
 div
 env
 {!}
8
2. Rivescript
! version = 2.0
+ hello bot
- Hello human.
+ my name is *
- <set name=<formal>>Nice to meet you, <get name>.
+ (what is my name|who am i)
- You're <get name>, right?
+ *
- I don't have a reply for that.
- Try asking that a different way.
9
2. Rivescript
• Intepreter
▫ https://www.rivescript.com/interpreters
• For java
▫ https://github.com/aichaos/rivescript-java
• AiChaos
▫ https://github.com/aichaos
• Training
▫ No script generator
• A collection of known projects that are built on top of RiveScript
▫ https://www.kirsle.net/wiki/Built-with-RiveScript
10
3. Chatscipt
• ChatScript is a stand-alone chatbot engine, complete with its own
unique scripting language, created by bruce wilcox, who also created
the 2010 loebner prize winning chatbot, suzette. this is one of very
few stand-alone chatbot apps that have none of the “disadvantages”
I listed earlier for stand-alone bot apps. However, ChatScript has its
own set of “disadvantages”.
• Tutorial:
▫ https://www.chatbots.org/ai_zone/viewthread/492/
• Tutorial:
▫ Full necessary documents available in PDFDOCUMENTATION
• Editor
▫ https://github.com/bwilcox-
1234/ChatScript/blob/master/Third%20Party%20Tools/README.md
11
3. Chatscipt
• You can define your bot’s dialog flows with a script stored as a
normal text file. This is much simpler than methods that other
chatbot tools use, which often involve browser-based user
interfaces, JSON, or XML.
• Writing your scripts as a text files gives you full control over your
dialog flows. You a can easily process and upgrade your
conversational code with back-end scripts and tools.
• You could even use machine learning tools to mine conversations
logs. This could reveal all kinds of opportunities for you to improve
your dialog flows.
12
3. Chatscipt
• Creating a new chatbot by modifying source code
▫ https://www.youtube.com/watch?v=H9H4NfMepe4
• Download Chatscript platform here
▫ https://sourceforge.net/projects/chatscript/
#include <fstream>
#include <iostream>
#include <string>
#include <chatScript.h> //for example!
using namespace std;
int main()
{
ofstream output;
string str1, str2;
getline(cin, str1);
//This is the ChatScript function that i am looking for!
str2= ChatScript_input(str1);
output.open("output.txt");
output<< "str2";
output.close();
return 0;
}
13
RiveScript vs ChatScript
• ChatScript is a more sophisticated scripting language capable of
more Turing-complete-like functionality, whereas RiveScript is a
parsed, line-delimited language.
• ChatScript can combine all of its various rules in complicated ways
that RiveScript can't compete with.
• A converter program could be written to translate RiveScript into
ChatScript, but not the other way around.
• ChatScript is capable of complicated replies that can't be
represented equally in RiveScript.
14
1. RiveScript vs ChatScript
• Right now (so far as I know, at least), the only ChatScript engine
(the software necessary to interpret ChatScript files) is a
Linux/Windows stand-alone application, written in C (I forget
which “flavor”). the chatScript engine can be run as a server (in fact,
that’s the default action in Linux), so just about any scripting
language can access it. I’ve toyed with the notion of creating a
ChatScript interpreter/engine in PHP, but frankly, my time is too
limited to do so. I also think that attempting to do something like
this should only be done with Bruce’s blessing/approval.
• That said, however, there’s nothing stopping anyone from writing an
interface in Python that pre-processes the input using tools like the
NLTK before accessing a ChatScript server and retrieving the
results, and then presenting the output to the user. In fact, I think
that may be something to pursue, if you’re of a mind to do so.
15
Conclusion
• Deploying a chatbot with fully customizable by AIML or Rivescript
seems to be easier than Chatscript
• If we decide to apply NLP later, I think we should you AIML for ease
(because I think TIMA system is small enough)
• If we can use Chatscript, we even can ignore NLP and go through
by CS.
16

More Related Content

PPTX
Questions of character
PPTX
AIML Introduction
PPTX
AI and Python: Developing a Conversational Interface using Python
PDF
IRJET - Development of Chatbot Automation Application – DGCT CSE ALEXA
PDF
IRJET- Chatbot in Python
PPTX
Chatbots.pptx
PDF
VOCAL- Voice Command Application using Artificial Intelligence
PDF
IRJET-V7I51160.pdf
Questions of character
AIML Introduction
AI and Python: Developing a Conversational Interface using Python
IRJET - Development of Chatbot Automation Application – DGCT CSE ALEXA
IRJET- Chatbot in Python
Chatbots.pptx
VOCAL- Voice Command Application using Artificial Intelligence
IRJET-V7I51160.pdf

Similar to Survey on Script-based languages to write a Chatbot (20)

PPT
Chatbots software application or web interface that is designed to mimic huma...
PPT
group7-Chatbots.ppt
PPT
group7-Chatbots.ppt
PPT
group7-Chatbots.ppt
PDF
IRJET- Interactive Interview Chatbot
PDF
NLP_A Chat-Bot_answering_queries_of_UT-Dallas_Students
PDF
IRJET - Chat-Bot for College Information System using AI
PDF
Artificial intelligence markup language: a Brief tutorial
PDF
WHATSAPP CHATBOT FOR CAREER GUIDANCE
PDF
User stories collection via interactive chatbot to support requirements gathe...
PPT
Bridging the virtual and the physical space : Kornelia - a chatbot for public...
PDF
A Research Paper on HUMAN MACHINE CONVERSATION USING CHATBOT
PDF
IRJET - Chatbot for HR Department using AIML and LSA
PDF
Building Your First Chatbot - A Beginner's guide
PDF
isl mini project report Akshay
PDF
Lessons learned from building a commercial bot development platform
PDF
A Review on Chatbot with Different Methods
DOCX
Ai and bots
PDF
An Intelligent Chatbot for College Enquiry with Amazon Lex
PPTX
FAQ Chatbot.pptx
Chatbots software application or web interface that is designed to mimic huma...
group7-Chatbots.ppt
group7-Chatbots.ppt
group7-Chatbots.ppt
IRJET- Interactive Interview Chatbot
NLP_A Chat-Bot_answering_queries_of_UT-Dallas_Students
IRJET - Chat-Bot for College Information System using AI
Artificial intelligence markup language: a Brief tutorial
WHATSAPP CHATBOT FOR CAREER GUIDANCE
User stories collection via interactive chatbot to support requirements gathe...
Bridging the virtual and the physical space : Kornelia - a chatbot for public...
A Research Paper on HUMAN MACHINE CONVERSATION USING CHATBOT
IRJET - Chatbot for HR Department using AIML and LSA
Building Your First Chatbot - A Beginner's guide
isl mini project report Akshay
Lessons learned from building a commercial bot development platform
A Review on Chatbot with Different Methods
Ai and bots
An Intelligent Chatbot for College Enquiry with Amazon Lex
FAQ Chatbot.pptx
Ad

More from Nguyen Giang (8)

PPTX
Introduction to Interpretable Machine Learning
PDF
Show observe and tell giang nguyen
PPTX
Introduction to continual learning
PPTX
Variational continual learning
PPTX
Scalability fs v2
PPTX
How Tala works in credit score
PPTX
Virtual assistant with amazon alexa
PPTX
ECG Detector deployed based on OPENMSP430 open-core
Introduction to Interpretable Machine Learning
Show observe and tell giang nguyen
Introduction to continual learning
Variational continual learning
Scalability fs v2
How Tala works in credit score
Virtual assistant with amazon alexa
ECG Detector deployed based on OPENMSP430 open-core
Ad

Recently uploaded (20)

PPT
Project quality management in manufacturing
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Welding lecture in detail for understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Digital Logic Computer Design lecture notes
PDF
composite construction of structures.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Foundation to blockchain - A guide to Blockchain Tech
Project quality management in manufacturing
UNIT 4 Total Quality Management .pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
R24 SURVEYING LAB MANUAL for civil enggi
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Internet of Things (IOT) - A guide to understanding
additive manufacturing of ss316l using mig welding
Welding lecture in detail for understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Digital Logic Computer Design lecture notes
composite construction of structures.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lecture Notes Electrical Wiring System Components
Foundation to blockchain - A guide to Blockchain Tech

Survey on Script-based languages to write a Chatbot

  • 1. Languages to write a chatbot AIML (1995) ChatScript (2010) RiveScript (2009) Hanoi, 6 - 2018 1
  • 3. 1. AIML • AIML is rule-based, matching a sequence of words to generate either a completely canned response or a response involving substitution of input words into an output template. • A chatbot like A.L.I.C.E. is an expert system. A.L.I.C.E. data is defined using AIML, an expert system can perform interesting to significant tasks when it has a limited domain and 30,000 to 50,000 rules for a brain. • We can teach aiml bot by using learn/learnf tags. 3
  • 4. 1. AIML • #1 Flaw of AIML ▫ The biggest flaw of AIML is that it is simply too wordy and requires huge numbers of effectively redundant categories. ▫ Since the pattern matching of AIML is so primitive and generic, it takes a lot of category information to perform a single general task. If you want the system to respond to a keyword, either alone or as a prefix, infix, or suffix in a sentence, it takes you four categories to do so, one for each condition (with three of them remapping using SRAI to the fourth ). <category> <pattern>MOTHER</pattern> <template> Tell me more about your family. </template> </category> <category> <pattern>* MOTHER</pattern> <template><srai>MOTHER</srai> </template> </category> <category> <pattern>MOTHER *</pattern> <template><srai>MOTHER</srai> </template> </category> <category> <pattern>* MOTHER *</pattern> <template><srai>MOTHER</srai> </template> </category> 4
  • 5. 1. AIML • #2 Flaw of AIML ▫ Similarly, the pattern uses an exact word. It would be nice if you could match a list of synonyms in a single specification. <category><pattern>I AM JACK</pattern><template><srai>call me jack</srai></template></category> <category><pattern>I AM JAKE</pattern><template><srai>call me jake</srai></template></category> <category><pattern>I AM JAMES</pattern><template><srai>call me james</srai></template></category> <category><pattern>I AM JANE</pattern><template><srai>call me jane</srai></template></category> I would much rather write a synonym set for a list of names and write this as a single pattern 5
  • 6. 1. AIML • #3 Flaw of AIML ▫ Because you can't use wildcard sets of words, you cannot easily handle generic set-based sentences. Google, for example, has no problem taking in what is two hundred plus twelve thousand and 2 and then spitting out the correct answer <category> <pattern>* PLUS *</pattern> <template><think><set name="x"> <star/></set> <set name="y"><person><star index="2"/></person></set></think> The answer is <script language="JavaScript"> var result = <get name="x"/> + <get name="y"/>; document.write("<br/>result = " + result, "<br/>");</script> </template> </category> That is, the AIML reference guide says: As soon as the first complete match is found, the process stops, and the template that belongs to the category whose pattern was matched is processed by the AIML interpreter to construct the output. It seems to say nothing about what happens if the result of the execution of the template is nada. So seems to me, you really want to have a more reliable match BEFORE you commit to the template. 6
  • 7. 1. AIML • #4 Flaw of AIML ▫ AIML creates a system with the potential for many rules that overlap and mask each other. ▫ <srai> are hard to connect visually to the categories they are remapping to, making it impossible to see or guess what will happen. <pattern> DO YOU WANT * </pattern> < template> No, I do not want * </template> <pattern>DO YOU WANT MOVIES </pattern> < template> <srai> Want Movies </srai></template> 7
  • 8. 2. Rivescript • Here are all of the things RiveScript has which AIML simply does not at all: ▫ ! Definition command; Alice bots need a handful of configuration files, separate from the actual AIML files, to define things such as the bot's name and other variables. These features are built right in to RiveScript itself. ▫ Weighted random responses. ▫ Object macros. ▫ Topics can inherit other topics. ▫ Tags that AIML doesn't have:  add  sub  mult  div  env  {!} 8
  • 9. 2. Rivescript ! version = 2.0 + hello bot - Hello human. + my name is * - <set name=<formal>>Nice to meet you, <get name>. + (what is my name|who am i) - You're <get name>, right? + * - I don't have a reply for that. - Try asking that a different way. 9
  • 10. 2. Rivescript • Intepreter ▫ https://www.rivescript.com/interpreters • For java ▫ https://github.com/aichaos/rivescript-java • AiChaos ▫ https://github.com/aichaos • Training ▫ No script generator • A collection of known projects that are built on top of RiveScript ▫ https://www.kirsle.net/wiki/Built-with-RiveScript 10
  • 11. 3. Chatscipt • ChatScript is a stand-alone chatbot engine, complete with its own unique scripting language, created by bruce wilcox, who also created the 2010 loebner prize winning chatbot, suzette. this is one of very few stand-alone chatbot apps that have none of the “disadvantages” I listed earlier for stand-alone bot apps. However, ChatScript has its own set of “disadvantages”. • Tutorial: ▫ https://www.chatbots.org/ai_zone/viewthread/492/ • Tutorial: ▫ Full necessary documents available in PDFDOCUMENTATION • Editor ▫ https://github.com/bwilcox- 1234/ChatScript/blob/master/Third%20Party%20Tools/README.md 11
  • 12. 3. Chatscipt • You can define your bot’s dialog flows with a script stored as a normal text file. This is much simpler than methods that other chatbot tools use, which often involve browser-based user interfaces, JSON, or XML. • Writing your scripts as a text files gives you full control over your dialog flows. You a can easily process and upgrade your conversational code with back-end scripts and tools. • You could even use machine learning tools to mine conversations logs. This could reveal all kinds of opportunities for you to improve your dialog flows. 12
  • 13. 3. Chatscipt • Creating a new chatbot by modifying source code ▫ https://www.youtube.com/watch?v=H9H4NfMepe4 • Download Chatscript platform here ▫ https://sourceforge.net/projects/chatscript/ #include <fstream> #include <iostream> #include <string> #include <chatScript.h> //for example! using namespace std; int main() { ofstream output; string str1, str2; getline(cin, str1); //This is the ChatScript function that i am looking for! str2= ChatScript_input(str1); output.open("output.txt"); output<< "str2"; output.close(); return 0; } 13
  • 14. RiveScript vs ChatScript • ChatScript is a more sophisticated scripting language capable of more Turing-complete-like functionality, whereas RiveScript is a parsed, line-delimited language. • ChatScript can combine all of its various rules in complicated ways that RiveScript can't compete with. • A converter program could be written to translate RiveScript into ChatScript, but not the other way around. • ChatScript is capable of complicated replies that can't be represented equally in RiveScript. 14
  • 15. 1. RiveScript vs ChatScript • Right now (so far as I know, at least), the only ChatScript engine (the software necessary to interpret ChatScript files) is a Linux/Windows stand-alone application, written in C (I forget which “flavor”). the chatScript engine can be run as a server (in fact, that’s the default action in Linux), so just about any scripting language can access it. I’ve toyed with the notion of creating a ChatScript interpreter/engine in PHP, but frankly, my time is too limited to do so. I also think that attempting to do something like this should only be done with Bruce’s blessing/approval. • That said, however, there’s nothing stopping anyone from writing an interface in Python that pre-processes the input using tools like the NLTK before accessing a ChatScript server and retrieving the results, and then presenting the output to the user. In fact, I think that may be something to pursue, if you’re of a mind to do so. 15
  • 16. Conclusion • Deploying a chatbot with fully customizable by AIML or Rivescript seems to be easier than Chatscript • If we decide to apply NLP later, I think we should you AIML for ease (because I think TIMA system is small enough) • If we can use Chatscript, we even can ignore NLP and go through by CS. 16

Editor's Notes

  • #4: <pattern>_ A COUPLE OF WORDS *</pattern> and <pattern>_ A COUPLE OF WORDS</pattern> is the proper way to use _ if you want to catch every times A COUPLE OF WORDS is inside or at the end of a sentence.
  • #7: The problem is AIML stop asap it meets the first match. Then if the calculation is: 100 plus 200 and two => make wrong output while google can do it exactly.
  • #8: The problem is AIML stop asap it meets the first match. Then if the calculation is: 100 plus 200 and two => make wrong output while google can do it exactly.
  • #9: ChatScript (CS) integration with a foreign language (not English) is possible but it require work todo: dictionary ontologies (wordnet like) interjections/etc.
  • #10: https://play.rivescript.com/ https://www.rivescript.com/try
  • #11: ChatScript (CS) integration with a foreign language (not English) is possible but it require work todo: dictionary ontologies (wordnet like) interjections/etc.
  • #12: ChatScript (CS) integration with a foreign language (not English) is possible but it require work todo: dictionary ontologies (wordnet like) interjections/etc.
  • #13: ChatScript (CS) integration with a foreign language (not English) is possible but it require work todo: dictionary ontologies (wordnet like) interjections/etc.
  • #14: CS is chatbot engine. It is rule-based, and it might resemble a declarative programming approach similar to writing a configuration file or grammar for an interpreter. Yet, CS is more imperative since you should also use commands to tell how to react to this or that message. It is written in C++ and has binary builds for Windows, Linux, and MacOS platforms.
  • #15: SuperScript: https://github.com/superscriptjs/superscript