Skip to content

Translating Persian text to Quran-style Arabic text using OpenNMT-py

Notifications You must be signed in to change notification settings

sor8sh/Machine-Translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine-Translation

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:

  1. Clone OpenNMT-py:
    git clone https://github.com/OpenNMT/OpenNMT-py
    cd OpenNMT-py

  2. Intall requirements:
    pip3 install -r requirements.txt

  3. 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

  4. Train the model:
    python3 train.py -data data/demo -save_model demo-model

  5. Translate:
    python3 translate.py -model demo-model_XYZ.pt -src data/src-test.txt -output pred.txt -replace_unk -verbose


Sample result:

    input: من شما را دوست دارم
    output: إِنِّي لَكُمْ أَمِينٌ 

About

Translating Persian text to Quran-style Arabic text using OpenNMT-py

Topics

Resources

Stars

Watchers

Forks

Languages