Instructions to use amaan00z/sarcasm_xlmr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaan00z/sarcasm_xlmr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="amaan00z/sarcasm_xlmr")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("amaan00z/sarcasm_xlmr") model = AutoModelForSequenceClassification.from_pretrained("amaan00z/sarcasm_xlmr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("amaan00z/sarcasm_xlmr")
model = AutoModelForSequenceClassification.from_pretrained("amaan00z/sarcasm_xlmr", device_map="auto")sarcasm_xlmr
This model is a fine-tuned version of xlm-roberta-base on the None dataset. It achieves the following results on the evaluation set:
- Loss: 0.1423
- Accuracy: 0.9498
- F1: 0.9546
Model description
Hinglish Sarcasm Detection Model (XLM-RoBERTa Base β Fine-Tuned)
Version: 1.0 Author: Amaan Shaikh (amaan00z) Language: Hinglish Labels: 0 = not_sarcastic 1 = sarcastic
β¨ Model Summary
This is a Hinglish Sarcasm Classifier trained on a rich combination of:
β MUStARD Hinglish Dialogues β Swami et al. Hinglish Twitter dataset β 4,000 generated Gen-Z + political + meme sarcasm samples β 2,500 real non-sarcastic Hinglish social-media samples β Reddit & general Hinglish sarcasm templates β Cleaned + deduplicated final dataset: 9,594 samples
Model backbone: XLM-RoBERTa Base
π Labels
ID Label
0 not_sarcastic 1 sarcastic
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 4
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| 0.2244 | 1.0 | 505 | 0.1979 | 0.9220 | 0.9291 |
| 0.2034 | 2.0 | 1010 | 0.1418 | 0.9387 | 0.9448 |
| 0.1759 | 3.0 | 1515 | 0.1423 | 0.9498 | 0.9546 |
| 0.1009 | 4.0 | 2020 | 0.2033 | 0.9465 | 0.9509 |
Framework versions
- Transformers 4.57.1
- Pytorch 2.8.0+cu126
- Datasets 4.0.0
- Tokenizers 0.22.1
- Downloads last month
- 38
Model tree for amaan00z/sarcasm_xlmr
Base model
FacebookAI/xlm-roberta-base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="amaan00z/sarcasm_xlmr")