d04134375b6fafc03efec776728e2334a927e37f,run_tgen.py,,rerank_cl_eval,#Any#,542

Before Change



    if len(files) != 3:
        sys.exit("Invalid arguments.\n" + __doc__)
    fname_cl_model, fname_test_da, fname_test_sent = files

    log_info("Loading reranking classifier...")
    rerank_cl = RerankingClassifier.load_from_file(fname_cl_model)

After Change




def rerank_cl_eval(args):
    ap = ArgumentParser(prog=" ".join(sys.argv[0:2]))
    ap.add_argument("-l", "--language", type=str,
                    help="Override classifier language (for t-tree input files)")
    ap.add_argument("-s", "--selector", type=str,
                    help="Override classifier selector (for t-tree input files)")
    ap.add_argument("fname_cl_model", type=str, help="Path to trained reranking classifier model")
    ap.add_argument("fname_test_da", type=str, help="Path to test DA file")
    ap.add_argument("fname_test_sent", type=str, help="Path to test trees file (must be trees!)")
    args = ap.parse_args(args)

    log_info("Loading reranking classifier...")
    rerank_cl = RerankingClassifier.load_from_file(args.fname_cl_model)
    if args.language is not None:
        rerank_cl.language = args.language
    if args.selector is not None:
        rerank_cl.selector = args.selector

    log_info("Evaluating...")
    tot_len, dist = rerank_cl.evaluate_file(args.fname_test_da, args.fname_test_sent)
    log_info("Penalty: %d, Total DAIs %d." % (dist, tot_len))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: UFAL-DSG/tgen
Commit Name: d04134375b6fafc03efec776728e2334a927e37f
Time: 2017-03-30
Author: odusek@ufal.mff.cuni.cz
File Name: run_tgen.py
Class Name:
Method Name: rerank_cl_eval


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 8e5522ff50124a9ba05a7cdddfff7df8ebbafc14
Time: 2017-02-26
Author: carlo.deramo@gmail.com
File Name: examples/q_learning_grid.py
Class Name:
Method Name:


Project Name: UFAL-DSG/tgen
Commit Name: d04134375b6fafc03efec776728e2334a927e37f
Time: 2017-03-30
Author: odusek@ufal.mff.cuni.cz
File Name: run_tgen.py
Class Name:
Method Name: rerank_cl_eval


Project Name: UFAL-DSG/tgen
Commit Name: d04134375b6fafc03efec776728e2334a927e37f
Time: 2017-03-30
Author: odusek@ufal.mff.cuni.cz
File Name: run_tgen.py
Class Name:
Method Name: rerank_cl_train