Doing term frequency with Spark - everything that counts

For this recipe, we will download a book in text format from Project Gutenberg, from http://www.gutenberg.org/cache/epub/62/pg62.txt.

Project Gutenberg offers over 50,000 free eBooks in various formats for human consumption. Please read their terms of use; let us not use command-line tools to download any books.

When you look at the contents of the file, you will notice the title and author of the book is The Project Gutenberg EBook of A Princess of Mars by Edgar Rice Burroughs.

This eBook is for the use of anyone, anywhere, at no cost, and with almost no restrictions whatsoever. You may copy it, give it away, or reuse it under the terms of the Project Gutenberg License included with ...

Get Apache Spark 2.x Machine Learning Cookbook 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.