code: def _inference_with_bleu(self, generator, sample, model):
      import sacrebleu
  
      def decode(toks, is_ref):
          s = self.target_dictionary.string(
              toks.int().cpu(),
              self.cfg.eval_bleu_remove_bpe,
              # The default unknown string in fairseq is `<unk>`, but
              # this is tokenized by sacrebleu as `< unk >`, inflating
              # BLEU scores. Instead, we use a somewhat more verbose
              # alternative that is unlikely to appear in the real
              # reference, but doesn't get split into multiple tokens.
              unk_string=(
                  "UNKNOWNTOKENINREF" if is_ref else "UNKNOWNTOKENINHYP"
              ),
          )
          if self.tokenizer:
              s = self.tokenizer.decode(s)
          return s
  
      gen_out = self.inference_step(generator, [model], sample)
      hyps, refs = [], []
      for i in range(len(gen_out)):
          hyps.append(decode(gen_out[i][0]["tokens"], is_ref=False))
          refs.append(
              decode(
                  utils.strip_pad(
                      sample["target"][i], self.target_dictionary.pad()
                  ),
                  is_ref=True,  # don't count <unk> as matches to the hypo
              )
          )
      if self.cfg.eval_bleu_print_samples:
          logger.info("H-{} {}".format(sample["id"][0], hyps[0]))
          logger.info("T-{} {}".format(sample["id"][0], refs[0]))
  
      eval_tokenization = (
          "none" if self.cfg.eval_tokenized_bleu else "13a"
      )
      return sacrebleu.corpus_bleu(
          hyps, [refs], tokenize=eval_tokenization
      )
  
imports: import logging
  import os
  import torch
  import json
  from argparse import Namespace
  from dataclasses import dataclass, field
  from typing import Optional, Any
  from fairseq.data import AddTargetDataset, Dictionary, encoders
  from fairseq.tasks.audio_pretraining import AudioPretrainingTask, AudioPretrainingConfig
  from fairseq.dataclass import FairseqDataclass
  from fairseq.dataclass.configs import GenerationConfig
  from fairseq.data.text_compressor import TextCompressor, TextCompressionLevel
  from .None import register_task
  from ..None import utils
  from ..logging import metrics
label_desc: Use image node_id 9 for calling the NLUFinetuningTask obj's underlying member method code with example usage: obj._inference_with_bleu(generator, sample, model) and returns: sacrebleu, s