Closed linkyouhj closed 3 years ago
for i in range(NUM_TOPICS+1): if len(corp_doc_topic[i])!= 0: mat,vocab_idx, idx_vocab = word_graph(corp_doc_topic[i]) R = pagerank(mat,method ="iterative") topk = 10 idxs = R.argsort()[-topk:] keywords.append([(idx, R[idx], idx_vocab[idx]) for idx in reversed(idxs)])
range changed from NUM_TOPICS --> NUM_TOPICS+1