I've tried to transition fully to python3, but yet it should mostly work in python2.7 as well!
I did not read the book on nltk. I've been into information/coding theory recently (just finished Information by James Gleick) and thought I'd try my hand at something closer to NLP/ML. Very little background in the topic - I've taken a few courses in college and chatted with a few friends that know ML fairly well, but besides that I relied on blog posts and papers found on arxiv!
I believe you intended to run in python3 based on your last cell.
changing maketrans and translate will have it run in python2.7
Did you read the book on nltk before writing this project? Curious about background skill development to undertake this project.