Skip to content

WeerayutBu/WangChanXNER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WangChanXNER

Welcome to WangChanXNER! This repository contains a basic implementation for sequence labeling tasks. It provides functionalities for training and testing.

Installation

To install the necessary dependencies, run the following: python=3.8.16

seqeval
pythainlp
tabulate
pandas==2.0.3
torch==2.0.1
numpy==1.23.5
python=3.8.16
protobuf==3.20.0
transformers==4.29.2

Downloading the Checkpoint

Test the model with Colab.

You can download the checkpoint from our google drive: checkpoint.

Once downloaded, extract the files to ensure the appropriate directory structure.

unzip downloaded_checkpoint.zip -d storage/

Directory tree

.
├── utils
├── model
├── storage
├── trainer
├── inference.ipynb
└── inference.py

Train/Test

Training

Run the main.py script to train the model:

python main.py --device 0 -c storage/config_base.json
  • The --device flag specifies the GPU device to use during training. In this example, GPU 0 will be used.
  • The -c flag points to the configuration file config_lst20.json, which holds the hyperparameters and settings for training.

Pretrained

xlm-roberta-base
airesearch/wangchanberta-base-att-spm-uncased

Testing

To test the model, use the inference.py script:

python inference.py --resume storage/best_model/model_best.pth
  • The --resume flag points to the saved checkpoint file to load the model for testing.

Acknowledgements

This project is inspired by Tensorflow-Project-Template created by Mahmoud Gemy. We express our gratitude to Mahmoud Gemy for providing the foundation and ideas for this project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published