    def predictions_to_labeled_instances(
        self, instance: Instance, outputs: Dict[str, numpy.ndarray]
    ) -> List[Instance]:
        """
        This function takes a model's outputs for an Instance, and it labels that instance according
        to the `outputs`. This function is used to (1) compute gradients of what the model predicted;
        (2) label the instance for the attack. For example, (a) for the untargeted attack for classification
        this function labels the instance according to the class with the highest probability; (b) for
        targeted attack, it directly constructs fields from the given target.
        The return type is a list because in some tasks there are multiple predictions in the output
        (e.g., in NER a model predicts multiple spans). In this case, each instance in the returned list of
        Instances contains an individual entity prediction as the label.
        """

        raise RuntimeError("implement this method for model interpretations or attacks")
This function takes a model's outputs for an Instance, and it labels that instance according
to the `outputs`. This function is used to (1) compute gradients of what the model predicted;
(2) label the instance for the attack. For example, (a) for the untargeted attack for classification
this function labels the instance according to the class with the highest probability; (b) for
targeted attack, it directly constructs fields from the given target.
The return type is a list because in some tasks there are multiple predictions in the output
(e.g., in NER a model predicts multiple spans). In this case, each instance in the returned list of
Instances contains an individual entity prediction as the label.
allennlp/predictors/predictor.py