code: def __init__(self, onnx_node, run_params):  # type: ignore
      OpRun.__init__(self, onnx_node, run_params)
      mode = self.mode  # type: ignore
  
      if mode == "TF":
          self.weighting_criteria_ = WeightingCriteria.TF
      elif mode == "IDF":
          self.weighting_criteria_ = WeightingCriteria.IDF
      elif mode == "TFIDF":
          self.weighting_criteria_ = WeightingCriteria.TFIDF
  
      self.min_gram_length_ = self.min_gram_length  # type: ignore
      self.max_gram_length_ = self.max_gram_length  # type: ignore
      self.max_skip_count_ = self.max_skip_count  # type: ignore
      self.ngram_counts_ = self.ngram_counts  # type: ignore
      self.max_gram_length_ = self.max_gram_length  # type: ignore
      self.ngram_indexes_ = self.ngram_indexes  # type: ignore
      self.output_size_ = max(self.ngram_indexes_) + 1
      self.weights_ = self.weights  # type: ignore
      self.pool_int64s_ = self.pool_int64s  # type: ignore
      self.pool_strings_ = self.pool_strings  # type: ignore
  
      self.int64_map_ = NgramPart(-10)
      self.int64_map_.init()
  
      total_items = len(self.pool_int64s_ or self.pool_strings_)
      ngram_id = 1  # start with 1, 0 - means no n-gram
      # Load into dictionary only required gram sizes
      ngram_size = 1
      for i in range(len(self.ngram_counts_)):
          start_idx = self.ngram_counts_[i]
          end_idx = (
              self.ngram_counts_[i + 1]
              if (i + 1) < len(self.ngram_counts_)
              else total_items
          )
          items = end_idx - start_idx
          if items > 0:
              ngrams = items // ngram_size
              if (
                  ngram_size >= self.min_gram_length_
                  and ngram_size <= self.max_gram_length_
              ):
                  ngram_id = populate_grams(
                      self.pool_int64s_ or self.pool_strings_,
                      start_idx,
                      ngrams,
                      ngram_size,
                      ngram_id,
                      self.int64_map_,
                  )
              else:
                  ngram_id += ngrams
          ngram_size += 1
  
imports: from enum import IntEnum
  from typing import List
  import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 to create a new TfIdfVectorizer object from inherited base classes: OpRun with example: obj = TfIdfVectorizer(onnx_node, run_params)