簡體   English   中英

Rasa NLU Trainer-如何修復“找不到訓練文件”錯誤?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM