  
      logger.info("Training on {} articles".format(len(train_data)))
      logger.info("Dev testing on {} articles".format(len(dev_data)))
  
      dev_baseline_accuracies = measure_baselines(
          dev_data, kb
      )
  
      logger.info("Dev Baseline Accuracies:")
      logger.info(dev_baseline_accuracies.report_accuracy("random"))
      logger.info(dev_baseline_accuracies.report_accuracy("prior"))
      logger.info(dev_baseline_accuracies.report_accuracy("oracle"))
  
 
</s> remove     logger.info(dev_baseline_accuracies.report_accuracy("random"))
    logger.info(dev_baseline_accuracies.report_accuracy("prior"))
    logger.info(dev_baseline_accuracies.report_accuracy("oracle"))
 </s> add     measure_performance(dev_data, kb, el_pipe, baseline=True, context=False) </s> remove     logger.info(baseline_accuracies.report_accuracy("random"))
    logger.info(baseline_accuracies.report_accuracy("prior"))
    logger.info(baseline_accuracies.report_accuracy("oracle"))
 </s> add     if context:
        # using only context
        el_pipe.cfg["incl_context"] = True
        el_pipe.cfg["incl_prior"] = False
        results = get_eval_results(dev_data, el_pipe)
        logger.info(results.report_metrics("context only")) </s> remove def measure_performance(dev_data, kb, el_pipe):
    baseline_accuracies = measure_baselines(
        dev_data, kb
    )
 </s> add def measure_performance(dev_data, kb, el_pipe, baseline=True, context=True):
    if baseline:
        baseline_accuracies, counts = measure_baselines(dev_data, kb)
        logger.info("Counts: {}".format({k: v for k, v in sorted(counts.items())}))
        logger.info(baseline_accuracies.report_performance("random"))
        logger.info(baseline_accuracies.report_performance("prior"))
        logger.info(baseline_accuracies.report_performance("oracle")) </s> remove     logger.info("Train entity encoder")
 </s> add     logger.info("Training entity encoder") </s> remove                 "(non-unique) entities across {} ".format(self.epochs) +
 </s> add                 "(non-unique) descriptions across {} ".format(self.epochs) +
    # baseline performance on dev data
  
      logger.info("Training on {} articles".format(len(train_data)))
      logger.info("Dev testing on {} articles".format(len(dev_data)))
  
    # baseline performance on dev data
    # baseline performance on dev data
    # baseline performance on dev data
    # baseline performance on dev data
      logger.info("Dev Baseline Accuracies:")
      logger.info(dev_baseline_accuracies.report_accuracy("random"))
      logger.info(dev_baseline_accuracies.report_accuracy("prior"))
      logger.info(dev_baseline_accuracies.report_accuracy("oracle"))
  
keep keep keep keep replace 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/wikidata_train_entity_linker.py