ossteam8 / LDA-TextRank-keyword

Keyword extractor using LDA and TextRank combined
GNU Lesser General Public License v2.1
4 stars 0 forks source link

After textrank, topic count reduces (ex: N -> N-1) #1

Closed linkyouhj closed 3 years ago

linkyouhj commented 3 years ago
스크린샷 2021-06-05 오후 1 20 30 스크린샷 2021-06-05 오후 1 20 41
linkyouhj commented 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)])

keyword = [(R[idx]) for idx in reversed(idxs)]

range changed from NUM_TOPICS --> NUM_TOPICS+1