From 0dbe9274ebebc1763cfbbca58dfa2e7e85ce4124 Mon Sep 17 00:00:00 2001 From: taoche Date: Tue, 1 Sep 2026 19:45:39 +0800 Subject: [PATCH] docs(cookbook): install notebook 08 NER model --- .../08_Your_First_Knowledge_Graph.ipynb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb b/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb index 65074f87..d63e2890 100644 --- a/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb +++ b/cookbook/introduction/08_Your_First_Knowledge_Graph.ipynb @@ -83,7 +83,18 @@ "cell_type": "code", "metadata": {}, "source": [ - "!pip install semantica\n" + "%pip install semantica\n", + "\n", + "# spaCy models are distributed separately from the spaCy library. This lesson\n", + "# relies on the English model to recognize standalone places such as Cupertino.\n", + "import sys\n", + "import subprocess\n", + "import spacy\n", + "\n", + "try:\n", + " spacy.load(\"en_core_web_sm\")\n", + "except OSError:\n", + " subprocess.check_call([sys.executable, \"-m\", \"spacy\", \"download\", \"en_core_web_sm\"])\n" ], "execution_count": null, "outputs": []