Feature Engineering for NLP in Python
Rounak Banik
Data Scientist
| Reading ease score | Grade Level |
|---|---|
| 90-100 | 5 |
| 80-90 | 6 |
| 70-80 | 7 |
| 60-70 | 8-9 |
| 50-60 | 10-12 |
| 30-50 | College |
| 0-30 | College Graduate |
| Fog index | Grade level |
|---|---|
| 17 | College graduate |
| 16 | College senior |
| 15 | College junior |
| 14 | College sophomore |
| 13 | College freshman |
| 12 | High school senior |
| 11 | High school junior |
| Fog index | Grade level |
|---|---|
| 10 | High school sophomore |
| 9 | High school freshman |
| 8 | Eighth grade |
| 7 | Seventh grade |
| 6 | Sixth grade |
# Download nltk punkt module
import nltk
nltk.download('punkt_tab')
# Import the Readability class from readability import Readability# Create a Readability Object readability_scores = Readability(text)# Generate scores gf = readability_scores.gunning_fog() print(gf.score())
16.26
Feature Engineering for NLP in Python