class_docstr: prompt format was inspired by [日本語に特化した60億パラメータ規模のGPTモデルの構築と評価](https://www.anlp.jp/proceedings/annual_meeting/2023/pdf_dir/H9-4.pdf)
code: def batch_truncate_text(self, batch_text, token_limit):
      encode_fn = self.tokenizer.batch_encode_plus
      encode_params = {}
      if "add_special_tokens" in inspect.getfullargspec(encode_fn).args:
          encode_params.update(dict(add_special_tokens=False))
      if "padding" in inspect.getfullargspec(encode_fn).args:
          encode_params.update(dict(padding=False))
      if "truncation" in inspect.getfullargspec(encode_fn).args:
          encode_params.update(dict(truncation=True))
      if "max_length" in inspect.getfullargspec(encode_fn).args:
          encode_params.update(dict(max_length=token_limit))
  
      batch_encoded = encode_fn(batch_text, **encode_params)
      batch_input_ids = [
          input_ids[:token_limit]
          for input_ids in batch_encoded["input_ids"]
      ]
      decode_fn = self.tokenizer.batch_decode
      if (
          "skip_special_tokens"
          in inspect.getfullargspec(decode_fn).args
      ):
          decode_params = dict(skip_special_tokens=True)
      else:
          decode_params = {}
      truncated = decode_fn(batch_input_ids, **decode_params)
      return truncated
  
imports: import os
  import inspect
  import datasets
  from lm_eval.base import MultipleChoiceTask, rf
  import numpy
label_desc: Use image node_id 8 for calling the JAQKETV1 obj's underlying member method code with example usage: obj.batch_truncate_text(batch_text, token_limit) and returns: truncated