Instructions to use mahesh27/div-class-roberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mahesh27/div-class-roberta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mahesh27/div-class-roberta")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("mahesh27/div-class-roberta") model = AutoModelForSequenceClassification.from_pretrained("mahesh27/div-class-roberta", device_map="auto") - Notebooks
- Google Colab
- Kaggle
This is the best-performing classfier in Divinity classification of Rig Vedic verses.
Sample usage:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mahesh27/div-class-roberta")
model = AutoModelForSequenceClassification.from_pretrained("mahesh27/div-class-roberta", device_map="auto")
text = "ahim ahann sindhum pariśiśriyānam valam abhinad yataḥ sindhavo akṣaran prati vatsam na dhenavaḥ"
### "Killed the snake lying in the river Indus, broke the cave entrance whence flowed the rivers like cows towards a calf."
inputs = tokenizer(text, return_tensors='pt')["input_ids"].to(model.device)
model.eval()
pred = model(input_ids= inputs)
prediction = int(pred['logits'].argmax(dim=-1)[0])
print(model.config.id2label[prediction])
> 'indraḥ'
Citation:
@inproceedings{mahesh-bhattacharya-2023-creation,
title = "Creation of a Digital Rig {V}edic Index (Anukramani) for Computational Linguistic Tasks",
author = "Akavarapu, V.S.D.S.Mahesh and
Bhattacharya, Arnab",
editor = "Kulkarni, Amba and
Hellwig, Oliver",
booktitle = "Proceedings of the Computational {S}anskrit {\&} Digital Humanities: Selected papers presented at the 18th World {S}anskrit Conference",
month = jan,
year = "2023",
address = "Canberra, Australia (Online mode)",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.wsc-csdh.6/",
pages = "89--96"
}
- Downloads last month
- 53
Model tree for mahesh27/div-class-roberta
Base model
mahesh27/vedicberta-base