This repository contains the code associated with the paper Thai Nested Named Entity Recognition Corpus presented at ACL2022(findings).
This work presents the first Thai Nested Named Entity Recognition (N-NER) dataset. Thai N-NER consists of 264,798 mentions, 104 classes, and a maximum depth of 8 layers obtained from news articles and restaurant reviews, a total of 4894 documents. Our work, to the best of our knowledge, presents the largest non-English N-NER dataset and the first non-English one with fine-grained classes.
To get started, install the library:
pip install thai_nner
First, download the necessary resources (models, datasets, and pre-trained language models) from here and use the convert_model2use.py
script to prepare it.
python convert_model2use.py -i 0906_214036/checkpoint.pth -o model.pth
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
from thai_nner import NNER
nner = NNER("model.pth")
tags = nner.get_tag("วันนี้วันที่ 5 เมษายน 2565 เป็นวันที่อากาศดีมาก")
print(tags)
python train.py --device 0,1 -c config.json
python test_nne.py --resume [PATH]/checkpoint.pth
tensorboard --logdir [PATH]/save/log/
If you find our work useful, please consider citing:
@inproceedings{buaphet-etal-2022-thai,
title = "{T}hai Nested Named Entity Recognition Corpus",
author = "Buaphet, Weerayut and
Udomcharoenchaikit, Can and
Limkonchotiwat, Peerat and
Rutherford, Attapol and
Nutanong, Sarana",
booktitle = "Findings of the Association for Computational Linguistics: ACL 2022",
month = may,
year = "2022",
address = "Dublin, Ireland",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2022.findings-acl.116",
doi = "10.18653/v1/2022.findings-acl.116",
pages = "1473--1486",
abstract = "",
}
The project is licensed under CC-BY-SA 3.0.