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 | 大學畢業 |
| 霧指數 | 年級 |
|---|---|
| 17 | 大學畢業 |
| 16 | 大四 |
| 15 | 大三 |
| 14 | 大二 |
| 13 | 大一 |
| 12 | 高三 |
| 11 | 高二 |
| 霧指數 | 年級 |
|---|---|
| 10 | 高一 |
| 9 | 國三 |
| 8 | 國二 |
| 7 | 國一 |
| 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
Python 中文本特徵工程