code: def forward(
      self,
      inputs: List[torch.Tensor],
      input_lengths: List[int],
      max_new_tokens: int,
  ):
      # Extract the sequences tensor from the LLMs forward pass
      generated_outputs = extract_generated_tokens(
          raw_generated_output_sequences=inputs,
          input_lengths=input_lengths,
          max_new_tokens=max_new_tokens,
          pad_sequence=False,
      )
      outputs_device = generated_outputs[0].device
  
      # Decode generated outputs from the LLM's generate function.
      decoded_outputs = self.tokenizer.tokenizer.batch_decode(
          generated_outputs, skip_special_tokens=True
      )
  
      # Parse labels based on matching criteria and return probability vectors
      matched_labels = []
      probabilities = []
      logits = []
      for output in decoded_outputs:
          output = output.lower()  # Convert to lowercase for matching
  
          matched_label = self.matcher(output)
          idx = (
              self.str2idx[matched_label]
              if matched_label in self.str2idx
              else self.str2idx[self.fallback_label]
          )
  
          # Append the index of the matched label
          matched_labels.append(idx)
  
          # Append the probability vector for the matched label
          probability_vec = [0] * self.vocab_size
          probability_vec[idx] = 1
          probabilities.append(probability_vec)
  
          # TODO(Arnav): Figure out how to compute logits. For now, we return
          # a tensor of zeros.
          logits.append([0] * self.vocab_size)
  
      return {
          PREDICTIONS: torch.tensor(
              matched_labels, device=outputs_device
          ),
          PROBABILITIES: torch.tensor(
              probabilities, dtype=torch.float32, device=outputs_device
          ),
          LOGITS: torch.tensor(
              logits, dtype=torch.float32, device=outputs_device
          ),
      }
  
imports: import logging
  import re
  from typing import Any, Dict, List, Union
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import CATEGORY, LOGITS, PREDICTIONS, PROBABILITIES, TEXT
  from ludwig.decoders.base import Decoder
  from ludwig.decoders.registry import register_decoder
  from ludwig.decoders.utils import extract_generated_tokens
  from ludwig.schema.decoders.llm_decoders import CategoryExtractorDecoderConfig, TextExtractorDecoderConfig
  from ludwig.utils.strings_utils import get_tokenizer
label_desc: Use image node_id 5 for calling the CategoryExtractorDecoder obj's underlying member method code with example usage: obj.forward(inputs, input_lengths, max_new_tokens) and returns: dict