mirror of https://github.com/explosion/spaCy.git
* Upd test_docs
This commit is contained in:
parent
609f729cc5
commit
5c9b8d05e4
|
@ -56,7 +56,7 @@ def test3():
|
|||
from numpy.linalg import norm
|
||||
|
||||
cosine = lambda v1, v2: dot(v1, v2) / (norm(v1) * norm(v2))
|
||||
words = [w for w in nlp.vocab if w.check(IS_LOWER) and w.has_repvec]
|
||||
words = [w for w in nlp.vocab if w.is_lower and w.has_repvec]
|
||||
words.sort(key=lambda w: cosine(w.repvec, pleaded.repvec))
|
||||
words.reverse()
|
||||
o = [w.orth_ for w in words[0:20]]
|
||||
|
|
Loading…
Reference in New Issue