Downloads · 30 days
13
7% of all-time downloads
navnav98/xlmr-comi-pos
xlmr-comi-pos is a token classification model from navnav98. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as cc-by-4.0.
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 C…
Downloads · 30 days
13
7% of all-time downloads
All-time downloads
175
Public
Parameters
277M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
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.
xlm-roberta-basePOS tagging of Hindi–English code-mixed sentences for corpus-linguistic analysis. Intended for research use only
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.
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.
COMI-LINGUA, POS-annotated split. [add: number of sentences/tokens, train/dev/test sizes, tagset used — UD or BIS]
Token-level F1.
| Metric | Score |
|---|---|
| F1 | 0.886 |
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.