Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A Python library for calculating a large variety of metrics from text
| Date | Stars |
|---|---|
| 2026-07-24 | 366 |
| 2026-07-25 | 366 |
| 2026-07-28 | 366 |
| 2026-07-30 | 366 |
| 2026-08-16 | 367 |
| 2026-08-18 | 368 |
| 2026-09-20 | 368 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<a href="https://github.com/HLasse/TextDescriptives"><img src="https://github.com/HLasse/TextDescriptives/raw/main/docs/_static/icon.png" width="175" height="175" align="right" /></a>
# TextDescriptives
[](https://spacy.io)
[](https://github.com/hlasse/textdescriptives/actions)
[](https://hlasse.github.io/TextDescriptives/)
[](https://joss.theoj.org/papers/06447337ee61969b5a64de484199df24)
[](https://huggingface.co/spaces/HLasse/textdescriptives)
A Python library for calculating a large variety of metrics from text(s) using spaCy v.3 pipeline components and extensions.
# 🔧 Installation
`pip install textdescriptives`
# 📰 News
* We now have a TextDescriptives-powered web-app so you can extract and downloads metrics without a single line of code! Check it out [here](https://huggingface.co/spaces/HLasse/textdescriptives)
* Version 2.0 out with a new API, a new component, updated documentation, and tutorials! Components are now called by "`textdescriptives/{metric_name}`. New `coherence` component for calculating the semantic coherence between sentences. See the [documentation](https://hlasse.github.io/TextDescriptives/) for tutorials and more information!
# ⚡ Quick Start
Use `extract_metrics` to quickly extract your desired metrics. To see available methods you can simply run:
```python
import textdescriptives as td
td.get_valid_metrics()
# {'quality', 'readability', 'all', 'descriptive_stats', 'dependency_distance', 'pos_proportions', 'information_theory', 'coherence'}
```
Set the `spacy_model` parameter to specify which spaCy model to use, otherwise, TextDescriptives will auto-download an appropriate one based on `lang`. If `lang` is set, `spacy_model` is not necessary and vice versa.
Specify which metrics to extract in the `metrics` argument. `None` extracts all metrics.
```py
import textdescriptives as td
text = "The world is changed. I feel it in the water. I feel it in the earth. I smell it in the air. Much that once was is lost, for none now live who remember it."
# will automatically download the relevant model (´en_core_web_lg´) and extract all metrics
df = td.extract_metrics(text=text, lang="en", metrics=None)
# specify spaCy model and which metrics to extract
df = td.extract_metrics(text=text, spacy_model="en_core_web_lg", metrics=["readability", "coherence"])
```
## Usage with spaCy
To integrate with other spaCy pipelines, import the library and add the component(s) to your pipeline using the standard spaCy syntax. Available components are *descriptive_stats*, *readability*, *dependency_distance*, *pos_proportions*, *coherence*, and *quality* prefixed with `textdescriptives/`.
If you want to add all components you can use the shorthand `textdescriptives/all`.
```py
import spacy
import textdescriptives as td
# load your favourite spacy model (remember to install it first using e.g. `python -m spacy download en_core_web_sm`)
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("textdescriptives/all")
doc = nlp("The world is changed. I feel it in the water. I feel it in the earth. I smell it in the air. Much that once was is lost, for none now live who remember it.")
# access some of the values
doc._.readability
doc._.token_length
```
TextDescriptives includes convenience functions for extracting metrics from a `Doc` to a Pandas DataFrame or a dictionary.
```py
td.extract_dict(doc)
td.extract_df(doc)
```
| | text | first_order_coherence | second_order_coherence | pos_prop_DET | pos_prop_NOUN | poExcerpt of 9,396 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:24893de2253b725f, topic:nlp, topic:spacy