def test_get_phi_opinion_from_memory():
sampler2 = GibbsSampler(corpus, nTopics=3, nIter=5)
sampler2._initialize()
sampler2.run()
f = sampler2.get_phi_opinion_file_name(0, 0)
yield assert_false, os.path.isfile(f)
phi = sampler2.get_phi_opinion()
yield assert_equal, len(phi), sampler2.nPerspectives
yield assert_equal, phi[0].shape, (sampler2.nTopics, sampler2.VO)
phi = sampler2.get_phi_opinion(index=2)
yield assert_equal, len(phi), sampler2.nPerspectives
yield assert_equal, phi[0].shape, (sampler2.nTopics, sampler2.VO)
phi = sampler2.get_phi_opinion(start=0, end=5)
yield assert_equal, len(phi), sampler2.nPerspectives
yield assert_equal, phi[0].shape, (sampler2.nTopics, sampler2.VO)
评论列表
文章目录