fabeffe39e70e1c371bcce158b3b8b0dd029e7a6,gensim/summarization/summarizer.py,,_set_graph_edge_weights,#Any#,74

Before Change


            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()):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: fabeffe39e70e1c371bcce158b3b8b0dd029e7a6
Time: 2019-01-17
Author: __Singleton__@hackerdom.ru
File Name: gensim/summarization/summarizer.py
Class Name:
Method Name: _set_graph_edge_weights


Project Name: neuroailab/tnn
Commit Name: 0d14553fa39718c788b2c3064e24ec10cc218098
Time: 2016-10-07
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _construct_graph


Project Name: dmlc/dgl
Commit Name: 9b4d60799a25409506a73ef4fbaa640a9c4e9ee2
Time: 2019-09-17
Author: wmjlyjemaine@gmail.com
File Name: tests/compute/test_heterograph.py
Class Name:
Method Name: create_test_heterograph