def get_wmt_enfr_train_set(directory):
 train_path = os.path.join(directory, 'giga-fren.release2.fixed')
 if (not (gfile.Exists((train_path + '.fr')) and gfile.Exists((train_path + '.en')))):
  corpus_file = maybe_download(directory, 'training-giga-fren.tar', _WMT_ENFR_TRAIN_URL)
  print(('Extracting tar file %s' % corpus_file))
  with tarfile.open(corpus_file, 'r') as corpus_tar:
   corpus_tar.extractall(directory)
  gunzip_file((train_path + '.fr.gz'), (train_path + '.fr'))
  gunzip_file((train_path + '.en.gz'), (train_path + '.en'))
 return train_path

def get_wmt_enfr_train_set ( directory ) : train_path = os . path . join ( directory , 'giga-fren.release2.fixed' ) if ( not ( gfile . Exists ( ( train_path + '.fr' ) ) and gfile . Exists ( ( train_path + '.en' ) ) ) ) : corpus_file = maybe_download ( directory , 'training-giga-fren.tar' , _WMT_ENFR_TRAIN_URL ) print ( ( 'Extracting tar file %s' % corpus_file ) ) with tarfile . open ( corpus_file , 'r' ) as corpus_tar : corpus_tar . extractall ( directory ) gunzip_file ( ( train_path + '.fr.gz' ) , ( train_path + '.fr' ) ) gunzip_file ( ( train_path + '.en.gz' ) , ( train_path + '.en' ) ) return train_path
download the wmt en-fr training corpus to directory unless its there .