All Projects → arosspope → eliza-rs

arosspope / eliza-rs

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
A rust implementation of ELIZA - a natural language processing program developed by Joseph Weizenbaum in 1966.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to eliza-rs

simplematch
Minimal, super readable string pattern matching for python.
Stars: ✭ 147 (+206.25%)
Mutual labels:  regex
bhedak
A replacement of "qsreplace", accepts URLs as standard input, replaces all query string values with user-supplied values and stdout.
Stars: ✭ 77 (+60.42%)
Mutual labels:  regex
expressive-ts
A functional programming library designed to simplify building complex regular expressions
Stars: ✭ 78 (+62.5%)
Mutual labels:  regex
langua
A suite of language tools
Stars: ✭ 29 (-39.58%)
Mutual labels:  linguistics
termco
Regular Expression Counts of Terms and Substrings
Stars: ✭ 24 (-50%)
Mutual labels:  regex
devfuria.com.br
http://devfuria.com.br/
Stars: ✭ 3 (-93.75%)
Mutual labels:  regex
KoParadigm
KoParadigm: Korean Inflectional Paradigm Generator
Stars: ✭ 48 (+0%)
Mutual labels:  linguistics
LangPad
A word processor/dictionary/generally useful tool for linguistics.
Stars: ✭ 20 (-58.33%)
Mutual labels:  linguistics
es6-template-regex
Regular expression for matching es6 template delimiters in a string.
Stars: ✭ 15 (-68.75%)
Mutual labels:  regex
libpalaso
Palaso Library: A set of .Net libraries useful for developers of Language Software.
Stars: ✭ 36 (-25%)
Mutual labels:  linguistics
verbecc
Complete Conjugation of any Verb using Machine Learning for French, Spanish, Portuguese, Italian and Romanian
Stars: ✭ 45 (-6.25%)
Mutual labels:  linguistics
regXwild
⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.
Stars: ✭ 20 (-58.33%)
Mutual labels:  regex
expletives
Expletives vomiting library...
Stars: ✭ 12 (-75%)
Mutual labels:  linguistics
regexp-expand
Show the ELisp regular expression at point in rx form.
Stars: ✭ 18 (-62.5%)
Mutual labels:  regex
tokenquery
TokenQuery (regular expressions over tokens)
Stars: ✭ 28 (-41.67%)
Mutual labels:  regex
AutomateWithPython
If you've ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you? In Automate the Boring Stuff with Python, you'll learn how to use Python to write programs that do in minutes what would take you hours to do by hand-no prior…
Stars: ✭ 22 (-54.17%)
Mutual labels:  regex
solregex
Regex compilation to Solidity
Stars: ✭ 37 (-22.92%)
Mutual labels:  regex
my-swift-projects
An overview of my most relevant open-source projects on GitHub
Stars: ✭ 261 (+443.75%)
Mutual labels:  regex
mlconjug3
A Python library to conjugate verbs in French, English, Spanish, Italian, Portuguese and Romanian (more soon) using Machine Learning techniques.
Stars: ✭ 47 (-2.08%)
Mutual labels:  linguistics
LLRegex
Regular expression library in Swift, wrapping NSRegularExpression.
Stars: ✭ 18 (-62.5%)
Mutual labels:  regex

eliza-rs

Crates.io Documentation Build Status

This rust binary is an implementation of the early 'chatbot' program ELIZA. The original program was developed from 1964 to 1966 at the MIT Artificial Intelligence Laboratory by Joseph Weizenbaum.

Introduction

convo

ELIZA simulates conversation by implementing pattern matching and a substitution methodology that gives users an illusion of understanding on the part of the program. Directives on how to process input are provided by 'scripts', (written originally in MAD-Slip, now in json) which allow ELIZA to engage in discourse by following script rules. Weizenbaum’s intention was to demonstrate that the communication between man and machine is superficial. The most famous script, DOCTOR, simulates a Rogerian psychotherapist.

Weizenbaum, J. (1996), ELIZA - A computer program for the study of natural language communication between man and machine, Communications of the ACM, vol 9, issue 1

Installation

To install this rust binary, one can do so from source or from crates.io. In either case, you need to have the rust compiler and cargo installed on your system.

From crates.io

Installing eliza from crates.io is quite simple with cargo:

user@foo(~)$ cargo install eliza

From source

After forking this project and cloning it to your local machine, navigate to the project directory and run:

user@foo(eliza-rs)$ cargo build

You may also want to optionally run the unit tests to ensure ELIZA is behaving as expected:

user@foo(eliza-rs)$ cargo test

Usage

To start an ELIZA session, you must provide the binary with a path to an ELIZA script. This script takes the form of a json file. Assuming that you have installed from source and wanted to run the famous DOCTOR program, the command you would run from the project root would be similar to:

user@foo(eliza-rs)$ cargo run scripts/doctor.json
...

If instead, you installed from crates.io, then the location of doctor.json will be different. Out of convenience I decided to bundle the doctor.json script with the eliza binary on crates.io. For each user, it's location will be slightly different within the crates registry, so I would suggest moving it to somewhere more memorable before running:

user@foo(~)$ cp .cargo/registry/src/[some_hash]/eliza-[ver]/scripts/doctor.json .
user@foo(~)$ eliza doctor.json
...

running

Starting eliza with cargo then leaving the session


Writing your own ELIZA script

The beauty of ELIZA's design methodology means that the role of the programmer and playwright are separated. An important property of ELIZA is that a script is data - it is not part of the program itself. Hence, ELIZA is not restricted to a particular set of recognition patterns or responses, indeed not even to any specific language.

As such, contributors may decide to improve the original doctor.json script or completely create their own from scratch. A simple example of a pirate script has been included to show how little is needed to start creating something neat.

More information on the structure of a script can be found in the documentation for the script module on doc.rs.

Testing

Due to the somewhat deterministic nature of ELIZA, you can write unit tests to evaluate script rules. For example, in tests/conversation_test.rs, you could add the following:

#[test]
fn your_test(){
    let mut e = Eliza::new("scripts/your_script.json").unwrap();
    assert_eq!("bar", e.respond("foo"));
}

Where 'foo' is the users input to ELIZA, and 'bar' is the response.

It is also important to note that ELIZA produces logging output. To observe these logs during program execution, start the binary with the environment variable RUST_LOG=eliza.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].