Attaparse : Thai Dependency Parser
attaparse is a Thai dependency parser trained using stanza. Attaparse uses PhayaThaiBERT as a based model in training process. The model refer to Stanza*P with no POS model in Thai Universal Dependency Treebank (TUD).
Content
Installation
attaparse can be installed using pip:
pip install attaparse
Usage
Initialising
import attaparse
from attaparse import load_model, depparse
nlp = load_model()
Plain Text
Uses Stanza's default Thai tokeniser.
text = 'ฉันอยากกินข้าวที่แม่ทำ'
doc = depparse(text, nlp)
Pipe-Delimited Input
from attaparse import depparse_pipe_delimited
nlp = load_model(tokenize_pretokenized=True)
pipe_text = "ฉัน|รัก|เธอ"
doc = depparse_pipe_delimited(pipe_text, nlp)
Pre-tokenised List Input
from attaparse import depparse_pretokenized
nlp = load_model(tokenize_pretokenized=True)
tokens = [["ฉัน", "กิน", "ข้าว"]]
doc = depparse_pretokenized(tokens, nlp)
Access the Results
print(f'\n{text}\n',*[f'id: {word.id}\tword: {word.text}\thead id: {word.head}\thead: {sent.words[word.head-1].text if word.head > 0 else "root"}\tdeprel: {word.deprel}' for sent in doc.sentences for word in sent.words], sep='\n')
.id: the id of the word..head: the head of the word..deprel: the dependency relationship between the word and the head.
Citation
If you use attaparse in your project or publication, please cite as follows:
Panyut Sriwirote, Wei Qi Leong, Charin Polpanumas, Santhawat Thanyawong, William Chandra Tjhi, Wirote Aroonmanakun, and Attapol T. Rutherford. 2025. The Thai Universal Dependency Treebank. Transactions of the Association for Computational Linguistics, 13:376–391.
BibTex
@article{sriwirote-etal-2025-thai,
title = "The {T}hai {U}niversal {D}ependency Treebank",
author = "Sriwirote, Panyut and
Leong, Wei Qi and
Polpanumas, Charin and
Thanyawong, Santhawat and
Tjhi, William Chandra and
Aroonmanakun, Wirote and
Rutherford, Attapol T.",
journal = "Transactions of the Association for Computational Linguistics",
volume = "13",
year = "2025",
address = "Cambridge, MA",
publisher = "MIT Press",
url = "https://aclanthology.org/2025.tacl-1.18/",
doi = "10.1162/tacl_a_00745",
pages = "376--391"
}
Metadata
Release files for attaparse 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| attaparse-1.0.0.tar.gz | 4.7 kB | Without provenance | Details for attaparse-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| attaparse-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for attaparse-1.0.0-py3-none-any.whl |
Total release size: 9.3 kB
Release files / attaparse-1.0.0.tar.gz
| Download URL | attaparse-1.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6f5be0cb39c7b2605fbb985d57f8a1ee25f4dc37181e45b85187efeb87b988d
|
|
BLAKE2b-256 checksum How to use checksums |
d71c0be6ae423ef721e85f83221484af3bf429e83f32f44bd4c07f8af3e4f74a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / attaparse-1.0.0-py3-none-any.whl
| Download URL | attaparse-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c9529daf26e59b7171397499e7172b0fbe028c20dd5a95ad1c810b7c0d42231
|
|
BLAKE2b-256 checksum How to use checksums |
4922d66a2663aef9c21775a853dd4444a1adbcdcb8c160ac4876783dee5e901e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for attaparse 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.