spaCy v2.0 pipeline component for calculating readability scores of of text. Provides scores for Flesh-Kincaid grade level, Flesh-Kincaid reading ease, Dale-Chall, and SMOG.
pip install spacy-readability
import spacy
from spacy_readability import Readability
nlp = spacy.load('en')
nlp.add_pipe(Readability())
doc = nlp("I am some really difficult text to read because I use obnoxiously large words.")
print(doc._.flesch_kincaid_grade_level)
print(doc._.flesch_kincaid_reading_ease)
print(doc._.dale_chall)
print(doc._.smog)
print(doc._.coleman_liau_index)
print(doc._.automated_readability_index)
print(doc._.forcast)
Readability is the ease with which a reader can understand a written text. In natural language, the readability of text depends on its content (the complexity of its vocabulary and syntax) and its presentation (such as typographic aspects like font size, line height, and line length).
The Flesch formulas : - Flesch-Kincaid Readability Score
Dale-Chall formula
make setup
to prepare workspacemake test
to run all testsmake format
to run black code formattermake lint
to run pylintmake mypy
to run mypy