bert base arabic finetuned emotion

hatemnoaman

Introduction

The BERT-BASE-ARABIC-FINETUNED-EMOTION model is a fine-tuned version of the BERT base model for Arabic language processing, specifically targeting emotion detection using the emotone_ar dataset. It is optimized for text classification tasks and provides metrics such as accuracy and F1 scores.

Architecture

This model is based on the BERT architecture and has been fine-tuned for Arabic emotion detection tasks. It leverages the transformer-based approach, utilizing BERT's ability to understand context in text, to classify emotions in Arabic text data.

Training

The model was trained using the emotone_ar dataset, with training hyperparameters set as follows:

  • Learning rate: 2e-05
  • Train batch size: 64
  • Eval batch size: 64
  • Seed: 42
  • Optimizer: Adam with betas = (0.9, 0.999) and epsilon = 1e-08
  • Learning rate scheduler: Linear
  • Number of epochs: 6

Training results include:

  • Final Loss: 0.8965
  • Accuracy: 0.7416
  • F1 Score: 0.7406

Guide: Running Locally

To use the model locally, follow these steps:

  1. Install Dependencies: Ensure you have the required packages installed. You can use pip:

    pip install transformers torch datasets
    
  2. Load the Model:

    from transformers import AutoTokenizer, AutoModel
    
    tokenizer = AutoTokenizer.from_pretrained("hatemnoaman/bert-base-arabic-finetuned-emotion")
    model = AutoModel.from_pretrained("hatemnoaman/bert-base-arabic-finetuned-emotion")
    
  3. Run Inference: Use the tokenizer and model to process text data and predict emotions.

Cloud GPUs: For faster processing, consider using cloud GPU services such as Google Colab, AWS EC2, or Azure ML. These platforms provide powerful hardware suitable for running deep learning models.

License

The model and associated data are subject to the terms and conditions specified by the author, Hatem Noaman. Please refer to the model's page on Hugging Face or associated publications for specific licensing details.

More Related APIs in Text Classification