Logo Lanfrica

Dagmawi-BG/amharic-nlp-toolkit

Domain:

natural language processing

Record type:

software
Creator:
Dag
Host:
🐍 Python toolkit for processing, normalizing, and transliterating Amharic Ge'ez text # 🐍 Amharic NLP Toolkit A lightweight Python toolkit for processing, normalizing, and transliterating Amharic (Ge'ez script) text. Designed for preprocessing text in machine learning pipelines and linguistic applications. ## Features - **Text Normalization:** Replaces homophones (sound-alike characters such as `ሐ`, `αŠ…`, `ሠ` with standard equivalents `αˆ€`, `αˆ€`, `ሰ`) to eliminate spelling variations. - **Word & Sentence Tokenization:** Tokenizes text based on traditional Amharic punctuation marks like `ፑ` (word separator) and `ፒ` (sentence ender). - **Stopwords Filter:** Built-in list of common Amharic stopwords for text filtering. - **Transliteration:** Phonetically maps Ge'ez characters to Latin characters. - **CLI Utility:** Quick command-line interface for common operations. ## Structure ``` β”œβ”€β”€ amharic_nlp/ β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ normalizer.py β”‚ β”œβ”€β”€ stopwords.py β”‚ β”œβ”€β”€ tokenizer.py β”‚ └── transliterator.py β”œβ”€β”€ tests/ β”‚ └── test_nlp.py β”œβ”€β”€ cli.py β”œβ”€β”€ setup.py └── requirements.txt ``` ## Installation ```bash git clone github.com cd amharic-nlp-toolkit pip install -e . ``` ## Usage ### Python API ```python from amharic_nlp.normalizer import normalize_text from amharic_nlp.transliterator import transliterate text = "α€αˆ€α‹­α‘α‰ αŒ£αˆα‘αˆ™α‰…α‘αŠ“α‰΅α’" normalized = normalize_text(text) print(normalized) # Output: αŒΈαˆ€α‹­ α‰ αŒ£αˆ αˆ™α‰… αŠ“α‰΅α’ trans = transliterate("αˆ°αˆ‹αˆ") print(trans) # Output: selame ``` ### CLI ```bash python3 cli.py normalize --text "αˆαˆ˜αˆαˆ›αˆ" # Output: αˆ€αˆ˜αˆαˆ›αˆ ``` ## License This project is licensed under the MIT License - see the LICENSE file for details.