File size: 1,708 Bytes
87dca7d
4236010
3814228
 
b6f5d2a
3814228
 
 
 
eeabd5d
87dca7d
426648b
2b7cac2
87dca7d
627d9cd
1842d01
87dca7d
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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')