记:安装chatterbot库的一系列辛酸史(完)

问题说明

最近安装chatterbot,来搭建个聊天机器人,然而,刚开始就卡住了,就仅仅搭这个环境就卡了我两三天!一个一个问题接踵而至,真是一把鼻涕一把泪地解决掉了!

  • 问题一:chatterbot安装不起来
  • 问题二:spacy安装不起来
  • 问题三:spacy里的en模块安装不起来
  • 问题四:pip3安装库的版本不兼容问题
  • 问题五

准备工作

下载python3,配置环境我就不说了,这是最基本的。
python3里自带pip3,记得也把pip3环境配置一下。
参考文档:

解决方案

2022年7月4日回头来补充文章
环境:
操作系统:uos专业版1050 x86
python3.7.3
网络可以科学上网

操作步骤:

 pip3 install chatterbot

安装成功,接下来测试是否可用

首先下载英语语言包
python3 -m spacy download en


对于网络不科学的伙伴,这里提供了离线安装包
在离线安装版本中,对于en的问题有涉及到链接,这是spacyv2.x的特点,v3.x将不需要使用
离线安装包地址:
蓝奏云

As of spaCy v3.0, model symlinks are not supported anymore. You can
load trained pipeline packages using their full names or from a
directory path.

其他下载地址:
蓝奏云
github


from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer

# creat a chatterbot
chatbot = ChatBot('Ron Obvious')
 
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)

# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.english")
 
# Get a response to an input statement
while True:
 
    q = input("UserInput:")
 
    print (chatbot.get_response(q))

在这里插入图片描述

安装时会有版本冲突,这里先不管了。后面有空再改
在这里插入图片描述

参考:
https://github.com/gunthercox/ChatterBot
https://chatterbot.readthedocs.io/en/stable/
https://spacy.io/api/cli#download
https://github.com/explosion/spacy-models/releases

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值