Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lemmatizer should skip Typo + GoesWith tags #1345

Closed
Jemoka opened this issue Feb 16, 2024 · 2 comments
Closed

lemmatizer should skip Typo + GoesWith tags #1345

Jemoka opened this issue Feb 16, 2024 · 2 comments
Labels

Comments

@Jemoka
Copy link
Member

Jemoka commented Feb 16, 2024

nlp = stanza.Pipeline(lang="en")
nlp("Hi Andrea")

gives

...
    {
      "id": 2,
      "text": "Andrea",
      "lemma": "andreabertone@enron_development",
      "upos": "PROPN",
      "xpos": "NNP",
      "feats": "Number=Sing",
      "head": 1,
      "deprel": "vocative",
      "start_char": 3,
      "end_char": 9,
      "ner": "S-PERSON",
      "multi_ner": [
        "S-PERSON"
      ]
    }
...

causing incorrect lemmas to leak from the training data.

@AngledLuffa
Copy link
Collaborator

oops, also a problem here:

trainer.train_dict(train_batch.doc.get([TEXT, UPOS, LEMMA]))

@AngledLuffa
Copy link
Collaborator

With version 1.8.0 or 1.8.1:

>>> pipe("Hi Andrea")
[
  [
    {
      "id": 1,
      "text": "Hi",
      "lemma": "hi",
      "upos": "INTJ",
      "xpos": "UH",
      "start_char": 0,
      "end_char": 2
    },
    {
      "id": 2,
      "text": "Andrea",
      "lemma": "Andrea",
      "upos": "PROPN",
      "xpos": "NNP",
      "feats": "Number=Sing",
      "start_char": 3,
      "end_char": 9,
      "misc": "SpaceAfter=No"
    }
  ]
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants