已搜索,但無法在過去一年中找到類似問題。我試圖遵循this tutorial,但自從4月份發佈以來似乎有所改變。我已經構建了PubNub模塊,並已註冊Bluemix Watson帳戶並設置了自然語言理解服務。Bluemix/Watson自然語言處理無效API密鑰
它,當我嘗試運行PubNub測試包,我收到錯誤:
23點24分12秒的js:
[" TypeError: Cannot read property 'type' of undefined at Sentiment/IBM Watson.js:46:43 at process._tickCallback (internal/process/next_tick.js:109:7)"] Error at Sentiment/IBM Watson.js:76:21 at process._tickCallback (internal/process/next_tick.js:109:7)
23:24:13記者:
{ "body": "{ \"status\": \"ERROR\", \"statusInfo\": \"invalid-api-key\", \"usage\": \"By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html\", \"totalTransactions\": \"1\", \"language\": \"unknown\" }
用於API的教程代碼是這樣的:
export default (request) => {
// url for sentiment analysis api
const apiUrl = 'https://gateway-a.watsonplatform.net/calls/text/TextGetTextSentiment';
// api key
const apiKey = 'Your_API_Key';
,但似乎自從教程寫入以來,Bluemix的API格式發生了變化。該Bluemix憑據現在的格式爲:
{
"url": "https://gateway.watsonplatform.net/natural-language-understanding/api",
"username": "x",
"password": "y"
}
正如有人誰來自使用R作爲一個統計計算器和上週剛剛編寫他的第一個(原始)戰艦遊戲在Python中,任何幫助,非常感謝!