                      # Currently only training on the positive instances
                      if value:
                          context_docs.append(doc)
  
          context_encodings, bp_context = self.model.begin_update(context_docs, drop=drop)
          loss, d_scores = self.get_similarity_loss(scores=context_encodings, golds=golds, docs=None)
          bp_context(d_scores, sgd=sgd)
  
          if losses is not None:
              losses[self.name] += loss
          return loss
 
</s> remove                         context_docs.append(doc)
 </s> add                         sentence_docs.append(ent.sent.as_doc()) </s> remove                     if offset not in tagged_entries_per_article:
                        baseline_results.random.increment_false_negatives()
                        baseline_results.oracle.increment_false_negatives()
                        baseline_results.prior.increment_false_negatives()
 </s> add  </s> remove                 # only evaluating on positive examples
 </s> add 
        sentence_encodings, bp_context = self.model.begin_update(sentence_docs, drop=drop)
        loss, d_scores = self.get_similarity_loss(scores=sentence_encodings, golds=golds, docs=None)
                      # Currently only training on the positive instances
                      if value:
                          context_docs.append(doc)
  
        sentence_encodings, bp_context = self.model.begin_update(sentence_docs, drop=drop)
        loss, d_scores = self.get_similarity_loss(scores=sentence_encodings, golds=golds, docs=None)
        sentence_encodings, bp_context = self.model.begin_update(sentence_docs, drop=drop)
        loss, d_scores = self.get_similarity_loss(scores=sentence_encodings, golds=golds, docs=None)
          bp_context(d_scores, sgd=sgd)
  
          if losses is not None:
              losses[self.name] += loss
          return loss
keep keep keep keep 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 
spacy/pipeline/pipes.pyx