CoolFace
Modelpublic

MWirelabs/nagamesebert

sourceHugging Facecc-by-4.0updated 8mo agoView on Hugging Face
0likes21downloads
Model Card

NagameseBERT

![HuggingFace Model](https://huggingface.co/MWirelabs/nagamesebert) ![License: CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) ![Language](https://en.wikipedia.org/wiki/Nagamese_Creole)

A Foundational BERT model for Nagamese Creole - A compact, efficient language model for a low resource Northeast Indian language.


Overview

NagameseBERT is a 7M parameter RoBERTa-style BERT model pre-trained on 42,552 Nagamese sentences. Despite being 15ร— smaller than multilingual models like mBERT (110M) and XLM-RoBERTa (125M), it achieves competitive performance on downstream NLP tasks while offering significant efficiency advantages.

Key Features:

  • โ€”Compact: 6.9M parameters (15ร— smaller than mBERT)
  • โ€”Efficient: Pre-trained in 35 minutes on single A40 GPU
  • โ€”Custom tokenizer: 8K BPE vocabulary optimized for Nagamese
  • โ€”Rigorous evaluation: Multi-seed testing (n=3) with reproducible results
  • โ€”Open: Model, code, and data splits publicly available

Performance

Multi-seed evaluation results (mean ยฑ std, n=3):

ModelParametersPOS AccuracyPOS F1NER AccuracyNER F1
NagameseBERT7M88.35 ยฑ 0.71%0.807 ยฑ 0.01391.74 ยฑ 0.68%0.565 ยฑ 0.054
mBERT110M95.14 ยฑ 0.47%0.916 ยฑ 0.00896.11 ยฑ 0.72%0.750 ยฑ 0.064
XLM-RoBERTa125M95.64 ยฑ 0.56%0.919 ยฑ 0.00896.38 ยฑ 0.26%0.819 ยฑ 0.066

Trade-off: 6-7 percentage points lower accuracy with 15ร— parameter reduction, enabling resource-constrained deployment.


Model Details

Architecture

  • โ€”Type: RoBERTa-style BERT (no token type embeddings)
  • โ€”Hidden size: 256
  • โ€”Layers: 6 transformer blocks
  • โ€”Attention heads: 4 per layer
  • โ€”Intermediate size: 1,024
  • โ€”Max sequence length: 64 tokens
  • โ€”Total parameters: 6,878,528

Tokenizer

  • โ€”Type: Byte-Pair Encoding (BPE)
  • โ€”Vocabulary size: 8,000 tokens
  • โ€”Special tokens: [PAD], [UNK], [CLS], [SEP], [MASK]
  • โ€”Normalization: NFD Unicode + accent stripping
  • โ€”Case: Preserved (for proper nouns and code-switched English)

Training Data

  • โ€”Corpus size: 42,552 Nagamese sentences
  • โ€”Average length: 11.82 tokens/sentence
  • โ€”Split: 90% train (38,296) / 10% validation (4,256)
  • โ€”Sources: Web, social media, community contributions (deduplicated)

Pre-training

  • โ€”Objective: Masked Language Modeling (15% masking)
  • โ€”Optimizer: AdamW (lr=5e-4, weight_decay=0.01)
  • โ€”Batch size: 64
  • โ€”Epochs: 50
  • โ€”Training time: ~35 minutes
  • โ€”Hardware: NVIDIA A40 (48GB)
  • โ€”Final validation loss: 2.79

Usage

Load Model and Tokenizer

python
from transformers import AutoTokenizer, AutoModel

model_name = "MWirelabs/nagamesebert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

# Example usage
text = "Toi moi laga sathi hobo pare?"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

Fine-tuning for Token Classification

python
from transformers import AutoModelForTokenClassification, TrainingArguments, Trainer

# Load model with classification head
model = AutoModelForTokenClassification.from_pretrained(
    "MWirelabs/nagamesebert",
    num_labels=num_labels
)

# Training arguments
training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=100,
    per_device_train_batch_size=8,
    learning_rate=3e-5,
    weight_decay=0.01
)

# Train
trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset
)
trainer.train()

Evaluation

Dataset

  • โ€”Source: NagaNLP Annotated Corpus
  • โ€”Total: 214 sentences
  • โ€”Split (seed=42): 171 train / 21 dev / 22 test (80/10/10)
  • โ€”POS tags: 13 Universal Dependencies tags
  • โ€”NER tags: 4 entity types (PER, LOC, ORG, MISC) in IOB2 format

Experimental Setup

  • โ€”Seeds: 42, 123, 456 (n=3 for variance estimation)
  • โ€”Batch size: 32
  • โ€”Learning rate: 3e-5
  • โ€”Epochs: 100
  • โ€”Optimization: AdamW with 100 warmup steps
  • โ€”Hardware: NVIDIA A40
  • โ€”Metrics: Token-level accuracy and macro-averaged F1

Data Leakage Statement: All splits created with fixed seed (42) with no sentence overlap between train/dev/test sets.


Limitations

  • โ€”Corpus size: 42K sentences is modest; expansion to 100K+ could improve performance
  • โ€”Evaluation scale: Small test set (22 sentences) limits statistical power
  • โ€”Task scope: Only evaluated on token classification; needs broader task assessment
  • โ€”Efficiency metrics: No quantitative inference benchmarks (latency, memory) yet provided
  • โ€”Data documentation: Complete data provenance and licenses to be formalized

Citation

If you use NagameseBERT in your research, please cite:

bibtex
@misc{nagamesebert2025,
  title={Bootstrapping BERT for Nagamese: A Low-Resource Creole Language},
  author={MWire Labs},
  year={2025},
  url={https://huggingface.co/MWirelabs/nagamesebert}
}

Contact

MWire Labs Shillong, Meghalaya, India Website: MWire Labs


License

This model is released under Creative Commons Attribution 4.0 International (CC BY 4.0).

You are free to:

  • โ€”Share โ€” copy and redistribute the material
  • โ€”Adapt โ€” remix, transform, and build upon the material

Under the following terms:

  • โ€”Attribution โ€” You must give appropriate credit to MWire Labs

Acknowledgments

We thank the Nagamese-speaking community for their contributions to corpus development and validation.