diff --git a/tensorflow/lite/models/BUILD b/tensorflow/lite/models/BUILD
deleted file mode 100644
index 6332636a0db..00000000000
--- a/tensorflow/lite/models/BUILD
+++ /dev/null
@@ -1,12 +0,0 @@
-# Model tests
-package(
- default_visibility = ["//visibility:public"],
-)
-
-licenses(["notice"]) # Apache 2.0
-
-exports_files(["LICENSE"])
-
-exports_files(glob([
- "testdata/*",
-]))
diff --git a/tensorflow/lite/models/smartreply/BUILD b/tensorflow/lite/models/smartreply/BUILD
deleted file mode 100644
index 9819c804cc2..00000000000
--- a/tensorflow/lite/models/smartreply/BUILD
+++ /dev/null
@@ -1,117 +0,0 @@
-load("//tensorflow:tensorflow.bzl", "tf_cc_test")
-load("//tensorflow/lite:build_def.bzl", "gen_selected_ops", "tflite_copts")
-
-package(
- default_visibility = [
- "//visibility:public",
- ],
- licenses = ["notice"], # Apache 2.0
-)
-
-exports_files(["LICENSE"])
-
-gen_selected_ops(
- name = "smartreply_ops",
- model = ["@tflite_smartreply//:smartreply.tflite"],
-)
-
-cc_library(
- name = "custom_ops",
- srcs = [
- "ops/extract_feature.cc",
- "ops/normalize.cc",
- "ops/predict.cc",
- ":smartreply_ops",
- ],
- copts = tflite_copts(),
- deps = [
- "//tensorflow/lite:framework",
- "//tensorflow/lite:string_util",
- "//tensorflow/lite/kernels:builtin_ops",
- "//tensorflow/lite/kernels:kernel_util",
- "//tensorflow/lite/kernels/internal:tensor",
- "@com_google_absl//absl/strings",
- "@com_googlesource_code_re2//:re2",
- "@farmhash_archive//:farmhash",
- ],
- alwayslink = 1,
-)
-
-cc_library(
- name = "predictor_lib",
- srcs = ["predictor.cc"],
- hdrs = ["predictor.h"],
- copts = tflite_copts(),
- deps = [
- ":custom_ops",
- "//tensorflow/lite:framework",
- "//tensorflow/lite:string_util",
- "//tensorflow/lite/kernels:builtin_ops",
- "@com_google_absl//absl/strings",
- "@com_googlesource_code_re2//:re2",
- ],
-)
-
-# TODO(b/118895218): Make this test compatible with oss.
-tf_cc_test(
- name = "predictor_test",
- srcs = ["predictor_test.cc"],
- data = [
- "//tensorflow/lite/models:testdata/smartreply_samples.tsv",
- "@tflite_smartreply//:smartreply.tflite",
- ],
- tags = ["no_oss"],
- deps = [
- ":predictor_lib",
- "//tensorflow/core:test",
- "//tensorflow/lite:string_util",
- "//tensorflow/lite/testing:util",
- "@com_google_absl//absl/strings",
- "@com_google_googletest//:gtest",
- ],
-)
-
-cc_test(
- name = "extract_feature_op_test",
- size = "small",
- srcs = ["ops/extract_feature_test.cc"],
- tags = ["no_oss"],
- deps = [
- ":custom_ops",
- "//tensorflow/lite:framework",
- "//tensorflow/lite/kernels:builtin_ops",
- "//tensorflow/lite/kernels:test_util",
- "@com_google_googletest//:gtest",
- "@farmhash_archive//:farmhash",
- ],
-)
-
-cc_test(
- name = "normalize_op_test",
- size = "small",
- srcs = ["ops/normalize_test.cc"],
- tags = ["no_oss"],
- deps = [
- ":custom_ops",
- "//tensorflow/lite:framework",
- "//tensorflow/lite:string_util",
- "//tensorflow/lite/kernels:builtin_ops",
- "//tensorflow/lite/kernels:test_util",
- "@com_google_googletest//:gtest",
- ],
-)
-
-cc_test(
- name = "predict_op_test",
- size = "small",
- srcs = ["ops/predict_test.cc"],
- tags = ["no_oss"],
- deps = [
- ":custom_ops",
- "//tensorflow/lite:framework",
- "//tensorflow/lite:string_util",
- "//tensorflow/lite/kernels:builtin_ops",
- "//tensorflow/lite/kernels:test_util",
- "@com_google_googletest//:gtest",
- ],
-)
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/AndroidManifest.xml b/tensorflow/lite/models/smartreply/demo/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 75ed9432c8f..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/BUILD b/tensorflow/lite/models/smartreply/demo/app/src/main/BUILD
deleted file mode 100644
index 8c489cf729f..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/BUILD
+++ /dev/null
@@ -1,68 +0,0 @@
-load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
-load(
- "//tensorflow/lite:build_def.bzl",
- "tflite_copts",
- "tflite_jni_binary",
-)
-
-package(
- default_visibility = ["//visibility:public"],
- licenses = ["notice"], # Apache 2.0
-)
-
-filegroup(
- name = "assets",
- srcs = [
- "@tflite_smartreply//:model_files",
- ],
-)
-
-android_binary(
- name = "SmartReplyDemo",
- srcs = glob(["java/**/*.java"]),
- assets = [":assets"],
- assets_dir = "",
- custom_package = "com.example.android.smartreply",
- manifest = "AndroidManifest.xml",
- nocompress_extensions = [
- ".tflite",
- ],
- resource_files = glob(["res/**"]),
- tags = ["manual"],
- deps = [
- ":smartreply_runtime",
- "@androidsdk//com.android.support:support-v13-25.2.0",
- "@androidsdk//com.android.support:support-v4-25.2.0",
- ],
-)
-
-cc_library(
- name = "smartreply_runtime",
- srcs = ["libsmartreply_jni.so"],
- visibility = ["//visibility:public"],
-)
-
-tflite_jni_binary(
- name = "libsmartreply_jni.so",
- deps = [
- ":smartreply_jni_lib",
- ],
-)
-
-cc_library(
- name = "smartreply_jni_lib",
- srcs = [
- "smartreply_jni.cc",
- ],
- copts = tflite_copts(),
- linkopts = [
- "-lm",
- "-ldl",
- ],
- deps = [
- "//tensorflow/lite:framework",
- "//tensorflow/lite/java/jni",
- "//tensorflow/lite/models/smartreply:predictor_lib",
- ],
- alwayslink = 1,
-)
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/assets/BUILD b/tensorflow/lite/models/smartreply/demo/app/src/main/assets/BUILD
deleted file mode 100644
index 86023676484..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/assets/BUILD
+++ /dev/null
@@ -1,16 +0,0 @@
-package(
- default_visibility = ["//visibility:public"],
- licenses = ["notice"], # Apache 2.0
-)
-
-exports_files(glob(["*"]))
-
-filegroup(
- name = "assets_files",
- srcs = glob(
- ["**/*"],
- exclude = [
- "BUILD",
- ],
- ),
-)
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/assets/backoff_response.txt b/tensorflow/lite/models/smartreply/demo/app/src/main/assets/backoff_response.txt
deleted file mode 100644
index a0a5b46b5f8..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/assets/backoff_response.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Ok
-Yes
-No
-👍
-☺
-😟
-❤️
-Lol
-Thanks
-Got it
-Done
-Nice
-I don't know
-What?
-Why?
-What's up?
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/MainActivity.java b/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/MainActivity.java
deleted file mode 100644
index 02fec9ae5e9..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/MainActivity.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright 2017 The TensorFlow 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.
-==============================================================================*/
-
-package com.example.android.smartreply;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.TextView;
-
-/**
- * The main (and only) activity of this demo app. Displays a text box which updates as messages are
- * received.
- */
-public class MainActivity extends Activity {
- private static final String TAG = "SmartReplyDemo";
- private SmartReplyClient client;
-
- private Button sendButton;
- private TextView messageTextView;
- private EditText messageInput;
-
- private Handler handler;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Log.v(TAG, "onCreate");
- setContentView(R.layout.main_activity);
-
- client = new SmartReplyClient(getApplicationContext());
- handler = new Handler();
-
- sendButton = (Button) findViewById(R.id.send_button);
- sendButton.setOnClickListener(
- (View v) -> {
- send(messageInput.getText().toString());
- });
-
- messageTextView = (TextView) findViewById(R.id.message_text);
- messageInput = (EditText) findViewById(R.id.message_input);
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- Log.v(TAG, "onStart");
- handler.post(
- () -> {
- client.loadModel();
- });
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- Log.v(TAG, "onStop");
- handler.post(
- () -> {
- client.unloadModel();
- });
- }
-
- private void send(final String message) {
- handler.post(
- () -> {
- messageTextView.append("Input: " + message + "\n");
-
- SmartReply[] ans = client.predict(new String[] {message});
- for (SmartReply reply : ans) {
- appendMessage("Reply: " + reply.getText());
- }
- appendMessage("------");
- });
- }
-
- private void appendMessage(final String message) {
- handler.post(
- () -> {
- messageTextView.append(message + "\n");
- });
- }
-}
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReply.java b/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReply.java
deleted file mode 100644
index 3357fd17c11..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReply.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright 2017 The TensorFlow 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.
-==============================================================================*/
-
-package com.example.android.smartreply;
-
-import android.support.annotation.Keep;
-
-/**
- * SmartReply contains predicted message, and confidence.
- *
- *
NOTE: this class used by JNI, class name and constructor should not be obfuscated.
- */
-@Keep
-public class SmartReply {
-
- private final String text;
- private final float score;
-
- @Keep
- public SmartReply(String text, float score) {
- this.text = text;
- this.score = score;
- }
-
- public String getText() {
- return text;
- }
-
- public float getScore() {
- return score;
- }
-}
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReplyClient.java b/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReplyClient.java
deleted file mode 100644
index cbd155bb0cd..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/java/com/example/android/smartreply/SmartReplyClient.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Copyright 2017 The TensorFlow 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.
-==============================================================================*/
-
-package com.example.android.smartreply;
-
-import android.content.Context;
-import android.content.res.AssetFileDescriptor;
-import android.support.annotation.Keep;
-import android.support.annotation.WorkerThread;
-import android.util.Log;
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.List;
-
-/** Interface to load TfLite model and provide predictions. */
-public class SmartReplyClient implements AutoCloseable {
- private static final String TAG = "SmartReplyDemo";
- private static final String MODEL_PATH = "smartreply.tflite";
- private static final String BACKOFF_PATH = "backoff_response.txt";
- private static final String JNI_LIB = "smartreply_jni";
-
- private final Context context;
- private long storage;
- private MappedByteBuffer model;
-
- private volatile boolean isLibraryLoaded;
-
- public SmartReplyClient(Context context) {
- this.context = context;
- }
-
- public boolean isLoaded() {
- return storage != 0;
- }
-
- @WorkerThread
- public synchronized void loadModel() {
- if (!isLibraryLoaded) {
- try {
- System.loadLibrary(JNI_LIB);
- isLibraryLoaded = true;
- } catch (Exception e) {
- Log.e(TAG, "Failed to load prebuilt smartreply_jni lib", e);
- return;
- }
- }
-
- try {
- model = loadModelFile();
- String[] backoff = loadBackoffList();
- storage = loadJNI(model, backoff);
- } catch (IOException e) {
- Log.e(TAG, "Fail to load model", e);
- return;
- }
- }
-
- @WorkerThread
- public synchronized SmartReply[] predict(String[] input) {
- if (storage != 0) {
- return predictJNI(storage, input);
- } else {
- return new SmartReply[] {};
- }
- }
-
- @WorkerThread
- public synchronized void unloadModel() {
- close();
- }
-
- @Override
- public synchronized void close() {
- if (storage != 0) {
- unloadJNI(storage);
- storage = 0;
- }
- }
-
- private MappedByteBuffer loadModelFile() throws IOException {
- try (AssetFileDescriptor fileDescriptor = context.getAssets().openFd(MODEL_PATH);
- FileInputStream inputStream = new FileInputStream(fileDescriptor.getFileDescriptor())) {
- FileChannel fileChannel = inputStream.getChannel();
- long startOffset = fileDescriptor.getStartOffset();
- long declaredLength = fileDescriptor.getDeclaredLength();
- return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength);
- }
- }
-
- private String[] loadBackoffList() throws IOException {
- List labelList = new ArrayList();
- try (BufferedReader reader =
- new BufferedReader(new InputStreamReader(context.getAssets().open(BACKOFF_PATH)))) {
- String line;
- while ((line = reader.readLine()) != null) {
- if (!line.isEmpty()) {
- labelList.add(line);
- }
- }
- }
- String[] ans = new String[labelList.size()];
- labelList.toArray(ans);
- return ans;
- }
-
- @Keep
- private native long loadJNI(MappedByteBuffer buffer, String[] backoff);
-
- @Keep
- private native SmartReply[] predictJNI(long storage, String[] text);
-
- @Keep
- private native void unloadJNI(long storage);
-}
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/res/layout/main_activity.xml b/tensorflow/lite/models/smartreply/demo/app/src/main/res/layout/main_activity.xml
deleted file mode 100644
index 23b4cadc007..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/res/layout/main_activity.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tensorflow/lite/models/smartreply/demo/app/src/main/smartreply_jni.cc b/tensorflow/lite/models/smartreply/demo/app/src/main/smartreply_jni.cc
deleted file mode 100644
index 9b5df36c37a..00000000000
--- a/tensorflow/lite/models/smartreply/demo/app/src/main/smartreply_jni.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Copyright 2017 The TensorFlow 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.
-==============================================================================*/
-
-#include
-#include
-#include
-
-#include "tensorflow/lite/model.h"
-#include "tensorflow/lite/models/smartreply/predictor.h"
-
-const char kIllegalStateException[] = "java/lang/IllegalStateException";
-
-using tflite::custom::smartreply::GetSegmentPredictions;
-using tflite::custom::smartreply::PredictorResponse;
-
-template
-T CheckNotNull(JNIEnv* env, T&& t) {
- if (t == nullptr) {
- env->ThrowNew(env->FindClass(kIllegalStateException), "");
- return nullptr;
- }
- return std::forward(t);
-}
-
-std::vector jniStringArrayToVector(JNIEnv* env,
- jobjectArray string_array) {
- int count = env->GetArrayLength(string_array);
- std::vector result;
- for (int i = 0; i < count; i++) {
- auto jstr =
- reinterpret_cast(env->GetObjectArrayElement(string_array, i));
- const char* raw_str = env->GetStringUTFChars(jstr, JNI_FALSE);
- result.emplace_back(std::string(raw_str));
- env->ReleaseStringUTFChars(jstr, raw_str);
- }
- return result;
-}
-
-struct JNIStorage {
- std::vector backoff_list;
- std::unique_ptr<::tflite::FlatBufferModel> model;
-};
-
-extern "C" JNIEXPORT jlong JNICALL
-Java_com_example_android_smartreply_SmartReplyClient_loadJNI(
- JNIEnv* env, jobject thiz, jobject model_buffer,
- jobjectArray backoff_list) {
- const char* buf =
- static_cast(env->GetDirectBufferAddress(model_buffer));
- jlong capacity = env->GetDirectBufferCapacity(model_buffer);
-
- JNIStorage* storage = new JNIStorage;
- storage->model = tflite::FlatBufferModel::BuildFromBuffer(
- buf, static_cast(capacity));
- storage->backoff_list = jniStringArrayToVector(env, backoff_list);
-
- if (!storage->model) {
- delete storage;
- env->ThrowNew(env->FindClass(kIllegalStateException), "");
- return 0;
- }
- return reinterpret_cast(storage);
-}
-
-extern "C" JNIEXPORT jobjectArray JNICALL
-Java_com_example_android_smartreply_SmartReplyClient_predictJNI(
- JNIEnv* env, jobject /*thiz*/, jlong storage_ptr, jobjectArray input_text) {
- // Predict
- if (storage_ptr == 0) {
- return nullptr;
- }
- JNIStorage* storage = reinterpret_cast(storage_ptr);
- if (storage == nullptr) {
- return nullptr;
- }
- std::vector responses;
- GetSegmentPredictions(jniStringArrayToVector(env, input_text),
- *storage->model, {storage->backoff_list}, &responses);
-
- // Create a SmartReply[] to return back to Java
- jclass smart_reply_class = CheckNotNull(
- env, env->FindClass("com/example/android/smartreply/SmartReply"));
- if (env->ExceptionCheck()) {
- return nullptr;
- }
- jmethodID smart_reply_ctor = CheckNotNull(
- env,
- env->GetMethodID(smart_reply_class, "", "(Ljava/lang/String;F)V"));
- if (env->ExceptionCheck()) {
- return nullptr;
- }
- jobjectArray array = CheckNotNull(
- env, env->NewObjectArray(responses.size(), smart_reply_class, nullptr));
- if (env->ExceptionCheck()) {
- return nullptr;
- }
- for (int i = 0; i < responses.size(); i++) {
- jstring text =
- CheckNotNull(env, env->NewStringUTF(responses[i].GetText().data()));
- if (env->ExceptionCheck()) {
- return nullptr;
- }
- jobject reply = env->NewObject(smart_reply_class, smart_reply_ctor, text,
- responses[i].GetScore());
- env->SetObjectArrayElement(array, i, reply);
- }
- return array;
-}
-
-extern "C" JNIEXPORT void JNICALL
-Java_com_example_android_smartreply_SmartReplyClient_unloadJNI(
- JNIEnv* env, jobject thiz, jlong storage_ptr) {
- if (storage_ptr != 0) {
- JNIStorage* storage = reinterpret_cast(storage_ptr);
- delete storage;
- }
-}
diff --git a/tensorflow/lite/models/smartreply/g3doc/README.md b/tensorflow/lite/models/smartreply/g3doc/README.md
deleted file mode 100644
index 04439293337..00000000000
--- a/tensorflow/lite/models/smartreply/g3doc/README.md
+++ /dev/null
@@ -1,146 +0,0 @@
-# Smart Reply Model
-
-## What is On-Device Smart Reply Model?
-
-Smart Replies are contextually relevant, one-touch responses that help the user
-to reply to an incoming text message (or email) efficiently and effortlessly.
-Smart Replies have been highly successful across several Google products
-including
-[Gmail](https://www.blog.google/products/gmail/save-time-with-smart-reply-in-gmail/),
-[Inbox](https://www.blog.google/products/gmail/computer-respond-to-this-email/)
-and
-[Allo](https://blog.google/products/allo/google-allo-smarter-messaging-app/).
-
-The On-device Smart Reply model is targeted towards text chat use cases. It has
-a completely different architecture from its cloud-based counterparts, and is
-built specifically for memory constraints devices such as phones & watches. It
-has been successfully used to provide [Smart Replies on Android
-Wear](https://research.googleblog.com/2017/02/on-device-machine-intelligence.html)
-to all first- & third-party apps.
-
-The on-device model comes with several benefits. It is:
-
-* **Faster**: The model resides on the device and does not require internet
- connectivity. Thus, the inference is very fast and has an average latency of
- only a few milliseconds.
-* **Resource efficient**: The model has a small memory footprint on
- the device.
-* **Privacy-friendly**: The user data never leaves the device and this
- eliminates any privacy restrictions.
-
-A caveat, though, is that the on-device model has lower triggering rate than its
-cloud counterparts (triggering rate is the percentage of times the model
-suggests a response for an incoming message).
-
-## When to use this Model?
-
-The On-Device Smart Reply model is aimed towards improving the messaging
-experience for day-to-day conversational chat messages. We recommend using this
-model for similar use cases. Some sample messages on which the model does well
-are provided in this [tsv
-file](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/models/testdata/smartreply_samples.tsv)
-for reference. The file format is:
-
-```
- {incoming_message smart_reply1 [smart_reply2] [smart_reply3]}
-```
-
-For the current model, we see a triggering rate of about 30-40% for messages
-which are similar to those provided in the tsv file above.
-
-In case the model does not trigger any response, the system falls back to
-suggesting replies from a fixed back-off set that was compiled from popular
-response intents observed in chat conversations. Some of the fallback responses
-are `Ok, Yes, No, 👍, ☺`.
-
-The model can only be used for inference at this time (i.e. it cannot be custom
-trained). If you are interested to know how the model was trained, please refer
-to this [blog
-post](https://research.googleblog.com/2017/02/on-device-machine-intelligence.html)
-and [research paper](https://arxiv.org/pdf/1708.00630).
-
-## How to use this Model?
-
-We have provided a pre-built demo APK that you can download, install and test on
-your phone
-([demo APK here](https://storage.googleapis.com/download.tensorflow.org/deps/tflite/SmartReplyDemo.apk)).
-
-The On-Device Smart Reply demo App works in the following way:
-
-1. Android app links to the JNI binary with a predictor library.
-
-2. In the predictor library, `GetSegmentPredictions` is called with a list of input
- strings.
-
- 2.1 The input string can be 1-3 most recent messages of the conversations in
- form of string vector. The model will run on these input sentences and
- provide Smart Replies corresponding to them.
-
- 2.2 The function performs some preprocessing on input data which includes:
-
- * Sentence splitting: The input message will be split into sentences if
- message has more than one sentence. Eg: a message like “How are you?
- Want to grab lunch?” will be broken down into 2 different sentences.
- * Normalization: The individual sentences will be normalized by converting
- them into lower cases, removing unnecessary punctuations, etc. Eg: “how
- are you????” will be converted to “how are you?” (refer for NORMALIZE op
- for more details).
-
- The input string content will be converted to tensors.
-
- 2.3 The function then runs the prediction model on the input tensors.
-
- 2.4 The function also performs some post-processing which includes
- aggregating the model predictions for the input sentences from 2.2 and
- returning the appropriate responses.
-
-3. Finally, it gets response(s) from `std::vector`, and
- returns back to Android app. Responses are sorted in descending order of
- confidence score.
-
-## Ops and Functionality Supported
-
-Following are the ops supported for using On-Device Smart Reply model:
-
-* **NORMALIZE**
-
- This is a custom op which normalizes the sentences by:
-
- * Converting all sentences into lower case.
- * Removing unnecessary punctuations (eg: “how are you????” → “how are
- you?”).
- * Expanding sentences wherever necessary (eg: “ I’m home” → “I am home”).
-
-* **SKIP_GRAM**
-
- This is an op inside TensorFlow Lite that converts sentences into a list of
- skip grams. The configurable parameters are `ngram_size` and
- `max_skip_size`. For the model provided, the values for these parameters are
- set to 3 & 2 respectively.
-
-* **EXTRACT_FEATURES**
-
- This is a custom op that hashes skip grams to features represented as
- integers. Longer skip-grams are allocated higher weights.
-
-* **LSH_PROJECTION**
-
- This is an op inside TensorFlow Lite that projects input features to a
- corresponding bit vector space using Locality Sensitive Hashing (LSH).
-
-* **PREDICT**
-
- This is a custom op that runs the input features through the projection
- model (details [here](https://arxiv.org/pdf/1708.00630.pdf)), computes the
- appropriate response labels along with weights for the projected features,
- and aggregates the response labels and weights together.
-
-* **HASHTABLE_LOOKUP**
-
- This is an op inside TensorFlow Lite that uses label id from predict op and
- looks up the response text from the given label id.
-
-## Further Information
-
-* Open source code
- [here](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/models/smartreply/).
diff --git a/tensorflow/lite/models/smartreply/ops/extract_feature.cc b/tensorflow/lite/models/smartreply/ops/extract_feature.cc
deleted file mode 100644
index ea5b185af60..00000000000
--- a/tensorflow/lite/models/smartreply/ops/extract_feature.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright 2017 The TensorFlow 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.
-==============================================================================*/
-
-// Convert a list of strings to integers via hashing.
-// Input:
-// Input[0]: A list of ngrams. string[num of input]
-//
-// Output:
-// Output[0]: Hashed features. int32[num of input]
-// Output[1]: Weights. float[num of input]
-
-#include
-#include