mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Fix vector_norm test.
This commit is contained in:
parent
fefde8aef8
commit
e120561294
|
@ -5,6 +5,7 @@ from spacy.attrs import IS_SPACE, IS_TITLE, IS_UPPER, LIKE_URL, LIKE_NUM
|
|||
from spacy.attrs import IS_STOP
|
||||
|
||||
import pytest
|
||||
import numpy
|
||||
|
||||
|
||||
@pytest.mark.models
|
||||
|
@ -67,7 +68,9 @@ def test_vectors(EN):
|
|||
assert apples.similarity(oranges) > apples.similarity(oov)
|
||||
assert apples.similarity(oranges) == oranges.similarity(apples)
|
||||
assert sum(apples.vector) != sum(oranges.vector)
|
||||
assert apples.vector_norm != oranges.vector_norm
|
||||
assert numpy.isclose(
|
||||
apples.vector_norm,
|
||||
numpy.sqrt(numpy.dot(apples.vector, apples.vector)))
|
||||
|
||||
@pytest.mark.models
|
||||
def test_ancestors(EN):
|
||||
|
|
Loading…
Reference in New Issue
Block a user