f305086031fc31a838d5b6c06eec35fd5cd16038,scripts/score_moe.py,,intra_ref,#Any#,130
Before Change
for rs in refs:
for i, h in enumerate(rs):
rest = rs[:i] + rs[i+1:]
s = [sentence_bleu(r, h) for r in rest]
j = np.argmax(s)
_ref.append(rest[j])
_hypo.append(h)
print("ref avg oracle BLEU (leave-one-out): %.2f" % corpus_bleu(_ref, _hypo))
After Change
concat_h.append(h)
for j in range(m - 1):
concat_rest[j].extend(rest[j])
concat_h = list(chain.from_iterable(concat_h))
bleu = corpus_bleu(concat_h, concat_rest)
print("multi-reference BLEU (leave-one-out): %.2f" % bleu)
if __name__ == "__main__":
main()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: pytorch/fairseq
Commit Name: f305086031fc31a838d5b6c06eec35fd5cd16038
Time: 2019-03-19
Author: myleott@fb.com
File Name: scripts/score_moe.py
Class Name:
Method Name: intra_ref
Project Name: titu1994/DenseNet
Commit Name: 3a3dc678e50e60f9cf05e95e992ab873046c1b8f
Time: 2016-12-05
Author: titu1994@gmail.com
File Name: cifar10.py
Class Name:
Method Name: