小编gmv*_*gmv的帖子

更新对分数没有影响(Prediction API)

我正在尝试language_id.txtGoogle预测示例中的数据集.现在我正在尝试使用以下方法更新模型:

def update(label, data)
  input = @prediction.trainedmodels.update.request_schema.new
  input.label = label
  input.csv_instance = [data]
  result = @client.execute(
    :api_method => @prediction.trainedmodels.update,
    :parameters => {'id' => MODEL_ID},
    :headers => {'Content-Type' => 'application/json'},
    :body_object => input
  )
  assemble_json_body(result)
end
Run Code Online (Sandbox Code Playgroud)

(此方法基于一些Google示例代码.)

我的问题是这些更新没有任何效果.This is a test sentence.无论我运行了多少更新,以下是分数:

{
   "response":{
      "kind":"prediction#output",
      "id":"mymodel",
      "selfLink":"https://www.googleapis.com/prediction/v1.5/trainedmodels/mymodel/predict",
      "outputLabel":"English",
      "outputMulti":[
         {
            "label":"English",
            "score":0.420937
         },
         {
            "label":"French",
            "score":0.273789
         },
         {
            "label":"Spanish",
            "score":0.305274
         }
      ]
   },
   "status":"success"
}
Run Code Online (Sandbox Code Playgroud)

根据" 创建情感分析模型 " 底部的免责声明,我确保在预期任何更改之前至少更新100次.首先,我尝试使用一个句子并将其更新1000次.其次,我尝试使用从简单维基百科中抽取的~150个独特的句子,每次更新一次.每次更新都"成功":

{"response":{"kind":"prediction#training","id":"mymodel","selfLink":"https://www.googleapis.com/prediction/v1.5/trainedmodels/mymodel"},"status":"success"}
Run Code Online (Sandbox Code Playgroud)

但两种方法都没有改变我的结果

我也尝试过使用API​​ Explorer(Prediction,v1.5)并以这种方式更新~300次.我的结果仍然没有区别.这些更新也是"成功的".

200 OK …
Run Code Online (Sandbox Code Playgroud)

ruby google-prediction

23
推荐指数
1
解决办法
1252
查看次数

标签 统计

google-prediction ×1

ruby ×1