Skip to content

Commit

Permalink
add link to docs in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HLasse committed Aug 9, 2021
1 parent d7be7c3 commit d9cdff7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[![spacy](https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg)](https://spacy.io)
[![github actions pytest](https://github.com/hlasse/textdescriptives/actions/workflows/pytest-cov-comment.yml/badge.svg)](https://github.com/hlasse/textdescriptives/actions)
[![github actions docs](https://github.com/hlasse/textdescriptives/actions/workflows/documentation.yml/badge.svg)](https://hlasse.io/textdescriptives/)
[![github actions docs](https://github.com/hlasse/textdescriptives/actions/workflows/documentation.yml/badge.svg)](https://hlasse.github.io/TextDescriptives/)
![github coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/hlasse/24ee79064ca9d49616cbc410da65cee2/raw/badge-textdescriptives-pytest-coverage.json)
<!-- Needs to add gist -->

Expand All @@ -10,14 +10,15 @@

# TextDescriptives

A Python library for calculating a large variety of statistics from text(s) using spaCy v.3 pipeline components and extensions. TextDescriptives can be used to calculate several descriptive statistics, readability metrics, and metrics related to dependency distance. The components are implemented using getters, which means they will only be calculated when accessed.
A Python library for calculating a large variety of statistics from text(s) using spaCy v.3 pipeline components and extensions. TextDescriptives can be used to calculate several descriptive statistics, readability metrics, and metrics related to dependency distance.

# 🔧 Installation
`pip install textdescriptives`

# 📰 News

* TextDescriptives has been completely re-implemented using spaCy v.3.0. The stanza implementation can be found in the `stanza_version` branch and will no longer be maintained.
* Check out the brand new documentation [here](https://hlasse.github.io/TextDescriptives/)!


# 👩‍💻 Usage
Expand All @@ -43,7 +44,7 @@ td.extract_df(doc)
```
| | text | token_length_mean | token_length_median | token_length_std | sentence_length_mean | sentence_length_median | sentence_length_std | syllables_per_token_mean | syllables_per_token_median | syllables_per_token_std | n_tokens | n_unique_tokens | proportion_unique_tokens | n_characters | n_sentences | flesch_reading_ease | flesch_kincaid_grade | smog | gunning_fog | automated_readability_index | coleman_liau_index | lix | rix | dependency_distance_mean | dependency_distance_std | prop_adjacent_dependency_relation_mean | prop_adjacent_dependency_relation_std |
|---:|:------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------:|----------------------:|-------------------:|-----------------------:|-------------------------:|----------------------:|---------------------------:|-----------------------------:|--------------------------:|-----------:|------------------:|---------------------------:|---------------:|--------------:|----------------------:|-----------------------:|--------:|--------------:|------------------------------:|---------------------:|--------:|------:|---------------------------:|--------------------------:|-----------------------------------------:|----------------------------------------:|
| 0 | 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. | 3.28571 | 3 | 1.54127 | 7 | 6 | 3.09839 | 1.08571 | 1 | 0.368117 | 35 | 23 | 0.657143 | 121 | 5 | 107.879 | -0.0485714 | 5.68392 | 3.94286 | -2.45429 | -0.708571 | 12.7143 | 0.4 | 1.69524 | 0.422282 | 0.44381 | 0.0863679 |
| 0 | The world (...) | 3.28571 | 3 | 1.54127 | 7 | 6 | 3.09839 | 1.08571 | 1 | 0.368117 | 35 | 23 | 0.657143 | 121 | 5 | 107.879 | -0.0485714 | 5.68392 | 3.94286 | -2.45429 | -0.708571 | 12.7143 | 0.4 | 1.69524 | 0.422282 | 0.44381 | 0.0863679 |

Set which group(s) of metrics you want to extract using the `metrics` parameter (one or more of `readability`, `dependency_distance`, `descriptive_stats`, defaults to `all`)

Expand All @@ -56,8 +57,8 @@ td.extract_df(docs, metrics="dependency_distance")
```
| | text | dependency_distance_mean | dependency_distance_std | prop_adjacent_dependency_relation_mean | prop_adjacent_dependency_relation_std |
|---:|:------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------:|--------------------------:|-----------------------------------------:|----------------------------------------:|
| 0 | 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. | 1.69524 | 0.422282 | 0.44381 | 0.0863679 |
| 1 | He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it. | 2.56 | 0 | 0.44 | 0 |
| 0 | The world (...) | 1.69524 | 0.422282 | 0.44381 | 0.0863679 |
| 1 | He felt (...) | 2.56 | 0 | 0.44 | 0 |

The `text` column can by exluded by setting `include_text` to `False`.

Expand Down
2 changes: 1 addition & 1 deletion textdescriptives/about.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "textdescriptives"
__version__ = "1.0.0" # the ONLY source of version ID
__version__ = "1.0.1" # the ONLY source of version ID
__download_url__ = "https://github.com/HLasse/textdescriptives"

1 comment on commit d9cdff7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
textdescriptives
   init.py40100% 
   about.py30100% 
   dataframe_extract.py500100% 
   load_components.py120100% 
textdescriptives/components
   init.py30100% 
   dependency_distance.py320100% 
   descriptive_stats.py51198%105
   readability.py720100% 
   utils.py160100% 
TOTAL243199% 

Please sign in to comment.