05a5e9c7c71571a1396adacd305bb0415e9c4170,src/evaluate.py,,write_preds,#Any#Any#,66

Before Change


    Args:
        - all_preds (Dict[str:list]): dictionary mapping task names to predictions.
                        Assumes that predictions are sorted (if necessary)."""
    pdb.set_trace()

    def write_preds_to_file(preds, pred_file, pred_map=None, write_float=False):
        """ Write preds to pred_file """
        with open(pred_file, "w") as pred_fh:

After Change


            // convert each prediction to a single string if we find a list of tokens
            if isinstance(preds[0], list):
                assert isinstance(preds[0][0], str)
                preds = [" ".join(pred) for pred in preds]
            write_preds_to_file(preds, os.path.join(pred_dir, "%s.tsv" % task), write_type=str)
        else:
            write_preds_to_file(preds, os.path.join(pred_dir, "%s.tsv" % task))
    log.info("Wrote predictions to %s", pred_dir)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: jsalt18-sentence-repl/jiant
Commit Name: 05a5e9c7c71571a1396adacd305bb0415e9c4170
Time: 2018-07-04
Author: wang.alex.c@gmail.com
File Name: src/evaluate.py
Class Name:
Method Name: write_preds


Project Name: jsalt18-sentence-repl/jiant
Commit Name: c6c9864bd5be1822892e71f640dc71e28ef512ab
Time: 2017-12-11
Author: wang.alex.c@gmail.com
File Name: src/codebase/tasks.py
Class Name: RTETask
Method Name: load_data


Project Name: studioml/studio
Commit Name: 81633e02b2c07bd6080e5639c04e4f73eb7d1cce
Time: 2017-09-10
Author: peter.zhokhov@sentient.ai
File Name: util/completion_service.py
Class Name: CompletionService
Method Name: submitTask