def rank(nodes, edges):
''' Creates the graph with the calculates nodes (sentences) and their weight'''
graph = nx.DiGraph()
graph.add_nodes_from(nodes)
graph.add_weighted_edges_from(edges)
''' Uses google's pagerank formula to find the most important senteces'''
return nx.pagerank(graph)
评论列表
文章目录