          for doc, gold in zip(docs, golds):
              ents_by_offset = dict()
              for ent in doc.ents:
                  ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)] = ent
              for entity, value in gold.links.items():
                  start, end, kb_id = entity
                  mention = doc.text[start:end]
                  entity_encoding = self.kb.get_vector(kb_id)
                  prior_prob = self.kb.get_prior_prob(kb_id, mention)
  
                  gold_ent = ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)]
 
</s> remove                 entity_encoding = self.kb.get_vector(kb_id)
                prior_prob = self.kb.get_prior_prob(kb_id, mention)

                gold_ent = ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)]
                assert gold_ent is not None
                type_vector = [0 for i in range(len(type_to_int))]
                if len(type_to_int) > 0:
                    type_vector[type_to_int[gold_ent.label_]] = 1

                # store data
                entity_encodings.append(entity_encoding)
                context_docs.append(doc)
                type_vectors.append(type_vector)

                if self.cfg.get("prior_weight", 1) > 0:
                    priors.append([prior_prob])
                else:
                    priors.append([0])
 </s> add                 for kb_id, value in kb_dict.items():
                    entity_encoding = self.kb.get_vector(kb_id)
                    prior_prob = self.kb.get_prior_prob(kb_id, mention)

                    gold_ent = ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)]
                    assert gold_ent is not None
                    type_vector = [0 for i in range(len(type_to_int))]
                    if len(type_to_int) > 0:
                        type_vector[type_to_int[gold_ent.label_]] = 1

                    # store data
                    entity_encodings.append(entity_encoding)
                    context_docs.append(doc)
                    type_vectors.append(type_vector)

                    if self.cfg.get("prior_weight", 1) > 0:
                        priors.append([prior_prob])
                    else:
                        priors.append([0]) </s> remove             for entity, value in gold.links.items():
                start, end, gold_kb = entity
                # only evaluating on positive examples
                if value:
                    correct_entries_per_article[str(start) + "-" + str(end)] = gold_kb
 </s> add             for entity, kb_dict in gold.links.items():
                start, end = entity
                for gold_kb, value in kb_dict.items():
                    # only evaluating on positive examples
                    if value:
                        correct_entries_per_article[str(start) + "-" + str(end)] = gold_kb </s> remove             for entity, value in gold.links.items():
 </s> add             for entity, kb_dict in gold.links.items():
                start, end = entity </s> remove                 if value:
                    start, end, gold_kb = entity
                    correct_entries_per_article[str(start) + "-" + str(end)] = gold_kb
 </s> add                 for gold_kb, value in kb_dict.items():
                    if value:
                        correct_entries_per_article[str(start) + "-" + str(end)] = gold_kb </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
            for entity, kb_dict in gold.links.items():
                start, end = entity
          for doc, gold in zip(docs, golds):
              ents_by_offset = dict()
              for ent in doc.ents:
                  ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)] = ent
            for entity, kb_dict in gold.links.items():
                start, end = entity
            for entity, kb_dict in gold.links.items():
                start, end = entity
                  mention = doc.text[start:end]
                  entity_encoding = self.kb.get_vector(kb_id)
                  prior_prob = self.kb.get_prior_prob(kb_id, mention)
  
                  gold_ent = ents_by_offset[str(ent.start_char) + "_" + str(ent.end_char)]
keep keep keep keep replace replace keep keep keep keep keep
 have gold.links correspond exactly to doc.ents 
spacy/pipeline/pipes.pyx