              "The `nlp` object should have access to pretrained word vectors, "
              " cf. https://spacy.io/usage/models#languages."
          )
  
      logger.info("Get entity frequencies")
      entity_frequencies = wp.get_all_frequencies(count_input=count_input)
  
      logger.info("Filtering entities with fewer than {} mentions".format(min_entity_freq))
      # filter the entities for in the KB by frequency, because there's just too much data (8M entities) otherwise
      filtered_title_to_id, entity_list, description_list, frequency_list = get_filtered_entities(
          title_to_id,
          id_to_descr,
 
</s> remove def get_entity_to_id(entity_def_output):
    entity_to_id = dict()
    with entity_def_output.open("r", encoding="utf8") as csvfile:
        csvreader = csv.reader(csvfile, delimiter="|")
        # skip header
        next(csvreader)
        for row in csvreader:
            entity_to_id[row[0]] = row[1]
    return entity_to_id


def get_id_to_description(entity_descr_path):
    id_to_desc = dict()
    with entity_descr_path.open("r", encoding="utf8") as csvfile:
        csvreader = csv.reader(csvfile, delimiter="|")
        # skip header
        next(csvreader)
        for row in csvreader:
            id_to_desc[row[0]] = row[1]
    return id_to_desc


def _add_aliases(kb, title_to_id, max_entities_per_alias, min_occ, prior_prob_input):
 </s> add def _add_aliases(kb, entity_list, title_to_id, max_entities_per_alias, min_occ, prior_prob_path): </s> remove     logger.info("STEP 1: loading model from {}".format(nlp_dir))
    nlp, kb = read_nlp_kb(nlp_dir, kb_path)
 </s> add     logger.info("STEP 1a: Loading model from {}".format(nlp_dir))
    nlp = spacy.load(nlp_dir)
    logger.info("STEP 1b: Loading KB from {}".format(kb_path))
    kb = read_kb(nlp, kb_path) </s> remove     logger.info("Left with {} entities".format(len(description_list)))
 </s> add     logger.info("Kept {} entities from the set of {}".format(len(description_list), len(title_to_id.keys())))
              "The `nlp` object should have access to pretrained word vectors, "
              " cf. https://spacy.io/usage/models#languages."
          )
  



      logger.info("Filtering entities with fewer than {} mentions".format(min_entity_freq))
      # filter the entities for in the KB by frequency, because there's just too much data (8M entities) otherwise
      filtered_title_to_id, entity_list, description_list, frequency_list = get_filtered_entities(
          title_to_id,
          id_to_descr,
keep keep keep keep replace replace replace keep keep keep keep keep
 KB extensions and better parsing of WikiData (#4375)

* fix overflow error on windows

* more documentation & logging fixes

* md fix

* 3 different limit parameters to play with execution time

* bug fixes directory locations

* small fixes

* exclude dev test articles from prior probabilities stats

* small fixes

* filtering wikidata entities, removing numeric and meta items

* adding aliases from wikidata also to the KB

* fix adding WD aliases

* adding also new aliases to previously added entities

* fixing comma's

* small doc fixes

* adding subclassof filtering

* append alias functionality in KB

* prevent appending the same entity-alias pair

* fix for appending WD aliases

* remove date filter

* remove unnecessary import

* small corrections and reformatting

* remove WD aliases for now (too slow)

* removing numeric entities from training and evaluation

* small fixes

* shortcut during prediction if there is only one candidate

* add counts and fscore logging, remove FP NER from evaluation

* fix entity_linker.predict to take docs instead of single sentences

* remove enumeration sentences from the WP dataset

* entity_linker.update to process full doc instead of single sentence

* spelling corrections and dump locations in readme

* NLP IO fix

* reading KB is unnecessary at the end of the pipeline

* small logging fix

* remove empty files 
bin/wiki_entity_linking/kb_creator.py