Flesch Kincaid Readability Algorithm
The history of readability algorithms can be traced back to the US Military in the early 1900s. In 1948, Rudolph Flesch created a readability test to assess what level of education a person needed to attain to understand a piece of text easily. The US Navy improved the effort in 1975 when Peter Kincaid augmented the existing algorithm in order to assist development and understanding of technical manuals.
We maintain the fkscore library on PyPi implementing the Flesch-Kincaid readability index in our python. There are 2 main related uses; the first being to determine the quality of written text and the second in to tune text to a specific education level of an audience.
The source code is released under the MIT License.
pip3 install fkscore
For text in python represented as a string.
Takes text as string datatype. Words can be on same or different lines. Current version is English language only. Email for support.
import fkscore text = '...blah blah blah...' f = fkscore.fkscore(text) print(f.stats) print(f.score) OR from fkscore import fkscore text = '...blah blah blah...' f = fkscore(text) print(f.stats) print(f.score)
Output includes 2 dictionaries of information as follows:
- score[‘readability’] # Calculated F-K Readability Score
- score[‘grade’] # Permuted F-K Grade Reading Level
Releases and additions will push to PyPi periodically, but if there is a feature in master not built/pushed and you want it to be, just ping me.
This is a maintained as an implementation of the Flesch-Kincaid readability algorithm which was initially developed in 1948 by Rudolph Flesch and later revised by the U.S. Navy in 1975. This module is pure python and works with 3.5+.
Feel free to ping for questions, comments, concerns or interact directly via the GitHub repository.
Randall Shane, PhD
History & Sources: