Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

Ā© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

ibrahim-shedo/Translator-English-to-swahili-

Domain:

natural language processing

Record type:

software
Creator:
ibr
Host:
# English-to-Swahili Translator ## Overview This is a simple Python script that translates English text into Swahili using a pre-trained neural machine translation model from the Helsinki-NLP project. The script utilizes the `transformers` library by Hugging Face and the `torch` library for running the model. ## Features - Uses the `Helsinki-NLP/opus-mt-en-sw` model for translation. - Accepts user input interactively and provides instant Swahili translations. - Simple and lightweight implementation using PyTorch and Transformers. ## Prerequisites Ensure you have the following installed before running the script: - Python (>=3.7) - PyTorch (`torch`) - Transformers (`transformers`) ## Installation 1. Clone or download this repository. 2. Install the required dependencies by running: ```sh pip install torch transformers ``` ## Usage 1. Run the script: ```sh python script.py ``` 2. Enter English text to translate. 3. Type `exit` to quit the program. ## Code Explanation - The script loads the `Helsinki-NLP/opus-mt-en-sw` model and tokenizer. - It defines a `translate()` function to convert English text into Swahili. - It runs an interactive loop where users can input text, receive translations, and exit when desired. ## Example ```sh šŸ”  English-to-Swahili Translator (Type 'exit' to quit) šŸ”  Enter English text: Hello, how are you? Swahili Translation: Habari, unaendeleaje? Enter English text: Thank you very much. Swahili Translation: Asante sana. Enter English text: exit Goodbye! šŸ‘‹ ``` ## License This project is open-source and licensed under the MIT License. ## Acknowledgments Special thanks to Helsinki-NLP and Hugging Face for providing pre-trained translation models.

Visit

github.com

Tasks

machine translation

Languages

AkanAsanteSwahili

Similar

ibrahim-shedo/kenya-sing-language-translator-using-LSTM-model-deep-learning-tuyishime12/llama3-english-swahili-translatorHenryle-hd/swahili-english-translatorngosha/English-Swahili-Subs-Translator-v1Henryle-hd/Swahili-english-translator-Examplejgachoka87-art/Swahili-English-AI-translator

ibrahim-shedo/kenya-sing-language-translator-using-LSTM-model-deep-learning-

# šŸ‡°šŸ‡Ŗ Kenyan Sign Language Recognition (KSL) - Open Research Project This project is an open-source

tuyishime12/llama3-english-swahili-translator

Henryle-hd/swahili-english-translator

A simple npm package for translating between English and Swahili # Swahili-English Translator šŸŒšŸ—£ļø

ngosha/English-Swahili-Subs-Translator-v1

Henryle-hd/Swahili-english-translator-Example

Swahili-english-translator-Example ### swahili-english-translator ``` https://github.com/Henryle-hd

jgachoka87-art/Swahili-English-AI-translator

A langflow-based AI project that builds an English-Swahili translation and language assistance desig