Abbrv pipeline errors out
trisongz opened this issue · 1 comments
trisongz commented
- spikex version: spikex-0.4.0.dev2 from source / spacy 2.3.5
- Python version: 3.6
- Operating System: OSX
Description
Describe what you were trying to get done.
- I was trying to test the abbrv pipeline
Tell us what happened, what went wrong, and what you expected to happen.
- Copied the example from README
What I Did
import spacy
from spikex.pipes import AbbrX
nlp = spacy.load("en_core_web_sm")
abbrx = AbbrX(nlp)
nlp.add_pipe(abbrx)
doc = abbrx(nlp("a little snippet with abbreviations (abbrs)"))
doc._.abbrs
205 return (
206 self.vocab.strings.add(key)
--> 207 if key not in self.vocab.strings
208 else self.vocab.strings[key]
209 )
AttributeError: 'English' object has no attribute 'strings'
paoloq commented
Thank you, I forgot to update that example in the README.
You should fix that by modifying abbrx = AbbrX(nlp)
in abbrx = AbbrX(nlp.vocab)