簡體   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