【问题标题】:Need help to setup Rasa NLU server with docker需要帮助来使用 docker 设置 Rasa NLU 服务器
【发布时间】:2019-01-09 19:05:51
【问题描述】:

我浏览了各种文档以在我的 ubuntu 服务器上设置 Rasa NLU。他们有一个必须运行的 docker 容器

docker run -p 5000:5000 rasa/rasa_nlu:latest-full

所以我设置了一个模型和一些训练数据并重新启动了 docker 实例。当我在 url 中转到 /status 并且它在响应中返回 project not found 时,它无法找到我的模型。我相信我需要在运行 docker 容器时设置项目路径和模型路径。但我不知道该怎么做。

我是 docker 和 Rasa NLU 的新手。如果有人能指出我正确的方向,那将有很大的帮助!

【问题讨论】:

    标签: docker machine-learning rasa-nlu rasa-core


    【解决方案1】:

    您提供的命令启动 NLU 服务器。 由于您的状态是project not found,您似乎还没有提供经过训练的模型。

    您可以将包含训练模型的目录挂载为 Docker 卷,例如:

    docker run 
      -v nlu-models:/app/nlu-models \ # mounts the directory `nlu-models` in the container to `/app/nlu-models`
      -p 5000:5000 \ # maps the container port 5000 to port 5000 of your host
      rasa/rasa_nlu:latest-full \ # the Docker image
      start --path /app/nlu-models # starts the NLU server and points it to the directory with the trained models`
    

    另一种选择是使用您问题中的命令启动服务器,然后通过sending the training data via POST request to the server 在服务器上开始训练(确保您的标题指定Content-Type: application/x-yml)。为此,请指定一个文件 config_train_server.yml,其中包含 NLU 管道的配置和训练数据,例如:

    language: "en"
    
    pipeline: "spacy_sklearn"
    
    # data contains the same md, as described in the training data section
    data: |
      ## intent:affirm
      - yes
      - yep
    
      ## intent:goodbye
      - bye
      - goodbye
    

    然后你可以通过POST请求将文件内容发送到服务器,例如:

    curl -XPOST \ # POST request
      -H "Content-Type: application/x-yml" \ # content header localhost:5000/train?project=my_project \
      -d @config_train_server.yml # pipeline config and training data as body of the POST request
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      • 2023-03-19
      相关资源
      最近更新 更多