gmv*_*gmv 23 ruby google-prediction
我正在尝试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
{
"kind": "prediction#training",
"id": "mymodel",
"selfLink": "https://www.googleapis.com/prediction/v1.5/trainedmodels/mymodel"
}
Run Code Online (Sandbox Code Playgroud)
我很确定该模型正在接收这些更新.get并且analyze都表明该模型具有numberInstances": "2024".但奇怪的是,list该模型表明了这一点"numberInstances": "406".
此时,我不知道是什么导致了这个问题.
2019年更新
根据 Jochem Schulenklopper 的评论,该 API 已于 2018 年 4 月关闭。
选择迁移到 Google Cloud 机器学习引擎的开发人员将必须重新创建现有的 Prediction API 模型。
机器学习 API 示例: https: //github.com/GoogleCloudPlatform/cloudml-samples
| 归档时间: |
|
| 查看次数: |
1252 次 |
| 最近记录: |