From cfe7118a30b897ddf4b2a67a1905d9f37669ef8c Mon Sep 17 00:00:00 2001 From: Abhimanyu Aryan Date: Mon, 6 Jan 2020 03:35:41 +0530 Subject: [PATCH] spacy: As of v2.2, the lemmatizer is initialized with a Lookups --- 2-svd-nmf-topic-modeling.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/2-svd-nmf-topic-modeling.ipynb b/2-svd-nmf-topic-modeling.ipynb index f9d50bf..c87fc38 100644 --- a/2-svd-nmf-topic-modeling.ipynb +++ b/2-svd-nmf-topic-modeling.ipynb @@ -569,7 +569,10 @@ "outputs": [], "source": [ "from spacy.lemmatizer import Lemmatizer\n", - "lemmatizer = Lemmatizer()" + "from spacy.lookups import Lookups\n", + "lookups = Lookups()\n", + "lookups.add_table(\"lemma_rules\", {\"noun\": [[\"s\", \"\"]]})\n", + "lemmatizer = Lemmatizer(lookups)" ] }, { @@ -1761,4 +1764,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file