sy-lac commited on
Commit
f6e46c4
1 Parent(s): 92a650e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -128,14 +128,13 @@ def summary_2(text):
128
  most_freq_words_p.append(mfwp)
129
 
130
  sentences = sent_tokenize(text)
131
- summary2 = []
132
-
133
  for sent in sentences:
134
- words_in_sentence = word_tokenize(sent)
135
- common_words = set(words_in_sentence).intersection(most_freq_words)
136
-
137
- if common_words:
138
- summary2.append(sent)
139
 
140
  return summary2
141
 
 
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 summary:
135
+ summary2.append(sent)
136
+ else :
137
+ None
138
 
139
  return summary2
140