      doc (Doc): Document to parse.
      options (Dict[str, Any]): NER-specific visualisation options.
      RETURNS (dict): Generated entities keyed by text (original text) and ents.
      """
      ents = [
          {
              "start": ent.start_char,
              "end": ent.end_char,
              "label": ent.label_,
 
</s> remove     doc (Doc): Document do parse.
 </s> add     doc (Doc): Document to parse.
    options (Dict[str, Any]): NER-specific visualisation options. </s> remove         {"start": ent.start_char, "end": ent.end_char, "label": ent.label_}
 </s> add         {
            "start": ent.start_char,
            "end": ent.end_char,
            "label": ent.label_,
            "kb_id": ent.kb_id_ if ent.kb_id_ else "",
            "kb_url": kb_url_template.format(ent.kb_id_) if kb_url_template else "#",
        } </s> remove     assert ents["ents"] == [{"start": 4, "end": 10, "label": "ORG"}]
 </s> add     assert ents["ents"] == [
        {"start": 4, "end": 10, "label": "ORG", "kb_id": "", "kb_url": "#"}
    ]

    doc.ents = [Span(doc, 1, 2, label=doc.vocab.strings["ORG"], kb_id="Q95")]
    ents = displacy.parse_ents(doc)
    assert isinstance(ents, dict)
    assert ents["text"] == "But Google is starting from behind "
    assert ents["ents"] == [
        {"start": 4, "end": 10, "label": "ORG", "kb_id": "Q95", "kb_url": "#"}
    ]


def test_displacy_parse_ents_with_kb_id_options(en_vocab):
    """Test that named entities with kb_id on a Doc are converted into displaCy's format."""
    doc = Doc(en_vocab, words=["But", "Google", "is", "starting", "from", "behind"])
    doc.ents = [Span(doc, 1, 2, label=doc.vocab.strings["ORG"], kb_id="Q95")]

    ents = displacy.parse_ents(
        doc, {"kb_url_template": "https://www.wikidata.org/wiki/{}"}
    )
    assert isinstance(ents, dict)
    assert ents["text"] == "But Google is starting from behind "
    assert ents["ents"] == [
        {
            "start": 4,
            "end": 10,
            "label": "ORG",
            "kb_id": "Q95",
            "kb_url": "https://www.wikidata.org/wiki/Q95",
        }
    ] </s> remove from spacy.tokens import Span, Doc
 </s> add 
    kb_url_template = options.get("kb_url_template", None)
      doc (Doc): Document to parse.
      options (Dict[str, Any]): NER-specific visualisation options.
      RETURNS (dict): Generated entities keyed by text (original text) and ents.
      """
    kb_url_template = options.get("kb_url_template", None)
      ents = [
          {
              "start": ent.start_char,
              "end": ent.end_char,
              "label": ent.label_,
keep keep keep add keep keep keep keep keep
 Displacy serve entity linking support without `manual=True` support. (#9748)

* Add support for kb_id to be displayed via displacy.serve. The current support is only limited to the manual option in displacy.render

* Commit to check pre-commit hooks are run.

* Update spacy/displacy/__init__.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Changes as per suggestions on the PR.

* Update website/docs/api/top-level.md

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Update website/docs/api/top-level.md

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* tag option as new from 3.2.1 onwards

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com> 
spacy/displacy/__init__.py