Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: components/translate/core/browser/proto/ranker_model.proto

Issue 2565873002: [translate] Add translate ranker model loader. (Closed)
Patch Set: fix builders? Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/browser/proto/ranker_model.proto
diff --git a/components/translate/core/browser/proto/ranker_model.proto b/components/translate/core/browser/proto/ranker_model.proto
new file mode 100644
index 0000000000000000000000000000000000000000..de327e28ca292d5f2d0429bf87838f8642ba9436
--- /dev/null
+++ b/components/translate/core/browser/proto/ranker_model.proto
@@ -0,0 +1,39 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Experimental Translation Assist Model to allow/suppress translation prompts.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+import "translate_ranker_model.proto";
+
+package chrome_intelligence;
+
+// Metadata for a ranker model instance. This data describes how the ranker
+// model should be interpreted/used.
+message RankerModelMetadata {
+ // An identifier, typically a URL, denoting the source from which this model
+ // was obtained. The model referenced with a given source is presumed to be
+ // immutable; this can be used as a cache control mechanism. If the currently
+ // configured model source matches the source of a cached model, then there
+ // is no need to refresh the model.
+ optional string source = 1;
+
+ // The timestamp at which this model was download..
hamelphi 2017/01/20 18:44:18 downloaded, remove one '.'
Roger McFarlane (Chromium) 2017/02/08 23:08:09 Done.
+ optional int64 last_modified_sec = 2;
+
+ // The number of seconds after which this model should be considered expired.
+ // Defaults to 30 days, in seconds.
+ optional int64 cache_duration_sec = 3 [default = 2592000];
hamelphi 2017/01/20 18:44:18 What does it mean for a model to be expired? Is th
Roger McFarlane (Chromium) 2017/02/08 23:08:09 Updated thee documentation and dropped the default
+}
+
+// Defines an envelope/wrapper for general models.
+message RankerModel {
+ // Metadata.
+ optional RankerModelMetadata metadata = 1;
+
+ oneof model_type { TranslateRankerModel translate = 2; }
hamelphi 2017/01/20 18:44:18 This could be only 'model'. I find that model_type
Roger McFarlane (Chromium) 2017/02/08 23:08:08 That's not how the proto API works. You don't acce
+}

Powered by Google App Engine
This is Rietveld 408576698