Skip to content

Commit 9b9f0ac

Browse files
authored
Update spacy to version 3.3.1 (#5)
* words_n_fun (update): updated spacy to version 3.3.1 (to avoid click issues) * words_n_fun (fix): updated fr_core_news_sm following the spacy update * words_n_fun (fix): fixed some tests with the new lemmatizer version
1 parent 97a8cd7 commit 9b9f0ac

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.github/workflows/wnf_build_tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Install package & dependencies
6969
run: |
7070
python -m pip install --upgrade pip
71-
pip install https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.2.0/fr_core_news_sm-3.2.0-py3-none-any.whl
71+
pip install https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.3.0/fr_core_news_sm-3.3.0-py3-none-any.whl
7272
pip install .[lemmatizer]
7373
pip install nose==1.3.7 nose-exclude==0.5.0 coverage==5.3
7474
pip install flake8

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ coverage==5.3
2222
# Has to be installed last / optionnal to use spacy lemmatizer
2323
markupsafe==2.0.1 # BUG FIX -> https://github.com/aws/aws-sam-cli/issues/3661
2424
Cython==0.29.24
25-
spacy==3.2.4
25+
spacy==3.3.1
2626
# The following line downloads a spacy model. It can be commented if you don't have an internet access to download it, but lemmatizer features won't work.
27-
https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.2.0/fr_core_news_sm-3.2.0-py3-none-any.whl
27+
https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.3.0/fr_core_news_sm-3.3.0-py3-none-any.whl

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
'ftfy>=5.8,<6.0',
5757
],
5858
extras_require={
59-
"lemmatizer": ["spacy==3.2.4", "markupsafe==2.0.1", "Cython==0.29.24", "fr-core-news-sm==3.2.0"]
59+
"lemmatizer": ["spacy==3.3.1", "markupsafe==2.0.1", "Cython==0.29.24", "fr-core-news-sm==3.3.0"]
6060
}
6161
# pip install words_n_fun || pip install words_n_fun[lemmatizer]
6262
)

tests/test_2_basic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_remove_gender_synonyms(self):
229229
def test_lemmatize(self):
230230
'''Testing function basic.lemmatize'''
231231
docs = ["Chauffeur(se) accompagnateur(trice) pers à mob - 5 ans de expérience.", "Je maîtrise 12 langages informatiques dont le C & j'ai le Permis B", "^Chauffeur(se) accompagnateur(trice) pers à mob - 5 ans de expérience.", "Coordinateur d'Equipe d'Action Territoriale ", 5, None]
232-
docs_lemmatized = ['chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'je maîtris 12 langage informatique dont le c j avoir le permis b', 'chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'coordinateur d equipe d action territorial', None, None]
232+
docs_lemmatized = ['chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'je maîtrise 12 langage informatique dont le c j avoir le permettre b', 'chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'coordinateur d equipe d action territorial', None, None]
233233

234234
# On check seulement si model lemmatizer installé
235235
if spacy.util.is_package("fr_core_news_sm"):

tests/test_6_lemmatizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def setUp(self):
6262
def test_lemmatize(self):
6363
'''Testing function lemmatizer.lemmatize'''
6464
docs = ["Chauffeur(se) accompagnateur(trice) pers à mob - 5 ans de expérience.", "Je maîtrise 12 langages informatiques dont le C & j'ai le Permis B", "^Chauffeur(se) accompagnateur(trice) pers à mob - 5 ans de expérience.", "Coordinateur d'Equipe d'Action Territoriale ", 5, None]
65-
docs_lemmatized = ['chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'je maîtris 12 langage informatique dont le c j avoir le permis b', 'chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'coordinateur d equipe d action territorial', None, None]
65+
docs_lemmatized = ['chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'je maîtrise 12 langage informatique dont le c j avoir le permettre b', 'chauffeur se accompagnateur trice pers à mob 5 an de expérience', 'coordinateur d equipe d action territorial', None, None]
6666

6767
if spacy.util.is_package("fr_core_news_sm"):
6868
# Vérification du fonctionnement type

0 commit comments

Comments
 (0)