docs: Added missing cosine declaration

* Added missing cosine declaration to code listing that already included
  imports for `dot` and `norm` function it uses.

Signed-off-by: mr.Shu <mr@shu.io>
This commit is contained in:
mr.Shu 2015-01-25 17:51:18 +01:00
parent 006699eeb9
commit e6dc0958c4
1 changed files with 1 additions and 0 deletions

View File

@ -207,6 +207,7 @@ problematic, given our starting assumptions:
>>> from numpy.linalg import norm >>> from numpy.linalg import norm
>>> import spacy.en >>> import spacy.en
>>> from spacy.postags import ADVERB, VERB >>> from spacy.postags import ADVERB, VERB
>>> cosine = lambda v1, v2: dot(v1, v2) / (norm(v1), norm(v2))
>>> def is_bad_adverb(token, target_verb, tol): >>> def is_bad_adverb(token, target_verb, tol):
... if token.pos != ADVERB ... if token.pos != ADVERB
... return False ... return False