A fork of an Eliza bot implementation at https://github.com/mattshiel/eliza-go which will be the basis of derivatives such as alternative personalities

gremlin df329b157e Merge branch 'feature/Eliza-009-Dont-Repeat-Yourself' of gremlin/elizaservice into develop 3 年 前
bots 4ca9a1f6f1 Eliza-014 Add Template functions 3 年 前
eliza 575656c6a6 Eliza-009 : Do repeat yourself unless absolutely necessary. 3 年 前
facades 5f896929c9 Eliza-010 Distributed Redis cache 3 年 前
infrastructure b8f0249f75 eliza-011 : Added placeholder replacement and version commands 3 年 前
templates 570c218af6 Eliza-012 Change Personality question-response format 3 年 前
web 570c218af6 Eliza-012 Change Personality question-response format 3 年 前
.gitignore ed4530d3db 1st commit 3 年 前
LICENSE ed4530d3db 1st commit 3 年 前
README.md 530ef8c38a Updated Readme 3 年 前
go.mod 5f896929c9 Eliza-010 Distributed Redis cache 3 年 前
go.sum 5f896929c9 Eliza-010 Distributed Redis cache 3 年 前
main.go 4ca9a1f6f1 Eliza-014 Add Template functions 3 年 前
makefile b8f0249f75 eliza-011 : Added placeholder replacement and version commands 3 年 前

README.md

Eliza-Go

Author: Gary Leeson based on the work of Matthew Shiel at https://github.com/mattshiel/eliza-go

How to Run The Chatbot

Assumes that Git and Go are installed along with the prerequisites. If not, they can be found from https://golang.org/dl/ and https://git-scm.com/downloads

1. Clone the Repository

> git clone https://git.riomhaire.com/gremlin/elizaservice.git

2. Change Directory to the Folder

Open the terminal/command line and navigate into the folder 
eg. > cd elizaservice

2. Compile the Chatbot

> make

3. Run the Chatbot

To run the chatbot enter './' followed by the executable produced
For Mac/Linux:
> ./eliza-server

Alternatively:
> go run server.go

4. Open the localhost

Go to your browser and type:
> 127.0.0.1:8080

Design Components

The primary design components that went into this project were as follows, a web server to serve a HTML as the root, Javascript to get the user input with ajax and finally all functionality and responses are contained in the eliza package.

Problems and Features

To give Eliza the impression she was thinking Matthew implemented a delay to her responses, adding to this the delay will also randomise between 0.6 and 4 seconds per response.

Eliza crafts her responses by examining the user's text input for a keyword. When the keyword is found it goes through a pre-processing procedure. This includes things like transforming all letters to lower case and trimming unnecessary whitespace. After this the word is tested against keywords in the 'responses.go' file. If a regex group is matched, the program gets the first match, the matched group then makes up a fraction of the response for added realism. If Eliza does not find a match then there are a number of fallback default response she will chose from. All responses are chosen randomly.

A problem Matthew encountered with this method is that selecting answers from the map of responses may be slightly non-deterministic, and the map will be out of order. In Weizenbaum's original design of Eliza he used a method of decomposition where all keywords held a certain value or 'precedence number'. This weighted approach is definitely another approach I could have taken when designing my program and something I might change in the future.

References

This implementation of Eliza gave Matthew many ideas and provided Matthew with the main method of implementing Matthew Eliza functionality https://github.com/kennysong/goeliza

I consulted both the the Golang, Bootstrap and JQuery documentation frequently over the course of my assignment.