              true examples of a label to have the value 1.0, and negative
              examples of a label to have the value 0.0. Labels not in the
              dictionary are treated as missing - the gradient for those labels
              will be zero.
          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.
          RETURNS (GoldParse): The newly constructed object.
          """
          if words is None:
              words = [token.text for token in doc]
          if tags is None:
 
</s> remove                                 # add both pos and neg examples (in random order)
                                # this will exclude examples not in the KB
                                if kb:
                                    gold_entities = {}
                                    candidates = kb.get_candidates(alias)
                                    candidate_ids = [c.entity_ for c in candidates]
                                    random.shuffle(candidate_ids)
                                    for kb_id in candidate_ids:
                                        entry = (gold_start, gold_end, kb_id)
                                        if kb_id != wd_id:
                                            gold_entities[entry] = 0.0
 </s> add                                 gold_entities = {}
                                found_useful = False
                                for ent in sent.ents:
                                    if ent.start_char == gold_start and ent.end_char == gold_end:
                                        # add both pos and neg examples (in random order)
                                        # this will exclude examples not in the KB
                                        if kb:
                                            value_by_id = {}
                                            candidates = kb.get_candidates(alias)
                                            candidate_ids = [c.entity_ for c in candidates]
                                            random.shuffle(candidate_ids)
                                            for kb_id in candidate_ids:
                                                found_useful = True
                                                if kb_id != wd_id:
                                                    value_by_id[kb_id] = 0.0
                                                else:
                                                    value_by_id[kb_id] = 1.0
                                            gold_entities[(ent.start_char, ent.end_char)] = value_by_id
                                        # if no KB, keep all positive examples </s> remove                                 # currently feeding the gold data one entity per sentence at a time
 </s> add  </s> remove         "but Douglas doesn't write about George Washington or Homer Simpson."
 </s> add         "but Dougledydoug doesn't write about George Washington or Homer Simpson." </s> remove                     if candidates:
 </s> add                     if not candidates:
                        final_kb_ids.append(self.NIL)  # no prediction possible for this entity
                    else:
        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.
              true examples of a label to have the value 1.0, and negative
              examples of a label to have the value 0.0. Labels not in the
              dictionary are treated as missing - the gradient for those labels
              will be zero.
        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.
        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.
        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.
        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.
          RETURNS (GoldParse): The newly constructed object.
          """
          if words is None:
              words = [token.text for token in doc]
          if tags is None:
keep keep keep keep replace replace replace replace keep keep keep keep keep
 have gold.links correspond exactly to doc.ents 
spacy/gold.pyx