Text Classification
Transformers
PyTorch
Arabic
bert
text classification
arabic
poetry
text-embeddings-inference
Instructions to use Ammar-alhaj-ali/arabic-MARBERT-poetry-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ammar-alhaj-ali/arabic-MARBERT-poetry-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Ammar-alhaj-ali/arabic-MARBERT-poetry-classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Ammar-alhaj-ali/arabic-MARBERT-poetry-classification") model = AutoModelForSequenceClassification.from_pretrained("Ammar-alhaj-ali/arabic-MARBERT-poetry-classification") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Ammar-alhaj-ali/arabic-MARBERT-poetry-classification")
model = AutoModelForSequenceClassification.from_pretrained("Ammar-alhaj-ali/arabic-MARBERT-poetry-classification")Quick Links
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 model. For the fine-tuning, I used APCD: Arabic Poem Comprehensive Dataset that includes 23 labels (البسيط,الطويل,الكامل,الوافر,الخفيف,السريع,..).
How to use
To use the model with a transformers pipeline:
>>>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}]
- Downloads last month
- 70
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Ammar-alhaj-ali/arabic-MARBERT-poetry-classification")