Instructions to use mofawzy/BERT-ASTD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mofawzy/BERT-ASTD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mofawzy/BERT-ASTD")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("mofawzy/BERT-ASTD") model = AutoModelForSequenceClassification.from_pretrained("mofawzy/BERT-ASTD") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mofawzy/BERT-ASTD")
model = AutoModelForSequenceClassification.from_pretrained("mofawzy/BERT-ASTD")Quick Links
BERT-ASTD Balanced
Arabic version bert model fine tuned on ASTD dataset balanced version to identify twitter sentiments in Arabic language MSA dialect .
Data
The model were fine-tuned on ~1330 tweet in Arabic language.
Results
| class | precision | recall | f1-score | Support |
|---|---|---|---|---|
| 0 | 0.9328 | 0.9398 | 0.9363 | 133 |
| 1 | 0.9394 | 0.9323 | 0.9358 | 133 |
| Accuracy | 0.9361 | 266 |
How to use
You can use these models by installing torch or tensorflow and Huggingface library transformers. And you can use it directly by initializing it like this:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name="mofawzy/BERT-ASTD"
model = AutoModelForSequenceClassification.from_pretrained(model_name,num_labels=2)
tokenizer = AutoTokenizer.from_pretrained(model_name)
- Downloads last month
- 3
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mofawzy/BERT-ASTD")