繁体   English   中英

需要帮助来使用Docker设置Rasa NLU服务器

[英]Need help to setup Rasa NLU server with docker

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

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

因此,我设置了一个模型和少量训练数据,然后重新启动了docker实例。 当我转到url中的/status时,它找不到我的模型,并且它返回在响应中project not found 我相信我需要在运行docker容器时设置项目路径和模型路径。 但是我不确定该怎么做。

我是docker以及Rasa NLU的新手。 如果有人可以指出正确的方向,那将对您有很大帮助!

您提供的命令将启动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`

另一个选择是使用问题中的命令启动服务器,然后通过POST请求将培训数据发送到服务器来启动服务器上的培训 (确保标头指定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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM