jiayihu / gmail-smart-compose

A study implementation of Gmail Smart Compose trained with Keras and used in browser with Tensorflow.js
MIT License
26 stars 8 forks source link

Gmail Smart Compose

Detailed article explaining the training process and usage in browser: Gmail Smart Compose in Keras and Tensorflow.js.

This is study implementation of the Gmail Smart Compose feature, which allows to suggest sentence completion personalized on the user emails.

The seq2seq model has been trained using Tensorflow Keras on Colab and the dataset has been provided by the Enron email dataset. Then the model is saved and loaded in the browser for immediate inference using Tensorflow.js.

In the browser, the model loading and the inference is done within a Web Worker to avoid blocking the main UI thread.

Note: currently there is a bug in Tensorflow.js, which doesn't support loading TF2.2 RNN GRU models (the Python version used in Colab).

Files