File size: 1,694 Bytes
7256981
 
 
 
3c9bdcc
 
6ab1b92
3c9bdcc
7256981
 
042e5d3
 
7256981
3744f7e
7256981
 
 
 
 
 
 
715e6a7
6c6ee09
 
7256981
6c6ee09
 
7256981
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
language:
- ar
widget:
- text: "قِفَا نَبْكِ مِنْ ذِكْرَى حَبِيبٍ ومَنْزِلِ [sep]بِسِقْطِ اللِّوَى بَيْنَ الدَّخُولِ فَحَوْمَلِ"
- text: "ليس الغريب غريب الشام واليمنُ[sep]إن الغريب غريب اللحد والكفن"
- text: "عَلى قَدْرِ أهْلِ العَزْم تأتي العَزائِمُ[sep] وَتأتي علَى قَدْرِ الكِرامِ المَكارمُ"
- text: "قم للمعلم وفّه التبجيلا[sep] كاد المعلم أن يكون رسولا"
tags:
- text classification
- arabic
- poetry
---
## Arabic MARBERT Poetry Classification Model
#### Model description
**arabic-MARBERT-poetry-classification Model** is a poetry classification model that was built by fine-tuning the [MARBERT](https://huggingface.co/UBC-NLP/MARBERT) model. For the fine-tuning, I used [APCD: Arabic Poem Comprehensive Dataset](https://hci-lab.github.io/ArabicPoetry-1-Private/) that includes 23 labels (البسيط,الطويل,الكامل,الوافر,الخفيف,السريع,..).

#### How to use
To use the model with a transformers pipeline:
```python
>>>from transformers import pipeline
>>>model = pipeline('text-classification', model='Ammar-alhaj-ali/arabic-MARBERT-poetry-classification')
>>>sentences = ['ويوم نلتقي فيه قصير[sep]يطول اليوم لا ألقاك فيه',
             'أما للهوى عليك نهي ولا أمر[sep]أراك عصيّ الدمع شيمتك الصبر']
>>>model(sentences)
[{'label': 'الوافر', 'score': 0.9979557991027832},
 {'label': 'الطويل', 'score': 0.9646275043487549}]
```