Logo Lanfrica

ayanasamuel8/amharic-text-extractor

Domain:

natural language processing

Record type:

software
Creator:
aya
Host:
# πŸ“š Amharic NER Pipeline for EthioMart This repository contains tools and scripts to preprocess Amharic Telegram text data, perform Named Entity Recognition (NER) using a fine-tuned transformer model, and extract vendor analytics for micro-lending evaluation. --- ## ✨ Features - **βœ… Text Cleaning & Normalization** - Removes emojis, symbols, links, and redundant punctuation. - Normalizes Amharic-specific characters and spacing. - **πŸ”  Tokenization** - Uses `XLM-RoBERTa` tokenizer for multilingual support. - Token-level formatting for CoNLL-style entity tagging. - **🏷️ NER Annotation Support** - Manual annotation via CoNLL format. - Supports entity labels: - `B-PRICE`, `I-PRICE` - `B-PRODUCT`, `I-PRODUCT` - `B-LOC`, `I-LOC` - `O` for non-entity tokens - **🧠 Model Fine-tuning** - Fine-tunes `xlm-roberta-base` on Amharic NER data. - Built using Hugging Face Transformers. - **πŸ“Š Vendor Analytics & Scorecard** - Extracts product/price entities from vendor posts. - Computes posting frequency, engagement metrics, and Lending Score. --- ## πŸ—‚οΈ Project Structure ``` yaml / β”œβ”€β”€ scripts/ β”‚ β”œβ”€β”€ preprocess.py # Cleaning and tokenization β”‚ β”œβ”€β”€ ner_utils.py # Entity extraction utilities β”‚ β”œβ”€β”€ vendor_metrics.py # Scorecard computation β”‚ └── telegram_scraper.py # Telegram data scraping β”‚ β”œβ”€β”€ data/ β”‚ β”œβ”€β”€ raw/ # Raw Telegram data β”‚ β”œβ”€β”€ processed/ # Cleaned + enriched data β”‚ └── labeled_conll/ # CoNLL annotated data β”‚ β”œβ”€β”€ models/ β”‚ └── trained_models/ # Fine-tuned XLM-RoBERTa model β”‚ β”œβ”€β”€ notebooks/ β”‚ β”œβ”€β”€ 01_preprocessing.ipynb β”‚ β”œβ”€β”€ 03_fine_tuning.ipynb β”‚ β”œβ”€β”€ 05_lime_and_shap.ipynb β”‚ └── 08_scorecard_analysis.ipynb β”‚ β”œβ”€β”€ interpretability/ β”‚ └── difficult_cases.md # Model errors & discussion β”‚ β”œβ”€β”€ outputs/ β”‚ └── enriched_data.csv # Product/price enriched records β”‚ β”œβ”€β”€ tests/ β”‚ β”œβ”€β”€ test_preprocess.py β”‚ └── test_dummy.py β”‚ β”œβ”€β”€ requirements.txt └── README.md ``` --- ## πŸš€ Getting Started ### πŸ“¦ Installation ```bash git clone github.com cd ethiomar …