From 6ef0e5415f3d08059f7074948c4779c0686f30e8 Mon Sep 17 00:00:00 2001 From: prasanna08 Date: Tue, 21 Jul 2020 11:53:37 +0530 Subject: [PATCH 1/2] Add proto files --- text_classifier.proto | 23 +++++++++++++++ training_job_response_payload.proto | 44 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 text_classifier.proto create mode 100644 training_job_response_payload.proto diff --git a/text_classifier.proto b/text_classifier.proto new file mode 100644 index 0000000..d75e390 --- /dev/null +++ b/text_classifier.proto @@ -0,0 +1,23 @@ +// coding: utf-8 +// +// Copyright 2020 The Oppia Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +message TextClassifierFrozenModel { + // The parameters of a trained text classifier model which are necessary + // for inference. + string model_json = 1; +} diff --git a/training_job_response_payload.proto b/training_job_response_payload.proto new file mode 100644 index 0000000..826dec1 --- /dev/null +++ b/training_job_response_payload.proto @@ -0,0 +1,44 @@ +// coding: utf-8 +// +// Copyright 2020 The Oppia Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "text_classifier.proto"; + +// Training job response payload contains job result of the training job +// along with other metadata items such as vm_id (to identify which VM executed +// this job) and signature of the payload for security purpose. +message TrainingJobResponsePayload { + // Job result of the training job. Job result contains the ID of the Job and + // trained model (frozen model) of the job. + message JobResult { + // Id of the training job whose data is being stored. + string job_id = 1; + + // Each of the classifier algorithms' proto message must be present in + // the oneof classifier_data field. + oneof classifier_frozen_model { + TextClassifierFrozenModel text_classifier = 2; + } + } + JobResult job_result = 1; + + // Id of the VM instance that trained the job. + string vm_id = 2; + + // Signature of the job data for authenticated communication. + string signature = 3; +} From b9b2103e367987520c7f17caf67e54169aaba6a4 Mon Sep 17 00:00:00 2001 From: prasanna08 Date: Tue, 21 Jul 2020 11:55:36 +0530 Subject: [PATCH 2/2] Fix newline tests --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8cb2db8..71d4c61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .vscode/* third_party/* -