MahaPOS-BERT is a fine-tuned version of
l3cube-pune/marathi-bert-v2 for
Part-of-Speech (POS) tagging in Marathi. It is trained on the
L3Cube-MahaPOS dataset — one of the first large-scale, manually annotated POS tagging datasets for Marathi — comprising 32,354 sentences drawn from Marathi news text.
This model is part of the
L3Cube-MahaNLP project.
For more details refer our
MahaPOS paper.
The model uses a 16-tag set aligned with the Universal Dependencies (UD) v2 framework:
The dataset was manually annotated by a team of Marathi-proficient annotators from PICT, Pune. Raw text was sourced from Marathi news portals covering politics, sports, culture, technology, and local affairs.
1from transformers import pipeline
2
3pipe = pipeline(
4 "token-classification",
5 model="l3cube-pune/marathi-pos-bert", # update with actual HuggingFace repo path
6 aggregation_strategy="first"
7)
8
9text = "भारत हा एक सुंदर देश आहे."
10result = pipe(text)
11for token in result:
12 print(f"{token['word']:<15} {token['entity']}")
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3
4model_path = "path/to/marathi_pos_final" # local path or HF repo
5
6tokenizer = AutoTokenizer.from_pretrained(model_path)
7model = AutoModelForTokenClassification.from_pretrained(model_path)
8
9id2label = model.config.id2label
10
11text = "नागपूर येथे मोठा कार्यक्रम झाला."
12inputs = tokenizer(text, return_tensors="pt")
13
14with torch.no_grad():
15 outputs = model(**inputs)
16
17predictions = outputs.logits.argmax(dim=-1)[0]
18tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
19
20for token, pred in zip(tokens, predictions):
21 if token not in ["[CLS]", "[SEP]", "[PAD]"]:
22 print(f"{token:<20} {id2label[pred.item()]}")
1@article{ingle2026l3cube,
2 title={L3Cube-MahaPOS: A Marathi Part-of-Speech Tagging Dataset and BERT Models},
3 author={Ingle, Hariom and Ghode, Ronit and Gondkar, Ishwari and Harad, Jidnyasa and Joshi, Raviraj},
4 journal={arXiv preprint arXiv:2606.24825},
5 year={2026}
6}
This work was carried out under the mentorship of
L3Cube Labs, Pune. This work is part of the
L3Cube-MahaNLP project.