This repository is made for the NLP course project - May 2018.
- Translating Persian text to Quran-style Arabic text using OpenNMT-py.
To run, follow these steps:
-
Clone OpenNMT-py:
git clone https://github.com/OpenNMT/OpenNMT-py
cd OpenNMT-py
-
Intall requirements:
pip3 install -r requirements.txt
-
Preprocess the data:
python3 preprocess.py -train_src data/src-train.txt -train_tgt data/tgt-train.txt -valid_src data/src-val.txt -valid_tgt data/tgt-val.txt -save_data data/demo
-
Train the model:
python3 train.py -data data/demo -save_model demo-model
-
Translate:
python3 translate.py -model demo-model_XYZ.pt -src data/src-test.txt -output pred.txt -replace_unk -verbose
Sample result:
input: من شما را دوست دارم
output: إِنِّي لَكُمْ أَمِينٌ