code: def tf_idf_vec_uni(sentence, vocounts, totcounts):
      sen_tab = sentence.lower().split()
      uni_dic = {}
      for _, w in enumerate(sen_tab):
          if w in vocounts:
              uni_dic[w] = -math.log(
                  float(vocounts.get(w, 1.0)) / totcounts
              )
      # normalize
      uni_norm = math.sqrt(sum([x * x for x in uni_dic.values()]))
      if uni_norm > 0:
          for w in uni_dic:
              uni_dic[w] /= uni_norm
      return uni_dic
  
file_path: ParlAI/parlai/tasks/eli5/data_creation/data_utils.py
imports: import json
  import math
  import re
  import signal
  from contextlib import contextmanager
  from glob import glob
  from os.path import join
label_desc: Use image node_id 5 for calling a global function with example usage: tf_idf_vec_uni(sentence, vocounts, totcounts) and returns: uni_dic