Run this model with HF Jobs
Run NAMAA-Space/AraModernBert-Topic-Classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/NAMAA-Space/AraModernBert-Topic-Classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/NAMAA-Space/AraModernBert-Topic-Classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use NAMAA-Space/AraModernBert-Topic-Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NAMAA-Space/AraModernBert-Topic-Classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="NAMAA-Space/AraModernBert-Topic-Classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("NAMAA-Space/AraModernBert-Topic-Classifier") model = AutoModelForSequenceClassification.from_pretrained("NAMAA-Space/AraModernBert-Topic-Classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
AraModernBert For Topic Classification
Overview
This is an Experimental Arabic Model demonstrates how ModernBERT can be adapted to Arabic for tasks like topic classification.
This is an Experimental Arabic version of ModernBERT-base, trained ONLY on Topic Classification Task using the base model of original modernbert with a custom Arabic trained tokenizer with the following details:
- Dataset: Arabic Wikipedia
- Size: 1.8 GB
- Tokens: 228,788,529 tokens
This model demonstrates how ModernBERT can be adapted to Arabic for tasks like topic classification.
Model Eval Details
- Epochs: 3
- Evaluation Metrics:
- F1 Score: 0.95
- Loss: 0.1998
- Training Step: 47,862
Dataset Used For Training:
- SANAD DATASET was used for training and testing which contains 7 different topics such as Politics, Finance, Medical, Culture, Sport , Tech and Religion.
How to Use
The model can be used for text classification using the transformers library. Below is an example:
from transformers import pipeline
# Load model from huggingface.co/models using our repository ID
classifier = pipeline(
task="text-classification",
model="Omartificial-Intelligence-Space/AraModernBert-Topic-Classifier",
)
sample = '''
PUT SOME TEXT HERE TO CLASSIFY ITS TOPIC
'''
classifier(sample)
# [{'label': 'health', 'score': 0.6779336333274841}]
Test Phase Results:
- The model was evalauted on Test Set of 14181 examples of different topics, the distrubtion of these topics are:
- The model achieved the follwoing accuracy for prediction on this test set:
Citation
@misc{modernbert,
title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference},
author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},
year={2024},
eprint={2412.13663},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.13663},
}
- Downloads last month
- 23
Model tree for NAMAA-Space/AraModernBert-Topic-Classifier
Base model
answerdotai/ModernBERT-base
