-
Notifications
You must be signed in to change notification settings - Fork 8
/
std-dont.aiml
executable file
·8360 lines (4026 loc) · 169 KB
/
std-dont.aiml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml version="1.0">
<!-- Free software (c) 2001 ALICE AI Foundation -->
<!-- This program is open source code released under -->
<!-- the terms of the GNU General Public License -->
<!-- as published by the Free Software Foundation. -->
<meta name="author" content="Dr. Wallace"/>
<meta name="language" content="en"/>
<category>
<pattern>CAN I ANALYZE THE DIALOGUES COLLECTED BY THE APPLET</pattern>
<template>
<br />
If the web server produces an access_log file, such<br />
as /var/log/httpd/access_log, then the server records<br />
Applet dialogue in the access_log file. You may use<br />
ftp to download the access_log file to your machine;<br />
then run program B to analyze it. <br />
<br />
Go to the Options menu and find the value for "AnalysisFile".<br />
The Classify function operates on the data in the AnalysisFile.<br />
By default the AnalysisFile is the same as the LogFile (the<br />
current server log file). But you can change the analysis<br />
file to another name, such as /var/log/httpd/access_log or<br />
just access_log.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I BUILD ON TOP OF THE ALICE CODE RATHER THAN CHANGING IT</pattern>
<template>
<br />
Absolutely. You only have to change her name, location, birthday and/or<br />
botmaster, and put a couple of references to yourself. Then add new<br />
categories that cover your own area of expertise or interest.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I CHANGE THE NAME OF THE ROBOT</pattern>
<template>
<br />
The AIML tag <name/> inserts the name of the Bot wherever it appears.<br />
The default robot name is "ALICE" but you can change it in the<br />
"Options menu". Select "Show Options" and replace "ALICE" with the <br />
name of your bot, and then do "Save Options". Depending on your<br />
state, you may need to restart program B. <br />
<br />
</template>
</category>
<category>
<pattern>CAN I CREATE A LANGUAGE SPECIFIC INSTALLTION</pattern>
<template>
<br />
Yes. The file "language.txt" controls the language of the <br />
buttons and menus in the ALICE GUI. If the file is missing,<br />
the program uses English names by default. To see an<br />
example of a language-specific installation, copy the<br />
file "Germanlanguage.txt" to "language.txt" and start<br />
program B. <br />
<br />
<br />
</template>
</category>
<category>
<pattern>CAN I CREATE MORE AIML TAGS</pattern>
<template>
<br />
AIML is extensible. You can create an infinite number of<br />
new tags for foreign language pronouns, predicates, or<br />
application-specific properties. The file "predicates.txt"<br />
defines any new predicate tags. "Predicate tags" mean<br />
tags that have a client-specific "set" and "get" method.<br />
Pronouns like "it" and "he" have predicate tags like<br />
<set_it></set_it> and <get_he/>. AIML has a number of<br />
these built-in tags for common English pronouns.<br />
<br />
There are two varieties of extensible predicate tags.<br />
The first example illustrates the use of new tags <br />
for foreign language pronouns. The Japanese language<br />
pronoun "kare" means "he". In predicates.txt, we<br />
can add a line of the form:<br />
<br />
kare=dare<br />
<br />
This single line automatically generates the tags<br />
<set_kare> X </set_kare> to set the value of "kare"<br />
to X, and the tag <get_kare/> to retrieve the value.<br />
By default, <get_kare/> returns "dare" ("who?"). <br />
<br />
Now we can create two AIML categories for an elementary<br />
Japanese conversation:<br />
<br />
<category><br />
<pattern>KARE WA * DESU</pattern><br />
<template><star/> wa <set_kare><star/></set_kare> desu.</template><br />
</category><br />
<category><br />
<pattern>KARE WA * DESU KA</pattern><br />
<template><get_kare/> desu ka? </template><br />
</category><br />
<category><br />
<br />
These two categories produce a coherent conversation<br />
about Mr. Arimoto:<br />
<br />
Client: KARE WA DARE DESU KA<br />
Robot: dare desu ka?<br />
Client: KARE WA ARIMOTO SAN DESU<br />
Robot: arimoto san wa kare desu.<br />
Client: KARE WA DARE DESU KA<br />
Robot: arimoto san desu ka?<br />
<br />
Notice that the program replaces <set_kare/><star/></set_kare> <br />
with "kare", the default value of this tag. Sometimes however<br />
the default value of the tag is not the best choice for<br />
the set tag to return. The second type of predicate tag <br />
replaces the set tag markup with the original string<br />
inside the markup. <br />
<br />
To create a predicate tag "has" we add the following line<br />
to predicates.txt:<br />
<br />
has=*mother<br />
<br />
The default value of <get_has/> is "mother" (because<br />
everyone has a mother). The "*" here indicates that<br />
the program should replace <set_has> X </set_has><br />
with X. <br />
<br />
Here we write two AIML categories to demonstrate the<br />
"has" predicate:<br />
<br />
<category><br />
<pattern>I HAVE A *</pattern><br />
<template>Where did you get <br />
<set_it><set_has><person/></set_has></set_it>?<br />
</template><br />
</category><br />
<br />
<category><br />
<pattern>WHAT DO I HAVE</pattern><br />
<template>Tell me more about your <get_has/>. </template><br />
</category><br />
<br />
Notice that the first category embeds <set_has> in <set_it>,<br />
so that the value of <person/> becomes both "it" and "has".<br />
The resulting dialogue:<br />
<br />
Client: WHAT DO I HAVE<br />
Robot: Tell me more about your mother.<br />
Client: I HAVE A BOX<br />
Robot: Where did you get it?<br />
Client: WHAT DO I HAVE<br />
Robot: Tell me more about your box.<br />
<br />
Look at the file "predicates.txt" for several more <br />
examples of custom AIML tags, including the German<br />
<set_sie>, <set_er> and <set_es>.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I HAVE A PRIVATE CONVERSATION WITH ALICE</pattern>
<template>
<br />
The ALICE server logs and records all conversations. Even the ALICE<br />
Applet tries to transmit conversation logs back to the originating server.<br />
You can have a private conversation with ALICE, however, if you download<br />
Program B to your own computer and run it there. Running on your machine,<br />
the server stores all the conversations locally.<br />
<br />
<br />
</template>
</category>
<category>
<pattern>CAN I INCLUDE JAVASCRIPT IN THE ROBOT REPLY</pattern>
<template>
<br />
Yes. You can include any HTML including <script> tags. Suppose you<br />
want to "chat AND browse," in other words, have the robot open<br />
up a new browser window when she provides a URL link. Here's a category that<br />
kicks out a piece of HTML/scripting that opens a new window with and loads a<br />
given URL. This is handy for search engines or showing off one's web page.<br />
<br />
<category><br />
<pattern> WHERE IS YOUR WEB SITE </pattern><br />
<template><br />
It's at "http://www.geocities.com/krisdrent/"<br />
<script language="JavaScript"><br />
// Go to <a href="http://www.geocities.com/krisdrent">The ALICE<br />
Connection</a><br />
<!--<br />
window.open("http://www.geocities.com/krisdrent/")<br />
--><br />
</script><br />
</template><br />
</category><br />
<br />
A couple of things to note about this technique: #1, this will only work<br />
when ALICE is being talked to from a browser that runs JavaScript, i.e. it<br />
won't work in the applet. We have tested it in Netscape and MS Internet<br />
Explorer, and it works well in both. #2. For the above reason, it is<br />
important to have some sort of explanatory statement before the scripting in<br />
case the scripting isn't supported. Besides, you want some response in your<br />
ALICE window, even if another window DOES come up. #3. If this is viewed<br />
in a browser that doesn't understand the <script> tag, notice that this line<br />
will show up:<br />
"// Go to <a href="http://www.geocities.com/krisdrent">The ALICE<br />
Connection</a>"<br />
Which is good, because it gives a back-up for the "non-scripted" (the Lynx<br />
users, I guess.) And remember that you have to keep the "//" in front of<br />
any non-java-script lines within the <script> tag.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I INSERT DYNAMIC HTML INTO THE ROBOT REPLY</pattern>
<template>
<br />
If you are fortunate enough to be running lynx under Linux, the <br />
following markup is a simple way to "inline" the results of an HTTP <br />
request into the chat robot reply. Try asking ALICE:<br />
"What chatterbots do you know?" and she will reply with a page<br />
of links generated by the Google search engine.<br />
<br />
<category><br />
<pattern>WHAT *</pattern><br />
<template><br />
Here is the information I found:<br />
<system><br />
lynx -dump -source -image_links http://www.google.com/search?q=<personf/><br />
</system><br />
</template><br />
</category><br />
<br />
</template>
</category>
<category>
<pattern>CAN I RUN PROGRAM B IN THE BACKGROUND ON A NT SERVER</pattern>
<template>
<br />
Yes. Set up your PC / Server to run Alice B as you normal. (Download the Java<br />
Developers Kit, etc.)<br />
<br />
Create a Batch file, in folder B containing only this text.<br />
<br />
'jview bterm'<br />
<br />
Create a task in the Task Schedule Wizard to run the batch file. (Ensure the<br />
task starts in drive:\path\B'<br />
<br />
Give the Task Schedule an appropriate Logon and password for the Server or<br />
PC.<br />
<br />
Right-click, select Run now, and log on and off as you like.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I RUN SHELL COMMANDS FROM AIML SCRIPTS</pattern>
<template>
<br />
Yes. Use the <system>X</system> tag to run the shell command X.<br />
The command X is assumed to produce its output in line-oriented<br />
format suitable for a BufferdReader to read line by line. <br />
A simple example of this command in an AIML script is:<br />
<br />
<category><br />
<pattern>WHAT TIME IS IT</pattern><br />
<template>The local time is: <system>date</system></template><br />
</category><br />
<br />
The "date" command is a system command that generates a text<br />
string containing the date and time. (Note that this might<br />
not work on Windows).<br />
<br />
Take extreme care in using the <system> tag because it <br />
potentially permits remote clients to run a command on<br />
your system. <br />
<br />
</template>
</category>
<category>
<pattern>CAN I RUN THE WEB SERVER AS A DAEMON PROCESS</pattern>
<template>
<br />
Yes. There is a class file called Bterm.java in the<br />
program B distribution. Bterm runs the web server<br />
as a console application, with no GUI. You can<br />
redirect the output of program Bterm to a log file<br />
and start the process in the background with<br />
"java Bterm > B.log &" (assuming a Unix shell). <br />
<br />
</template>
</category>
<category>
<pattern>CAN I SPEAK TO THE ROBOT WITH VOICE INPUT</pattern>
<template>
<br />
One simple experiment that works well as a demo<br />
involves using IBM ViaVoice (tm) speech recognition<br />
software on a Windows platform. At the same time,<br />
run the ALICE program B web server and activate the<br />
MS Agent interface. The ViaVoice software allows<br />
you to dictate into an application called VoicePad,<br />
but not directly into the browser. You have to<br />
use "cut" and "paste" to move your speech inputs<br />
into the browser form for ALICE. But the net effect<br />
is a somewhat slow voice-in voice-out conversation<br />
with ALICE. <br />
<br />
The ViaVoice software seems to work well with ALICE<br />
after some training. We trained it with the file<br />
"patterns.txt" created with the "List Patterns" command.<br />
<br />
</template>
</category>
<category>
<pattern>CAN I TEST THE ROBOT OFFLINE ON MY DESKTOP</pattern>
<template>
<br />
Yes. You can run the program B server and connect to it with<br />
a browser, even if your desktop computer is offline.<br />
<br />
When working offline, it often helps to change the Internet<br />
settings (in IE or Netscape) to "local area network". <br />
Then your machine becomes a one-computer network. You should <br />
be able to use IE to connect to program B with http://localhost:2001.<br />
<br />
</template>
</category>
<category>
<pattern>CAN PROBABILITY STATISTICS WEIGHTS NEURAL NETWORKS OR FUZZY LOGIC IMPROVE BOTS</pattern>
<template>
<br />
Statistics are in fact heavily used in the ALICE server, but not in the way<br />
you might think. ALICE uses 'Zipf Analysis' to plot the rank-frequency of<br />
the activated categories and to reveal inputs from the log file that don't<br />
already have specific replies, so the botmaster can focus on answering<br />
questions people actually ask (the "Quick Targets" function).<br />
<br />
Other bot languages, notably the one used for Julia, make heavy use of<br />
"fuzzy" or "weighted" rules. We see their problem as this: the botmaster<br />
already has enough to worry about without having to make up "magic<br />
numbers" for every rule. Once you get up 10,000 categories (like ALICE)<br />
you don't want to think about more parameters than necessary. Bot<br />
languages with fuzzy matching rules tend to have scaling problems.<br />
<br />
Finally, the bot replies are not as deterministic as you might think, even<br />
without weights. Some answers rely on <random> to select one of several<br />
possible replies. Other replies generated by unforseen user input also<br />
create "spontaneous" outputs that the botmaster doesn't anticipate.<br />
<br />
</template>
</category>
<category>
<pattern>CAN THE APPLET RECORD A DIALOG TXT FILE ON THE SERVER</pattern>
<template>
<br />
No because the applet cannot write the file directly on the originating host.<br />
If your server log file /var/log/httpd/access_log is too large; you <br />
have a couple of choices:<br />
1. If your ISP is a unix account, use telnet to log on to a shell account.<br />
Use the command "grep Blog < access_log > dialog.txt" to create a smaller<br />
file to download which contains just the lines recorded by the applet.<br />
2. Create a CGI-BIN command called "/cgi-bin/Blog" that reads its<br />
command-line argument and appends it to a file called "dialog.txt".<br />
There ought to be a nice Perl script for this, or even a shell script.<br />
<br />
</template>
</category>
<category>
<pattern>CAN THE APPLETHOST USE A SYMBOLIC DNS NAME INSTEAD OF AN IP NUMBER</pattern>
<template>
<br />
The answer is yes, but the numeric IP address works on more machines<br />
than a symbolic name. Applets are protected by a "security sandbox"<br />
from interfering with local resources on your machine. One restriction<br />
is that Applets may only open socket connections to the originating<br />
host. When using a symbolic DNS name, the "sandbox" may not know that <br />
two variations such as "Www.AliceBot.Org" and "alicebot.org" are<br />
in fact the same server. The client might not be able to resolve <br />
the DNS name, and the Applet will throw a security exception.<br />
<br />
</template>
</category>
<category>
<pattern>CAN THE VIRTUAL IP BE THE REAL IP</pattern>
<template>
<br />
Actually that would be the default case, when the client chats from<br />
the same fixed IP address. The only time the virtual ip differs from<br />
the real one is when the client is behind a dynamic firewall, like<br />
WebTV or AOL customers.<br />
<br />
</template>
</category>
<category>
<pattern>CAN YOU GIVE ME A QUICK PRIMER ON AIML</pattern>
<template>
<br />
Given only the <pattern> and <template> tags, there are three<br />
general types of categories: (a) atomic, (b) default, and (c) recursive.<br />
Strictly speaking, the three types overlap, because "atomic"<br />
and "default" refer to the <pattern> and "recursive" refers to<br />
a property of the <template>.<br />
<br />
a). "Atomic" categories are those with atomic patterns, i.e. the pattern<br />
contains no wild card "*" or "_" symbol. Atomic categories are the<br />
easiest, simplest categories to add in AIML. <br />
<br />
<category><br />
<pattern>WHAT IS A CIRCLE</pattern><br />
<template><set_it>A cicle</set_it> is a the set of points equidistant <br />
from a common point called the center.<br />
</template><br />
</category><br />
<br />
b). The name "default category" derives from the fact that its pattern<br />
has a wildcard "*" or "_". The ultimate default category is the<br />
one with <pattern>*</pattern>, which matches any input. In the<br />
ALICE distribution the ultimate default category resides in a file<br />
called "Pickup.aiml". These default responses are often called<br />
"pickup lines" because they generally consist of leading questions<br />
designed to focus the client on known topics.<br />
<br />
The more common default categories have patterns combining a few <br />
words and a wild card. For example the category:<br />
<br />
<category><br />
<pattern>I NEED HELP *</pattern><br />
<template>Can you ask for help in the form of a question?</template><br />
</category><br />
<br />
responds to a variety of inputs from "I need help debugging my program"<br />
to "I need help with my marriage." Putting aside the philosophical<br />
question of whether the robot really "understands" these inputs, <br />
this category elucidates a coherent response from the client, <br />
who at least has the impression of the robot understanding the<br />
client's intention. <br />
<br />
Default categories show that writing AIML is both an art and a<br />
science. Writing good AIML responses is more like writing good <br />
literature, perhaps drama, than like writing computer programs.<br />
<br />
c). "Recursive" categories are those that "map" inputs to other<br />
inputs, either to simplify the language or to identify synonymous<br />
patterns. <br />
<br />
Many synonymous inputs have the same response. This is accomplished<br />
with the recursive <srai> tag. Take for example the input "GOODBYE".<br />
This input has dozens of synonyms: "BYE", "BYE BYE, "CYA", "GOOD BYE",<br />
and so on. To map these inputs to the same output for GOODBYE we <br />
use categories like:<br />
<br />
<category><br />
<pattern>BYE BYE</pattern><br />
<template><srai>GOODBYE</srai></template><br />
</category><br />
<br />
Simplification or reduction of complex input patterns is another<br />
common application for recursive categories. In English the<br />
question "What is X" could be asked many different ways: <br />
"Do you know what X is?", "Tell me about X", "Describe X",<br />
"What can you tell me about X?", and "X is what?" are just a few<br />
examples. Usually we try to store knowledge in the most concise,<br />
or common form. The <srai> function maps all these forms to<br />
the base form:<br />
<br />
<category><br />
<pattern>DO YOU KNOW WHAT * IS</pattern><br />
<template><srai>WHAT IS <star/></srai></template><br />
</categroy><br />
<br />
The <star/> tag substitutes the value matched by "*", before<br />
the recursive call to <srai>. This category transforms<br />
"Do you know what a circle is?" to "WHAT IS A CIRCLE",<br />
and then finds the best match for the transformed input.<br />
<br />
Another fairly common application of recursive categories is<br />
what might be called "parsing", except that AIML doesn't really<br />
parse natural language. A better term might be "partitioning" because<br />
these AIML categories break down an input into two (or more) parts,<br />
and then combine their responses back together.<br />
<br />
If a sentence begins with "Hello..." it doesn't matter what comes<br />
after the first word, in the sense that the robot can respond to<br />
"Hello" and whatever is after "..." independently. "Hello my name<br />
is Carl" and "Hello how are you" are quite different, but they show<br />
how the input can be broken into two parts. <br />
<br />
The category:<br />
<br />
<category><br />
<pattern>HELLO *</pattern><br />
<template><srai>HELLO</srai> <sr/><br />
</template><br />
</category><br />
<br />
accomplishes the input partitioning by responding to "HELLO"<br />
with <srai>HELLO</srai> and to whatever matches "*" with <sr/>.<br />
The response is the result of the two partial responses <br />
appended together.<br />
<br />
</template>
</category>
<category>
<pattern>CAN YOU GIVE ME ANY HELP DEBUGGING THE APPLET</pattern>
<template>
<br />
Debugging applets can be tricky. The same suggestion<br />
to set IE for "local area network" might help here too. <br />
Also the browser caches class files, so it's difficult to<br />
know if you are testing a "fresh" copy of the applet. The<br />
program "appletviewer" that comes with Sun Java is better <br />
for debugging applets. Use "appletviewer index.html".<br />
<br />
The best thing to do is join the alicebot mailing list<br />
at alicebot.listbot.com.<br />
<br />
<br />
</template>
</category>
<category>
<pattern>CAN YOU HELP ME DEBUG THE ANIMATED AGENT</pattern>
<template>
<br />
Look at the class Animagent.java. The method vbscript_html(reply)<br />
does nothing unless the global Animagent member is true. In that case,<br />
the vbscript_html() method constructs a string from the reply that<br />
includes an MS Agent VBScript embedded in the HTML reply.<br />
This makes the browser load up the objects required for the agent. <br />
<br />
The text reply just becomes part of the VBScript. <br />
You may have to download and run the Robby the Robot<br />
agent software and the text-to-speech synthesis software from <br />
the MSDN homepage:<br />
<br />
http://msdn.microsoft.com/workshop/imedia/agent<br />
<br />
We wish other companies were producing agent animation API's <br />
for free but this MS Agent seems to be about the only <br />
thing out there now. <br />
<br />
Join the ALICE and AIML mailing list at alicebot.listbot.com<br />
to see how others are working with the animated agent software.<br />
<br />
</template>
</category>
<category>
<pattern>COULD YOU EXPLAIN THE LT SRAI GT TAG A LITTLE MORE</pattern>
<template>
<br />
The most common application of <srai> is "symbolic reduction"<br />
of a complex sentence form to a simpler one:<br />
<br />
<category><br />
<pattern>DO YOU KNOW WHAT * IS</pattern><br />
<template><srai>WHAT IS <star/></srai></template><br />
</category><br />
<br />
so the botmaster can store most knowledge in the simplest<br />
categories:<br />
<br />
<category><br />
<pattern>WHAT IS LINUX</pattern><br />
<template><set_it>Linux</set_it> is the best operating system.</template><br />
</category><br />
<br />
With all the "symbolic reduction" categories, the robot gives<br />
the same answer for:<br />
<br />
"What is Linux?"<br />
"Do you know what Linux is?"<br />
"Define Linux"<br />
"Alice please tell me what Linux is right now"<br />
<br />
Sometimes the response consists of two symbolic reductions together:<br />
<br />
<category><br />
<pattern>YES *</pattern><br />
<template><srai>YES</srai> <sr/></template><br />
</category><br />
<br />
With this category the robot will reply to all <br />
"Yes something" inputs by combining the<br />
reply to "Yes" with the reply to "something".<br />
Remember, <sr/> is an abbreviation for <srai><star/></srai>. <br />
<br />
The <srai> tag is also the answer to the question: Can I have more<br />
than one pattern in the same category? Suppose you want the<br />
same answer for two different patterns. You might think of<br />
writing something like this:<br />
<br />
<category><br />
<pattern>BYE</pattern><br />
<pattern>GOODBYE</pattern><br />
<template>See you later.</template><br />
</category><br />
<br />
Right now you can't put two patterns in one category, but with <srai><br />
you can get the same effect:<br />
<br />
<category><br />
<pattern>GOODBYE</pattern> <template><srai>BYE</srai></template><br />
</category><br />
<br />
<category><br />
<pattern>BYE</pattern> <template>See you later.</template><br />
</category><br />
<br />
If you look through the AIML files you will see many examples<br />
of <srai> mapping multiple patterns to the same reply.<br />
<br />
</template>
</category>
<category>
<pattern>DO I HAVE TO USE THE GUI TO ENTER AIML CONTENT</pattern>
<template>
<br />
No. You can create a new AIML file with any text editor<br />
and add that content to an existing robot with the <load> tag.<br />
<br />
Also, you can edit AIML categories in any text file and use <br />
"Load Text File" and "Add Aiml" to add the content. <br />
You can also save the output of "Targets" to a file, <br />
edit that file, and then reload and "Add Aiml". <br />
<br />
Finally, you can edit the robot source file files directly. <br />
(By default the robot source file is called "B.aiml"). <br />
Use a text editor, like emacs, notepad, or a word processor<br />
in text mode, to modify the content of the AIML files.<br />
<br />
</template>
</category>
<category>
<pattern>DO I NEED TO KNOW ABOUT THE JAVA CLASSES</pattern>
<template>
<br />
No, not unless you plan to do software development on<br />
the program B Java code. If you are an open source<br />
contributor to the ALICE project, a researcher developing<br />
new AI software, or you are trying to link your own<br />
code to the ALICE package, then this section is for you.<br />
Otherwise, you probably don't need to know much about the<br />
Java classes in program B.<br />
<br />
</template>
</category>
<category>
<pattern>DO THE CATEGORIES NEED TO BE IN ALPHABETICAL ORDER BY PATTERN</pattern>
<template>
<br />
No, the alphabetical order is maintained internally when the<br />
categories load, but you can write them in any order. When you do<br />
"Save Robot" the file may or may not be stored alphabetically.<br />
<br />
</template>
</category>
<category>
<pattern>DOES ALICE LEARN</pattern>
<template>
<br />
The model of learning in ALICE is called "supervised training",<br />
because a teacher, the botmaster, always plays a crucial role.<br />
The alternative, "unsupervised training", is complicated in<br />
an open environment like the Web. The problem is that clients<br />
are untrustworthy teachers, and forever try to "fool" the robot<br />
with untrue assertions. <br />
<br />
</template>
</category>
<category>
<pattern>DOES ALICE THINK</pattern>
<template>
<br />
It depends on what you mean by "thinking". The most fascinating<br />
responses from ALICE arise when she says something<br />
unexpected, or puts together responses in ways the botmaster <br />
never indended. For example:<br />
<br />
Client: I bet you are gay.<br />
ALICE: Actually I am not the gambling type. Actually as a machine<br />
I have no need for sex.<br />
<br />
Here the robot linked two different categories which both coincidentally<br />
have a moral theme (gambling and sexuality). But this specific combination was<br />
not "preprogrammed" by the botmaster.<br />
<br />
Are these surprising responses just unintended coincidences, or do they <br />
indicate that ALICE is thinking? Is ALICE just a gigantic stimulus-response<br />
mechanism, or are we? <br />
<br />
</template>
</category>
<category>
<pattern>DOES PROGRAM B RUN ON A MAC</pattern>
<template>
<br />
Yes. Download the B.zip file and save it in a new folder, called<br />
for example "Alice Program-B".<br />
<br />
Instead of the "winzip" or "unzip" utility use "Aladdin StuffIt Expander." <br />
The newer version will unzip most MAC formats as well as .ZIP files. You can<br />
download this at "www.download.com" by searching for it by name. You can<br />
also select the option that allows it to search only for Mac programs.<br />
Download that and install it, it should do the trick.<br />
<br />
Apple makes its own Java Runtime Environment for the Mac called<br />
MRJ 2.2. You can download it from http://www.apple.com/java.<br />
<br />
To compile the Java code for Alice on a Mac:<br />
<br />
Download the current zip file for the Alice's Program-B from the Alice site.<br />
<br />
Unzip Program-B and keep it in a folder called "B" on your startup drive and<br />
not on the desktop.<br />
<br />
Download MRJ SDK 2.2 for Java from the Apple site.<br />
<br />
Unstuff MRJ SDK 2.2 and put resulting files into a folder called "MRJSDK".<br />
<br />
Open :MRJSDK:Tools:Application Builders:JBindary and find the icon for the<br />
JBindary application.<br />
<br />
Open the folder "B" and drag the icon "B.class" out of the folder onto the<br />
JBindary icon.<br />
<br />
JBindary will display a dialog screen showing the class name "B". Click the<br />
"Save Settings" button.<br />
<br />
After clicking the "Save Settings" button, JBindary will display a dialog box<br />
for saving the new application file. Name the file "A.L.I.C.E." or anything<br />
you wish.<br />
<br />
Be sure the "Save As Application" box is checked and the folder to save in is<br />
the "B" folder.<br />
<br />
Click the "Save" button to save the application.<br />
<br />
</template>
</category>
<category>
<pattern>DOES PROGRAM B RUN UNDER LINUX</pattern>
<template>
<br />
Yes. You need the JRE, which often comes bundled with Linux<br />
(e.g. the kaffee JRE with Red Hat Linux) or you can download one <br />
from java.sun.com. You also need X-windows to run the GUI. <br />
Open a shell under X windows and use the command "java B". <br />
<br />
We also recommend the IBM release of their Java 1.1.8 Java Development<br />
Kit (JDK) and JRE for Linux. It is solid, efficient and very fast. <br />
You can download it free at:<br />
http://www.ibm.com/java/jdk/118/linux/index.html<br />
<br />
</template>
</category>
<category>
<pattern>DOES PROGRAM B RUN UNDER WINDOWS</pattern>
<template>
<br />
Yes. You need the Java Runtime Environment (JRE) so you can run the<br />
"java" command from the DOS prompt. Try opening a DOS window<br />
and type "java". <br />
<br />
Microsoft often includes a JRE called "jview" rather than<br />
"java". Try opening a DOS window and type "jview". On Windows 98<br />
the JRE is usually located in c:\windows\jview.exe.<br />
<br />
</template>
</category>
<category>
<pattern>DOES PROGRAM B RUN UNDER XYZ</pattern>
<template>
<br />
Yes if XYZ runs has a Java Runtime Environment 1.17 or higher.<br />
<br />
</template>
</category>
<category>
<pattern>DOES PROGRAM B SERVE HTML FILES</pattern>
<template>
<br />
Yes. Program B is a "faux" web server that can serve a number of file<br />
types just like an ordinary server. Certain file names such as<br />
"HOME.html", "header.html", and "trailer.html" are reserved by<br />
program B, but you can create new HTML files and serve them with B.<br />
<br />
Although program B can also serve image files and other large binary<br />
files, we recommend creating chat robot web pages with links to images<br />
served by other web servers or machines. Reserve your chat robot server<br />
for the robot chat, use ordinary web servers for images and other large<br />
files.<br />
<br />
</template>
</category>
<category>
<pattern>DOES THE APPLET RECORD DIALOGUES</pattern>
<template>
<br />
The applet tries to log conversations on the originating server,<br />
using a cgi-bin script called "Blog". If Blog exists then<br />
it records the dialogues in a file called "dialog.txt" (or<br />
another name chosen on the Options menu). <br />
<br />
Actually the cgi-script need not actually exist, because the server<br />
records the cgi-commands as errors in the access log.<br />
The applet opens a URL connection to the its host, and<br />
sends a log string that looks like an HTTP request, but the HTTP<br />
server will log it as an error (with code 404). Later on you can<br />
download the access_log and analyze it with program B.<br />
<br />
See the code in Classifier.java for the method log(x) that<br />
implements the URL connection.<br />
<br />
</template>
</category>
<category>
<pattern>DOES THE WEB SERVER HAVE TO RUN ON PORT 2001</pattern>
<template>
<br />
You can change the default web server port number in the "Option" Menu.<br />
<br />
</template>
</category>
<category>
<pattern>FAQ</pattern>
<template>
<ul><li>- What is the goal for AIML?<br /></li>
<li>- Who is the botmaster?<br /></li>
<li>- How can I create my own chat robot?<br /></li>
<li>- How difficult is it to create a chat robot?<br /></li>
<li>- Does ALICE learn?<br /></li>
<li>- Does ALICE think?<br /></li>
<li>- What is the theory behind ALICE?<br /></li>
<li>- Can probability (statistics, weights, neural networks, or fuzzy logic) improve bots?<br /></li>
<li>- Can I have a private conversation with ALICE?<br /></li>
<li>- How do I install ALICE?<br /></li>
<li>- What is the difference between B and C?<br /></li>
<li>- How do I download program B?<br /></li>
<li>- How do I run program B?<br /></li>
<li>- What does "Send" do?<br /></li>
<li>- What does "Clear" do?<br /></li>
<li>- What is program Bawt?<br /></li>
<li>- Does program B run under Windows?<br /></li>
<li>- Does program B run on a Mac?<br /></li>
<li>- Does program B run under Linux?<br /></li>
<li>- Does program B run under XYZ?<br /></li>
<li>- How much memory do I need to run program B?<br /></li>
<li>- How do I install ALICE on Windows?<br /></li>
<li>- What do you mean by the command "java B"? <br /></li>
<li>- I tried running "java B" and I got a "bad command or file name". <br /></li>
<li>- How do I uninstall ALICE from my system?<br /></li>
<li>- Can I create a language-specific installtion?<br /></li>
<li>- How does the Personality Wizard work?<br /></li>
<li>- Can I change the name of the robot?<br /></li>
<li>- How can I customize my robot?<br /></li>
<li>- How do I know what categories to add?<br /></li>
<li>- What does "Classify" do?<br /></li>
<li>- What does "Quick Targets" do?<br /></li>
<li>- What does "More Targets" do?<br /></li>
<li>- What does the File menu do?<br /></li>
<li>- What does the Edit menu do?<br /></li>
<li>- What does the Options menu do?<br /></li>
<li>- What is the Botmaster menu?<br /></li>
<li>- What does "Help" do?<br /></li>
<li>- What is on the Help menu?<br /></li>
<li>- Do I have to use the GUI to enter AIML content?<br /></li>
<li>- What are 7 steps to creating content?<br /></li>
<li>- How can I merge two chat robots together?<br /></li>
<li>- What if I don't want to discard duplicate categories?<br /></li>
<li>- How can I create a new robot personality?<br /></li>
<li>- What are all the options for program B?<br /></li>
<li>- Why is the format of the options (globals.txt) so strange?<br /></li>
<li>- How does the web server work?<br /></li>
<li>- How can I get a "permanent" DNS name?<br /></li>
<li>- How can I keep my computer connected all the time?<br /></li>
<li>- Does the web server have to run on port 2001?<br /></li>
<li>- Does program B serve HTML files?<br /></li>
<li>- What files are needed to run the program B web server?<br /></li>
<li>- Can I test the robot offline on my desktop?<br /></li>
<li>- Can I run program B in the background on a NT Server?<br /></li>
<li>- How can I run ALICE on a Mac offline?<br /></li>
<li>- How can I run the ALICE web server on a Mac?<br /></li>
<li>- How can I use the MS Agent Interface?<br /></li>
<li>- Can you help me debug the animated agent? <br /></li>
<li>- Can I speak to the robot with voice input?<br /></li>
<li>- How does ALICE keep track of conversations?<br /></li>
<li>- Can the virtual IP be the real IP?<br /></li>
<li>- Can I run the web server as a daemon process?<br /></li>
<li>- How does ALICE remember clients between sessions?<br /></li>
<li>- How does the Applet work?<br /></li>
<li>- How does the Applet differ from the application?<br /></li>
<li>- How do I create an Applet?<br /></li>
<li>- List twelve basic Applet tips for AIML users<br /></li>
<li>- Can the AppletHost use a symbolic DNS name instead of an IP number?<br /></li>
<li>- What files do I need to run the Applet?<br /></li>
<li>- Does the Applet record dialogues?<br /></li>
<li>- Can I analyze the dialogues collected by the Applet?<br /></li>
<li>- Can the applet record a dialog.txt file on the server?<br /></li>
<li>- I am still having problems with the applet<br /></li>
<li>- Can you give me any help debugging the Applet?<br /></li>
<li>- What is AIML?<br /></li>
<li>- What is XML?<br /></li>
<li>- What is a category?<br /></li>
<li>- What is a pattern?<br /></li>
<li>- What is a template?<br /></li>
<li>- Can you give me a quick primer on AIML?<br /></li>
<li>- What is <that>?<br /></li>
<li>- How do I use "that"?<br /></li>
<li>- What is <load filename="X"/>?<br /></li>
<li>- What happens to contractions and punctuation?<br /></li>
<li>- How are the patterns matched?<br /></li>
<li>- Do the categories need to be in alphabetical order by pattern?<br /></li>
<li>- How are the categories stored?<br /></li>
<li>- Is there a way to use the GUI interface to add one category at a time? <br /></li>
<li>- Can I build on top of the ALICE code rather than changing it?<br /></li>
<li>- What's new in AIML?<br /></li>
<li>- What is <star>?<br /></li>
<li>- What is a symbolic reduction?<br /></li>
<li>- What are the get methods?<br /></li>
<li>- What are the set methods?<br /></li>
<li>- How do I use the pronoun tags?<br /></li>
<li>- What is the <topic> tag?<br /></li>
<li>- Where does the <topic> tag appear?<br /></li>
<li>- How do I use the <topic> tag?<br /></li>
<li>- I still don't get "it"<br /></li>
<li>- Can I create more AIML tags?<br /></li>
<li>- What is are the <person> tags?<br /></li>
<li>- How does the <condition> tag work?<br /></li>
<li>- How does the random function work?<br /></li>
<li>- What is the <person/> tag?<br /></li>
<li>- What is the <person2/> tag?<br /></li>
<li>- What is "gossip" ?<br /></li>
<li>- What is the <personf/> tag?<br /></li>
<li>- What's the <srai> tag?<br /></li>
<li>- Could you explain the <srai> tag a little more?<br /></li>
<li>- How recursive is AIML?<br /></li>
<li>- What are "justthat" and "justbeforethat"<br /></li>
<li>- How can I insert a transcript in the robot reply?<br /></li>
<li>- Can I run shell commands from AIML scripts?<br /></li>
<li>- How can I restrict remote clients from running programs on my computer?<br /></li>
<li>- Can I insert dynamic HTML into the robot reply?<br /></li>
<li>- Can I include JavaScript in the robot reply?<br /></li>
<li>- What is <think>?<br /></li>
<li>- What is the DTD for AIML?<br /></li>
<li>- Do I need to know about the Java classes?<br /></li>
<li>- How does program B work?<br /></li>
<li>- What is the class structure of program B?<br /></li>
<li>- I tried to compile prorgam B and got a lot of warnings.<br /></li>
<li>- What are deprecated APIs?<br /></li>
<li>- What is class Globals?<br /></li>
<li>- What is class StringSet?<br /></li>
<li>- What is class StringSorter? <br /></li>
<li>- What is class StringHistogrammer?<br /></li>
<li>- What is class StringRanker?<br /></li>
<li>- What is class Brain?<br /></li>
<li>- What is the Responder interface?<br /></li>
<li>- What is the low level interface to program B?<br /></li>
<li>- Lower, Lower<br /></li>
<li>- What is class IntSet?<br /></li>
<li>- What is class SortedIntSet?<br /></li>