CoolFace
Modelpublic

snunlp/KR-ELECTRA-generator

sourceHugging Faceupdated 4y agoView on Hugging Face
1likes41kdownloads
Model Card

KoRean based ELECTRA (KR-ELECTRA)

This is a release of a Korean-specific ELECTRA model with comparable or better performances developed by the Computational Linguistics Lab at Seoul National University. Our model shows remarkable performances on tasks related to informal texts such as review documents, while still showing comparable results on other kinds of tasks.

Released Model

We pre-trained our KR-ELECTRA model following a base-scale model of ELECTRA. We trained the model based on Tensorflow-v1 using a v3-8 TPU of Google Cloud Platform.

Model Details

We followed the training parameters of the base-scale model of ELECTRA.

Hyperparameters
model# of layersembedding sizehidden size# of heads
Discriminator1276876812
Generator127682564
Pretraining
batch sizetrain stepslearning ratesmax sequence lengthgenerator size
2567000002e-41280.33333
Training Dataset

34GB Korean texts including Wikipedia documents, news articles, legal texts, news comments, product reviews, and so on. These texts are balanced, consisting of the same ratios of written and spoken data.

Vocabulary

vocab size 30,000 We used morpheme-based unit tokens for our vocabulary based on the Mecab-Ko morpheme analyzer.

Download Link
  • —PyTorch models on HuggingFace
python
from transformers import ElectraModel, ElectraTokenizer

model = ElectraModel.from_pretrained("snunlp/KR-ELECTRA-discriminator")
tokenizer = ElectraTokenizer.from_pretrained("snunlp/KR-ELECTRA-discriminator")

Finetuning

We used and slightly edited the finetuning codes from KoELECTRA, with additionally adjusted hyperparameters. You can download the codes and config files that we used for our model from our github.

Experimental Results
**NSMC**<br/>(acc)**Naver NER**<br/>(F1)**PAWS**<br/>(acc)**KorNLI**<br/>(acc)**KorSTS**<br/>(spearman)**Question Pair**<br/>(acc)**KorQuaD (Dev)**<br/>(EM/F1)**Korean-Hate-Speech (Dev)**<br/>(F1)
KoBERT89.5987.9281.2579.6281.5994.8551.75 / 79.1566.21
XLM-Roberta-Base89.0386.6582.8080.2378.4593.8064.70 / 88.9464.06
HanBERT90.0687.7082.9580.3282.7394.7278.74 / 92.0268.32
KoELECTRA-Base90.3387.1881.7080.6482.0093.5460.86 / 89.2866.09
KoELECTRA-Base-v289.5687.1680.7080.7282.3094.8584.01 / 92.4067.45
KoELECTRA-Base-v390.6388.1184.4582.2485.5395.2584.83 / 93.4567.61
KR-ELECTRA (ours)91.16887.9082.0582.5185.4195.5184.93 / 93.0474.50

The baseline results are brought from KoELECTRA's.

Citation

bibtex
@misc{kr-electra,
  author = {Lee, Sangah and Hyopil Shin},
  title = {KR-ELECTRA: a KoRean-based ELECTRA model},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/snunlp/KR-ELECTRA}}
}