Downloads · 30 days
22
5% of all-time downloads
katomyomachia/xlm-roberta-persian-meter
xlm-roberta-persian-meter is a text classification model from katomyomachia. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is trained to classify the meter (baḥr) of a hemistich of classical Persian poetry. It is fine-tuned from XLM-RoBERTa and trained on a dataset drawn from Ganjoor.
Downloads · 30 days
22
5% of all-time downloads
All-time downloads
415
Public
Parameters
278M
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
This model is trained to classify the meter (baḥr) of a hemistich of classical Persian poetry. It is fine-tuned from XLM-RoBERTa and trained on a dataset drawn from Ganjoor.
The training data, scripts, etc. can all be found on GitHub.
So far, I have tested the performance of this model only on a randomly selected
sample (10%) from the training dataset. (See eval.py in the GitHub repo.)
While I understand that this is not ideal, and while I plan to carry out a more
rigorous evaluation, the results are promising:
Accuracy: 0.9801
F1: 0.9792
Precision: 0.9789
Recall: 0.9801
Loss: 0.0996
The model seems to perform nicely on all common Persian meters. Some rare meters remain underrepresented in the training data.
The training examples are hemistichs from classical Persian poems, all taken from the Ganjoor corpus, where poems are already tagged with their meters. Currently, the dataset contains 277,248 unique hemistichs, representing the following works:
The model predicts the meter of a given hemistich as an integer, which is mapped
to the Persian name of a meter. Fortunately, it is trivial to reverse this
mapping: see label_map.json, included both here and in the GitHub repo.