def compute_metrics(self, outputs, targets, **kwargs):
        """refactored from line 166:
        https://github.com/DmZhukov/CrossTask/blob/master/train.py"""

        recalls = self._get_recalls(Y_true=targets, Y_pred=outputs)
        results = {}
        for task, rec in recalls.items():
            results[str(task)] = rec

        avg_recall = np.mean(list(recalls.values()))
        results["recall"] = avg_recall
        return results
refactored from line 166:
        https://github.com/DmZhukov/CrossTask/blob/master/train.py
structured_prompting/fairseq-version/fairseq/examples/MMPT/mmpt/evaluators/metric.py