from torchmetrics.text import WordInfoLost metric = WordInfoLost() preds = ["this is the prediction", "there is an other sample"] target = ["this is the reference", "there is another one"] metric.update(preds, target) fig_, ax_ = metric.plot()