Instructions to use navnav98/xlmr-comi-pos with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use navnav98/xlmr-comi-pos with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="navnav98/xlmr-comi-pos")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("navnav98/xlmr-comi-pos") model = AutoModelForTokenClassification.from_pretrained("navnav98/xlmr-comi-pos", device_map="auto") - Notebooks
- Google Colab
- Kaggle
XLM-RoBERTa-base fine-tuned for Hindi–English code-mixed POS tagging
Model Details
Model Description
NOT PRODUCTION READY DO NOT USE. FOR TESTING PURPOSES ONLY
A token-classification model for part-of-speech tagging of Hindi–English
code-mixed text. Fine-tuned from xlm-roberta-base on the POS-annotated
split of the COMI-LINGUA dataset. Built as part of doctoral research on
structural and pragmatic dimensions of Hindi–English code-mixing in
digital communication.
- Model type: Token classification (POS tagging)
- Language(s): Hindi, English, Hindi–English code-mixed
- License: [inherit from COMI-LINGUA — check its terms before setting this]
- Finetuned from model:
xlm-roberta-base
Model Sources
- Base model: https://huggingface.co/xlm-roberta-base
- Training data: COMI-LINGUA [add dataset URL and citation]
Uses
Direct Use
POS tagging of Hindi–English code-mixed sentences for corpus-linguistic analysis. Intended for research use only
Downstream Use
Intended as one stage in an annotation pipeline for a Hindi–English code-mixed Reddit corpus, preceded by language identification and followed by human review. Model output is treated as a first pass requiring manual verification, not as gold annotation.
Out-of-Scope Use
- Production or user-facing applications
- Languages or language pairs outside Hindi–English
- Monolingual text in scripts or domains substantially unlike the training data
- Any use where unreviewed automatic output is treated as ground truth
Bias, Risks, and Limitations
Recommendations
How to Get Started with the Model
from transformers import AutoTokenizer, AutoModelForTokenClassification
import torch
repo = "navnav98/xlmr-comi-pos"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForTokenClassification.from_pretrained(repo)
model.eval()
id2label = model.config.id2label
def tag(text):
words = text.split()
inputs = tokenizer(words, is_split_into_words=True,
return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
preds = torch.argmax(logits, dim=2)[0]
word_ids = inputs.word_ids()
result, seen = [], set()
for idx, wid in enumerate(word_ids):
if wid is not None and wid not in seen:
seen.add(wid)
result.append((words[wid], id2label[preds[idx].item()]))
return result
print(tag("kal main office nahi gaya kyunki traffic bahut zyada tha"))
Note: inputs longer than 256 subword tokens are silently truncated.
Training Details
Training Data
COMI-LINGUA, POS-annotated split. [add: number of sentences/tokens, train/dev/test sizes, tagset used — UD or BIS]
Training Procedure
Preprocessing
Training Hyperparameters
- Training regime: [fp16 / fp32 — Colab T4]
- Epochs: [ ]
- Learning rate: [ ]
- Batch size: [ ]
- Optimizer: [ ]
- Max sequence length: 256
Speeds, Sizes, Times
Evaluation
Testing Data
Metrics
Token-level F1.
Results
| Metric | Score |
|---|---|
| F1 | 0.886 |
Summary
Achieves 0.886 F1 on the COMI-LINGUA POS test split. Comparison point: HingRoBERTa (Nayak & Joshi 2022) reports higher POS accuracy on code-mixed benchmarks and may be a stronger base model for this task.
Citation
- Downloads last month
- 95
Model tree for navnav98/xlmr-comi-pos
Base model
cardiffnlp/twitter-xlm-roberta-base