Tajik word-level POS classification — mBERT LoRA (PEFT), seed 42

Model summary

This is one of six checkpoints from a controlled three-seed study of full fine-tuning versus LoRA on an isolated-word Tajik part-of-speech (POS) classification task. The model assigns one of 28 Tajik POS categories to a word form in Tajik Cyrillic script.

This is not contextual sequence tagging. The model does not receive sentence context, so grammatical ambiguity may not be resolvable.

  • Base model: bert-base-multilingual-cased
  • Method: LoRA (PEFT)
  • Random seed: 42 (shared with the corresponding other method)
  • Training dataset: TajikNLPWorld/tajik-pos-corpus
  • External evaluation: TajikNLPWorld/TajikMorphCorpus
  • Trainable parameters: 906,268 of 178,781,240 (0.507%)
  • Format: This repository contains a LoRA adapter and a trained 28-class classifier head, not a standalone copy of the backbone. Load the pretrained base model and then attach the adapter with PEFT. The example uses the recorded base-model revision and training seed.

Evaluation results

The following are actual test results for this checkpoint, loaded from the completed experiment metadata, not training-set scores.

Evaluation Number of examples Accuracy Macro-F1 Weighted-F1
In-domain test (28 POS labels) 5,259 0.7557 0.3696 0.7516
In-domain test (9 shared labels; masked logits) 4,235 0.7202 0.3530 0.7169
External TajikMorphCorpus (9 mapped labels) 2,592 0.3056 0.1398 0.3434
External unseen-word subset (9 mapped labels) 2,289 0.3032 0.1320 0.3465

Across the three paired random seeds (42, 123, 2024), LoRA (PEFT) obtained in-domain 28-class mean macro-F1 0.3835 ± 0.0252 (sample standard deviation).

For the 9-label settings, the evaluation first retains examples with an in-scope gold label and then restricts the prediction to the same nine classes by masking all other class logits. The 9-label and 28-label Macro-F1 scores are not directly interchangeable.

The external data use an automatically mapped and filtered set of nine categories. The cross-corpus mapping still requires independent linguistic validation. "Unseen" denotes word forms absent from the entire main corpus, not just its training partition. Strong domain shift and rare categories limit external performance; this checkpoint is not claimed to solve general Tajik POS tagging.

Training and data protocol

  • Main dataset: 52,508 records prior to splitting, 28 categories.
  • Fixed word-form-disjoint split (normalized word forms do not overlap): 42,017 train / 5,232 validation / 5,259 test.
  • Fixed split seed: 42. Pairwise comparisons use identical split files.
  • Training epochs: 5.
  • Learning rate: 0.0003.
  • Per-device train batch: 8; gradient accumulation: 4; effective batch: 32.
  • Max sequence length: 64 tokens.
  • Weighted cross-entropy with square-root inverse-frequency weights, computed on the training split alone.
  • Best checkpoint chosen by validation Macro-F1.
  • Runtime: NVIDIA L4; BF16 training; Transformers 5.22.2, PEFT 0.21.2, Datasets 5.2.0.
  • No models or data from the earlier TajPersParallel study were reused.
  • Model serialization/reloading was checked using an exact full-state SHA-256 fingerprint and agreement on probe predictions.

Source revisions recorded for reproducibility:

  • Base model: 3f076fdb1ab68d5b2880cb87a0886f315b8146f8
  • Main dataset: 797ea46fe95cf086832a500bea0582001368b7a8
  • External dataset: b29f8230724ee4d305423e46691f65dd2f422120

How to use

import json
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification, set_seed
from peft import PeftModel
from huggingface_hub import hf_hub_download

repo_id = "TajikNLPWorld/tajik-mbert-pos-lora-seed42"
base_id = "bert-base-multilingual-cased"
set_seed(42)
with open(hf_hub_download(repo_id, "labels.json"), encoding="utf-8") as f:
    labels = json.load(f)["labels"]

base = AutoModelForSequenceClassification.from_pretrained(
    base_id,
    revision='3f076fdb1ab68d5b2880cb87a0886f315b8146f8',
    num_labels=len(labels),
    id2label={i: label for i, label in enumerate(labels)},
    label2id={label: i for i, label in enumerate(labels)},
)
model = PeftModel.from_pretrained(base, repo_id).eval()
tokenizer = AutoTokenizer.from_pretrained(repo_id)
word = "китоб"
inputs = tokenizer(word, return_tensors="pt", truncation=True, max_length=64)
with torch.inference_mode():
    predicted_id = model(**inputs).logits.argmax(-1).item()
print(labels[predicted_id])

The output label is in Tajik and follows the original 28-class dataset ontology. The model accepts isolated word forms; applying it word-by-word to a full sentence does not make it a context-aware POS tagger.

Files

  • Model checkpoint and tokenizer files.
  • labels.json: ordered 28-label vocabulary in the original Tajik labels.
  • metadata/completed.json: metrics, original split fingerprints, settings.
  • metadata/roundtrip_audit.json: evidence for exact restored parameters.
  • metadata/manifest_v3.json: pinned experimental metadata.
  • reports/perclass_*.csv: per-class validation of main/external results.

Limitations and responsible use

  • Training/evaluation is context-free, rather than sentence-level POS tagging.
  • Class frequencies are highly skewed, and some labels have very few examples.
  • Domain shift substantially reduces external-corpus performance.
  • Automatically harmonized external labels may contain linguistic mismatches.
  • Do not treat predictions as authoritative grammar annotations without language-expert review, especially for rare classes.
  • This experimental model is intended for research and exploratory NLP, not for high-stakes automated decisions.

Citation and provenance

This model is part of an ongoing Tajik NLP research program. A related earlier preprint used a different lexical corpus and is not the paper reporting the above six-model experiment:

  • M. K. Arabov, Benchmarking POS Tagging for the Tajik Language: A Comparative Study of Neural Architectures on the TajPersParallel Corpus, arXiv:2605.04576, 2026. https://arxiv.org/abs/2605.04576

The present controlled-experiment manuscript has not been assigned a publication URL or DOI in this model card. Please cite the specific model repository and its revision until a paper for these results is released.

License

Model weights are published by the uploader under Apache-2.0; the original pretrained mBERT and the main corpus are also distributed under Apache-2.0. The original dataset may be gated for access.

Downloads last month
37
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for TajikNLPWorld/tajik-mbert-pos-lora-seed42

Adapter
(33)
this model

Dataset used to train TajikNLPWorld/tajik-mbert-pos-lora-seed42

Paper for TajikNLPWorld/tajik-mbert-pos-lora-seed42