72c304fa7cac16ed19d8bc75a017f17c8073dd2f,parlai/core/torch_generator_agent.py,TorchGeneratorAgent,_compute_fairseq_bleu,#TorchGeneratorAgent#Any#Any#,691
Before Change
return 0
aa = torch.IntTensor(1)
for i, t in enumerate(texts):
self.fairseq_bleu_scorer.add(
batch.label_vec[i].type_as(aa),
self._vectorize_text(t, True, True, self.label_truncate, False).type_as(
aa
),
)
def _compute_nltk_bleu(self, batch: Batch, texts: List[str]):
Compute BLEU score between text and label(s), using the NLTK BLEU Scorer.
After Change
all_results.append(result)
bleu_scores = list(zip(*all_results))
for k in range(4):
self.record_local_metric(f"fairseq_bleu{k + 1}", bleu_scores[k])
def _compute_nltk_bleu(self, batch: Batch, texts: List[str]):
Compute BLEU score between text and label(s), using the NLTK BLEU Scorer.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: facebookresearch/ParlAI
Commit Name: 72c304fa7cac16ed19d8bc75a017f17c8073dd2f
Time: 2020-02-13
Author: roller@fb.com
File Name: parlai/core/torch_generator_agent.py
Class Name: TorchGeneratorAgent
Method Name: _compute_fairseq_bleu
Project Name: dmlc/gluon-nlp
Commit Name: 70a188776f7470c838dd22b1636462b75573a734
Time: 2020-07-16
Author: lausen@amazon.com
File Name: src/gluonnlp/models/roberta.py
Class Name: RobertaEncoder
Method Name: __init__
Project Name: dmlc/gluon-nlp
Commit Name: 70a188776f7470c838dd22b1636462b75573a734
Time: 2020-07-16
Author: lausen@amazon.com
File Name: src/gluonnlp/models/bert.py
Class Name: BertTransformer
Method Name: __init__
Project Name: automl/SMAC3
Commit Name: 8a9c8632ae085c2e429673c46ddf558cba211396
Time: 2019-09-26
Author: ashraaghav@gmail.com
File Name: test/test_intensify/test_successive_halving.py
Class Name: TestSuccessiveHalving
Method Name: test_intensify_2