We will proceed with the recipe as follows:
- We will start by loading the necessary libraries and starting a graph session, as follows:
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import random import os import pickle import string import requests import collections import io import tarfile import urllib.request import text_helpers from nltk.corpus import stopwords sess = tf.Session()
- We will load the movie review corpus, just as we did in the previous two recipes. Use the following code to do this:
texts, target = text_helpers.load_movie_data()
- We will declare the model parameters, like so:
batch_size = 500 vocabulary_size = 7500 generations = 100000 model_learning_rate = 0.001 embedding_size ...