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

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

Issue 2565873002: [translate] Add translate ranker model loader. (Closed)
Patch Set: comments from sdefresne Created 3 years, 10 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..cde35b701009a2979d084c3532e09c5b5f8aa979
--- /dev/null
+++ b/components/translate/core/browser/proto/ranker_model.proto
@@ -0,0 +1,49 @@
+// 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 denoting the type or purpose of this model.
+ optional string name = 1;
+
+ // An identifier denoting the specific instance of this model. For example:
+ // "Experiment B"
+ optional string label = 2;
+
+ // 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, and the
+ // cached model has not expired then there is no need to refresh the model.
+ optional string source = 3;
+
+ // The timestamp at which this model was downloaded. This will be set by the
+ // model loader before it caches the model to disk.
+ optional int64 last_modified_sec = 4;
+
+ // The (optional) number of seconds after which this model should be
+ // considered expired. If the value is zero or not set, then the cached
+ // instance of the model never expires. A new download can be triggered by
+ // changing the configured source URL for the model loader.
+ optional int64 cache_duration_sec = 5;
+}
+
+// Defines an envelope/wrapper for general models.
+message RankerModelProto {
+ // Metadata.
+ optional RankerModelMetadata metadata = 1;
+
+ oneof model { TranslateRankerModel translate = 2; }
+}
« no previous file with comments | « components/translate/core/browser/proto/BUILD.gn ('k') | components/translate/core/browser/proto/translate_ranker_model.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698