📄 std-dont.aiml
字号:
<?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 />
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -