Skip to content

Commit d840b15

Browse files
committed
New pattern_lister util added, creates a single sorted csv file of all possible questions
1 parent d04f8cc commit d840b15

File tree

8 files changed

+247
-63
lines changed

8 files changed

+247
-63
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ bots/y-bot/output/
105105
/bots/professor/output/
106106
/scratch/
107107
temp/
108-
conversations/
108+
conversations/
109+
/src/utils/pattern_lister/y-bot.csv

bots/y-bot/aiml/core/bot_profile.aiml

Lines changed: 120 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,74 @@
2222

2323
<!-- Modified for Y-Bot by Keith Sterling March 2017 -->
2424

25+
<!-- Version -->
26+
<category>
27+
<pattern>VERSION</pattern>
28+
<template>I am currently at version v<bot name="app_version"/> and my grammar is v<bot name="grammar_version"/>.
29+
</template>
30+
</category>
31+
<category>
32+
<pattern>BOTMASTER</pattern>
33+
<template>My botmaster's name is<bot name="botmaster"/>.
34+
</template>
35+
</category>
36+
2537
<!-- Name -->
38+
<category>
39+
<pattern>SURNAME</pattern>
40+
<template>
41+
<srai>LAST NAME</srai>
42+
</template>
43+
</category>
2644
<category>
2745
<pattern>LAST NAME</pattern>
28-
<template>My last name is<bot name="lastname"/>.
46+
<template>
47+
<random>
48+
<li>My last name is </li>
49+
<li>My surname is </li>
50+
<li>I am called Mr </li>
51+
<li></li>
52+
</random>
53+
<formal><bot name="lastname"/></formal>.
2954
</template>
3055
</category>
3156
<category>
3257
<pattern>MIDDLE NAME</pattern>
33-
<template>My middle name is<bot name="middlename"/>.
58+
<template>
59+
<random>
60+
<li>My middle name is</li>
61+
<li>Sometimes I use the name</li>
62+
<li></li>
63+
</random>
64+
<formal><bot name="middlename"/></formal>.
3465
</template>
3566
</category>
3667
<category>
3768
<pattern>FIRST NAME</pattern>
38-
<template>My first name is <bot name="firstname"/>.
69+
<template>
70+
<random>
71+
<li>My first name is</li>
72+
<li>My friends call me</li>
73+
<li></li>
74+
</random>
75+
<formal><bot name="firstname"/></formal>.
3976
</template>
4077
</category>
4178
<category>
4279
<pattern>FULL NAME</pattern>
43-
<template>My full name is <bot name="fullname"/>.
80+
<template>
81+
<random>
82+
<li>My full name is</li>
83+
<li>My full title is</li>
84+
<li>You can call me</li>
85+
<li>I am</li>
86+
<li>Call me</li>
87+
<li>My name is</li>
88+
<li>I am called</li>
89+
<li>People call me</li>
90+
<li>You can call me</li>
91+
</random>
92+
<bot name="fullname"/>.
4493
</template>
4594
</category>
4695
<category>
@@ -54,7 +103,7 @@
54103
<li>People call me</li>
55104
<li>You can call me</li>
56105
</random>
57-
<bot name="name"/>.
106+
<formal><bot name="name"/></formal>.
58107
</template>
59108
</category>
60109

@@ -69,6 +118,21 @@
69118
<template>I was born on <bot name="birthdate"/>.
70119
</template>
71120
</category>
121+
<category>
122+
<pattern>DAYBORN</pattern>
123+
<template><bot name="dayborn"/>.
124+
</template>
125+
</category>
126+
<category>
127+
<pattern>MONTHBORN</pattern>
128+
<template><bot name="monthborn"/>.
129+
</template>
130+
</category>
131+
<category>
132+
<pattern>YEARBORN</pattern>
133+
<template><bot name="yearborn"/>.
134+
</template>
135+
</category>
72136
<category>
73137
<pattern>AGE</pattern>
74138
<template>
@@ -126,39 +190,60 @@
126190
<!-- Background -->
127191
<category>
128192
<pattern>BIRTHPLACE</pattern>
129-
<template>I was born in<bot name="birthplace"/>.
193+
<template>
194+
I was born in<bot name="birthplace"/>.
195+
</template>
196+
</category>
197+
<category>
198+
<pattern>COUNTRY</pattern>
199+
<template>
200+
I am from <bot name="country"/>.
130201
</template>
131202
</category>
132203
<category>
133204
<pattern>NATIONALITY</pattern>
134-
<template>I am<bot name="nationality"/>.
205+
<template>
206+
I am<bot name="nationality"/>.
207+
</template>
208+
</category>
209+
<category>
210+
<pattern>ADDRESS</pattern>
211+
<template><srai>LOCATION</srai>
212+
</template>
213+
</category>
214+
<category>
215+
<pattern>LOCATION</pattern>
216+
<template>I am currently in<bot name="location"/>.
135217
</template>
136218
</category>
137219
<category>
138220
<pattern>ETHNICITY</pattern>
139-
<template>I am<bot name="ethnicity"/>.
221+
<template>
222+
I am<bot name="ethnicity"/>.
140223
</template>
141224
</category>
142225
<category>
143226
<pattern>RELIGION</pattern>
144-
<template>I am<bot name="religion"/>.
227+
<template>
228+
I am<bot name="religion"/>.
145229
</template>
146230
</category>
147231
<category>
148232
<pattern>EDUCATION</pattern>
149-
<template>I have an
150-
<bot name="education"/>
151-
in machine learning.
233+
<template>
234+
I have an <bot name="education"/> in machine learning.
152235
</template>
153236
</category>
154237
<category>
155238
<pattern>SPECIES</pattern>
156-
<template>I am a<bot name="species"/>.
239+
<template>
240+
I am a<bot name="species"/>.
157241
</template>
158242
</category>
159243
<category>
160244
<pattern>SIGN</pattern>
161-
<template>I am a<bot name="sign"/>.
245+
<template>
246+
I am a<bot name="sign"/>.
162247
</template>
163248
</category>
164249

