This project is a grapheme-to-phoneme (G2P) converter for Urdu language. It can generate lexicons for Urdu words using a deep learning model.
main.py
: This is a summarized inference code implementation.app.py
: This is a complete flask app and an API to generate lexicons.
You can run this app by the following command:
python app.py
This will open a nice web UI for you.
The API is also defined in app.py
and when we run the web UI, the API also runs. You can access the API at http://localhost:5000/g2p
using a POST request. This API requires a JSON object like this:
{"text": "رکوا\nایران\nخرید"}
Each word is separated by a newline character (\n
).
- Create an Anaconda environment with Python 3.6.
conda create -n env_name python=3.6 anaconda
- Reach inside this directory and activate the conda environment:
conda activate env_name
- Run the following command to install TensorFlow 1.0.0:
pip install tensorflow-1.0.0-cp36-cp36m-win_amd64.whl
- Run the following command to install other requirements:
pip install -r requirements.txt
- Now you are ready to go:
python app.py
I hope it was helpful. 😊