mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
Merge pull request #1350 from hscspring/patch-3
Update word-vectors-similarities.jade
This commit is contained in:
commit
1dbc2285b8
|
@ -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