You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit of follow up: I was going through the definition for spacy.vocab.Vocab.make_fused_token, and it seems that code expects ORTH to be equal to 'F', POS to be equal to 'pos', and LEMMA to be equal to 'L'; however, ORTH equals 65, POS equals 74, and LEMMA equals 73.
I am not sure if the values expected by make_fused_tokens are intentionally different from those defined in spacy.symbols.
EDIT: Even when replacing keys for token_attrs argument as described above, I still encounter an error:
importspacynlp=spacy.load('en')
nlp.tokenizer.add_special_case('gimme',
[
{
'F': 'gim',
'L': 'give',
'pos': 'VERB'},
{
'F': 'me' }])
# Traceback (most recent call last):# File "test.py", line 13, in <module># 'F': 'me' }])# File "spacy/tokenizer.pyx", line 377, in spacy.tokenizer.Tokenizer.add_special_case (spacy/tokenizer.cpp:8460)# File "spacy/vocab.pyx", line 342, in spacy.vocab.Vocab.make_fused_token (spacy/vocab.cpp:7907)# File "spacy/morphology.pyx", line 39, in spacy.morphology.Morphology.assign_tag (spacy/morphology.cpp:3919)# KeyError: 97
The docs have gotten ahead of the library here — the current/old behaviour is pretty inconsistent, so I wrote up the intended usage, but haven't had time to fix it yet. Will definitely have this resolved in the next release, which should be up this week.
Activity
soldni commentedon Nov 23, 2016
A bit of follow up: I was going through the definition for
spacy.vocab.Vocab.make_fused_token, and it seems that code expectsORTHto be equal to'F',POSto be equal to'pos', andLEMMAto be equal to'L'; however,ORTHequals65,POSequals74, andLEMMAequals73.I am not sure if the values expected by
make_fused_tokensare intentionally different from those defined inspacy.symbols.EDIT: Even when replacing keys for
token_attrsargument as described above, I still encounter an error:honnibal commentedon Nov 23, 2016
Thanks for this.
The docs have gotten ahead of the library here — the current/old behaviour is pretty inconsistent, so I wrote up the intended usage, but haven't had time to fix it yet. Will definitely have this resolved in the next release, which should be up this week.
Test #656, #624: special case rules for tokenizer with attributes.
lock commentedon May 9, 2018
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.