CoolFace
Modelpublic

sastarogers/alankar_classifier_v2_final

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes3downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

alankarclassifierv2_final

This model is a fine-tuned version of ai4bharat/IndicBERTv2-MLM-only on the None dataset. It achieves the following results on the evaluation set:

  • Loss: 0.0355
  • F1 Micro: 0.9669

Model description

More information needed

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: 5e-05
  • trainbatchsize: 16
  • evalbatchsize: 16
  • seed: 42
  • optimizer: Use OptimizerNames.ADAMWTORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • lrschedulertype: linear
  • num_epochs: 15

Training results

Training LossEpochStepValidation LossF1 Micro
No log1.0480.27020.3394
No log2.0960.12150.9107
No log3.01440.07350.9298
No log4.01920.05920.9516
No log5.02400.04820.9577
No log6.02880.04180.9665
No log7.03360.03960.9611
No log8.03840.03790.9611
No log9.04320.03660.9640
No log10.04800.03640.9640
0.092711.05280.03630.9611
0.092712.05760.03600.9640
0.092713.06240.03580.9669
0.092714.06720.03550.9669
0.092715.07200.03550.9669

Framework versions

  • Transformers 4.53.0
  • Pytorch 2.6.0+cu124
  • Datasets 2.14.4
  • Tokenizers 0.21.2

Intended Use & Limitations

This model is intended for educational and literary analysis purposes, providing a programmatic way to identify potential alankars in a line of poetry.

Limitations:

  • Anupras Bias: The model has a strong bias towards Anupras (Alliteration), as its pattern is the simplest to detect. It may confidently predict Anupras even when a more complex alankar is also present.
  • Weakest Classes: The model is weakest at distinguishing Utpreksha from other comparison-based alankars like Roopak. It relies heavily on keywords (मानो, ज्यों, etc.) for high confidence.
  • Confidence Scores: The model often predicts multiple alankars. It is best to look at the relative confidence scores. A high-confidence primary prediction and a medium-confidence secondary prediction can indicate the presence of both.
  • Modern Poetry: While trained on some modern examples, its expertise is stronger in classical poetry structures. It may be less accurate on highly colloquial or abstract modern ghazals.

How to Use

Basic Inference with Pipeline

The easiest way to use the model is with a pipeline.

python
!pip install transformers[torch] -q

from transformers import pipeline

# Load the model from the Hugging Face Hub
model_name = "sastarogers/alankar_classifier_v2_final"
alankar_detector = pipeline(
    "text-classification",
    model=model_name,
    return_all_scores=True
)

# Test with a line of poetry
line = "काली घटा का घमंड घटा।"
predictions = alankar_detector(line)
print(predictions)