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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: bwenge-ai
|
| 3 |
+
Version: 0.1.0
|
| 4 |
+
Summary: BwengeAi - Rwandan AI that knows Kinyarwanda
|
| 5 |
+
License: MIT
|
| 6 |
+
Requires-Python: >=3.10
|
| 7 |
+
Description-Content-Type: text/markdown
|
| 8 |
+
Requires-Dist: torch>=2.1.0
|
| 9 |
+
Requires-Dist: transformers>=4.36.0
|
| 10 |
+
Requires-Dist: datasets>=2.16.0
|
| 11 |
+
Requires-Dist: accelerate>=0.25.0
|
| 12 |
+
Requires-Dist: peft>=0.7.0
|
| 13 |
+
Requires-Dist: bitsandbytes>=0.41.0
|
| 14 |
+
Requires-Dist: trl>=0.7.0
|
| 15 |
+
Requires-Dist: huggingface-hub>=0.20.0
|
| 16 |
+
Requires-Dist: sentencepiece>=0.1.99
|
| 17 |
+
Requires-Dist: tokenizers>=0.15.0
|
| 18 |
+
Requires-Dist: safetensors>=0.4.0
|
| 19 |
+
Requires-Dist: beautifulsoup4>=4.12.0
|
| 20 |
+
Requires-Dist: requests>=2.31.0
|
| 21 |
+
Requires-Dist: lxml>=4.9.0
|
| 22 |
+
Requires-Dist: tqdm>=4.66.0
|
| 23 |
+
Requires-Dist: pyyaml>=6.0
|
| 24 |
+
Requires-Dist: python-dotenv>=1.0.0
|
| 25 |
+
Requires-Dist: numpy>=1.24.0
|
| 26 |
+
Provides-Extra: dev
|
| 27 |
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
| 28 |
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
| 29 |
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
| 30 |
+
Requires-Dist: mypy>=1.7.0; extra == "dev"
|
| 31 |
+
|
| 32 |
+
# BwengeAi - Rwandan AI that knows Kinyarwanda
|
| 33 |
+
|
| 34 |
+
BwengeAi is a Rwandan AI model trained on Kinyarwanda language data from multiple sources including Huggingface datasets, Kinyarwanda Wikipedia, and Rwandan news content.
|
| 35 |
+
|
| 36 |
+
## Features
|
| 37 |
+
|
| 38 |
+
- **Multi-source data collection** from Huggingface, Wikipedia, and Igihe
|
| 39 |
+
- **Kinyarwanda language support** with comprehensive NLP capabilities
|
| 40 |
+
- **Efficient fine-tuning** using LoRA for parameter-efficient training
|
| 41 |
+
- **Evaluation pipeline** with perplexity, ROUGE, BLEU, and accuracy metrics
|
| 42 |
+
|
| 43 |
+
## Project Structure
|
| 44 |
+
|
| 45 |
+
```
|
| 46 |
+
BwengeAi/
|
| 47 |
+
βββ configs/
|
| 48 |
+
β βββ default.yaml # Main configuration
|
| 49 |
+
βββ src/
|
| 50 |
+
β βββ data_collection/ # Data collection modules
|
| 51 |
+
β β βββ huggingface_collector.py
|
| 52 |
+
β β βββ wikipedia_collector.py
|
| 53 |
+
β β βββ igihe_scraper.py
|
| 54 |
+
β β βββ data_processor.py
|
| 55 |
+
β βββ models/ # Model architecture
|
| 56 |
+
β β βββ bwenge_model.py
|
| 57 |
+
β βββ training/ # Training pipeline
|
| 58 |
+
β β βββ trainer.py
|
| 59 |
+
β βββ evaluation/ # Evaluation metrics
|
| 60 |
+
β βββ metrics.py
|
| 61 |
+
βββ scripts/
|
| 62 |
+
β βββ collect_all.py # Data collection script
|
| 63 |
+
β βββ train.py # Training script
|
| 64 |
+
βββ data/
|
| 65 |
+
β βββ raw/ # Raw collected data
|
| 66 |
+
β βββ processed/ # Processed training data
|
| 67 |
+
βββ tests/ # Test files
|
| 68 |
+
βββ docs/ # Documentation
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Installation
|
| 72 |
+
|
| 73 |
+
```bash
|
| 74 |
+
# Clone the repository
|
| 75 |
+
git clone <repository-url>
|
| 76 |
+
cd BwengeAi
|
| 77 |
+
|
| 78 |
+
# Create virtual environment
|
| 79 |
+
python -m venv venv
|
| 80 |
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
| 81 |
+
|
| 82 |
+
# Install dependencies
|
| 83 |
+
pip install -e ".[dev]"
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Data Sources
|
| 87 |
+
|
| 88 |
+
### Huggingface Datasets
|
| 89 |
+
- **CircuitNotion/kinyarwanda_corpus** - Large Kinyarwanda text corpus (3.52M rows)
|
| 90 |
+
- **mbazaNLP/kinyarwanda_monolingual_v01.1** - Monolingual corpus (1.07M rows)
|
| 91 |
+
- **saillab/alpaca_kinyarwanda_taco** - Instruction tuning (62k rows)
|
| 92 |
+
- **mbazaNLP/Kinyarwanda_English_parallel_dataset** - Translation pairs (55.7k rows)
|
| 93 |
+
- Plus 100+ additional datasets
|
| 94 |
+
|
| 95 |
+
### Kinyarwanda Wikipedia
|
| 96 |
+
- 9,660 articles with 3M+ words
|
| 97 |
+
- API access for real-time content
|
| 98 |
+
- Dump files for bulk download
|
| 99 |
+
|
| 100 |
+
### Igihe News
|
| 101 |
+
- Rwanda's leading online news platform
|
| 102 |
+
- Multiple categories: politics, health, sports, technology
|
| 103 |
+
- **Note:** Content is copyrighted - contact info@igihe.com for licensing
|
| 104 |
+
|
| 105 |
+
## Usage
|
| 106 |
+
|
| 107 |
+
### 1. Collect Data
|
| 108 |
+
|
| 109 |
+
```bash
|
| 110 |
+
python scripts/collect_all.py
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
This will:
|
| 114 |
+
- Download datasets from Huggingface
|
| 115 |
+
- Fetch articles from Kinyarwanda Wikipedia
|
| 116 |
+
- Attempt limited Igihe scraping (with permission)
|
| 117 |
+
- Process and clean all collected data
|
| 118 |
+
|
| 119 |
+
### 2. Train Model
|
| 120 |
+
|
| 121 |
+
```bash
|
| 122 |
+
python scripts/train.py
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
This will:
|
| 126 |
+
- Load the base model (Llama-3 or Llama-2)
|
| 127 |
+
- Set up LoRA for efficient fine-tuning
|
| 128 |
+
- Train on the collected Kinyarwanda data
|
| 129 |
+
- Evaluate the trained model
|
| 130 |
+
|
| 131 |
+
### 3. Configuration
|
| 132 |
+
|
| 133 |
+
Edit `configs/default.yaml` to customize:
|
| 134 |
+
- Model selection and parameters
|
| 135 |
+
- Training hyperparameters
|
| 136 |
+
- Data sources and processing options
|
| 137 |
+
- Evaluation metrics
|
| 138 |
+
|
| 139 |
+
## Model Options
|
| 140 |
+
|
| 141 |
+
### Base Models
|
| 142 |
+
- `meta-llama/Llama-3.2-1B` (default, small)
|
| 143 |
+
- `almanach/Llama-3-8B-mono-Kinyarwanda` (8B, Kinyarwanda-specific)
|
| 144 |
+
- `almanach/Llama-2-7B-mono-Kinyarwanda` (7B, Kinyarwanda-specific)
|
| 145 |
+
|
| 146 |
+
### Training Modes
|
| 147 |
+
- **Full fine-tuning**: Train all parameters
|
| 148 |
+
- **LoRA fine-tuning**: Train only adapter layers (recommended)
|
| 149 |
+
- **QLoRA**: Quantized LoRA for memory efficiency
|
| 150 |
+
|
| 151 |
+
## Evaluation
|
| 152 |
+
|
| 153 |
+
The evaluation pipeline includes:
|
| 154 |
+
- **Perplexity**: Language model quality
|
| 155 |
+
- **ROUGE**: Text summarization quality
|
| 156 |
+
- **BLEU**: Translation quality
|
| 157 |
+
- **Accuracy**: Exact match accuracy
|
| 158 |
+
|
| 159 |
+
## Available Kinyarwanda Models on Huggingface
|
| 160 |
+
|
| 161 |
+
| Model | Type | Size |
|
| 162 |
+
|-------|------|------|
|
| 163 |
+
| almanach/Llama-3-8B-mono-Kinyarwanda | LLM | 8B |
|
| 164 |
+
| almanach/Llama-2-7B-mono-Kinyarwanda | LLM | 7B |
|
| 165 |
+
| RogerB/kinyaRoberta-large-pretrained | Encoder | Large |
|
| 166 |
+
| RogerB/KinyaBERT-small-pretrained | Encoder | Small |
|
| 167 |
+
| leophill/whisper-large-v3-sn-kinyarwanda | ASR | 2B |
|
| 168 |
+
| mbazaNLP/Whisper-Small-Kinyarwanda | ASR | Small |
|
| 169 |
+
|
| 170 |
+
## License
|
| 171 |
+
|
| 172 |
+
MIT License
|
| 173 |
+
|
| 174 |
+
## Contact
|
| 175 |
+
|
| 176 |
+
For questions about Igihe data licensing:
|
| 177 |
+
- Email: info@igihe.com
|
| 178 |
+
- Phone: +250 788 895 953
|