From 54e8e3c208df0fbe02f2b24eb8e22a1504efad46 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Thu, 14 Jan 2021 07:29:44 +0100 Subject: [PATCH] Update model-related dependencies (#6725) * Update pymorphy2 error messages for Russian and Ukrainian * Add pymorphy2 to pex * Update spacy-pkuseg version for pex --- Makefile | 2 +- spacy/lang/ru/lemmatizer.py | 4 +--- spacy/lang/uk/lemmatizer.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3f10e79cc..ba2bdf786 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL := /bin/bash ifndef SPACY_EXTRAS -override SPACY_EXTRAS = spacy-lookups-data==1.0.0rc0 jieba spacy-pkuseg==0.0.26 sudachipy sudachidict_core +override SPACY_EXTRAS = spacy-lookups-data==1.0.0rc0 jieba spacy-pkuseg==0.0.28 sudachipy sudachidict_core pymorphy2 endif ifndef PYVER diff --git a/spacy/lang/ru/lemmatizer.py b/spacy/lang/ru/lemmatizer.py index 3bcac8730..b7a2fc8e4 100644 --- a/spacy/lang/ru/lemmatizer.py +++ b/spacy/lang/ru/lemmatizer.py @@ -30,9 +30,7 @@ class RussianLemmatizer(Lemmatizer): except ImportError: raise ImportError( "The Russian lemmatizer requires the pymorphy2 library: " - 'try to fix it with "pip install pymorphy2==0.8" ' - 'or "pip install git+https://github.com/kmike/pymorphy2.git pymorphy2-dicts-uk"' - "if you need Ukrainian too" + 'try to fix it with "pip install pymorphy2"' ) from None if RussianLemmatizer._morph is None: RussianLemmatizer._morph = MorphAnalyzer() diff --git a/spacy/lang/uk/lemmatizer.py b/spacy/lang/uk/lemmatizer.py index 009ec5044..56d9c75c0 100644 --- a/spacy/lang/uk/lemmatizer.py +++ b/spacy/lang/uk/lemmatizer.py @@ -22,8 +22,8 @@ class UkrainianLemmatizer(RussianLemmatizer): except ImportError: raise ImportError( "The Ukrainian lemmatizer requires the pymorphy2 library and " - 'dictionaries: try to fix it with "pip uninstall pymorphy2" and' - '"pip install git+https://github.com/kmike/pymorphy2.git pymorphy2-dicts-uk"' + "dictionaries: try to fix it with " + '"pip install pymorphy2 pymorphy2-dicts-uk"' ) from None if UkrainianLemmatizer._morph is None: UkrainianLemmatizer._morph = MorphAnalyzer(lang="uk")