[英]Rasa NLU Trainer-How to fix “Can't find training file” error?
我正在使用RASA
堆栈创建天气机器人。我正在尝试访问NLU Trainer GUI
但出现错误。 它说即使我创建了一个 JSON 文件,它也找不到训练文件。它存储在 - Desktop/weather_bot/data
。我还使用以下方法成功安装了 nlu 训练器
sudo npm i -g rasa-nlu-trainer
但是当我尝试使用 rasa-nlu-trainer 访问 GUI 时,出现以下错误
Desktop/weather_bot/data/data.json
searching for the training examples...
(node:31971) UnhandledPromiseRejectionWarning: Error: Can't find training file, please try to specify it with the --source option
at checkDone (/usr/local/lib/node_modules/rasa-nlu-trainer/server.js:98:15)
at readData.then.catch.then (/usr/local/lib/node_modules/rasa-nlu-trainer/server.js:128:11)
at <anonymous>
(node:31971) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:31971) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
\\
大多数情况下,此错误是由于 server.js 中的这行代码if(!json.rasa_nlu_data){ return reject("....") }
而引发的,要解决此问题,请尝试包含{"rasa_nlu_data": {
as您的 data.json 文件或训练数据文件中的第一行代码,希望这能解决您的问题,
我遇到了同样的问题。 我在 data.json 文件的第一行代码中包含了 {"rasa_nlu_data": {。 但是我发现我的 JSON 文件有点错误。 我在最后一个 JSON 数据中放了一个逗号。 因此,请检查您的 JSON 文件是否正常。 我认为它应该可以工作。
这个命令应该可以工作。
rasa-nlu-trainer --source Desktop/weather_bot/data/data.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.