Logo Lanfrica

gashawdemlew/AMH-ENG-language-transliterator

Domaine:

natural language processing

Type de record:

software
Créateur:
gas
Hôte:
Transliterator of local langanguages to English language such as Amharic, Tigregna # Local Language Transliterator FastAPI service and batch script for transliterating Amharic and Tigrinya names from Fidel/Ge'ez script into Latin script. The project uses Gemini for high-quality transliteration when an API key is available, and falls back to a local rule-based Fidel map when keys are missing or the API is unavailable. ## Features - Single-name transliteration API - Batch transliteration API with chunking and pause between requests - Local fallback transliteration using a built-in Fidel map - Optional Gemini key rotation for higher throughput - Spreadsheet-based batch processing for Excel files - Dockerized runtime ## Project Structure ```text . ├── app/ │ ├── main.py │ └── fidel_map_data.py ├── amharic_tigregna_transliteration_batch.py ├── requirements.txt ├── dockerfile └── README.md ``` ## Prerequisites - Python 3.9+ - `pip` - A Gemini API key if you want cloud-based transliteration - Optional for the batch Excel script: `pandas` and `openpyxl` ## Installation Install the core API dependencies: ```bash pip install -r requirements.txt ``` If you want to use the batch Excel script, install its extra dependencies too: ```bash pip install pandas openpyxl requests ``` ## Environment Variables The API can use one or more Gemini API keys. - `GEMINI_API_KEYS`: comma-separated list of API keys - `GEMINI_API_KEY`: fallback single key if `GEMINI_API_KEYS` is not set If no key is provided, the service automatically uses the local rule-based transliterator. ## Running the API Locally The FastAPI app imports `fidel_map_data.py` as a top-level module, so the simplest local workflow is to run it from the `app/` directory: ```bash cd app uvicorn main:app --host 0.0.0.0 --port 8015 ``` Then open: - `127.0.0.1` - `127.0.0.1` ## API Endpoints ### `GET /` Health-style root response with a welcome message. ### `POST /transliterate/single` Transliterates one name. Example: ```bash curl -X POST "127.0.0.0