code: def inverse_entity_frequency(self, candidate_features):
      entity_len = len(candidate_features.keys())
      ief_dict = {}
      for candidate, features in candidate_features.iteritems():
          for word in features:
              if word in ief_dict:
                  ief_dict[word] = ief_dict[word] + 1.0
              else:
                  ief_dict[word] = 1.0
      for word in ief_dict:
          count = ief_dict[word]
          score = math.log(entity_len / (1 + count))
          ief_dict[word] = score + 1.0
      return ief_dict
  
file_path: sematch/sematch/nel.py
imports: from collections import Counter
  from sematch.nlp import word_tokenize
  import math
label_desc: Use image node_id 2 for calling the EntityDisambiguation obj's underlying member method code with example usage: obj.inverse_entity_frequency(candidate_features) and returns: ief_dict