Skip to content

个人对 ELIZA 网络上出现的代码的修改

Notifications You must be signed in to change notification settings

LRoInT/pyelizaplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ELIZA-CHANGE

介绍

ELIZA 的 Python 实现. ELIZA 是基于规则的聊天机器人, 用于扮演一个心理医生. 规则文件在 doctor.txt. 如何写规则文件见 rule.md

使用

从文件运行:

$ python eliza.py
How do you do.  Please tell me your problem.
> I would like to have a chat bot.
You say you would like to have a chat bot ?
> bye
Goodbye.  Thank you for talking to me.

作为包使用:

import eliza

eliza = eliza.Eliza()
eliza.load('doctor.txt')

print(eliza.initial())
while True:
    said = input('> ')
    response = eliza.respond(said)
    if response is None:
        break
    print(response)
print(eliza.final())

说明

源代码参考github:wadetb/eliza

About

个人对 ELIZA 网络上出现的代码的修改

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages