Exemple #1
0
 def test_phrase_similarity_totally_different_vectors(self):
     returned = compare_vectors(['dogs'], ['cats'])
     self.assertEqual(returned, 0)
Exemple #2
0
 def test_phrase_similarity_similar_vectors(self):
     returned = compare_vectors(['cats', 'great'], ['cats', 'evil'])
     self.assertAlmostEqual(returned, .5)
Exemple #3
0
 def test_phrase_similarity_same_word(self):
     returned = compare_vectors(['cats'], ['cats'])
     self.assertEqual(returned, 1)