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 --file flag is specified, save translation to this file."))


if __name__ == "__main__":
  define_translate_flags()
  FLAGS = flags.FLAGS
  absl_app.run(main)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

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: lanpa/tensorboardX
Commit Name: ad2ff3124948b32978b41d5b3e66630f05d0f6fe
Time: 2018-06-07
Author: huang.dexter@gmail.com
File Name: beholder_demo.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 9f3e9e7e9fd19fffe5ff647965ace2a0b022f899
Time: 2020-04-20
Author: rliaw@berkeley.edu
File Name: python/ray/tune/examples/bohb_example.py
Class Name:
Method Name: