Last active
May 6, 2022 14:34
-
-
Save YiLi225/9d2d9b593158ac19e4256cd8d33684d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Install: !pip install textstate | |
import textstat | |
# curText = doc_set[27310] | |
# (1) Flesch readability score | |
print(textstat.flesch_reading_ease(curText)) | |
68.94 ## indicating Standard | |
# (2) Reading time, assuming 15 ms/character | |
print(textstat.reading_time(curText, ms_per_char=15)) | |
3.8 ## 3.8s to read | |
# (3) Grade level: Intended for text written for children up to grade four | |
print(textstat.spache_readability(curText)) | |
5.81 | |
# (4) Word count | |
print(textstat.lexicon_count(curText, removepunct=True)) | |
55 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment