Lusaka Multilingual Aspect-Based Sentiment Analysis (ABSA) Model
Model Identifier
Kelvinmbewe/mbert_Lusaka_Language_Analysis
1. Model Summary
We present a multilingual Aspect-Based Sentiment Analysis (ABSA) model fine-tuned from mBERT for ride-hailing service reviews in a Lusaka urban context. The model performs token-level BIO tagging to extract aspect spans and classify their sentiment polarity.
The system is designed for multilingual and code-switched inputs involving:
- English
- Bemba
- Nyanja
- EnglishโBemba code-switch
- EnglishโNyanja code-switch
This work contributes toward low-resource African language sentiment modeling under multilingual transformer architectures.
2. Task Definition
The model performs joint:
- Aspect extraction (span detection)
- Sentiment classification (Positive, Negative, Neutral)
Formally:
Given a sentence ( S = {w_1, w_2, ..., w_n} ),
The model predicts:
- A BIO tag for each token
- Sentiment polarity for extracted aspect spans
Label schema:
O
B-POS / I-POS
B-NEG / I-NEG
B-NEU / I-NEU
3. Model Architecture
- Base model:
bert-base-multilingual-cased - Architecture: Transformer encoder (12-layer)
- Fine-tuning objective: Token classification
- Maximum sequence length: 64 tokens
- Optimizer: AdamW
- Learning rate: 1e-5 (recommended configuration)
- Scheduler: Linear decay
- Mixed precision (FP16) training enabled
4. Training Data
The training corpus consists of approximately 1,000+ annotated ride-hailing reviews and complaints reflecting Lusaka urban language use.
Dataset Properties
- Balanced sentiment distribution (POS / NEG / NEU)
- Monolingual and code-switched samples
- BIO-annotated aspect spans
- Domain: ride-hailing service (driver, payment, app, ride, safety, etc.)
The dataset contains synthetic and semi-synthetic examples constructed to simulate realistic Lusaka multilingual patterns.
5. Evaluation
Evaluation is conducted at the token level using macro-averaged metrics.
Metrics reported:
- Accuracy
- Precision (macro)
- Recall (macro)
- F1-score (macro)
Typical performance range:
| Metric | Approximate Range |
|---|---|
| Accuracy | 0.70โ0.80 |
| Macro F1 | 0.65โ0.75 |
These scores reflect token-level evaluation and may not directly correspond to span-level exact-match performance.
6. Intended Use
This model is intended for:
- Research on low-resource ABSA
- Multilingual sentiment modeling
- Code-switch robustness experiments
- Zambian NLP system development
- Ride-hailing feedback analytics
It is suitable for exploratory and research-driven deployments.
7. Limitations
Evaluation is token-level; span-level metrics are not provided.
Synthetic data may introduce distribution bias.
Limited dialectal variation beyond Lusaka urban patterns.
Performance may degrade on:
- Long-form paragraphs
- Heavy slang
- Out-of-domain text
Code-switch handling depends on subword tokenization quality.
8. Ethical Considerations
- The model is trained on simulated ride-service feedback and does not include personal user data.
- Predictions may contain bias introduced through synthetic pattern repetition.
- The system should not be used for automated decision-making affecting individuals.
9. Reproducibility
training_args = TrainingArguments(
output_dir=OUTPUT_DIR, # Directory where model checkpoints and outputs will be saved
eval_strategy="epoch", # Run evaluation at the end of each training epoch
save_strategy="epoch", # Save a checkpoint at the end of each epoch
save_total_limit=1, # Keep only the most recent/best checkpoint to save disk space
learning_rate=1e-5, # Initial learning rate for the optimizer
num_train_epochs=10, # Total number of full passes through the training dataset
warmup_ratio=0.1, # Warm up learning rate for the first 10% of total training steps
lr_scheduler_type="linear", # Linearly decay learning rate after warmup
per_device_train_batch_size=8, # Batch size per GPU/CPU during training
per_device_eval_batch_size=8, # Batch size per GPU/CPU during evaluation
weight_decay=0.01, # Apply L2 regularization to help prevent overfitting
logging_strategy="epoch", # Log training metrics at the end of each epoch
load_best_model_at_end=True, # After training, automatically load the best-performing checkpoint
metric_for_best_model="f1_macro", # Metric used to determine which checkpoint is "best"
greater_is_better=True, # Higher F1 score indicates better performance
fp16=True # Enable mixed precision (16-bit) training for faster performance and lower memory usage
)
10. Example
Input:
Payment yachoka twice but driver ali musuma sana.
Output:
[
{"aspect": "Payment yachoka twice", "sentiment": "neg"},
{"aspect": "driver ali umusuma sana", "sentiment": "pos"}
]
11. Research Contribution
This model demonstrates:
- Feasibility of ABSA under multilingual Zambian mixed language
- mBERT adaptability to low-resource sentiment tasks
- Token-level ABSA in mixed-language urban settings
- Synthetic dataset viability for bootstrapping low-resource domains
- Downloads last month
- 47
Model tree for Kelvinmbewe/ZambianABSA
Base model
google-bert/bert-base-multilingual-cased