class_docstr: takes as input a string or a list of words and checks if it is inside p_e_m
  if yes it returns the candidate entities otherwise it returns None.
  it also checks if string.lower() inside p_e_m and if string.lower() inside p_e_m_low
class_docstr_tok: ["takes","as","input","a","string","or","a","list","of","words","and","checks","if","it","is","inside","p_e_m","if","yes","it","returns","the","candidate","entities","otherwise","it","returns","None",".","it","also","checks","if","string.lower","(",")","inside","p_e_m","and","if","string.lower","(",")","inside","p_e_m_low"]
docstr: span can be either a string or a list of words
docstr_tok: ["span","can","be","either","a","string","or","a","list","of","words"]
code: def process(self, span):
      """span can be either a string or a list of words"""
  
      title = span.title()
      # 'obama 44th president of united states'.title() # 'Obama 44Th President Of United States'
      title_freq = (
          self.mention_total_freq[title]
          if title in self.mention_total_freq
          else 0
      )
      span_freq = (
          self.mention_total_freq[span]
          if span in self.mention_total_freq
          else 0
      )
  
      if title_freq == 0 and span_freq == 0:
          if span.lower() in self.p_e_m:
              self.lower_org.append(span)
              return self.p_e_m[span.lower()]
          elif span.lower() in self.p_e_m_lower:
              self.lower_lower.append(span)
              return self.p_e_m_lower[span.lower()]
          else:
              return []
      else:
          if span_freq > title_freq:
              return self.p_e_m[span]
          else:
              return self.p_e_m[title]
  
file_path: BLINK/blink/candidate_retrieval/dataset.py
imports: import re
  import pickle
  import os
  import time
  import numpy
label_desc: Use image node_id 2 for calling the FetchCandidateEntities obj's underlying member method code with example usage: obj.process(span) and returns: self, self, self, self, list