Feature Engineering for NLP in Python
Rounak Banik
Data Scientist
| คะแนนความสามารถในการอ่าน | ระดับชั้น |
|---|---|
| 90-100 | 5 |
| 80-90 | 6 |
| 70-80 | 7 |
| 60-70 | 8-9 |
| 50-60 | 10-12 |
| 30-50 | มหาวิทยาลัย |
| 0-30 | บัณฑิต |
| Fog index | ระดับชั้น |
|---|---|
| 17 | บัณฑิต |
| 16 | ปี 4 |
| 15 | ปี 3 |
| 14 | ปี 2 |
| 13 | ปี 1 |
| 12 | ม.6 |
| 11 | ม.5 |
| Fog index | ระดับชั้น |
|---|---|
| 10 | ม.4 |
| 9 | ม.3 |
| 8 | ม.2 |
| 7 | ม.1 |
| 6 | ป.6 |
# 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