Spacy: Pronoun Detection

Created on 7 Feb 2015  路  6Comments  路  Source: explosion/spaCy

It seems that spaCy counts all pronouns as normal nouns.

import spacy.en
nlp = spacy.en.English()

In [34]: for tok in nlp(u"You and I make us"):
   ....:     print tok.string, tok.pos
   ....:     
You  6
and  4
I  6
make  10
us 6

In [35]: from spacy.parts_of_speech import PRON, NOUN

In [36]: NOUN, PRON
Out[36]: (6, 8)

Most helpful comment

Same experience here鈥擨 can't get spaCy to detect pronouns at all.聽Is this a bug or is there some subtlety I'm missing? Thanks!

All 6 comments

I'll make this clearer in the documentation.

The .pos attribute gives you tags from Google's universal tag set. The .tag attribute gives you the "ordinary" language-specific 45 tag Penn Treebank tag set.

Hm... I thought that PRON was in Google's tag set. Wouldn't that mean .pos should recognize it?

Hmm you're right. I thought I copy-pasted the mapping, but I must have made an error somehow. I'll fix this and retrain my models.

Hey I was trying to detect pronouns too, and it returns that the pos_ is a noun. Is that normal?
I ran the same example:

for tok in nlp(u"You and I make us"):
... print tok.orth_, tok.pos_
...
You NOUN
and CONJ
I NOUN
make VERB
us NOUN

Not a big deal, just wanted to know, spacy is awesome!

(Name: spacy; Version: 0.94)

Same experience here鈥擨 can't get spaCy to detect pronouns at all.聽Is this a bug or is there some subtlety I'm missing? Thanks!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

notnami picture notnami  路  3Comments

besirkurtulmus picture besirkurtulmus  路  3Comments

melanietosik picture melanietosik  路  3Comments

peterroelants picture peterroelants  路  3Comments

nadachaabani1 picture nadachaabani1  路  3Comments