class_docstr: Wrapper class to perform a summarization task.
docstr: Predict on a single minibatch of examples.
docstr_tok: ["Predict","on","a","single","minibatch","of","examples","."]
code: def predict(self, inputs):
      """Predict on a single minibatch of examples."""
      inputs = list(
          inputs
      )  # needs to be referenced below, so keep full list
      model_inputs = (self.preprocess(ex) for ex in inputs)
      outputs = self.wrapped.predict(model_inputs)
      outputs = (
          utils.remap_dict(mo, self.FIELD_RENAMES) for mo in outputs
      )
  
      # TODO(gehrmann): temp solution to get ROUGE scores in data table.
      for ex, mo in zip(inputs, outputs):
          score = self._scorer.score(
              target=ex["reference"],
              prediction=self._get_pred_string(mo["output_text"]),
          )
          mo["rougeL"] = float(score["rougeL"].fmeasure)
          yield mo
  
imports: import re
  import attr
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
  import tensorflow
  import tensorflow_text
  import transformers
  from rouge_score import rouge_scorer
label_desc: Use image node_id 4 for calling the SummarizationWrapper obj's underlying member method code with example usage: obj.predict(inputs) without return types