[英]creating NLC classifier on bluemix
當我嘗試根據此文檔創建NLC的新分類器時: http : //www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/natural-language-classifier/api/v1/? node#create_classifier
我無法創建新的分類器。 這是錯誤:
{ code: 400, error: undefined }
我不應該收到這種錯誤。
CSV文件非常小,僅供測試。
也許我做錯了。 但是那個錯誤:“未定義”什么也沒說...
這是代碼(與文檔相同)
var params = { language: 'es', name: "Train_NODE", training_data: fs.createReadStream('./public/uploads/'+req.files.file.name) }; natural_language_classifier.create(params, function(err, response) { if (err){ console.log(err); res.status(500).render('./APIs/NLC/', { title: err.description }); }else{ console.log(JSON.stringify(response, null, 2)); res.status(200).render('./APIs/NLC/', { title: 'Natural Language Classifer' }); } });
有人知道該怎么辦嗎?
這里的問題是正在使用的文件路徑。 它返回了不存在的文件。 硬編碼training.csv的文件路徑后,一切工作正常。
因此,當我們使用'./public/uploads/'+req.files.file.name時,出現了400錯誤,但是當我們使用'./public/uploads/MyTrainingFile.csv'時,它可以工作。
我們將期待一些更具描述性的錯誤消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.