Jann/utils.py
def parse_arguments(arguments=None):
    """Parse the command line arguments."""
    parser = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)

    default_module = 'data/module/universal-sentence-encoder-lite-2'
    parser.add_argument('--module_path',
                        help='Specify the local encoder model path',
                        default=default_module)
    parser.add_argument('--use_sentence_piece',
                        type=bool,
                        default=True)
    parser.add_argument('--infile',
                        help="Path to input file.",
                        default='data/CMDC/all_lines_50.txt')
    parser.add_argument('--infile_path',
                        help="Input file path")
    parser.add_argument('--outfile',
                        help="Output file.",
                        default=None)
    parser.add_argument('--num_lines',
                        type=int,
                        help="Number of lines to processes")
    parser.add_argument('--pairs',
                        dest='pairs',
                        help="Flag to use pairs mode or not.",
                        action='store_true',
                        default=False)
    parser.add_argument('--delimiter',
                        default='\t',
                        help="Delimeter between input<>response.")
    parser.add_argument('--verbose',
                        dest='verbose',
                        help="Flag to add verbose logging detail.",
                        action='store_true',
                        default=True)
    parser.add_argument('--num_trees',
                        type=int,
                        help='Number of trees for to search for neighbors.',
                        default=100)
    parser.add_argument('--num_neighbors',
                        type=int,
                        help='Number of nearest neighbors to return.',
                        default=10)
    parser.add_argument('--search_k',
                        type=int,
                        help='Number of trees to search.',
                        default=10)
    args = parser.parse_args(arguments)

    # Specify the local module path
    if 'lite' in args.module_path:
        args.use_sentence_piece = True

    # Reduce logging output.
    tf.logging.set_verbosity(tf.logging.WARN)
    if args.verbose:
        tf.logging.set_verbosity(tf.logging.DEBUG)

    return args
Parse the command line arguments.
Parse the command line arguments.
Parse the command line arguments .
def parse_arguments(arguments=None):
    parser = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    default_module = 'data/module/universal-sentence-encoder-lite-2'
    parser.add_argument('--module_path',
                        help='Specify the local encoder model path',
                        default=default_module)
    parser.add_argument('--use_sentence_piece',
                        type=bool,
                        default=True)
    parser.add_argument('--infile',
                        help="Path to input file.",
                        default='data/CMDC/all_lines_50.txt')
    parser.add_argument('--infile_path',
                        help="Input file path")
    parser.add_argument('--outfile',
                        help="Output file.",
                        default=None)
    parser.add_argument('--num_lines',
                        type=int,
                        help="Number of lines to processes")
    parser.add_argument('--pairs',
                        dest='pairs',
                        help="Flag to use pairs mode or not.",
                        action='store_true',
                        default=False)
    parser.add_argument('--delimiter',
                        default='\t',
                        help="Delimeter between input<>response.")
    parser.add_argument('--verbose',
                        dest='verbose',
                        help="Flag to add verbose logging detail.",
                        action='store_true',
                        default=True)
    parser.add_argument('--num_trees',
                        type=int,
                        help='Number of trees for to search for neighbors.',
                        default=100)
    parser.add_argument('--num_neighbors',
                        type=int,
                        help='Number of nearest neighbors to return.',
                        default=10)
    parser.add_argument('--search_k',
                        type=int,
                        help='Number of trees to search.',
                        default=10)
    args = parser.parse_args(arguments)
    if 'lite' in args.module_path:
        args.use_sentence_piece = True
    tf.logging.set_verbosity(tf.logging.WARN)
    if args.verbose:
        tf.logging.set_verbosity(tf.logging.DEBUG)
    return args
def parse_arguments ( arguments = None ) : parser = argparse . ArgumentParser ( description = __doc__ , formatter_class = argparse . RawDescriptionHelpFormatter ) default_module = 'data/module/universal-sentence-encoder-lite-2' parser . add_argument ( '--module_path' , help = 'Specify the local encoder model path' , default = default_module ) parser . add_argument ( '--use_sentence_piece' , type = bool , default = True ) parser . add_argument ( '--infile' , help = "Path to input file." , default = 'data/CMDC/all_lines_50.txt' ) parser . add_argument ( '--infile_path' , help = "Input file path" ) parser . add_argument ( '--outfile' , help = "Output file." , default = None ) parser . add_argument ( '--num_lines' , type = int , help = "Number of lines to processes" ) parser . add_argument ( '--pairs' , dest = 'pairs' , help = "Flag to use pairs mode or not." , action = 'store_true' , default = False ) parser . add_argument ( '--delimiter' , default = '\t' , help = "Delimeter between input<>response." ) parser . add_argument ( '--verbose' , dest = 'verbose' , help = "Flag to add verbose logging detail." , action = 'store_true' , default = True ) parser . add_argument ( '--num_trees' , type = int , help = 'Number of trees for to search for neighbors.' , default = 100 ) parser . add_argument ( '--num_neighbors' , type = int , help = 'Number of nearest neighbors to return.' , default = 10 ) parser . add_argument ( '--search_k' , type = int , help = 'Number of trees to search.' , default = 10 ) args = parser . parse_args ( arguments ) if 'lite' in args . module_path : args . use_sentence_piece = True tf . logging . set_verbosity ( tf . logging . WARN ) if args . verbose : tf . logging . set_verbosity ( tf . logging . DEBUG ) return args
Parse the command line arguments.
Parse the command line arguments .
"""Parse the command line arguments.""" # Specify the local module path # Reduce logging output.
arguments