変数 = doPredict( 調べるテキスト );
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
function myFunc(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var input_text = Browser.inputBox("input text:");
  Browser.msgBox("言語名:" + doPredict(input_text));  
}
function doPredict(input_text){
  var datafile = "my_sample_data/language_id.txt";
  var prediction_input = Prediction.newPredictInput().setCsvInstance([input_text]); 
  var prediction_out = Prediction.predict(datafile,{"input" : prediction_input}); 
  return prediction_out.getOutputLabel();
}
| << 前へ |