02ba343e85f299130d2a1fc38e702040ef620c87,gensim/test/test_summarization.py,TestSummarizationTest,test_corpus_summarization,#TestSummarizationTest#,41
Before Change
self.assertEqual(generated_summary, summary)
def test_corpus_summarization(self):
pre_path = os.path.join(os.path.dirname(__file__), "test_data")
with utils.smart_open(os.path.join(pre_path, "mihalcea_tarau.txt"), mode="r") as f:
text = f.read()
// Generate the corpus.
sentences = text.split("\n")
tokens = [sentence.split() for sentence in sentences]
dictionary = Dictionary(tokens)
corpus = [dictionary.doc2bow(sentence_tokens) for sentence_tokens in tokens]
// Extract the most important documents.
selected_documents = summarize_corpus(corpus)
// They are compared to the method reference.
with utils.smart_open(os.path.join(pre_path, "mihalcea_tarau.summ.txt"), mode="r") as f:
summary = f.read()
summary = summary.split("\n")
// Each sentence in the document selection has to be in the model summary.
for doc_number, document in enumerate(selected_documents):
// Retrieves all words from the document.
words = [dictionary[token_id] for (token_id, count) in document]
After Change
self.assertEqual(generated_summary, summary)
def test_corpus_summarization(self):
text = self._get_text_from_test_data("mihalcea_tarau.txt")
// Generate the corpus.
sentences = text.split("\n")
tokens = [sentence.split() for sentence in sentences]
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 17
Instances
Project Name: RaRe-Technologies/gensim
Commit Name: 02ba343e85f299130d2a1fc38e702040ef620c87
Time: 2017-09-18
Author: fbarrios@live.com.ar
File Name: gensim/test/test_summarization.py
Class Name: TestSummarizationTest
Method Name: test_corpus_summarization
Project Name: RaRe-Technologies/gensim
Commit Name: 02ba343e85f299130d2a1fc38e702040ef620c87
Time: 2017-09-18
Author: fbarrios@live.com.ar
File Name: gensim/test/test_summarization.py
Class Name: TestSummarizationTest
Method Name: test_text_summarization
Project Name: RaRe-Technologies/gensim
Commit Name: 02ba343e85f299130d2a1fc38e702040ef620c87
Time: 2017-09-18
Author: fbarrios@live.com.ar
File Name: gensim/test/test_summarization.py
Class Name: TestSummarizationTest
Method Name: test_corpus_summarization
Project Name: RaRe-Technologies/gensim
Commit Name: 02ba343e85f299130d2a1fc38e702040ef620c87
Time: 2017-09-18
Author: fbarrios@live.com.ar
File Name: gensim/test/test_summarization.py
Class Name: TestSummarizationTest
Method Name: test_summary_from_unrelated_sentences
Project Name: RaRe-Technologies/gensim
Commit Name: 02ba343e85f299130d2a1fc38e702040ef620c87
Time: 2017-09-18
Author: fbarrios@live.com.ar
File Name: gensim/test/test_summarization.py
Class Name: TestSummarizationTest
Method Name: test_corpus_summarization_ratio