1c6679294848f303a361cba7b306b760e299bd9c,interactive.py,,main,#Any#,57

Before Change


                hypo_tokens, hypo_str, alignment = utils.post_process_prediction(
                    hypo_tokens=hypo["tokens"].int().cpu(),
                    src_str=src_str,
                    alignment=hypo["alignment"].int().cpu() if hypo["alignment"] is not None else None,
                    align_dict=align_dict,
                    tgt_dict=tgt_dict,
                    remove_bpe=args.remove_bpe,
                )
                hypo_str = decode_fn(hypo_str)
                print("H-{}\t{}\t{}".format(id, hypo["score"], hypo_str))
                print("P-{}\t{}".format(
                    id,
                    " ".join(map(lambda x: "{:.4f}".format(x), hypo["positional_scores"].tolist()))
                ))
                if args.print_alignment:
                    print("A-{}\t{}".format(
                        id,
                        " ".join(map(lambda x: str(utils.item(x)), alignment))
                    ))

        // update running id counter
        start_id += len(inputs)

After Change


                    " ".join(map(lambda x: "{:.4f}".format(x), hypo["positional_scores"].tolist()))
                ))
                if args.print_alignment:
                    alignment_str = " ".join(["{}-{}".format(src, tgt) for src, tgt in alignment])
                    print("A-{}\t{}".format(
                        id,
                        alignment_str
                    ))

        // update running id counter
        start_id += len(inputs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 15

Instances


Project Name: elbayadm/attn2d
Commit Name: 1c6679294848f303a361cba7b306b760e299bd9c
Time: 2019-09-30
Author: sarthak_garg@apple.com
File Name: interactive.py
Class Name:
Method Name: main


Project Name: elbayadm/attn2d
Commit Name: 1c6679294848f303a361cba7b306b760e299bd9c
Time: 2019-09-30
Author: sarthak_garg@apple.com
File Name: generate.py
Class Name:
Method Name: main