Harveenchadha's picture
Update app.py
b6f5d2a
raw
history blame
No virus
1.71 kB
import os
os.system('wget -q https://storage.googleapis.com/vakyaansh-open-models/translation_models/en-indic.zip')
os.system('git clone https://github.com/pytorch/fairseq.git')
os.chdir('fairseq')
os.system('pip install --no-cache-dir --editable ./')
cwd = os.getcwd()
os.chdir("/".join(cwd.split('/')[:-1]))
from fairseq import checkpoint_utils, distributed_utils, options, tasks, utils
os.system('pwd')
os.system('unzip /home/user/app/en-indic.zip')
#os.chdir('indicTrans')
os.system('ls')
from inference.engine import Model
indic2en_model = Model(expdir='en-indic')
ta_paragraph = """இத்தொற்றுநோய் உலகளாவிய சமூக மற்றும் பொருளாதார சீர்குலைவை ஏற்படுத்தியுள்ளது.இதனால் பெரும் பொருளாதார மந்தநிலைக்குப் பின்னர் உலகளவில் மிகப்பெரிய மந்தநிலை ஏற்பட்டுள்ளது. இது விளையாட்டு,மத, அரசியல் மற்றும் கலாச்சார நிகழ்வுகளை ஒத்திவைக்க அல்லது ரத்து செய்ய வழிவகுத்தது.
அச்சம் காரணமாக முகக்கவசம், கிருமிநாசினி உள்ளிட்ட பொருட்களை அதிக நபர்கள் வாங்கியதால் விநியோகப் பற்றாக்குறை ஏற்பட்டது."""
indic2en_model.translate_paragraph(ta_paragraph, 'ta', 'en')