Skip to content

Commit d2ff89e

Browse files
Added test for CVP
1 parent e5c9858 commit d2ff89e

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/test_cvp.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
def test_cvp():
2+
from turftopic import ConceptVectorProjection
3+
4+
cuteness_seeds = (
5+
["Absolutely adorable", "I love how he dances with his little feet"],
6+
[
7+
"What a big slob of an abomination",
8+
"A suspicious old man sat next to me on the bus today",
9+
],
10+
)
11+
bullish_seeds = (
12+
[
13+
"We are going to the moon",
14+
"This stock will prove an incredible investment",
15+
],
16+
[
17+
"I will short the hell out of them",
18+
"Uber stocks drop 7% in value after down-time.",
19+
],
20+
)
21+
seeds = [("cuteness", cuteness_seeds), ("bullish", bullish_seeds)]
22+
cvp = ConceptVectorProjection(seeds=seeds)
23+
test_documents = ["What an awesome investment", "Tiny beautiful kitty-cat"]
24+
doc_concept_matrix = cvp.transform(test_documents)
25+
assert doc_concept_matrix.shape == (2, 2)

0 commit comments

Comments
 (0)