63871d5ab3301d015805abddd8f4259680d6a24a,translate.py,,main,#,68

Before Change


                if opt.n_best > 1:
                    print("\nBEST HYP:")
                    for n in range(opt.n_best):
                        os.write(1, bytes("[%.4f] %s\n" % (pred_score[n],
                                 " ".join(pred_sents[n])),
                            "UTF-8"))

    report_score("PRED", pred_score_total, pred_words_total)
    if opt.tgt:
        report_score("GOLD", gold_score_total, gold_words_total)

After Change


        for pred_sents, gold_sent, pred_score, gold_score, src_sent in z_batch:
            n_best_preds = [" ".join(pred) for pred in pred_sents[:opt.n_best]]
            count += 1
            out_file.write("\n".join(n_best_preds))
            out_file.write("\n")
            out_file.flush()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 63871d5ab3301d015805abddd8f4259680d6a24a
Time: 2017-09-21
Author: bpeters@coli.uni-saarland.de
File Name: translate.py
Class Name:
Method Name: main


Project Name: streamlit/streamlit
Commit Name: 8d6e295859edc8c93a2c5dded536588cf01b55e6
Time: 2018-04-28
Author: adrien.g.treuille@gmail.com
File Name: local/server/streamlit/local/io.py
Class Name:
Method Name: echo


Project Name: Hironsan/anago
Commit Name: c12740b64e69e8383144d0f36a138bf033a9b074
Time: 2017-08-01
Author: light.tree.1.13@gmail.com
File Name: anago/data_utils.py
Class Name:
Method Name: write_vocab