From e6dc0958c4e17c9d361aca35793214646e509336 Mon Sep 17 00:00:00 2001 From: "mr.Shu" Date: Sun, 25 Jan 2015 17:51:18 +0100 Subject: [PATCH] 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 --- docs/source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index c2c4e44d0..18ce24ee8 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -207,6 +207,7 @@ problematic, given our starting assumptions: >>> from numpy.linalg import norm >>> import spacy.en >>> 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): ... if token.pos != ADVERB ... return False