def test_to_scipyspare(self): stream = TextFileStreamer(path_list=[self.doc1, self.doc2], tokenizer=self.tokenizer) result = stream.to_scipysparse() benchmark = sparse.csr_matrix([[1, 1, 0, 0], [0, 0, 1, 1]]) compare = result.toarray() == benchmark.toarray() self.assertTrue(compare.all())
def test_to_scipyspare(self): stream = TextFileStreamer(path_list = [self.doc1, self.doc2], tokenizer=self.tokenizer) result = stream.to_scipysparse() benchmark = sparse.csr_matrix([[1, 1, 0, 0], [0, 0, 1, 1]])
def test_to_scipyspare(self): stream = TextFileStreamer(path_list=[self.doc1, self.doc2], tokenizer=self.tokenizer) result = stream.to_scipysparse() benchmark = sparse.csr_matrix([[1, 1, 0, 0], [0, 0, 1, 1]])