1. Learn
  2. /
  3. Courses
  4. /
  5. Feature Engineering for NLP in Python

Connected

Exercise

Readability of various publications

In this exercise, you have been given excerpts of articles from four publications. Your task is to compute the readability of these excerpts using the Gunning fog score and consequently, determine the relative difficulty of reading these publications.

The excerpts are available as the following strings:

  • forbes- An excerpt from an article from Forbes magazine on the Chinese social credit score system.
  • harvard_law- An excerpt from a book review published in Harvard Law Review.
  • r_digest- An excerpt from a Reader's Digest article on flight turbulence.
  • time_kids - An excerpt from an article on the ill effects of salt consumption published in TIME for Kids.

Instructions

100 XP
  • Import the Readability class from readability.
  • Compute the gf object for each excerpt using the gunning_fog() method on Readability.
  • Compute the Gunning fog score using the the score attribute.
  • Print the list of Gunning fog scores.