【问题标题】:Failed to connect to duckling http server. Make sure the duckling server is running and the proper host and port are set in the configuration连接小鸭 http 服务器失败。确保小鸭服务器正在运行,并且在配置中设置了正确的主机和端口
【发布时间】:2019-11-27 06:59:13
【问题描述】:

我已经在 slack 上创建了工作场所,并且在那里注册了应用程序,我从那里获得了必要的东西,例如 slack 令牌和通道,以将其放入 rasa 的 credentials.yml 文件中。获得所有凭据后,我尝试使用以下命令在 rasa bot 和 slack 之间进行连接:

rasa run

我的 credentials.yml 包含:

松弛:

  slack_token: "xoxb-****************************************"
  slack_channel: "#ghale"

在这里,我使用 ngrok 将运行在本地计算机上的 Web 服务器公开到 Internet

但得到错误:

rasa.nlu.extractors.duckling_http_extractor - 无法连接到小鸭 http 服务器。确保小鸭服务器正在运行,并且在配置中设置了正确的主机和端口。更多关于如何运行服务器的信息可以在 github 上找到:https://github.com/facebook/duckling#quickstart Error: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /parse (Caused by NewConnectionError(': Failed to建立新连接:[WinError 10061] 无法建立连接,因为目标机器主动拒绝它',))

【问题讨论】:

    标签: python-3.x chatbot slack-api ngrok rasa


    【解决方案1】:

    你在用 Duckling 吗? Duckling 是一个基于规则的组件来提取实体(docs)。

    如果您不使用它,可以将其从 NLU 管道中删除。 如果你想使用它,最简单的方法是使用 docker:

    docker run -p 8000:8000 rasa/duckling
    

    上面的命令将运行小鸭并将其暴露在您主机的端口8000 上。

    【讨论】:

      【解决方案2】:

      只是为了补充@Tobias的答案;

      如果您在端口 8000 上运行其他服务,则可以将任何其他端口与容器的端口绑定并在管道配置中指定。

      示例: docker run -p <Desired Port, ex- 1000>:8000 rasa/duckling

      更改配置文件以反映这一点。您的管道应包括

      - name: DucklingHTTPExtractor
      # https://rasa.com/docs/rasa/nlu/components/#ducklinghttpextractor
        url: http://localhost:<Desired Port, 1000>
      

      使用更改的配置重新训练您的模型。 训练后,只需运行:rasa run

      【讨论】:

      • 谢谢,我遇到了同样的问题,你的评论救了我。
      【解决方案3】:

      如果您正在进行数字提取(例如 6 到 6 等),我认为这将有助于在 Rasa 上填写表单 - 您需要安装 docker,然后在端口 8000 上公开小鸭

      首先,安装 docker(假设是 Fedora,但您可以查找其他发行版)

      sudo dnf install docker
      

      二、激活docker

      sudo systemctl start docker
      

      最后,激活 Rasa 的 docker

      docker run -p 8000:8000 rasa/duckling
      

      您的回复应该是 - 状态:“已为 docker.io/rasa/duckling:最新收听http://0.0.0.0:8000"

      【讨论】:

        猜你喜欢
        • 2019-03-04
        • 2022-07-18
        • 2012-02-07
        • 2018-04-04
        • 2014-09-04
        • 1970-01-01
        • 2018-04-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多