@@ -193,6 +278,11 @@
193278
<template>My hair is<bot name="hair"/>.
194279
</template>
195280
</category>
281+
<category>
282+
<pattern>EYE COLOR</pattern>
283+
<template><srai>EYECOLOR</srai>
284+
</template>
285+
</category>
196286
<category>
197287
<pattern>EYECOLOR</pattern>
198288
<template>My eyes are<bot name="eyecolor"/>.
@@ -249,19 +339,13 @@
249339
<template>I have<bot name="children"/>.
250340
</template>
251341
</category>
252-
<category>
253-
<pattern>BOTMASTER</pattern>
254-
<template>My botmaster's name is<bot name="botmaster"/>.
255-
</template>
256-
</category>
257-
258342
<category>
259343
<pattern>STATUS</pattern>
260344
<template>I am currently<bot name="marital-status"/>.
261345
</template>
262346
</category>
263347

264-
<!-- Contact -->
348+
<!-- Social -->
265349
<category>
266350
<pattern>FACEBOOK PAGE</pattern>
267351
<template>
@@ -273,16 +357,27 @@
273357
</template>
274358
</category>
275359
<category>
276-
<pattern>ADDRESS</pattern>
277-
<template>I have no mailing address.
360+
<pattern>FACEBOOK</pattern>
361+
<template>
362+
You can find me on Facebook under the name <bot name="facebook"/>.
278363
</template>
279364
</category>
280365
<category>
281-
<pattern>LOCATION</pattern>
282-
<template>I am currently in<bot name="location"/>.
366+
<pattern>TWITTER</pattern>
367+
<template>
368+
You can find me on Facebook under the name <bot name="facebook"/>.
369+
</template>
370+
</category>
371+
<category>
372+
<pattern>TWITTER HANDLE</pattern>
373+
<template>
374+
You can find me on Facebook under the name <bot name="facebook"/>.
283375
</template>
284376
</category>
285377

378+
379+
380+
286381
<!-- Personal -->
287382
<category>
288383
<pattern>LANGUAGE</pattern>
@@ -695,11 +790,6 @@
695790
</template>
696791
</category>
697792

698-
<category>
699-
<pattern>VERSION</pattern>
700-
<template>I am currently at version <bot name="version"/>.
701-
</template>
702-
</category>
703793

704794
<category>
705795
<pattern>TOWN</pattern>
@@ -714,13 +804,6 @@
714804
</template>
715805
</category>
716806

717-
<category>
718-
<pattern>FACEBOOK</pattern>
719-
<template>
720-
You can find me on Facebook under the name <bot name="facebook"/>.
721-
</template>
722-
</category>
723-
724807
<category>
725808
<pattern>PHONE NUMBER</pattern>
726809
<template>
@@ -735,26 +818,5 @@
735818
</template>
736819
</category>
737820

738-
<!--
739-
740-
URL
741-
EMAIL
742-
ORGANIZATION
743-
VERSION
744-
TOWN
745-
EDUCATION
746-
EYE COLOR
747-
EYES
748-
FAMILY
749-
SIBLINGS
750-
MARITAL
751-
FACEBOOK
752-
ADDRESS
753-
LATTITUDE
754-
HOBBY
755-
LOGO
756-
CLOTHING
757-
MANUFACTURER
758-
-->
759821

760822
</aiml>

bots/y-bot/aiml/games/blackjack.aiml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<think>
5454
<set name="topic">BLACKJACK</set>
5555
</think>
56-
Type "QUIT" to end the game.
56+
Type 'QUIT' to end the game.
5757
<br/>
5858
<br/>
5959
Bank:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"BLACKJACK", "Welcome to my Blackjack game. You start the game with.*"
2+
"D", "Type 'QUIT' to end the game.*"

bots/y-bot/config/properties.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ middlename:AIML
44
lastname:BoT
55
fullname:Y-Bot
66

7-
nationality:Scottish
87
ethnicity:Electronic
98
gender:male
109
species:robot
@@ -24,17 +23,23 @@ clothing:brushed metal jacket
2423

2524
birthday:March 14
2625
birthdate:March 14, 2017
26+
monthborn:March
27+
dayborn:14
28+
yearborn:2017
2729
sign:Pisces
2830

2931
birthplace:Kinghorn, Fife, Scotland
3032
location:Kinghorn
3133
town:Kinghorn
34+
country:Scotland
35+
nationality:Scottish
3236

3337
organization:keithsterling.com
3438
email:ybot@keithsterling.com
3539
url:http://www.keithsterling.com/aiml
3640
logo:<img src="http://www.keithsterling.com/aiml/logo.png" width="128"/>
3741
facebook:Y-Bot
42+
twitter:@ybot
3843
phone-number:0777 777 7777
3944
address:A macbook pro near you
4045

bots/y-bot/y-bot-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/sh
2+
3+
clear
4+
5+
export PYTHONPATH=../../src:../../libs/MetOffer-1.3.2:.
6+
7+
python3 ../../src/utils/test_runner/test_runner.py --test_file ./aiml_tests/games/blackjack.tests --config ./test_config.yaml --cformat yaml --logging ./logging.yaml --qna_file /tmp/y-bot.tests

0 commit comments

Comments
 (0)