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):
graph.add_edge(edge_2, weights[j][i])
// Handles the case in which all similarities are zero.
After Change
documents = graph.nodes()
weights = _bm25_weights(documents)
for i, doc_bow in enumerate(weights):
if i % 1000 == 0 and i > 0:
logger.info("PROGRESS: processing %s/%s doc (%s non zero elements)", i, len(documents), len(doc_bow))
for j, weight in doc_bow:
if i == j or weight < WEIGHT_THRESHOLD:
continue
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()):
_create_valid_graph(graph)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
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: RaRe-Technologies/gensim
Commit Name: ac7486a69da6ce5d9873216bad86afa1a10191fc
Time: 2015-05-03
Author: fbarrios@fi.uba.ar
File Name: gensim/summarization/summarizer.py
Class Name:
Method Name: _set_graph_edge_weights
Project Name: deepmipt/DeepPavlov
Commit Name: 6d3e4bdc22cc89fb7ecf188ccf0479632012026f
Time: 2018-04-18
Author: dilyara.rimovna@gmail.com
File Name: deeppavlov/models/evolution/check_binary_mask.py
Class Name:
Method Name: get_graph_and_plot
Project Name: deepmipt/DeepPavlov
Commit Name: 4fca544205a55010e8959bb760aece5be80dc3a5
Time: 2018-06-26
Author: dilyara.rimovna@gmail.com
File Name: deeppavlov/models/evolution/check_binary_mask.py
Class Name:
Method Name: get_graph_and_plot