The `conllu` library (version 6.0.0) is a Python parser for the CoNLL-U format, converting CoNLL-U formatted strings into a nested Python dictionary structure. CoNLL-U is frequently used as an output format for natural language processing tasks. It is actively maintained with a moderate release cadence and has no external dependencies.
pip install conlluVerified import paths — ran on the pinned version, not inferred.
Parses a CoNLL-U formatted string into a list of `TokenList` objects, each representing a sentence. Tokens can be accessed as dictionary-like objects, and sentence metadata is available via the `.metadata` attribute.
Upgrade to Python 3.8+ or pin `conllu<5.0.0`.
Update token field access from `token['xpostag']` to `token['xpos']` and `token['upostag']` to `token['upos']`.
Review the official migration guides for versions 0.1 to 1.0 on the PyPI project page or GitHub repository for detailed code changes required.
Install the library using pip: `pip install conllu`
Inspect your CoNLL-U file around the indicated token or line to ensure it has exactly 10 tab-separated columns for each token line, blank lines for sentence boundaries, and comment lines starting with `#`. Ensure no lines are truncated or contain unexpected characters. For custom formats, consider using `conllu.parse(data, fields=...)` with a custom `fields` definition.
Iterate through the list of `TokenList` objects and call `.serialize()` on each individual `TokenList`, or if you parsed a single sentence, access the first element: `sentences = parse(data)`; `sentence_string = sentences[0].serialize()`.
No dependency data recorded yet.