Appendix
1. Data Storage Fundamentals
Activity 1.01: Creating a Text Classifier for Movie Reviews
Solution
- Create a new directory, Activity01.01, in the Chapter01 directory to store the files for this activity.
- Move the aclImdb folder to the Datasets directory.
- Open your Terminal (macOS or Linux) or Command Prompt (Windows), navigate to the Chapter01 directory, and type jupyter notebook.
- In the Jupyter notebook, click the Activity01.01 directory and create a new notebook file with a Python3 kernel.
- Import the os library and a random library, and define where our training and test data is stored using four variables, as shown in the following code:
import os
import random
dataset_train_pos_path = "../Datasets/aclImdb/train/pos/"
dataset_train_neg_path ...
Get The Artificial Intelligence Infrastructure Workshop now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.