Skip to main content

PyPI - Python Version PyPI Status Downloads Downloads/month CI Documentation PR welcome License: GPL v3

TextComplexityComputer

TextComplexityComputer (TCC) assesses the complexity of a French text. It computes about sixty linguistic metrics (syntactic complexity, vocabulary, lexical diversity, readability formulas and Biber dimensions) and feeds them to a classifier that estimates a difficulty level from 0 to 7.

Documentation: https://graal-research.github.io/tcc/

Installation

TCC requires Python 3.11 or later.

pip install text_complexity_computer
# or
uv add text_complexity_computer

The spaCy model fr_core_news_sm is downloaded on first use. To install it beforehand:

python -m spacy download fr_core_news_sm

Getting started

from text_complexity_computer import TextComplexityComputer

tcc = TextComplexityComputer()

tcc.compute("Alibaba et les 40 voleurs.")
# array([1])

tcc.get_metrics_scores("Le chat dort sur le tapis. Il fait beau.", metrics=["mls", "fk_ease"], with_biberpy=False)
#    fk_ease       mls
# 0  1.15424 -0.015608

See the usage guide for the metrics, the scalers and the bundled model.

Cite

Use the following to cite this package and our article:

@article{Primpied2022Quantifying,
    author = {Primpied, Vincent and Beauchemin, David and Khoury, Richard},
    journal = {Proceedings of the Canadian Conference on Artificial Intelligence},
    year = {2022},
    month = {may 27},
    note = {https://caiac.pubpub.org/pub/iaeeogod},
    publisher = {Canadian Artificial Intelligence Association (CAIAC)},
    title = {Quantifying {French} {Document} {Complexity}},
}

Contributing

We welcome bug reports and feature proposals. See the contributing guidelines to set up the development environment with uv.

License

TCC is licensed under the GPLv3, as found in the LICENSE file. The Biber dimensions module is adapted from biberpy by Serge Sharoff, also under the GPLv3.

Metadata

Release files for text_complexity_computer 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text_complexity_computer 0.3.0
File Size Uploaded Provenance Actions
text_complexity_computer-0.3.0.tar.gz 1.5 MB Without provenance Details for text_complexity_computer-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for text_complexity_computer 0.3.0
File Interpreter ABI Platform Actions
text_complexity_computer-0.3.0-py3-none-any.whl Python 3 none any Details for text_complexity_computer-0.3.0-py3-none-any.whl

Total release size: 3.0 MB

Release files / text_complexity_computer-0.3.0.tar.gz

Download URL text_complexity_computer-0.3.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
51db34e462590a2e00cad2bc501b025899ccaf085a93498e41d3b2c5978ad19e
BLAKE2b-256 checksum
How to use checksums
bb1d6118e942b0d43ce71a07b0daff1b2716d39c1a35aa65c654b7cc58302dd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / text_complexity_computer-0.3.0-py3-none-any.whl

Download URL text_complexity_computer-0.3.0-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5be87146b97e784a6753fe043487797105f0cb586d26c934a5015d567add02b1
BLAKE2b-256 checksum
How to use checksums
5e5b0c07e72923ebdade91fc50a3387115063deecf751d4de9ee50f9e4cfead8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for text_complexity_computer 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page