--- title: Arabic Sentiment Analysis emoji: 🧠 colorFrom: blue colorTo: green sdk: gradio sdk_version: 6.5.1 python_version: '3.10' app_file: app.py pinned: false --- # Arabic Sentiment Analysis with AraBERT This project presents an **Arabic Sentiment Analysis system** based on a fine-tuned version of **AraBERT**. The model predicts the sentiment of Arabic text as **Positive** or **Negative**, along with a confidence score. The application is deployed using **Gradio** on **Hugging Face Spaces**, providing an interactive web interface for real-time inference. --- ## 🚀 Demo Simply enter an Arabic text in the input box and the model will return: - **Sentiment**: Positive / Negative - **Confidence**: Prediction confidence in percentage (%) --- ## 🧠 Model - **Base model**: `aubmindlab/bert-base-arabertv02` - **Task**: Binary Sentiment Classification - **Labels**: - `0` → Negative - `1` → Positive - **Preprocessing**: AraBERT text normalization and cleaning --- ## 📊 Dataset - **Dataset**: Arabic Sentiment Analysis dataset - **Classes**: - Negative (0): 1,784 samples - Positive (1): 2,332 samples - **Domain**: Arabic tweets and short texts > ⚠️ The dataset is **not included** in this repository, as it is used only during training. --- ## ⚙️ Training Details - Fine-tuning performed on **Google Colab** - **Early Stopping** used to prevent overfitting - **Checkpointing** enabled during training - Final model selected based on validation performance --- ## 🖥️ Deployment - **Framework**: Gradio - **Platform**: Hugging Face Spaces - **Hardware**: CPU (Zero GPU) - **Inference**: Real-time --- ## 📦 Project Structure