bert base arabic camelbert mix sentiment

CAMeL-Lab

Introduction

The CAMeLBERT Mix SA model is a sentiment analysis model built by fine-tuning the CAMeLBERT Mix model. It is designed for Arabic text classification tasks, utilizing datasets such as ASTD, ArSAS, and SemEval for fine-tuning.

Architecture

This model is based on the BERT architecture, specifically tailored for Arabic text by incorporating a mix of Modern Standard Arabic, dialectal, and classical Arabic. The model is compatible with both PyTorch and TensorFlow frameworks.

Training

The model was fine-tuned using the ASTD, ArSAS, and SemEval datasets. Detailed information about the fine-tuning procedure and hyperparameters can be found in the paper titled "The Interplay of Variant, Size, and Task Type in Arabic Pre-trained Language Models." The fine-tuning code is available on the CAMeL-Lab GitHub repository.

Guide: Running Locally

To run the CAMeLBERT Mix SA model locally:

  1. Installation: Ensure that you have transformers>=3.5.0 installed. You can install it using pip:

    pip install transformers
    
  2. Using CAMeL Tools:

    from camel_tools.sentiment import SentimentAnalyzer
    sa = SentimentAnalyzer("CAMeL-Lab/bert-base-arabic-camelbert-mix-sentiment")
    sentences = ['أنا بخير', 'أنا لست بخير']
    print(sa.predict(sentences))
    
  3. Using Transformers Pipeline:

    from transformers import pipeline
    sa = pipeline('sentiment-analysis', model='CAMeL-Lab/bert-base-arabic-camelbert-mix-sentiment')
    sentences = ['أنا بخير', 'أنا لست بخير']
    print(sa(sentences))
    
  4. Hardware Recommendation: For optimal performance, it is advisable to utilize cloud GPU services such as AWS EC2, Google Cloud Platform, or Azure.

License

This model is licensed under the Apache 2.0 License, allowing for both academic and commercial use.

More Related APIs in Text Classification