Exemplo n.º 1
0
def main():
    args = get_train_args()
    model = init_train_env(args, tbert_type='siamese2')
    train_dir = os.path.join(args.data_dir, "train")
    valid_dir = os.path.join(args.data_dir, "valid")
    train_examples = load_examples(train_dir, model=model, num_limit=args.train_num)
    valid_examples = load_examples(valid_dir, model=model, num_limit=args.valid_num)
    train(args, train_examples, valid_examples, model, train_with_neg_sampling)
    logger.info("Training finished")
Exemplo n.º 2
0
def main():
    args = get_train_args()
    model = init_train_env(args, tbert_type='siamese2')
    valid_examples = load_examples(args.data_dir, data_type="valid", model=model, num_limit=args.valid_num,
                                   overwrite=args.overwrite)
    train_examples = load_examples(args.data_dir, data_type="train", model=model, num_limit=args.train_num,
                                   overwrite=args.overwrite)
    train(args, train_examples, valid_examples, model, train_iter_method=train_with_neg_sampling)
    logger.info("Training finished")
Exemplo n.º 3
0
def main():
    args = get_train_args()
    model = init_train_env(args, tbert_type='single')
    valid_examples = load_examples(args.data_dir,
                                   data_type="valid",
                                   model=model,
                                   num_limit=args.valid_num,
                                   overwrite=args.overwrite)
    train_examples = load_examples(args.data_dir,
                                   data_type="train",
                                   model=model,
                                   num_limit=args.train_num,
                                   overwrite=args.overwrite)
    train(args, train_examples, valid_examples, model, train_single_iteration)
    logger.info("Training finished")