  
                          # TODO: thresholding
                          best_index = scores.argmax()
                          best_candidate = candidates[best_index]
                          final_entities.append(ent)
                          final_kb_ids.append(best_candidate.entity_)
  
          return final_entities, final_kb_ids
  
      def set_annotations(self, docs, entities, kb_ids=None):
 
</s> remove         return final_entities, final_kb_ids
 </s> add         assert len(final_kb_ids) == entity_count </s> remove     def set_annotations(self, docs, entities, kb_ids=None):
        for entity, kb_id in zip(entities, kb_ids):
            for token in entity:
                token.ent_kb_id_ = kb_id
 </s> add         return final_kb_ids

    def set_annotations(self, docs, kb_ids, tensors=None):
        i=0
        for doc in docs:
            for ent in doc.ents:
                kb_id = kb_ids[i]
                i += 1
                for token in ent:
                    token.ent_kb_id_ = kb_id </s> remove         final_entities = []
 </s> add         entity_count = 0 </s> remove             return final_entities, final_kb_ids
 </s> add             return final_kb_ids </s> remove         entities, kb_ids = self.predict([doc])
        self.set_annotations([doc], entities, kb_ids)
 </s> add         kb_ids = self.predict([doc])
        self.set_annotations([doc], kb_ids)
  
                          # TODO: thresholding
                          best_index = scores.argmax()
                          best_candidate = candidates[best_index]

                          final_kb_ids.append(best_candidate.entity_)
  
          return final_entities, final_kb_ids
  
      def set_annotations(self, docs, entities, kb_ids=None):
keep keep keep keep replace keep keep keep keep keep
 have gold.links correspond exactly to doc.ents 
spacy/pipeline/pipes.pyx