mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-05 06:00:36 +03:00
Merge pull request #3 from mrshu/mrshu/docs-cosine-fix
docs: Added missing cosine declaration
This commit is contained in:
commit
5ef7485749
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user