Run this model with HF Jobs
Run mangaphd/HausaBERTa on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mangaphd/HausaBERTa. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mangaphd/HausaBERTa on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use mangaphd/HausaBERTa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mangaphd/HausaBERTa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="mangaphd/HausaBERTa")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("mangaphd/HausaBERTa") model = AutoModelForSequenceClassification.from_pretrained("mangaphd/HausaBERTa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
hausaBERTa
This model is a fine-tuned version of bert-base-cased trained on mangaphd/hausaBERTdatatrain dataset. It achieves the following results on the evaluation set:
- Train Loss: 0.0151
- Train Accuracy: 0.9849
- Epoch: 2
The sentiment fine-tuning was done on Hausa Language.
Model Repository : https://github.com/idimohammed/HausaBERTa
Model description
HausaSentiLex is a pretrained lexicon low resources language model. The model was trained on Hausa Language (Hausa is a Chadic language spoken by the Hausa people in the northern half of Nigeria, Niger, Ghana, Cameroon, Benin and Togo, and the southern half of Niger, Chad and Sudan, with significant minorities in Ivory Coast. It is the most widely spoken language in West Africa, and one of the most widely spoken languages in Africa as a whole). The model has been shown to obtain competitive downstream performances on text classification on trained language
Intended uses & limitations
You can use this model with Transformers for sentiment analysis task in Hausa Language.
Supplementary function
Add the following codes for ease of interpretation
import pandas as pd def sentiment_analysis(text): rs = pipe(text) df = pd.DataFrame(rs) senti=df['label'][0] score=df['score'][0] if senti == 'LABEL_0' and score > 0.5: lb='NEGATIVE' elif senti == 'LABEL_1' and score > 0.5: lb='POSITIVE' else: lb='NEUTRAL' return lb
call sentiment_analysis('Your text here') while using the model
Training hyperparameters
The following hyperparameters were used during training:
- optimizer: {'name': 'Adam', 'weight_decay': None, 'clipnorm': None, 'global_clipnorm': None, 'clipvalue': None, 'use_ema': False, 'ema_momentum': 0.99, 'ema_overwrite_frequency': None, 'jit_compile': True, 'is_legacy_optimizer': False, 'learning_rate': 5e-06, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-07, 'amsgrad': False}
- training_precision: float32
Training results
| Train Loss | Train Accuracy | Epoch |
|---|---|---|
| 0.2108 | 0.9168 | 0 |
| 0.1593 | 0.9385 | 1 |
| 0.0151 | 0.9849 | 2 |
Framework versions
- Transformers 4.33.2
- TensorFlow 2.13.0
- Datasets 2.14.5
- Tokenizers 0.13.3
- Downloads last month
- 65
Model tree for mangaphd/HausaBERTa
Base model
google-bert/bert-base-cased