f688c3c4a8c254bf5cdefd4e2e61587c0ef7a46e,src/preprocess.py,,build_tasks,#Any#,63

Before Change


        preproc = pkl.load(open(preproc_file, "rb"))
        save_preproc = 0
    else:
        preproc = {}
    for task in tasks:
        if task.name in preproc:
            train, val, test = preproc[task.name]
            task.train_data = train
            task.val_data = val
            task.test_data = test
            log.info("\tLoaded indexed data for %s from %s", task.name, preproc_file)
        else:
            log.info("\tIndexing task %s from scratch", task.name)
            process_task(task, token_indexer, vocab)
            del_field_tokens(task)
            preproc[task.name] = (task.train_data, task.val_data, task.test_data)
            save_preproc = 1
    log.info("\tFinished indexing tasks")
    if save_preproc:  // save preprocessing again because we processed something from scratch
        pkl.dump(preproc, open(preproc_file, "wb"))
        log.info("\tSaved data to %s", preproc_file)
    del preproc

    train_tasks = [task for task in tasks if task.name in train_task_names]

After Change


    preproc_file_names = []
    if not args.reload_vocab and not args.reload_indexing:
        for file in os.listdir(preproc_dir):
            preproc_file_names.append(file)
    for task in tasks:
        if task.name in preproc_files:
            train, val, test = get_task_generator(task.name)
            task.train_data = train
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: jsalt18-sentence-repl/jiant
Commit Name: f688c3c4a8c254bf5cdefd4e2e61587c0ef7a46e
Time: 2018-06-27
Author: jan.hula@osu.cz
File Name: src/preprocess.py
Class Name:
Method Name: build_tasks


Project Name: vatlab/SoS
Commit Name: 2f71baf87c6e3afc1ba952f132c5f5d6cbb0d9af
Time: 2017-06-27
Author: ben.bog@gmail.com
File Name: src/sos/__main__.py
Class Name:
Method Name: cmd_execute


Project Name: okfn-brasil/serenata-de-amor
Commit Name: 3c626088a7174c28d1b1a093143c4ca7b2b154fc
Time: 2016-11-25
Author: iirineu@gmail.com
File Name: src/fetch_yelp_info.py
Class Name:
Method Name: