Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -102,7 +102,7 @@ def summary_1(text):
|
|
102 |
## summarizing
|
103 |
similarity_matrix = cosine_similarity(sentence_embeddings)
|
104 |
|
105 |
-
num_sentences =
|
106 |
summary_sentences = []
|
107 |
for i in range(num_sentences):
|
108 |
sentence_scores = list(enumerate(similarity_matrix[i]))
|
@@ -128,10 +128,10 @@ def summary_2(text):
|
|
128 |
most_freq_words_p.append(mfwp)
|
129 |
|
130 |
sentences = sent_tokenize(text)
|
131 |
-
summary2= []
|
132 |
for sent in sentences:
|
133 |
for word in sent.split():
|
134 |
-
if word in most_freq_words_p and sent not in
|
135 |
summary2.append(sent)
|
136 |
else :
|
137 |
None
|
|
|
102 |
## summarizing
|
103 |
similarity_matrix = cosine_similarity(sentence_embeddings)
|
104 |
|
105 |
+
num_sentences = 3
|
106 |
summary_sentences = []
|
107 |
for i in range(num_sentences):
|
108 |
sentence_scores = list(enumerate(similarity_matrix[i]))
|
|
|
128 |
most_freq_words_p.append(mfwp)
|
129 |
|
130 |
sentences = sent_tokenize(text)
|
131 |
+
summary2 = []
|
132 |
for sent in sentences:
|
133 |
for word in sent.split():
|
134 |
+
if word in most_freq_words_p and sent not in summary2:
|
135 |
summary2.append(sent)
|
136 |
else :
|
137 |
None
|