py-readability-metrics

MIT license Python wheel

Score the readability of text using popular readability metrics including: Flesch Kincaid Grade Level, Flesch Reading Ease, Gunning Fog Index, Dale Chall Readability, Automated Readability Index (ARI), Coleman Liau Index, Lisnear Write, and SMOG

Install

pip install py-readability-metrics
python -m nltk.downloader punkt

Usage

Here is some text explaining some complicated stuff

from readability import Readability

r = Readability(text)

r.flesch_kincaid()
r.flesch()
r.gunning_fog()
r.coleman_liau()
r.dale_chall()
r.ari()
r.linsear_write()
r.smog()

Readability Metrics

Flesch-Kincaid Reading Ease

About

The U.S. Department of Defense uses the Reading Ease test as the standard test of readability for its documents and forms. Florida requires that life insurance policies have a Flesch Reading Ease score of 45 or greater. [reference]

Usage

r = Readability(text)

f = r.flesch()

print(f.score)
print(f.ease)
print(f.grade_levels)

Flesch-Kincaid Grade Level

About

Flesch readability scores are the most commonly cited and used of all readability scoring formula.

The U.S. Army uses Flesch-Kincaid Grade Level for assessing the difficulty of technical manuals. The commonwealth of Pennsylvania uses Flesch-Kincaid Grade Level for scoring automobile insurance policies to ensure their texts are no higher than a ninth grade level of reading difficulty. Many other U.S. states also use Flesch-Kincaid Grade Level to score other legal documents such as business policies and financial forms. [reference]

Usage

r = Readability(text)

fk = r.flesch_kincaid()

print(fk.score)
print(fk.grade_level)

Dale Chall Readability

About

The Dale-Chall Formula is an accurate readability formula for the simple reason that it is based on the use of familiar words, rather than syllable or letter counts. Reading tests show that readers usually find it easier to read, process and recall a passage if they find the words familiar. [reference]

Usage

r = Readability(text)

dc = dale_chall()

print(dc.score)
print(dc.grade_levels)

Automated Readability Index (ARI)

About

Unlike the other indices, the ARI, along with the Coleman-Liau, relies on a factor of characters per word, instead of the usual syllables per word. ARI is widely used on all types of texts. [reference]

Usage

r = Readability(text)

ari = r.ari()

print(ari.score)
print(ari.grade_levels)
print(ari.ages)

Coleman Liau

The Coleman-Liau Formula usually gives a lower grade value than any of the Kincaid, ARI and Flesch values when applied to technical documents. [reference]

r = Readability(text)

cl = r.coleman_liau()

print(cl.score)
print(cl.grade_level)

Gunning Fog

About

The Gunning fog index measures the readability of English writing. The index estimates the years of formal education needed to understand the text on a first reading. A fog index of 12 requires the reading level of a U.S. high school senior (around 18 years old). [reference]

Usage

r = Readability(text)

gf = r.gunning_fog()

print(gf.score)
print(gf.grade_level)

SMOG

About

The SMOG Readability Formula (Simple Measure of Gobbledygook) is a popular method to use on health literacy materials. [reference]

Usage

r = Readability(text)

s = r.smog()

print(s.score)
print(s.grade_level)

Indices and tables