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


        elif task in ["wmt"]:
            // 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: 3

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: tf-coreml/tf-coreml
Commit Name: a2736515e4a9e55da3798e6a4fcb8b352a17b987
Time: 2017-11-08
Author: awadhwa@apple.com
File Name: tfcoreml/_layers.py
Class Name:
Method Name: conv2d


Project Name: NifTK/NiftyNet
Commit Name: eeb1ac0da37e40b121be49fd7c47f75c3247bb40
Time: 2017-08-28
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_multi_device_inputs