Skip to content

Instantly share code, notes, and snippets.

View wellington36's full-sized avatar

Wellington José Leite da Silva wellington36

View GitHub Profile
@wellington36
wellington36 / udstyle.py
Last active February 27, 2022 02:53 — forked from andreasvc/udstyle.py
Compute complexity metrics from Universal Dependencies
"""Compute complexity metrics from Universal Dependencies.
Usage: python3 udstyle.py [OPTIONS] FILE...
--parse=LANG parse texts with Stanza; provide 2 letter language code
--output=FILENAME write result to a tab-separated file.
--persentence report per sentence results, not mean per document
Reported metrics:
- LEN: mean sentence length in words (excluding punctuation).
- MDD: mean dependency distance (Gibson, 1998).
- NDD: normalized dependency distance (Lei & Jockers, 2018).