chatterbot 中文测试

接着上一张的安装,进行了测试试验:

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer



Chinese_bot = ChatBot('chinese robot')
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(Chinese_bot)
# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.chinese")

# 测试一下
question = '早上好'
print(question)
response = Chinese_bot.get_response(question)
print(response)
print("\n")
question = '亲,在吗'
print(question)
response = Chinese_bot.get_response(question)
print(response)

运行结果:

Training ai.yml: [####################] 100%
Training botprofile.yml: [####################] 100%
Training conversations.yml: [####################] 100%
Training emotion.yml: [####################] 100%
Training food.yml: [####################] 100%
Training gossip.yml: [####################] 100%
Training greetings.yml: [####################] 100%
Training history.yml: [####################] 100%
Training humor.yml: [####################] 100%
Training literature.yml: [####################] 100%
Training money.yml: [####################] 100%
Training movies.yml: [####################] 100%
Training politics.yml: [####################] 100%
Training psychology.yml: [####################] 100%
Training science.yml: [####################] 100%
Training sports.yml: [####################] 100%
Training trivia.yml: [####################] 100%
早上好
是文艺参考启示录。


亲,在吗
有多远是太阳
 

评价:

感觉回答很差 ,每次运行结果不同,候选研究下如何换 训练集

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值