forked from oren/eliza-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eliza_test.html
132 lines (122 loc) Β· 4.91 KB
/
eliza_test.html
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
<HTML>
<HEAD>
<title>Eliza Test</title>
<script language="JavaScript" TYPE="text/javascript" src="elizabot.js"></script>
<script language="JavaScript" TYPE="text/javascript" src="elizadata.js"></script>
<script language="JavaScript" TYPE="text/javascript">
// initialize with argument 'true': no random choices
var eliza = new ElizaBot(true);
var exampleLines= [
"Gli uomini sono tutti uguali.",
"Ci infastidiscono sempre su qualcosa.",
"Bene, il mio ragazzo mi ha fatto finire qui.",
"Dice che sono depressa quasi tutto il giorno.",
"Γ vero, sono infelice.",
"Ho bisogno di aiuto, questo mi sembra certo.",
"Forse potrei imparare ad andare d'accordo con mia madre.",
"Mia madre si prende cura di me.",
"Mio padre.",
"Sembri molto mio padre per certi aspetti.",
"Non sei molto aggressiva ma credo che tu non voglia che io lo noti.",
"Tu non parli seriamente con me.",
"Hai paura di me.",
"Mio padre ha paura di tutti.",
"Bulli."
];
var exampleCursor=0;
function elizaReset() {
eliza.reset();
exampleCursor=0;
}
function elizaNext() {
if (exampleCursor >= exampleLines.length) {
alert('Last entry reached.\nClick "Reset" to start over again.');
return;
}
var userinput = exampleLines[exampleCursor++];
document.forms.eform.edisplay.value += 'TU > ' + userinput + '\n';
document.forms.eform.edisplay.value += 'ELIZA > ' + eliza.transform(userinput) + '\n';
}
</script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<BODY TOPMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" BOTTOMMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" STYLE="border:0"><A NAME="top"></A>
<CENTER>
<P> </P>
<H3>Eliza Test</H3>
<TABLE BORDER="0" CELLSPACING="10" CELLPADDING="0">
<FORM NAME="eform" onsubmit="return false">
<TR VALIGN="top">
<TD><TEXTAREA NAME="edisplay" COLS="80" ROWS="32"></TEXTAREA></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE="Next step" onclick="elizaNext()"><BR><BR><INPUT TYPE="reset" VALUE="Reset" onclick="elizaReset(); return true"></TD>
</TR>
</FORM>
</TABLE>
</CENTER>
<P> </P>
<TABLE BORDER="0" CELLSPACING="12" CELLPADDDING="0">
<TR>
<TD COLSPAN="2">
This is a test application for the <A HREF="index.html">JavaScript library "elizabot.js"</A> (Norbert Landsteiner 2005; <http://www.masswerk.at>).<BR>
The test application should produce the original example given by Joseph Weizenbaum in his article on ELIZA from Jannuary 1966 <A HREF="#ELIZA">[1]</A>.<BR> Click "Next step" to see the next input und and Eliza's answer. Click "Reset" to reset Eliza and the display form.</TD>
</TR>
<TR><TD COLSPAN="2"> </TD></TR>
<TR><TD COLSPAN="2">This is the "typical conversation" as described by Joseph Weizenbaum:</TD></TR>
<TR>
<TD> </TD>
<TD>
Men are all alike.<BR><BR>
IN WHAT WAY?<BR><BR>
They're always bugging us about something or other.<BR><BR>
CAN YOU THINK OF A SPECIFIC EXAMPLE?<BR><BR>
Well, my boyfriend made me come here.<BR><BR>
YOUR BOYFRIEND MADE YOU COME HERE?<BR><BR>
He says I'm depressed much of the time.<BR><BR>
I AM SORRY TO HEAR YOU ARE DEPRESSED.<BR><BR>
It's true.<BR>
I am unhappy.<BR><BR>
DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY.<BR><BR>
I need some help, that much seems certain.<BR><BR>
WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP?<BR><BR>
Perhaps I could learn to get along with my mother.<BR><BR>
TELL ME MORE ABOUT YOUR FAMILY.<BR><BR>
My mother takes care of me.<BR><BR>
WHO ELSE IN YOUR FAMILY TAKES CARE OF YOU?<BR><BR>
My father.<BR><BR>
YOUR FATHER?<BR><BR>
You are like my father in some ways.<BR><BR>
WHAT RESEMBLANCE DO YOU SEE?<BR><BR>
You are not very aggressive<BR>
but I think you don't want me to notice that.<BR><BR>
WHAT MAKES YOU THINK I AM NOT VERY AGGRESSIVE?<BR><BR>
You don't argue with me.<BR><BR>
WHY DO YOU THINK I DON'T ARGUE WITH YOU?<BR><BR>
You are afraid of me.<BR><BR>
DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU?<BR><BR>
My father is afraid of everybody.<BR><BR>
WHAT ELSE COMES TO YOUR MIND WHEN YOU THINK OF YOUR FATHER?<BR><BR>
Bullies.<BR><BR>
DOES THAT HAVE ANYTHING TO DO WITH THE FACT<BR>
THAT YOUR BOYFRIEND MADE YOU COME HERE?<BR>
</TD>
</TR>
<TR><TD COLSPAN="2">(The capitalized lines are the machine responses.)</TD></TR>
<TR><TD COLSPAN="2"> </TD></TR>
<TR><TD COLSPAN="2">References:</TD></TR>
<TR VALIGN="top">
<TD><A NAME="ELIZA"></A>[1]</TD>
<TD>
Weizenbaum, Joseph "ELIZA – A Computer Program For the Study of Natural Language
Communication Between Man and Machine"<BR>
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
</TD>
</TR>
<TR><TD COLSPAN="2"> </TD></TR>
<TR><TD COLSPAN="2"><SMALL>> <A HREF="#top">top of page</A></SMALL></TD></TR>
<TR><TD COLSPAN="2"> </TD></TR>
<TR><TD COLSPAN="2" STYLE="font-family: arial,helvetica,sans-serif; font-size: 12px;">N. Landsteiner 2005; <<A HREF="http://www.masswerk.at/" TARGET="_blank">http://www.masswerk.at</A>></SMALL></TD></TR>
<TR><TD COLSPAN="2"> </TD></TR>
</TABLE>
</BODY>
</HTML>