Building a TensorFlow model
The deep learning models in this chapter are built using TensorFlow, based on the original script written by Abhishek Thakur using Keras (you can read the original code at https://github.com/abhishekkrthakur/is_that_a_duplicate_quora_question). Keras is a Python library that provides an easy interface to TensorFlow. Tensorflow has official support for Keras, and the models trained using Keras can easily be converted to TensorFlow models. Keras enables the very fast prototyping and testing of deep learning models. In our project, we rewrote the solution entirely in TensorFlow from scratch anyway.
To start, let's import the necessary libraries, in particular TensorFlow, and let's check its version by printing it:
importzipfile fromtqdmimporttqdm_notebookastqdm importtensorflowastf print("TensorFlow version %s"%tf.__version__)
At this point, we simply load the data into the df
pandas dataframe or we load it from disk. We replace the missing values with an empty string...