Edit model card

Multiclass SDG Detection with ArBERTv2

This model is a multiclass classifier fine-tuned on the ArBERTv2 architecture, designed to identify specific Sustainable Development Goals (SDGs) mentioned in Arabic text. It classifies text into multiple SDG categories once it has been identified as SDG-related.

Prerequisite

Before running this model, input texts must first be classified as SDG-related using the binary classifier Kamel/AraSDG_Binary. This model only applies to articles that are confirmed to mention SDGs.

Model Details

Intended Use

This model is intended for use in detecting specific SDGs within Arabic text that has already been identified as SDG-related. It can be applied to large collections of articles, reports, or social media texts for content classification across multiple SDG categories.

How to Use

Step 1: Use the Binary SDG Classifier

Ensure that articles are first passed through the binary SDG classifier to determine if they are SDG-related. Only proceed with articles where the binary classifier predicts an SDG-related output.

Step 2: Use the Multiclass Model

Once an article is classified as SDG-related, use the following code to predict the specific SDG category.

from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Kamel/AraSDG_MultiClass")
model = AutoModelForSequenceClassification.from_pretrained("Kamel/AraSDG_MultiClass")

# Example text input (only use if the binary classifier predicts SDG-related)
text = "your Arabic text here"

# Tokenize input
inputs = tokenizer(text, return_tensors="pt")

# Perform inference
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits

# Get the predicted class (specific SDG class)
predicted_class = torch.argmax(logits, dim=-1).item()

# Print the result (you can map this to specific SDG labels as needed)
print(f"Predicted SDG class: {predicted_class}")

Training Data

The model was fine-tuned on a dataset of Arabic news articles, each labeled with a specific SDG category (e.g., SDG 1, SDG 2, etc.). The training data was augmented with synthetic content to ensure balanced representation across different SDGs.

Performance

The model achieves an average macro F1-score of 87%, performing well across a range of SDG categories.

Limitations

  • Prerequisite: This model assumes the input text has already been classified as SDG-related by a binary classifier.
  • The model is trained on Modern Standard Arabic (MSA) and may not perform as well on dialectal variations.
  • Some SDGs may have more training data than others, leading to potential bias in predictions.
Downloads last month
0
Safetensors
Model size
163M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.