2016-09-22 7 views
2

AlchemyLanguage APIを使用してURLからキーワードを抽出しようとしています。私はカスタムWatson Knowledge Studioモデルを持っています。Alchemy言語+ WKSモデル+ NodeJs

次のコードは、アカウントに私のカスタムモデルを取ることはありません。

var alchemyL = watson.alchemy_language({ 
    api_key: 'mykey', 
    model_id: '6311a194-0b12-4795-8edc-66ac0174868f' 
}); 

var params = { 
    maxRetrieve: 1000, 
    url: 'http://nsf701.mybluemix.net/', 
} 

alchemyL.keywords(params, function (err, resp) { 
    if(err) { 
    console.log('error:', err); 
    } else { 
    console.log(resp); 
    } 
}); 

答えて

0

知識Studioは、あなただけtyped_relationエンドポイントで使用可能なカスタムモデルを作成し、訓練してみましょう。あなただけのメソッド名とあなたがmodel_id

var watson = require('watson-developer-cloud'); 
var alchemyL = watson.alchemy_language({ 
    api_key: 'API_KEY' 
}) 

var parameters = { 
    url: 'http://nsf701.mybluemix.net/', 
    model: '6311a194-0b12-4795-8edc-66ac0174868f' 
}; 

alchemyL.typedRelations(parameters, function (err, response) { 
    if (err) 
    console.log('error:', err); 
    else 
    console.log(JSON.stringify(response, null, 2)); 
}); 

http://www.ibm.com/watson/developercloud/alchemy-language/api/v1/?node#typed_relations

を参照してくださいを送る方法を更新する必要が

関連する問題