Premium Project

Word Frequency in Moby Dick

Use web scraping and NLP to find the most frequent words in Herman Melville's novel, Moby Dick.

  • 9 tasks
  • 2,459 participants
  • 1,500 XP

Project Description

In this Project, you'll scrape the novel Moby Dick from the website Project Gutenberg (which contains a large corpus of books) using the Python package requests. Then you'll extract words from this web data using BeautifulSoup. Finally, we'll dive into analyzing the distribution of words using the Natural Language ToolKit (nltk). The natural language processing tools used here apply to much of the data that data scientists encounter as a vast proportion of the world's data is unstructured data and includes a great deal of text.

To complete this Project, you need to know how to import web data into python and how to work with natural language text. Before starting this project we recommend that you have completed the following courses:

This Project is based on a live screencast by DataCamp's own Hugo Bowne-Anderson. When you've finished the Project, or if you get stuck, do check out the screencast with Hugo's solution (the screencast starts 12 minutes into the video). You can also find Hugo's solution notebook here.

Project Tasks

  • 1 Tools for text processing
  • 2 Request Moby Dick
  • 3 Get the text from the HTML
  • 4 Extract the words
  • 5 Make the words lowercase
  • 6 Load in stop words
  • 7 Remove stop words in Moby Dick
  • 8 We have the answer
  • 9 The most common word
Hugo Bowne-Anderson
Hugo Bowne-Anderson

Data Scientist at DataCamp

Hugo is a data scientist, educator, writer and podcaster and DataCamp. His main interests are promoting data & AI literacy, helping to spread data skills through organizations and society and doing amateur stand up comedy in NYC. If you want to know what he likes to talk about, definitely check out DataFramed, the DataCamp podcast, which he hosts and produces: https://www.datacamp.com/community/podcast

See More
TECHNOLOGY
  • Python
  • Icon Icon Icon professional info