【问题标题】:why isn't chatterbot working in this code?为什么 chatterbot 不能在这段代码中工作?
【发布时间】:2019-04-29 00:12:34
【问题描述】:

我有一个导入 chatterbot 的代码。 我跑 python -m spacy 下载 python terminal1.py.

终端1.py '''' 导入空间

from chatterbot import ChatBot

# Uncomment the following lines to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)

# Create a new instance of a ChatBot
bot = ChatBot(
    'Terminal',
     storage_adapter='chatterbot.storage.SQLStorageAdapter',
     logic_adapters=[
        'chatterbot.logic.MathematicalEvaluation',
        'chatterbot.logic.TimeLogicAdapter',
        'chatterbot.logic.BestMatch'
    ],
    database_uri='sqlite:///database.db'
)

print('Type something to begin...')

# The following loop will execute each time the user enters input
while True:
    try:
        user_input = input()

        bot_response = bot.get_response(user_input)

        print(bot_response)

    # Press ctrl-c or ctrl-d on the keyboard to exit
    except (KeyboardInterrupt, EOFError, SystemExit):
        break

''''

我得到了错误

OS错误:[E050] 找不到型号“en”。它似乎不是快捷链接、Python 包或数据目录的有效路径。

谁能帮我解决这个问题并在这个过程中运行代码。我将不胜感激。

【问题讨论】:

    标签: spacy chatterbot


    【解决方案1】:

    尝试运行此命令 pip install spacy && python -m spacy download en 这将链接 en 模型。

    【讨论】:

    • 感谢您的回复。我运行了命令。它仍然给出同样的错误。这是一台 Windows 8.1 机器。
    • 关注this,也许你能得到一些帮助。
    • 跟随链接和命令。 pip 列表显示 en-core-web-sm。还是一样的错误:找不到模型'en'
    猜你喜欢
    • 2012-06-10
    • 2017-06-08
    • 1970-01-01
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-16
    • 1970-01-01
    相关资源
    最近更新 更多