Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Ruby implementation ELIZA, your friendly neighborhood robo Rogerian psychotherapist.

License

NotificationsYou must be signed in to change notification settings

tansengming/eliza-rb

Repository files navigation

Code ClimateTest Coverage

ELIZA-rb

A Ruby implementation Joseph Weizenbaum's ELIZA, your friendly neighborhood robo Rogerian psychotherapist.

This is a work in progress. The rules needs a bit more work before it's ready for 1.0. In the meantime have fun and let me know how it goes.

This is what it looks like chatting with her,

ELIZA: Please tell me what's been bothering you.I have problems sleeping every night. ELIZA: That's quite interesting.It's not really interesting. More bothersome than anything. ELIZA: What does that suggest to you?I think it means that I've been having bad dreams. ELIZA: You say you think it means that you've been having bad dreams?Yes, exactly. ELIZA: I understand.But how can you? You're a computer!ELIZA: What about machines worries you?

Getting Started

Installing

TBD

Usage

eliza=Eliza::Bot.newinitial=eliza.initial_phrasereply=eliza.transform(input_string)# `#transform` returns a final phrase in case of a quit phrase# but you can also get a final phrase with:final=eliza.final_phrase

Command Line Interface

You can chat with ELIZA on the CLI by running:

./bin/eliza-rb

Docker

If you already have Docker installed, here's how you can get started:

  • docker build -t eliza-rb github.com/tansengming/eliza-rb
  • docker run -it eliza-rb

Development

Approach

ELIZA works by matching keywords and using those keywords to form replies witha bunch of rules:

Let's sayforget is a keyword with decomposition and reassembly rules that look like this:

{decomposition_pattern:"* i forget *"reassembly_pattern:Can you think of why you might forget \2?}

If we start off with a sentence like:

What if I forgetabout the kettle?

Applying the rules would create this reply:

Can you think of why you might forgetabout the kettle?

References

About

A Ruby implementation ELIZA, your friendly neighborhood robo Rogerian psychotherapist.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp