我查阅了各种文档以在我的 ubuntu 服务器上设置 Rasa NLU。他们有一个必须运行的 docker 容器
docker run -p 5000:5000 rasa/rasa_nlu:latest-full
所以我设置了一个模型和一些训练数据并重新启动了 docker 实例。当我/status
在 url 中访问时它无法找到我的模型,它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
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句