spaCy pipeline component for adding text readability meta data to Doc objects.
Project description
spacy_readability
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.
Installation
pip install spacy-readability
Usage
import spacy
from spacy_readability import Readability
nlp = spacy.load('en')
read = Readability(nlp)
nlp.add_pipe(read, last=True)
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 Scores
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).
Popular Metrics
-
The Flesch formulas : - Flesch-Kincaid Readability Score
- Flesch-Kincaid Reading Ease
-
Dale-Chall formula
-
SMOG
-
Coleman-Liau Index
-
Automated Readability Index
-
FORCAST
Contributing
Setup
- Install Poetry
- Run
make setup
to prepare workspace
Testing
- Run
make test
to run all tests
Linting
- Run
make format
to run black code formatter - Run
make lint
to run pylint - Run
make mypy
to run mypy
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spacy_readability-1.4.1.tar.gz
.
File metadata
- Download URL: spacy_readability-1.4.1.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.6.6 Darwin/18.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fe75a60ef2497abcbd1e58fd6e8ab7bbd4a02cff25aef88609472f647c42309 |
|
MD5 | 791f1e69e0667709aa0190e5d0e9af0d |
|
BLAKE2b-256 | 62f762d0094602958091012b5f85f94f1ffe0d2a7bcbb0d91dd1f9ceb4d361c0 |
File details
Details for the file spacy_readability-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: spacy_readability-1.4.1-py3-none-any.whl
- Upload date:
- Size: 49.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.11 CPython/3.6.6 Darwin/18.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d55712a317c285a21744955cec1de994e27cf4eebb1c0906f606bd2a5cf556 |
|
MD5 | 4b18836057b93e5a3079f54c450f60da |
|
BLAKE2b-256 | 689ee8d9cdf0d54fa5fa0c6463bc6d0385c37deb5dc65a4cfe2c612a02a06869 |