def main(args):
    """
    pipeline for representation learning for all papers for a given name reference
    """
    dataset = data_parser.DataSet(args.file_path)
    bpr_optimizer = embedding.BprOptimizer(args.latent_dimen, args.alpha,
                                           args.matrix_reg)
    pp_sampler = sampler.CoauthorGraphSampler()
    pd_sampler = sampler.BipartiteGraphSampler()
    dd_sampler = sampler.LinkedDocGraphSampler()
    eval_f1 = eval_metric.Evaluator()
    run_helper = train_helper.TrainHelper()
    return run_helper.helper(args.num_epoch, dataset, bpr_optimizer,
                             pp_sampler, pd_sampler, dd_sampler, eval_f1,
                             args.sampler_method)
Ejemplo n.º 2
0
def main(file_path, latent_dimen, alpha, matrix_reg, num_epoch,
         sampler_method):
    """
    pipeline for representation learning for all papers for a given name reference
    """
    dataset = parser_helper.DataSet(file_path)
    paper_count = dataset.reader()

    bpr_optimizer = embedding.BprOptimizer(latent_dimen, alpha, matrix_reg)
    pp_sampler = sampler.CoauthorGraphSampler()
    pd_sampler = sampler.BipartiteGraphSampler()
    dd_sampler = sampler.LinkedDocGraphSampler()
    eval_f1 = eval_metric.Evaluator()

    run_helper = train_helper.TrainHelper()
    pairwise_precision, pairwise_recall, pairwise_f1 = run_helper.helper(
        num_epoch, dataset, bpr_optimizer, pp_sampler, pd_sampler, dd_sampler,
        eval_f1, sampler_method)

    return paper_count, pairwise_precision, pairwise_recall, pairwise_f1