sy-lac commited on
Commit
cd0e30d
1 Parent(s): 2648d64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- summary1 = ' '.join(summary_sentences)
113
- return summary1
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
- 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
138
 
139
- return summary2
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):