Reverse Lemma lookup not working on Spacy 2.3.2

  lemmatization, nlp, python, spacy

I keep getting an error when trying to run this reverse lemma lookup in a spacy 2.3.2 but environment but such works in 2.0.16. The error and code used are below.

AttributeError: module 'spacy.lang.fr' has no attribute 'LOOKUP'
lemma_lookup = spacy.lang.fr.LOOKUP

reverse_lemma_lookup = {}

for word,lemma in lemma_lookup.items():
    if not reverse_lemma_lookup.get(lemma):
        reverse_lemma_lookup[lemma] = [word]
    elif word not in reverse_lemma_lookup[lemma]:
        reverse_lemma_lookup[lemma].append(word)

reverse_lemma_lookup["belle"]

Source: Python Questions

LEAVE A COMMENT