mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 09:44:36 +03:00
Update word-vectors-similarities.jade
add ``` import spacy nlp = spacy.load('en') ```
This commit is contained in:
parent
ea2732469b
commit
425c09488d
|
@ -21,10 +21,12 @@ p
|
||||||
|
|
||||||
+code.
|
+code.
|
||||||
import numpy
|
import numpy
|
||||||
|
import spacy
|
||||||
|
nlp = spacy.load('en')
|
||||||
|
|
||||||
apples, and_, oranges = nlp(u'apples and oranges')
|
apples, and_, oranges = nlp(u'apples and oranges')
|
||||||
print(apples.vector.shape)
|
print(apples.vector.shape)
|
||||||
# (1,)
|
# (300,)
|
||||||
apples.similarity(oranges)
|
apples.similarity(oranges)
|
||||||
|
|
||||||
p
|
p
|
||||||
|
|
Loading…
Reference in New Issue
Block a user