用python写了一个简单版本的textrank,实现提取关键词的功能。
import numpy as np
import jieba
import jieba.posseg as pseg
class TextRank(object):
def __init__(self, sentence, window, alpha, iternum):
self.sentence = sentence
self.window = window
self.alpha = alpha
self.edge_dict = {} #记录节点的边连接字典
sel
1