code: def train(self, data):
      self.w2idf = self.cal_idf(data)
      self.tokens = []
      self.tfidf_scores = []
      self.w2tfidf = {}
  
      # Build word to TF-IDF score mapping
      for tokens in data:
          for t in tokens:
              if t not in self.w2tfidf:
                  self.w2tfidf[t] = 0
              self.w2tfidf[t] += 1 / len(tokens) * self.w2idf[t]
  
      if self.normalize:
          tfidf_scores = list(self.w2tfidf.values())
          tfidf_scores = self._normalize(np.array(tfidf_scores))
          for i, t in enumerate(self.w2tfidf):
              self.w2tfidf[t] = tfidf_scores[i]
  
      self.tokens = list(self.w2tfidf.keys())
      self.tfidf_scores = list(self.w2tfidf.values())
  
file_path: nlpaug/nlpaug/model/word_stats/tfidf.py
imports: import os
  import math
  import numpy
  from nlpaug.model.word_stats import WordStatistics
label_desc: Use image node_id 5 for calling the TfIdf obj's underlying member method code with example usage: obj.train(data) without return types