CoolFace
Modelpublic

Pavarissy/mdeberta-v3-ud-thai-pud-upos

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes171downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

mdeberta-v3-ud-thai-pud-upos

This model is a fine-tuned version of microsoft/mdeberta-v3-base on the universal_dependencies dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.0303
  • —Macro avg precision: 0.9235
  • —Macro avg recall: 0.9228
  • —Macro avg f1: 0.9231
  • —Weighted avg precision: 0.9935
  • —Weighted avg recall: 0.9935
  • —Weighted avg f1: 0.9935
  • —Accuracy: 0.9935

Model description

This model is train on thai UD Thai PUD corpus with Universal Part-of-speech (UPOS) tag to help with pos tagging in Thai language.

Example

python
from transformers import AutoModelForTokenClassification, AutoTokenizer, TokenClassificationPipeline

model = AutoModelForTokenClassification.from_pretrained("Pavarissy/mdeberta-v3-ud-thai-pud-upos")
tokenizer = AutoTokenizer.from_pretrained("Pavarissy/mdeberta-v3-ud-thai-pud-upos")

pipeline = TokenClassificationPipeline(model=model, tokenizer=tokenizer, grouped_entities=True)
outputs = pipeline("ประเทศไทย อยู่ใน ทวีป เอเชีย")
print(outputs)
# [{'entity_group': 'PROPN', 'score': 0.9946701, 'word': 'ประเทศไทย', 'start': 0, 'end': 9}, {'entity_group': 'VERB', 'score': 0.85809743, 'word': 'อยู่ใน', 'start': 9, 'end': 16}, {'entity_group': 'NOUN', 'score': 0.99632, 'word': 'ทวีป', 'start': 16, 'end': 21}, {'entity_group': 'PROPN', 'score': 0.9961184, 'word': 'เอเชีย', 'start': 21, 'end': 28}]

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 2e-05
  • —trainbatchsize: 8
  • —evalbatchsize: 8
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —num_epochs: 10

Training results

Training LossEpochStepValidation LossMacro avg precisionMacro avg recallMacro avg f1Weighted avg precisionWeighted avg recallWeighted avg f1Accuracy
No log1.01250.38980.84170.78490.80780.91190.91120.91010.9112
No log2.02500.17680.87650.86830.87200.95610.95600.95590.9560
No log3.03750.12170.89720.88920.89290.97010.97010.96990.9701
0.47094.05000.08410.90570.90640.90590.98020.98000.98000.9800
0.47095.06250.06490.91280.91330.91300.98540.98530.98530.9853
0.47096.07500.05130.91470.91700.91580.98780.98770.98770.9877
0.47097.08750.04230.91990.91800.91890.99000.99000.99000.9900
0.08578.010000.03500.92260.92070.92160.99210.99210.99210.9921
0.08579.011250.03180.92370.92190.92280.99320.99320.99320.9932
0.085710.012500.03030.92350.92280.92310.99350.99350.99350.9935

Framework versions

  • —Transformers 4.34.1
  • —Pytorch 2.1.0+cu118
  • —Datasets 2.14.6
  • —Tokenizers 0.14.1