spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Very poor PoS tagging after v1.4

Open petterhh opened this issue 9 years ago • 7 comments

After updating to the new version 1.4 (via pulling the repo), the PoS tagging is pretty much ruined. Using the same model as before, having done no changes whatsoever, the tagging gives completely wrong results. For instance, it tags '.' as NOUN, similar to the errors seen in #575. Also, re-running the train_ud.py script, as done in #579, I'm getting a tag accuracy of 84%, down from 96%. However, the parsing accuracy scores are the same as before. I can't find any big changes to the PoS tagging in the source code, so I'm really lost here - what might have gone wrong?

Your Environment

  • Operating System: macOS
  • Python Version Used: 3.5.2
  • spaCy Version Used: 1.4

petterhh avatar Dec 21 '16 08:12 petterhh

Hmm. Thanks for the report, sounds like something went very wrong!

Are the .tag_ values correct? Unfortunately I'm travelling today so can't easily test this.

honnibal avatar Dec 21 '16 09:12 honnibal

I'm sticking to the UD tag set, so tag_ and pos_ are identical. See example below.

doc = nlp(sent)
for token in doc:
    print(token.i, token.text, token.tag_, token.pos_, token.dep_, token.head.i)

Input sentence: "Jeg så John i parken" (eng. "I saw John in the park") Output:

0 Jeg PRON PRON neg 1
1 så SYM SYM nmod 3
2 John PROPN PROPN nsubj 3
3 i VERB VERB ROOT 3
4 parken PROPN PROPN dobj 3

It correctly tags 'jeg' as PRON and 'John' as PROPN, but the other ones are completely off.

Edit: And with punctuation, the output is even more puzzling.

0 Jeg PRON PRON neg 1
1 så SYM SYM nmod 3
2 John PROPN PROPN nsubj 3
3 i VERB VERB ROOT 3
4 parken PROPN PROPN nsubj 3
5 . ADP ADP case||nmod 3

petterhh avatar Dec 21 '16 09:12 petterhh

Also worth noting that the parsing (of course) suffers, e.g., 'i' (eng. 'in') is ROOT and 'Jeg' (eng. 'I') is neg - but the train_ud.py script still gives UAS of 87.55% and LAS of 84.08%! How do they relate?

petterhh avatar Dec 21 '16 10:12 petterhh

I experience a similar problem. After upgrading to 1.4, using the train_ud script, the tagger accuracy went down from 92% to 47%. The parser accuracy decreased a bit but not much (2-3%).

Tpt avatar Dec 22 '16 10:12 Tpt

Have you had a chance to look at it, @honnibal?

petterhh avatar Jan 03 '17 08:01 petterhh

Just pushed:

commit 95a52005dff1713b467b021338462560069c858b
Author: Matthew Honnibal <[email protected]>
Date:   Mon Jan 9 09:55:55 2017 -0600

    Revert "Fix Issue #683: Add 'SP' to tag_map, if it's not there already, within the Morphology class."

    This reverts commit 40e71586d607626cf7b144e39c2e049916933fa7.

Still don't really understand the root cause, but this should be fixed on master now. Closing this and reopening #683

honnibal avatar Jan 09 '17 17:01 honnibal

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 09 '18 04:05 lock[bot]