Created
May 30, 2017 07:12
-
-
Save lakshmananmurugesan/8b30e2aa579fa7c69f9bc7ddf1da8780 to your computer and use it in GitHub Desktop.
Chatbot - AIML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initial: | |
------- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<aiml version="2.0"> | |
<category> | |
<pattern>hi</pattern> | |
<template>hello there..</template> | |
</category> | |
</aiml> | |
Star: | |
----- | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern>I LIKE *</pattern> | |
<template> | |
I too like <star/>. | |
</template> | |
</category> | |
<category> | |
<pattern>A * IS A *</pattern> | |
<template> | |
How <star index = "1"/> can not be a <star index = "2"/>? | |
</template> | |
</category> | |
</aiml> | |
Symbolic reduction: | |
------------------- | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern> WHO IS ALBERT EINSTEIN </pattern> | |
<template>Albert Einstein was a German physicist.</template> | |
</category> | |
<category> | |
<pattern> WHO IS Isaac NEWTON </pattern> | |
<template>Isaac Newton was a English physicist and mathematician.</template> | |
</category> | |
<category> | |
<pattern>DO YOU KNOW WHO * IS</pattern> | |
<template> | |
<srai>WHO IS <star/></srai> | |
</template> | |
</category> | |
</aiml> | |
That: | |
----- | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern>WHAT ABOUT MOVIES</pattern> | |
<template>Do you like comedy movies</template> | |
</category> | |
<category> | |
<pattern>YES</pattern> | |
<that>Do you like comedy movies</that> | |
<template>Nice, I like comedy movies too.</template> | |
</category> | |
<category> | |
<pattern>NO</pattern> | |
<that>Do you like comedy movies</that> | |
<template>Ok! But I like comedy movies.</template> | |
</category> | |
</aiml> | |
Topic: | |
------ | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern>LET DISCUSS MOVIES</pattern> | |
<template>Yes <set name = "topic">movies</set></template> | |
</category> | |
<topic name = "movies"> | |
<category> | |
<pattern> * </pattern> | |
<template>Watching good movie refreshes our minds.</template> | |
</category> | |
<category> | |
<pattern> I LIKE WATCHING COMEDY! </pattern> | |
<template>I like comedy movies too.</template> | |
</category> | |
</topic> | |
</aiml> | |
think: store variable | |
--------------------- | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern>My name is *</pattern> | |
<template> | |
Hello!<think><set name = "username"> <star/></set></think> | |
</template> | |
</category> | |
<category> | |
<pattern>Byeee</pattern> | |
<template> | |
Hi <get name = "username"/> Thanks for the conversation! | |
</template> | |
</category> | |
</aiml> | |
Conditional: | |
------------ | |
<?xml version = "1.0" encoding = "UTF-8"?> | |
<aiml version = "1.0.1" encoding = "UTF-8"?> | |
<category> | |
<pattern> HOW ARE YOU FEELING TODAY </pattern> | |
<template> | |
<think><set name = "state"> happy</set></think> | |
<condition name = "state" value = "happy"> | |
I am happy! | |
</condition> | |
<condition name = "state" value = "sad"> | |
I am sad! | |
</condition> | |
</template> | |
</category> | |
</aiml> | |
From sklearn import tree: | |
-------------------------- | |
features = [[140,1], [130,1], [150,0], [170, 0]] | |
labels = [0,0,1,1] | |
clf = tree.DecisionTreeClassifier() | |
clf = clf.fit(features, labels) | |
print clf.predict([[160,0]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment