- We start by loading the necessary libraries:
import osimport reimport sysimport jsonimport mathimport timeimport stringimport requestsimport ioimport numpy as npimport collectionsimport randomimport pickleimport stringimport matplotlib.pyplot as pltimport tensorflow as tffrom zipfile import ZipFilefrom collections import Counterfrom tensorflow.python.ops import lookup_opsfrom tensorflow.python.framework import opsops.reset_default_graph()local_repository = 'temp/seq2seq'
- The following block of code will import the whole NMT model repository into the temp folder:
if not os.path.exists(local_repository): from git import Repo tf_model_repository = 'https://github.com/tensorflow/nmt/' Repo.clone_from(tf_model_repository, local_repository) ...