      text = (
          "In The Hitchhiker's Guide to the Galaxy, written by Douglas Adams, "
          "Douglas reminds us to always bring our towel, even in China or Brazil. "
          "The main character in Doug's novel is the man Arthur Dent, "
          "but Douglas doesn't write about George Washington or Homer Simpson."
      )
      doc = nlp(text)
      print(text)
      for ent in doc.ents:
          print(" ent", ent.text, ent.label_, ent.kb_id_)
 
</s> remove         links (dict): A dict with `(start_char, end_char, kb_id)` keys,
            representing the external ID of an entity in a knowledge base,
            and the values being either 1.0 or 0.0, indicating positive and
            negative examples, respectively.
 </s> add         links (dict): A dict with `(start_char, end_char)` keys,
            and the values being dicts with kb_id:value entries,
            representing the external IDs in a knowledge base (KB)
            mapped to either 1.0 or 0.0, indicating positive and
            negative examples respectively. </s> remove                     if candidates:
 </s> add                     if not candidates:
                        final_kb_ids.append(self.NIL)  # no prediction possible for this entity
                    else: </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             for entity, value in gold.links.items():
                start, end, kb_id = entity
 </s> add             for entity, kb_dict in gold.links.items():
                start, end = entity
        "but Dougledydoug doesn't write about George Washington or Homer Simpson."
      text = (
          "In The Hitchhiker's Guide to the Galaxy, written by Douglas Adams, "
          "Douglas reminds us to always bring our towel, even in China or Brazil. "
          "The main character in Doug's novel is the man Arthur Dent, "
        "but Dougledydoug doesn't write about George Washington or Homer Simpson."
      )
      doc = nlp(text)
      print(text)
      for ent in doc.ents:
          print(" ent", ent.text, ent.label_, ent.kb_id_)
keep keep keep keep replace keep keep keep keep keep
 have gold.links correspond exactly to doc.ents 
examples/pipeline/wikidata_entity_linking.py