lm_polygraph.generation_metrics.bart_score module

class lm_polygraph.generation_metrics.bart_score.BartScoreSeqMetric(score_type: str = 'rh', device=None, max_length=256, checkpoint='facebook/bart-large-cnn')[source]

Bases: GenerationMetric

Calculates BARTScore metric (https://arxiv.org/abs/2106.11520) between model-generated texts and ground truth texts.

load(path=None)[source]

Load model from paraphrase finetuning

score(srcs, tgts, batch_size=4)[source]

Score a batch of examples

test(batch_size=3)[source]

Test