Spacy: An issue using the fr_core_news_sm

Created on 10 Jul 2020  路  5Comments  路  Source: explosion/spaCy

Hi, I get an error when using the French spacy model. Not sure what the issue is.

How to reproduce the behaviour

import spacy
nlp = spacy.load("fr_core_news_sm")

text= "Un atome est la plus petite partie d'un corps simple pouvant se combiner chimiquement avec un autre. Les atomes sont les constituants 茅l茅mentaires de toutes les substances solides, liquides ou gazeuses. Les propri茅t茅s physiques et chimiques de ces substances sont d茅termin茅es par les atomes qui les constituent ainsi que par l'arrangement tridimensionnel de ces atomes."

doc= nlp(text)

Your Environment

Traceback (most recent call last):

  File "<ipython-input-7-f9c82afb6c9b>", line 1, in <module>
    doc= nlp(text)

  File "/home/santoshbs/anaconda3/envs/env_spacy/lib/python3.7/site-packages/spacy/language.py", line 449, in __call__
    doc = proc(doc, **component_cfg.get(name, {}))

  File "pipes.pyx", line 398, in spacy.pipeline.pipes.Tagger.__call__

  File "pipes.pyx", line 443, in spacy.pipeline.pipes.Tagger.set_annotations

  File "morphology.pyx", line 310, in spacy.morphology.Morphology.assign_tag_id

  File "morphology.pyx", line 244, in spacy.morphology.Morphology.lemmatize

  File "/home/santoshbs/anaconda3/envs/env_spacy/lib/python3.7/site-packages/spacy/lang/fr/lemmatizer.py", line 49, in __call__
    if self.is_base_form(univ_pos, morphology):

TypeError: 'NoneType' object is not callable

  • Operating System: Ubuntu 20.04
  • Python Version Used: 3.7.7
  • spaCy Version Used: Github version
bug duplicate lang / fr resolved

Most helpful comment

Okay, I think this should be fixed in v2.3.2 now.

All 5 comments

Sorry, this is a bug in spacy 2.3.1. See #5728. Please downgrade to 2.3.0 until we get the fix released in 2.3.2.

Thanks, v 2.3.0 works fine!

Sounds like you guys are on it but just an FYI: I think this issue happens with 2.3.0 as well.

I get the same stack trace,

    for sentence in self.nlp_provider(paragraph).sents:
  File "/usr/local/lib/python3.7/dist-packages/spacy/language.py", line 449, in __call__
    doc = proc(doc, **component_cfg.get(name, {}))
  File "pipes.pyx", line 398, in spacy.pipeline.pipes.Tagger.__call__
  File "pipes.pyx", line 443, in spacy.pipeline.pipes.Tagger.set_annotations
  File "morphology.pyx", line 310, in spacy.morphology.Morphology.assign_tag_id
  File "morphology.pyx", line 244, in spacy.morphology.Morphology.lemmatize
  File "/usr/local/lib/python3.7/dist-packages/spacy/lang/fr/lemmatizer.py", line 49, in __call__
    if self.is_base_form(univ_pos, morphology):
TypeError: 'NoneType' object is not callable

but PIP indicates the version is 2.3.0.

$ python -m pip show fr_core_news_sm
Name: fr-core-news-sm
Version: 2.3.0
Summary: French multi-task CNN trained on UD French Sequoia and WikiNER. Assigns context-specific token vectors, POS tags, dependency parse and named entities.
Home-page: https://explosion.ai
Author: Explosion
Author-email: [email protected]
License: LGPL
Location: /usr/local/lib/python3.7/dist-packages
Requires: spacy
Required-by:

Is there an ETA for 2.3.2's release.

@ericmclachlan : what Adriane refers to, is that this is a bug in spaCy 2.3.0, not fr-core-news-sm 2.3.0. In fact, fr-core-news-sm 2.3.0 is compatible with both spaCy 2.3.0 and 2.3.1. So you can keep the same model, but downgrade spaCy from 2.3.1 to 2.3.0 for now.

We're typically hesitant to communicate ETA's for releases as it's always difficult to estimate upfront how smooth a release will go, and unexpected problems may always pop up. But I would assume "soon".

Okay, I think this should be fixed in v2.3.2 now.

Was this page helpful?
0 / 5 - 0 ratings