def test_gensim_rp(self): corpus = DefaultJsonCorpus(self.get_docs()) ds = DocumentSimilarity(model_type="gensim_rp") ds.fit(corpus) res = ds.nn(0,k=1) self.assertEqual(res[0][0],1)
def test_sklearn_nmf(self): corpus = DefaultJsonCorpus(self.get_docs()) ds = DocumentSimilarity(model_type="sklearn_nmf") ds.fit(corpus) res = ds.nn(0,k=1) self.assertEqual(res[0][0],1)