forked from geckom/ChatScript
-
Notifications
You must be signed in to change notification settings - Fork 10
/
README.html
179 lines (169 loc) · 10.7 KB
/
README.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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
</head>
<body>
<h1 id="chatscript">ChatScript</h1>
<p>Natural Language tool/dialog manager</p>
<p>ChatScript is the next generation chatbot engine that has won the Loebner's 4 times and is the basis for natural language company for a variety of tech startups.</p>
<p>ChatScript is a rule-based engine, where rules are created by humans writers in program scripts through a process called dialog flow scripting. These use a scripting metalanguage (simply called a "script") as their source code. Here what a ChatScript script file looks like:</p>
<pre><code>#
# file: food.top
#
topic: ~food []
#! I like spinach
s: ( I like spinach ) Are you a fan of the Popeye cartoons?
a: ( ~yes ) I used to watch him as a child. Did you lust after Olive Oyl?
b: ( ~no ) Me neither. She was too skinny.
b: ( yes ) You probably like skinny models.
a: ( ~no ) What cartoons do you watch?
b: ( none ) You lead a deprived life.
b: ( Mickey Mouse ) The Disney icon.
#! I often eat chicken
u: ( ![ not never rarely ] I * ~ingest * ~meat ) You eat meat.
#! I really love chicken
u: ( !~negativeWords I * ~like * ~meat ) You like meat.
#! do you eat bacon?
?: ( do you eat _ [ ham eggs bacon] ) I eat '_0
#! do you like eggs or sushi?
?: ( do you like _* or _* ) I don't like '_0 so I guess that means I prefer '_1.
#! I adore kiwi.
s: ( ~like ~fruit ![~animal _bear] ) Vegan, you too...
#! do you eat steak?
?: ( do you eat _~meat ) No, I hate _0.
#! I eat fish.
s: ( I eat _*1 > )
$food = '_0
I eat oysters.</code></pre>
<p>Above example mentioned in article <a href="https://medium.freecodecamp.com/chatscript-for-beginners-chatbots-developers-c58bb591da8#.2qdxjuyvs">How to build your first chatbot using ChatScript</a>.</p>
<h2 id="basic-features">Basic Features</h2>
<ul>
<li>Powerful pattern matching aimed at detecting meaning.</li>
<li>Simple rule layout combined with C-style general scripting.</li>
<li>Built-in WordNet dictionary for ontology and spell-checking.</li>
<li>Extensive extensible ontology of nouns, verbs, adjectives, adverbs.</li>
<li>Data as fact triples enables inferencing and supports JSON representation.</li>
<li>Rules can examine and alter engine and script behavior.</li>
<li>Planner capabilities allow a bot to act in real/virtual worlds.</li>
<li>Remembers user interactions across conversations.</li>
<li>Document mode allows you to scan documents for content.</li>
<li>Ability to control local machines via popen/tcpopen/jsonopen.</li>
<li>Ability to read structured JSON data from websites.</li>
<li><a href="https://www.postgresql.org/">Postgres</a> and <a href="https://www.mongodb.com/">Mongo</a> databases support for big data or large-user-volume chatbots.</li>
</ul>
<h2 id="os-features">OS Features</h2>
<ul>
<li>Runs on Windows or Linux or Mac or iOS or Android</li>
<li>Fast server performance supports a thousand simultaneous users.</li>
<li>Multiple bots can cohabit on the same server.</li>
</ul>
<h2 id="support-features">Support Features</h2>
<ul>
<li>Mature technology in use by various parties around the world.</li>
<li>Integrated tools to support maintaining and testing large systems.</li>
<li>UTF8 support allows scripts written in any language</li>
<li>User support forum on <a href="https://www.chatbots.org/ai_zone/viewforum/44/">chatbots.org</a></li>
<li>Issues or bugs on this <a href="https://github.com/bwilcox-1234/ChatScript/issues">repo</a></li>
</ul>
<h1 id="getting-started">Getting started</h1>
<h2 id="installation">Installation</h2>
<p>Take this project and put it into some directory on your machine (typically we call the directory ChatScript, but you can name it whatever). That takes care of installation.</p>
<pre><code>git clone https://github.com/bwilcox-1234/ChatScript</code></pre>
<h2 id="standalone-mode---run-locally-on-a-console-for-developementtest">Standalone mode - run locally on a console (for developement/test)</h2>
<p>From your ChatScript home directory, go to the BINARIES directory:</p>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="bu">cd</span> BINARIES</code></pre></div>
<p>And run the ChatScript engine</p>
<h3 id="windows">Windows</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">ChatScript</span></code></pre></div>
<h3 id="linux">Linux</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./LinuxChatScript64</span> local</code></pre></div>
<p>Note: to set the file executable: <code>chmod a+x ./LinuxChatScript64</code></p>
<h3 id="macos">MacOS</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./MacChatScript</span> local</code></pre></div>
<p>This will cause ChatScript to load and ask you for a username. Enter whatever you want. You are then talking to the default demo bot <code>Harry</code>.</p>
<h2 id="server-mode-for-production">Server Mode (for production)</h2>
<p>From your ChatScript home directory, go to the BINARIES directory and run the ChatScript engine as server ### Run the server on Windows</p>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">ChatScript</span> port=1024</code></pre></div>
<h3 id="run-the-server-on-linux">Run the server on Linux</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./LinuxChatScript64</span></code></pre></div>
<h3 id="run-the-server-on-macos">Run the server on MacOS</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./MacChatScript</span></code></pre></div>
<p>This will cause ChatScript to load as a server.<br />
But you also need a client (to test client-server communication). You can run a separate command window and go to the BINARIES directory and type</p>
<h3 id="run-a-client-test-on-windows">Run a client (test) on Windows</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">ChatScript</span> client=localhost:1024 </code></pre></div>
<h3 id="run-a-client-test-on-linux">Run a client (test) on Linux</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./LinuxChatScript64</span> client=localhost:1024</code></pre></div>
<h3 id="run-a-client-test-on-macos">Run a client (test) on MacOS</h3>
<div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./MacChatScript</span> client=localhost:1024</code></pre></div>
<p>This will cause ChatScript to load as a client and you can talk to the server.</p>
<h2 id="how-to-build-a-bot">How to build a bot</h2>
<p>Run ChatScript locally. From the ChatScript command prompt, type</p>
<pre><code>:build Harry</code></pre>
<p>or whatever other preinstalled bot exists. If you have revised basic data, you can first:</p>
<pre><code>:build 0</code></pre>
<h2 id="how-to-compile-the-engine.">How to compile the engine.</h2>
<p>On windows if you have Visual Studio installed, launch <code>VS2010/chatscript.sln</code> or <code>VS2015/chatscript.sln</code> and do a build. The result will go in the <code>BINARIES</code> directory.</p>
<p>On Linux, go stand in the SRC directory and type <code>make server</code> (assuming you have make and g++ installed). This creates BINARIES/ChatScript, which can run as a server or locally. There are other make choices for installing PostGres or Mongo.</p>
<h1 id="full-documentation">Full Documentation</h1>
<p><a href="/WIKI/README.md">ChatScript Wiki (user guides, tutorials, papers)</a></p>
<h1 id="contributing">Contributing</h1>
<ol style="list-style-type: decimal">
<li>Fork it</li>
<li>Create your feature branch (git checkout -b my-new-feature)</li>
<li>Commit your changes (git commit -am 'Add some feature')</li>
<li>Push to the branch (git push origin my-new-feature)</li>
<li>Create new Pull Request</li>
</ol>
<h1 id="last-releases">Last releases</h1>
<p><a href="/changes.md">changes.md</a></p>
<h1 id="author">Author</h1>
<ul>
<li>Bruce Wilcox</li>
<li>home website: <a href="http://www.brilligunderstanding.com">BrilligUnderstanding.com</a></li>
<li>mail: <a href="mailto:[email protected]">[email protected]</a></li>
</ul>
</body>
</html>