I've been trying this python 2.7.12 running on Ubuntu.
When I have spaCy 0.101.0 installed, I have no problems running:-
import spacy
spacy.en.STOPWORDS
which yields the list of stop words. However, with spaCy 1.3.0 installed, I get the following error:-
spacy.en.STOPWORDS
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'STOPWORDS'
Reverting to 0.101.0 causes the error to go away. Was there some change that happened with 1.3.0 with regards to the STOPWORDS functions?
In the same manner:
nlp.is_stop('test')
works in 0.101.0 but in 1.3.0 I get:-
nlp.is_stop('test')
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'English' object has no attribute 'is_stop'
Would appreciate heads up - I can't find any documentation on the key changes in this regard. Thanks.
Yes, the language data has moved since version 0.101.0. You can now find the stopwords in spacy.en.language_data.STOP_WORDS or spacy.en.English.Defaults.stop_words. I hope this helps!
Thanks! This works perfectly!
On 16/12/2016 00:50, Ines Montani wrote:
>
Yes, the language data has moved since version 0.101.0. You can now
find the stopwords in |spacy.en.language_data.STOP_WORDS| or
|spacy.en.English.Defaults.stop_words|. I hope this helps!—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/explosion/spaCy/issues/687#issuecomment-267378766,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANSQSx6hGSWE6wEtCbYvxrJwBj0Ay85gks5rIW_EgaJpZM4LNqoE.
What worked for me is:
from spacy.lang.en import STOP_WORDS
print(STOP_WORDS)
OR
import spacy
nlp = spacy.load('en')
print(nlp.Defaults.stop_words)
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.
Most helpful comment
Yes, the language data has moved since version 0.101.0. You can now find the stopwords in
spacy.en.language_data.STOP_WORDSorspacy.en.English.Defaults.stop_words. I hope this helps!