Thai dependency parser.
Project description
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 usig pipː
pip install attaparse
Usage
Initalizing
import attaparse
from attaparse import load_model, depparse
nlp = load_model()
text = 'ฉันอยากกินข้าวที่แม่ทำ'
dep = depparse(text, 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 dep.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:
BibTex
@article{Sriwirote-etal-2024-TUD,
title={The Thai Universal Dependency Treebank},
author={Panyut Sriwirote and Wei Qi Leong and
Charin Polpanumas and Santhawat Thanyawong and
William Chandra Tjhi and Wirote Aroonmanakun and
Attapol T. Rutherford},
journal={Transactions of the Association for Computational Linguistics},
year={in press},
publisher={MIT Press Direct}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file attaparse-0.0.1.tar.gz.
File metadata
- Download URL: attaparse-0.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
180abae9ada18fb7f5112de6550c7ded81209c8659458d7c25f6f0c3e197f4ff
|
|
| MD5 |
97c9647c4e42b811619510b2609fa3d1
|
|
| BLAKE2b-256 |
a94047d4fb0703422b1a0b28c1508a455df147f836cec5d3115aaf97ed5f7be8
|
File details
Details for the file attaparse-0.0.1-py3-none-any.whl.
File metadata
- Download URL: attaparse-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0553cc764ea3cb62cfc7d5a263a9c6daa76746e5dbc07b2bb29e6aec7f077cb1
|
|
| MD5 |
a0514a69c413d04bf841ad3a42519617
|
|
| BLAKE2b-256 |
8a174d0c17a48cd9d16c621ef7fac8b443773048050de2f1a0d1aa9fc00c68de
|