                          if c.entity_ == gold_entity:
                              oracle_candidate = c.entity_
  
                      best_index = scores.index(max(scores))
                      best_candidate = candidates[best_index].entity_
                      random_candidate = random.choice(candidates).entity_
  
                  baseline_results.update_baselines(gold_entity, ent_label,
                                                    random_candidate, best_candidate, oracle_candidate)
  
 
</s> remove                 baseline_results.update_baselines(gold_entity, ent_label,
                                                  random_candidate, best_candidate, oracle_candidate)
 </s> add                 current_count = counts_d.get(ent_label, 0)
                counts_d[ent_label] = current_count+1

                baseline_results.update_baselines(
                    gold_entity,
                    ent_label,
                    random_candidate,
                    prior_candidate,
                    oracle_candidate,
                ) </s> remove     return baseline_results
 </s> add     return baseline_results, counts_d </s> remove                 best_candidate = ""
 </s> add                 prior_candidate = "" </s> remove     def report_accuracy(self, model):
 </s> add     def report_performance(self, model): </s> remove     def update_baselines(self, true_entity, ent_label, random_candidate, prior_candidate, oracle_candidate):
 </s> add     def update_baselines(
        self,
        true_entity,
        ent_label,
        random_candidate,
        prior_candidate,
        oracle_candidate,
    ):
                    prior_candidate = candidates[best_index].entity_
                          if c.entity_ == gold_entity:
                              oracle_candidate = c.entity_
  
                      best_index = scores.index(max(scores))
                    prior_candidate = candidates[best_index].entity_
                      random_candidate = random.choice(candidates).entity_
  
                  baseline_results.update_baselines(gold_entity, ent_label,
                                                    random_candidate, best_candidate, oracle_candidate)
  
keep keep keep keep 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/entity_linker_evaluation.py