Git Product home page Git Product logo

thai-nner's Introduction

Thai-NNER (Thai Nested Named Entity Recognition Corpus)

This repository contains the code associated with the paper Thai Nested Named Entity Recognition Corpus presented at ACL2022(findings).

Classes

Abstract / Motivation

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.

How to use?

Installation

To get started, install the library:

pip install thai_nner

Model Preparation

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

Sample Usage

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)

Examples & Testing

Training and Testing

Train

python train.py --device 0,1 -c config.json

Test

python test_nne.py --resume [PATH]/checkpoint.pth

Tensorboard

tensorboard --logdir [PATH]/save/log/

Results

Experimental results

Citation

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 = "",
}

License

The project is licensed under CC-BY-SA 3.0.

Acknowledgements

  • Dataset Credits: The Thai N-NER corpus owes its inception partly to the Digital Economy Promotion Agency (depa) Digital Infrastructure Fund MP-62-003 and the Siam Commercial Bank. The dataset is named as scb-nner-th-2022.
  • Training Code Inspiration: Adapted from Tensorflow-Project-Template by Mahmoud Gemy.

thai-nner's People

Contributors

weerayutbu avatar wannaphong avatar mrpeerat avatar c4n avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.