def load_wmt_en_fr_dataset(path='<STR_LIT:data>'):
path = os.path.join(path, '<STR_LIT>')<EOL>_WMT_ENFR_TRAIN_URL = "<STR_LIT>"<EOL>_WMT_ENFR_DEV_URL = "<STR_LIT>"<EOL>def gunzip_file(gz_path, new_path):<EOL><INDENT>"""<STR_LIT>"""<EOL>logging.info("<STR_LIT>" % (gz_path, new_path))<EOL>with gzip.open(gz_path, "<STR_LIT:rb>") as gz_file:<EOL><INDENT>with open(new_path, "<STR_LIT:wb>") as new_file:<EOL><INDENT>for line in gz_file:<EOL><INDENT>new_file.write(line)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>def get_wmt_enfr_train_set(path):<EOL><INDENT>"""<STR_LIT>"""<EOL>filename = "<STR_LIT>"<EOL>maybe_download_and_extract(filename, path, _WMT_ENFR_TRAIN_URL, extract=True)<EOL>train_path = os.path.join(path, "<STR_LIT>")<EOL>gunzip_file(train_path + "<STR_LIT>", train_path + "<STR_LIT>")<EOL>gunzip_file(train_path + "<STR_LIT>", train_path + "<STR_LIT>")<EOL>return train_path<EOL><DEDENT>def get_wmt_enfr_dev_set(path):<EOL><INDENT>"""<STR_LIT>"""<EOL>filename = "<STR_LIT>"<EOL>dev_file = maybe_download_and_extract(filename, path, _WMT_ENFR_DEV_URL, extract=False)<EOL>dev_name = "<STR_LIT>"<EOL>dev_path = os.path.join(path, "<STR_LIT>")<EOL>if not (gfile.Exists(dev_path + "<STR_LIT>") and gfile.Exists(dev_path + "<STR_LIT>")):<EOL><INDENT>logging.info("<STR_LIT>" % dev_file)<EOL>with tarfile.open(dev_file, "<STR_LIT>") as dev_tar:<EOL><INDENT>fr_dev_file = dev_tar.getmember("<STR_LIT>" + dev_name + "<STR_LIT>")<EOL>en_dev_file = dev_tar.getmember("<STR_LIT>" + dev_name + "<STR_LIT>")<EOL>fr_dev_file.name = dev_name + "<STR_LIT>"  <EOL>en_dev_file.name = dev_name + "<STR_LIT>"<EOL>dev_tar.extract(fr_dev_file, path)<EOL>dev_tar.extract(en_dev_file, path)<EOL><DEDENT><DEDENT>return dev_path<EOL><DEDENT>logging.info("<STR_LIT>".format(path))<EOL>train_path = get_wmt_enfr_train_set(path)<EOL>dev_path = get_wmt_enfr_dev_set(path)<EOL>return train_path, dev_path<EOL>
Load WMT'15 English-to-French translation dataset.

    It will download the data from the WMT'15 Website (10^9-French-English corpus), and the 2013 news test from the same site as development set.
    Returns the directories of training data and test data.

    Parameters
    ----------
    path : str
        The path that the data is downloaded to, defaults is ``data/wmt_en_fr/``.

    References
    ----------
    - Code modified from /tensorflow/models/rnn/translation/data_utils.py

    Notes
    -----
    Usually, it will take a long time to download this dataset.