问题描述
如何通过RASA NLU程序创建培训数据?实际上,我正在使用MEAN堆栈开发应用程序,该应用程序准备了需要使用RASA NLU进行训练的数据.
How to create training data through program for RASA NLU?Actually I am developing an application using MEAN stack, this application prepares the data that needs to be trained with RASA NLU.
但是我不知道如何将该信息从我的nodejs服务器传递到RASA NLU.是否有支持的api来实现这一目标?
But I don't know how to pass this info from my nodejs server to RASA NLU. Is there any supported api's to achieve this?
推荐答案
Rasa具有功能强大的API,如此处.
Rasa has a highly functional API as documented here.
要回答特定问题,您可以通过以下命令将训练数据传递给Rasa NLU API:
To answer the specific question you can pass training data to the Rasa NLU API via the below commands:
如果您的训练数据在文件中:
If your training data is in a file:
curl -XPOST localhost:5000/train?project=my_project -d @data/examples/rasa/demo-rasa.json
如果您的训练数据为json格式:
If your training data is in json format:
curl --request POST \
--url 'http://localhost:5000/train?project=test&fixed_model_name=tested-project' \
--header 'content-type: application/json' \
--data ' {
"rasa_nlu_data": {
"regex_features": [
{
"name": "zipcode",
"pattern": "[0-9]{5}"
}
],
"entity_synonyms": [
{
"value": "chinese",
"synonyms": ["Chinese", "Chines", "chines"]
},
{
"value": "vegetarian",
"synonyms": ["veggie", "vegg"]
}
],
"common_examples": []
}
}'
显然,您需要创建json文件或有效负载.并且在Node中您不会使用curl,而是使用 request 之类的库.
Obviously you'll need to create the json file or payload. and in Node you wouldn't be using curl, but a library like request.
我写了系列教程可能有助于您开始与Rasa的API进行交互.
I've written a series of tutorials that may be good to help you get started interacting with Rasa's API.
这篇关于如何通过程序Node.js为RASA NLU创建训练数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!