Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -109,8 +109,8 @@ def summary_1(text):
|
|
109 |
sentence_scores = sorted(sentence_scores, key=lambda x: x[1], reverse=True)
|
110 |
summary_sentences.append(sentences[sentence_scores[1][0]])
|
111 |
|
112 |
-
|
113 |
-
return
|
114 |
|
115 |
|
116 |
# summary2
|
@@ -128,15 +128,15 @@ def summary_2(text):
|
|
128 |
most_freq_words_p.append(mfwp)
|
129 |
|
130 |
sentences = sent_tokenize(text)
|
131 |
-
|
132 |
for sent in sentences:
|
133 |
for word in sent.split():
|
134 |
-
if word in most_freq_words_p and sent not in
|
135 |
-
|
136 |
else :
|
137 |
None
|
138 |
|
139 |
-
return
|
140 |
|
141 |
|
142 |
def analyze_text(text):
|
|
|
109 |
sentence_scores = sorted(sentence_scores, key=lambda x: x[1], reverse=True)
|
110 |
summary_sentences.append(sentences[sentence_scores[1][0]])
|
111 |
|
112 |
+
summary = ' '.join(summary_sentences)
|
113 |
+
return summary
|
114 |
|
115 |
|
116 |
# summary2
|
|
|
128 |
most_freq_words_p.append(mfwp)
|
129 |
|
130 |
sentences = sent_tokenize(text)
|
131 |
+
summary = []
|
132 |
for sent in sentences:
|
133 |
for word in sent.split():
|
134 |
+
if word in most_freq_words_p and sent not in summary:
|
135 |
+
summary.append(sent)
|
136 |
else :
|
137 |
None
|
138 |
|
139 |
+
return summary
|
140 |
|
141 |
|
142 |
def analyze_text(text):
|