#Eliza This repository contains a JSON express server, which is both the backend AND the frontend for an Eliza chatbot app.
Point Jasonette to the root url for this server and it will return a JSON response, which Jasonette will interpret to self-construct into a native app.
The core logic is just a typical NLP technique I took from another open source module called elizabot.js
.
The only part you need to look at is the main.js
:
- It starts an express server
- A Jasonette client makes a GET request to
/
. - The server responds by sending back the JSON markup, and the Jasonette client renders accordingly.
- The markup contains a footer input.
- When a user presses the
send
button, it triggers thesay
action, which makes a POST request to/messages
. - The server responds to the
POST /messages
request by saving it into local variable and returning the result. (This doesn't use any persistent DB, so the variable only stays on memory and will get reset when the server becomes idle)
- Set up a server using this code.
- Download Jasonette.
- Take the root url of your server and play it on Jasonette. Learn how.
#License
Here's the license for the core Eliza logic.
elizabot.js v.1.1 - ELIZA JS library (N.Landsteiner 2005)
Eliza is a mock Rogerian psychotherapist.
Original program by Joseph Weizenbaum in MAD-SLIP for "Project MAC" at MIT.
cf: Weizenbaum, Joseph "ELIZA - A Computer Program For the Study of Natural Language
Communication Between Man and Machine"
in: Communications of the ACM; Volume 9 , Issue 1 (January 1966): p 36-45.
JavaScript implementation by Norbert Landsteiner 2005; <http://www.masserk.at>