# Amharic E-commerce NER & Vendor Scorecard πͺπΉ
Extracting Structured Product Intelligence from Telegram E-commerce Channels
**Named Entity Recognition (NER) + Vendor Analytics + Micro-Lending Scorecard**
---
## Project Overview
This project builds an NLP pipeline to extract and analyze e-commerce information from **Amharic-language Telegram posts**. The system performs:
π **Named Entity Recognition (NER)** to identify key entities:
- ποΈ `PRODUCT` β items being sold
- π° `PRICE` β numerical price values (e.g., "6500 α₯α")
- π `LOCATION` β delivery/meeting/store areas
- π `CONTACT` β phone numbers
- **FinTech Vendor Scorecard** to assess vendor activity, engagement, and pricing and identify top-performing microbusinesses eligible for **micro-lending** based on engagement and product insights.
## Quick Start
### 1. Install Dependencies
```bash
pip install -r requirements.txt
````
### 2. Run the Preprocessing & Labeling Pipeline
```bash
python scripts/run_preprocessing.py
python scripts/run_ner_labeling.py
```
These scripts clean and tokenize Telegram messages and output weakly labeled data in **CoNLL format** (`labeled_data.conll`).
## Pipeline Components
### Data Preprocessing
* Scraped Telegram posts using Telethon
* Cleaned noise, removed emojis, normalized text
### Rule-based Weak Labeling
Custom heuristics for each entity:
| Entity | Strategy |
| -------- | ----------------------------------------- |
| PRODUCT | Keyword anchor matching (e.g., αα½α, α«α) |
| PRICE | Regex on digits + α₯α / αα |
| LOCATION | Clue phrases (e.g., α¦α³, α α΅α«α» αα) |
| CONTACT | Regex (e.g., 09xx,07xx,251 numbers) |
* BIO format applied to support model training (`B-`, `I-`, `O`)
### NER Model Training
* Used π€ HuggingFace transformers
* Fine-tuned multilingual models:
* `rasyosef/bert-tiny-amharic`
* `Davlan/distilbert-base-multilingual-cased-ner-hrl`
* `mbeukman/xlm-roberta-base-finetuned-ner-swahili`
* β¦