We will now write an app to predict sentiments of a movie review. Reviews are made up of a sequence of words and the order of words encodes very useful information to predict sentiment. The first step is to map words to word embeddings. The second step is the RNN that receives a sequence of vectors as input and considers the order of the vectors to generate the prediction.
We will now train a neural network for word to vector representation. Given a particular word in the center of a sentence, which is the input word, we look at the words nearby. The network is going to tell us the probability for every word in our vocabulary of being the nearby word that we choose.

import time import tensorflow as tf import numpy as np import utility from tqdm import tqdm from urllib.request import urlretrieve from os.path import isfile, isdir import zipfile from collections import Counter import random dataDir = 'data' dataFile = 'text8.zip' datasetName = 'text 8 data set...