Member-only story
Let’s build a text classifier with TensorFlow and Python!
Welcome back! TensorFlow is one of the best machine learning packages for Python, so let’s build a basic machine learning project with this package. Now, this specific project was actually built out by the TensorFlow team, it’s hosted on Google Colab as well, so if you want to run this project straight in your web browser check out the link below:
The specific project we’ll be building out is a text classification project, we’ll be looking at reviews from IMDB and determining whether they are positive or negative. With that long introduction out of the way, let’s build out this project!
The Code
Starting off, make sure to have the following packages installed in your environment: numpy, TensorFlow and matplotlib. Next up, let’s go ahead and import these packages and verify the versions that they are on:
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
import matplotlib.pyplot as pltprint("Version: ", tf.__version__)…