Metadata-Version: 2.4
Name: lvnlp
Version: 0.1.0
Summary: Latvian NLP tools
Project-URL: Homepage, https://github.com/LUMII-AILab/lvnlp
Project-URL: Repository, https://github.com/LUMII-AILab/lvnlp
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: torch==2.9.0
Requires-Dist: smart-open==7.5.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: transformers==4.57.1
Requires-Dist: huggingface-hub==0.36.2
Requires-Dist: ufal.chu-liu-edmonds==1.0.3
Requires-Dist: conllu==6.0.0
Requires-Dist: wandb==0.23.0
Requires-Dist: sentencepiece==0.2.1
Requires-Dist: tiktoken==0.12.0
Requires-Dist: safetensors==0.7.0

# lvnlp

Latvian NLP tools for morphosyntactic parsing.

## Installation

Install from PyPI:

```bash
pip install lvnlp
```

Or install the latest development version from GitHub:

```bash
pip install git+https://github.com/LUMII-AILab/lvnlp.git
```

## Morphosyntactic parsing

```python
from lvnlp.parser import Parser
from lvnlp.parser.utils import to_conll, tokenize_sentence

parser = Parser.from_pretrained()
sentences = [tokenize_sentence('Jānis brauca uz Rīgu.')]
sentences = parser.parse(sentences, analyzer=False)
for sentence in sentences:
    for token in sentence:
        print(token)
    print()

print(to_conll(sentences))
```

The parser can optionally use the Latvian morphological analyzer during decoding. This improves XPOS tagging and lemmatization.

## Citation

```bibtex
@inproceedings{znotins-2026-improving,
  title = {Improving Latvian Morphosyntactic Parsing with Pretrained Encoders and Analyzer-Constrained Decoding},
  author = {Znotins, Arturs},
  booktitle = {Proceedings of the Fifteenth Language Resources and Evaluation Conference (LREC 2026)},
  month = {May},
  year = {2026},
  pages = {11724--11734},
  address = {Palma, Mallorca, Spain},
  publisher = {European Language Resources Association (ELRA)},
  editor = {Piperidis, Stelios and Bel, Núria and van den Heuvel, Henk and Ide, Nancy and Krek, Simon and Toral, Antonio},
  doi = {10.63317/5khpzsaiqrzw},
  url = {https://lrec.elra.info/lrec2026-main-918}
}
```

## Acknowledgements

This work was supported by the EU Recovery and Resilience Facility project
[Language Technology Initiative](https://www.vti.lu.lv)
(2.3.1.1.i.0/1/22/I/CFLA/002).
