Token.lex.prob returns constant values on nightly. #6388
-
How to reproduce the behaviourI think something is up with When I run this code; import spacy
nlp = spacy.load("en_core_web_lg")
for t in nlp("bank of the riverside and stuff"):
print(t.text, t.lex.prob) I get this output.
It seems like all the words have a constant Your EnvironmentI'm running on google colab. Info about spaCy
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 7 replies
-
Hi, this is a change in v2.3+, where the probability features aren't included with the pretrained models by default. See the section on "Probability and cluster features" for how to load very similar probability tables into a model in v2.3+: https://spacy.io/usage/v2-3#migrating Be aware that the tables from If you need the exact same probabilities, you can export the probabilities from a v2.2 model and load them in if you need the exact same probabilities. You can set |
Beta Was this translation helpful? Give feedback.
-
Ah I wasn't aware of that. Thanks for the detailed explanation 👍 ! |
Beta Was this translation helpful? Give feedback.
-
Strange. I had gotten it to work for spaCy 2.3 but now it seems like import spacy
nlp = spacy.load("en_core_web_md")
if nlp.vocab.lookups_extra.has_table("lexeme_prob"):
nlp.vocab.lookups_extra.remove_table("lexeme_prob") This code results in;
Is the migration perhaps slightly different for spaCy 3.0? |
Beta Was this translation helpful? Give feedback.
-
The It should work as for v2.3 if you just refer to |
Beta Was this translation helpful? Give feedback.
-
@adrianeboyd since spacy v3 just dropped, I've been having issues getting the extra tables via EDIT:
runs without errors, however extra tables don't seem to be loaded:
|
Beta Was this translation helpful? Give feedback.
-
This really needs to be foregrounded in documentation. |
Beta Was this translation helpful? Give feedback.
-
A year and a half later, the migration documentation still shows old code that doesn't work. Can it be fixed? |
Beta Was this translation helpful? Give feedback.
Hi, this is a change in v2.3+, where the probability features aren't included with the pretrained models by default. See the section on "Probability and cluster features" for how to load very similar probability tables into a model in v2.3+: https://spacy.io/usage/v2-3#migrating
Be aware that the tables from
spacy-lookups-data
are not identical with the v2.2 models because there are 1M entries instead of 1.3M. The size of the tables in thespacy-lookups-data
package starts to become a problem, so I just kept the most frequent 1M tokens.If you need the exact same probabilities, you can export the probabilities from a v2.2 model and load them in if you need the exact same probabilities. Yo…