Instructions to use qandos0/SentimentArEng with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qandos0/SentimentArEng with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="qandos0/SentimentArEng")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("qandos0/SentimentArEng") model = AutoModelForSequenceClassification.from_pretrained("qandos0/SentimentArEng", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| base_model: cardiffnlp/twitter-xlm-roberta-base-sentiment | |
| metrics: | |
| - accuracy | |
| model-index: | |
| - name: result | |
| results: [] | |
| language: | |
| - ar | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-classification | |
| --- | |
| # SentimentArEng | |
| This model is a fine-tuned version of [cardiffnlp/twitter-xlm-roberta-base-sentiment](https://huggingface.co/cardiffnlp/twitter-xlm-roberta-base-sentiment) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.502831 | |
| - Accuracy: 0.798512 | |
| # inference with pipeline | |
| ``` | |
| from transformers import pipeline | |
| model_path = "Noor0/SentimentArEng" | |
| sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path) | |
| sentiment_task("ุชุนุงู ู ุงูู ูุธููู ูุงู ุฃูู ู ู ุงูู ุชููุน") | |
| ``` | |
| - output: | |
| - [{'label': 'negative', 'score': 0.9905518293380737}] | |
| ## Training and evaluation data | |
| - Training set: 114,885 records | |
| - evaluation data: 12,765 records | |
| ## Training procedure | |
| | Training Loss | Epoch |Validation Loss | Accuracy | | |
| |:-------------:|:-----:|:---------------:|:--------:| | |
| | 0.4511 | 2.0 |0.502831 | 0.7985 | | |
| | 0.3655 | 3.0 |0.576118 | 0.7954 | | |
| | 0.3019 | 4.0 |0.625391 | 0.7985 | | |
| | 0.2466 | 5.0 |0.835689 | 0.7979 | | |
| ### Training hyperparameters | |
| - The following hyperparameters were used during training: | |
| - learning_rate=2e-5 | |
| - num_train_epochs=20 | |
| - weight_decay=0.01 | |
| - batch_size=16, | |
| ### Framework versions | |
| - Transformers 4.35.0 | |
| - Pytorch 2.0.0 | |
| - Datasets 2.11.0 | |
| - Tokenizers 0.14.1 |