I am getting started with Spacy, and I was just experimenting the given examples. It is weird though that when I run them over their containers using their experimental console it gives me different results than when I run them locally.
For example, when I run the following example from their console,
import spacy
nlp = spacy.load('en_core_web_md') # make sure to use larger model!
tokens = nlp(u'dog cat banana')
for token1 in tokens:
for token2 in tokens:
print(token1.text, token2.text, token1.similarity(token2))
It gives me:
dog dog 1.0
dog cat 0.80168545
dog banana 0.24327646
cat dog 0.80168545
cat cat 1.0
cat banana 0.2815437
banana dog 0.24327646
banana cat 0.2815437
banana banana 1.0
But when I run the exact same thing locally, it gives me:
dog dog 1.0
dog cat 0.0
dog banana 0.0
cat dog 0.0
cat cat 1.0
cat banana -0.044681177
banana dog -7.828739e+17
banana cat -8.242222e+17
banana banana 1.0
To me the former makes sense, not my local result. And the problem persists for other examples as well. I am so confused! What is happening locally?
- Spacy: '2.0.12'
- Python 3.6.5 Anaconda, Inc.
- Mac OSx 10.13.5
I am not sure if it is relevant, but I was getting this error running it in Jupyter, so I exported the followings, as suggested in the git, in the terminal before launching the Jupyter:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8