File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments