我仔细阅读了各种文档,以在ubuntu服务器上设置Rasa NLU。他们有一个必须运行的docker容器
ArrayAdapter<MutableLiveData<List<String>>>
因此,我建立了一个模型,并提供了少量训练数据并重新启动了docker实例。当我进入url中的viewModel.getPlayListObservable().observe(this, new Observer<List<String>>() {
@Override
public void onChanged(List<String> playerList) {
ArrayAdapter<String> playerAdapter = new MyAdapter<String>(this, R.layout.grid_item, playerList);
gridView.setAdapter(playerAdapter);
playerAdapter.notifydataChanged();
}
});
时,它找不到我的模型,并且它在响应中返回docker run -p 5000:5000 rasa/rasa_nlu:latest-full
。我相信我需要在运行docker容器时设置项目路径和模型路径。但是我不确定该怎么做。
我是docker以及Rasa NLU的新手。如果有人可以指出我正确的方向,那将有很大帮助!
答案 0 :(得分:2)
您提供的命令将启动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