torch-transformer-hinglish2hindi-translator is a character-level translater implemented in PyTorch, specifically designed for translating Hinglish (romanized hindi) to Hindi. The translator employs a Transformer-based architecture, leveraging the power of attention mechanisms for accurate and context-aware translation.
- Character-level translation for Hinglish to Hindi.
- Transformer-based architecture for improved context understanding.
- PyTorch implementation for ease of use and extensibility.
- Trained on a dataset containing Hinglish sentences and their corresponding Hindi translations.
- Suitable for small to medium-sized translation tasks.
-
Clone the Repository:
git clone https://github.com/yourusername/torch-transformer-hinglish2hindi-translator.git cd torch-transformer-hinglish2hindi-translator
-
Install Dependencies:
pip install -r requirements.txt
-
Download Pre-trained Model:
- Download the pre-trained transformer model weights.
- Save the weights in the
models/
directory.
-
Run the Translator:
- Use the provided script or integrate the translator into your Python code.
- Example:
from translator import Hinglish2HindiTranslator # translator = Hinglish2HindiTranslator(model_path='model/hinglish2hindi_oneHot_epoch-50.pth.tar', model_type_oneHot=True) translator = Hinglish2HindiTranslator(model_path='model/hinglish2hindi_epoch-50.pth.tar', model_type_oneHot=False) translation = translator.translate("mera naam laksh kumar sisodiya hai") print(f"Translation: {translation}") # -> मेरा नाम लक्ष कुमर सिसोदिया है
-
Fine-tuning (Optional):
- Fine-tune the model on your specific dataset by modifying the training script and providing your dataset.
Contributions are welcome! Feel free to submit pull requests, report issues, or contribute to the project's improvement. Whether you're a beginner or an experienced developer, your contributions can help enhance the translator's features and performance.
This translator is intended for educational and small to medium-sized translation tasks. It may not perform optimally on large-scale and domain-specific datasets.
Feel free to customize the repository name and description to better fit your vision for the project. Adjust the paths and commands based on your specific setup and system.