This readme provides instructions on how to set up and run the Hinglish Translator, which translates English text to Hinglish (a mix of Hindi and English) using Python. The code utilizes libraries such as gradio, nltk, and googletrans to achieve this translation.
Before running the code, ensure that you have the following dependencies installed on your system:
-
gradio: A Python library for creating interactive user interfaces for machine learning models. Install it using pip:pip install gradio
-
nltk: The Natural Language Toolkit library for natural language processing tasks. Install it using pip:pip install nltk
-
googletrans: A Python wrapper for Google Translate. Install it using pip:pip install googletrans==4.0.0-rc1
Once you have installed the required dependencies, follow these steps to run the Hinglish Translator:
-
Copy the code provided in the original script to a Python file, e.g.,
hinglish_translator.py. -
Open a terminal or command prompt and navigate to the directory where
hinglish_translator.pyis located. -
Run the Python script:
python hinglish_translator.py
-
After running the script, you will see a local URL displayed in the terminal. It will look something like this:
Running on http://127.0.0.1:7860/ -
Open a web browser and paste the URL (e.g.,
http://127.0.0.1:7860/) into the address bar. -
You will be directed to the Hinglish Translator web interface.
-
In the provided textbox labeled "Enter text to translate to Hinglish," type or paste the English text you want to translate.
-
After entering the text, press the "Submit" button or simply hit Enter.
-
The translated Hinglish text will be displayed in the textbox labeled "Hinglish translation."
-
Voilà! You now have your Hinglish translation.
Feel free to use the Hinglish Translator for your English-to-Hinglish translation needs. Enjoy!