if i == j or weights[i][j] < WEIGHT_THRESHOLD:
continue
sentence_1 = documents[i]
sentence_2 = documents[j]
edge_1 = (sentence_1, sentence_2)
edge_2 = (sentence_2, sentence_1)
if not graph.has_edge(edge_1):
graph.add_edge(edge_1, weights[i][j])
if not graph.has_edge(edge_2):
After Change
edge = (documents[i], documents[j])
if not graph.has_edge(edge):
graph.add_edge(edge, weight)
// Handles the case in which all similarities are zero.
// The resultant summary will consist of random sentences.
if all(graph.edge_weight(edge) == 0 for edge in graph.iter_edges()):