Skip to content

Portuguese words starting with a capital letter are not correctly lemmatized  #7636

Description

@dcaled

How to reproduce the behaviour

>>> nlp = spacy.load('pt_core_news_sm')
>>> doc=nlp('''Feito.''')
>>> for token in doc:
...     print(token.text, token.lemma_, token.pos_)
...
Feito Feito VERB
. . PUNCT

And it is not exclusively when starting a sentence:

>>> nlp = spacy.load('pt_core_news_sm')
>>> doc=nlp('''Eu havia Feito o trabalho.''')
>>> for token in doc:
...     print(token.text, token.lemma_, token.pos_)
...
Eu Eu PRON
havia haver AUX
Feito Feito VERB
o o DET
trabalho trabalhar NOUN
. . PUNCT

It should return "Fazer" as in:

>>> nlp = spacy.load('pt_core_news_sm')
>>> doc=nlp('''feito.''')
>>> for token in doc:
...     print(token.text, token.lemma_, token.pos_)
...
feito fazer VERB
. . PUNCT

Your Environment

  • Operating System: Windows
  • Python Version Used: Python 3.8.5
  • spaCy Version Used: 2.3.5
  • Environment Information:

My example includes a verb, but I've also tested using nouns and the same bug occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions