mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Add tests for vector-space model
This commit is contained in:
parent
48b98e3fb5
commit
7d432b7e39
19
tests/test_vec.py
Normal file
19
tests/test_vec.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from spacy.en import English
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def EN():
|
||||||
|
return English()
|
||||||
|
|
||||||
|
def test_vec(EN):
|
||||||
|
hype = EN.vocab['hype']
|
||||||
|
assert hype.orth_ == 'hype'
|
||||||
|
assert 0.08 >= hype.repvec[0] > 0.07
|
||||||
|
|
||||||
|
def test_capitalized(EN):
|
||||||
|
hype = EN.vocab['Hype']
|
||||||
|
assert hype.orth_ == 'Hype'
|
||||||
|
assert 0.08 >= hype.repvec[0] > 0.07
|
Loading…
Reference in New Issue
Block a user