a84e1ef9f1398100dd73c49737f39ac42f797f02,official/transformer/translate.py,,,#,204
Before Change
if __name__ == "__main__":
parser = argparse.ArgumentParser()
// Model arguments
parser.add_argument(
"--data_dir", "-dd", type=str, default="/tmp/data/translate_ende",
help="[default: %(default)s] Directory where vocab file is stored.",
metavar="<DD>")
parser.add_argument(
"--vocab_file", "-vf", type=str, default=VOCAB_FILE,
help="[default: %(default)s] Name of vocabulary file.",
metavar="<vf>")
parser.add_argument(
"--model_dir", "-md", type=str, default="/tmp/transformer_model",
help="[default: %(default)s] Directory containing Transformer model "
"checkpoints.",
metavar="<MD>")
parser.add_argument(
"--params", "-p", type=str, default="big", choices=["base", "big"],
help="[default: %(default)s] Parameter used for trained model.",
metavar="<P>")
// Flags for specifying text/file to be translated.
parser.add_argument(
"--text", "-t", type=str, default=None,
help="[default: %(default)s] Text to translate. Output will be printed "
"to console.",
metavar="<T>")
parser.add_argument(
"--file", "-f", type=str, default=None,
help="[default: %(default)s] File containing text to translate. "
"Translation will be printed to console and, if --file_out is "
"provided, saved to an output file.",
metavar="<F>")
parser.add_argument(
"--file_out", "-fo", type=str, default=None,
help="[default: %(default)s] If --file flag is specified, save "
"translation to this file.",
metavar="<FO>")
FLAGS, unparsed = parser.parse_known_args()
main(sys.argv)
After Change
if __name__ == "__main__":
define_translate_flags()
FLAGS = flags.FLAGS
absl_app.run(main)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 19
Instances
Project Name: tensorflow/models
Commit Name: a84e1ef9f1398100dd73c49737f39ac42f797f02
Time: 2018-05-11
Author: 31663267+k-w-w@users.noreply.github.com
File Name: official/transformer/translate.py
Class Name:
Method Name:
Project Name: tensorflow/models
Commit Name: a84e1ef9f1398100dd73c49737f39ac42f797f02
Time: 2018-05-11
Author: 31663267+k-w-w@users.noreply.github.com
File Name: official/transformer/translate.py
Class Name:
Method Name:
Project Name: tensorflow/models
Commit Name: a84e1ef9f1398100dd73c49737f39ac42f797f02
Time: 2018-05-11
Author: 31663267+k-w-w@users.noreply.github.com
File Name: official/transformer/compute_bleu.py
Class Name:
Method Name:
Project Name: tensorflow/models
Commit Name: a84e1ef9f1398100dd73c49737f39ac42f797f02
Time: 2018-05-11
Author: 31663267+k-w-w@users.noreply.github.com
File Name: official/transformer/data_download.py
Class Name:
Method Name: