We will proceed with the recipe as follows:
- We will start by loading the necessary libraries. This time, we are loading the scikit-learn TF-IDF preprocessing library for our texts. Use the following code to do this:
import tensorflow as tf import matplotlib.pyplot as plt import csv import numpy as np import os import string import requests import io import nltk from zipfile import ZipFile from sklearn.feature_extraction.text import TfidfVectorizer
- We will start a graph session and declare our batch size and maximum feature size for our vocabulary:
sess = tf.Session() batch_size= 200 max_features = 1000
- Next, we will load the data, either from the web or from our temp data folder if we have saved it before. Use the following ...