lm_polygraph.stat_calculators.bart_score module

class lm_polygraph.stat_calculators.bart_score.BartScoreCalculator(device=None, max_length=256, checkpoint='facebook/bart-large-cnn')[source]

Bases: StatCalculator

load(path=None)[source]

Load model from paraphrase finetuning

static meta_info() Tuple[List[str], List[str]][source]

Returns the statistics and dependencies for the calculator.

multi_ref_score(srcs, tgts: List[List[str]], agg='mean', batch_size=4)[source]
score(srcs, tgts, batch_size=4)[source]

Score a batch of examples

test(batch_size=3)[source]

Test