issam9 commited on
Commit
7f09a76
1 Parent(s): 5226c27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -10,22 +10,22 @@ import nltk
10
  nltk.download('punkt')
11
 
12
 
13
- def summarize(algorithm, language, sentence_count, input_type, input_):
14
- if algorithm == 'LSA':
15
  from sumy.summarizers.lsa import LsaSummarizer as Summarizer
16
- if algorithm =='text-rank':
17
  from sumy.summarizers.text_rank import TextRankSummarizer as Summarizer
18
- if algorithm =='lex-rank':
19
  from sumy.summarizers.lex_rank import LexRankSummarizer as Summarizer
20
- if algorithm =='edmundson':
21
  from sumy.summarizers.edmundson import EdmundsonSummarizer as Summarizer
22
- if algorithm =='luhn':
23
  from sumy.summarizers.luhn import LuhnSummarizer as Summarizer
24
- if algorithm =='kl-sum':
25
  from sumy.summarizers.kl import KLSummarizer as Summarizer
26
- if algorithm =='random':
27
  from sumy.summarizers.random import RandomSummarizer as Summarizer
28
- if algorithm =='reduction':
29
  from sumy.summarizers.reduction import ReductionSummarizer as Summarizer
30
 
31
  if input_type=="URL":
@@ -37,7 +37,7 @@ def summarize(algorithm, language, sentence_count, input_type, input_):
37
  summarizer = Summarizer(stemmer)
38
  stop_words = get_stop_words(language)
39
 
40
- if algorithm=='edmundson':
41
  summarizer.null_words = stop_words
42
  summarizer.bonus_words = parser.significant_words
43
  summarizer.stigma_words = parser.stigma_words
 
10
  nltk.download('punkt')
11
 
12
 
13
+ def summarize(method, language, sentence_count, input_type, input_):
14
+ if method== 'LSA':
15
  from sumy.summarizers.lsa import LsaSummarizer as Summarizer
16
+ if method=='text-rank':
17
  from sumy.summarizers.text_rank import TextRankSummarizer as Summarizer
18
+ if method=='lex-rank':
19
  from sumy.summarizers.lex_rank import LexRankSummarizer as Summarizer
20
+ if method=='edmundson':
21
  from sumy.summarizers.edmundson import EdmundsonSummarizer as Summarizer
22
+ if method=='luhn':
23
  from sumy.summarizers.luhn import LuhnSummarizer as Summarizer
24
+ if method=='kl-sum':
25
  from sumy.summarizers.kl import KLSummarizer as Summarizer
26
+ if method=='random':
27
  from sumy.summarizers.random import RandomSummarizer as Summarizer
28
+ if method=='reduction':
29
  from sumy.summarizers.reduction import ReductionSummarizer as Summarizer
30
 
31
  if input_type=="URL":
 
37
  summarizer = Summarizer(stemmer)
38
  stop_words = get_stop_words(language)
39
 
40
+ if method=='edmundson':
41
  summarizer.null_words = stop_words
42
  summarizer.bonus_words = parser.significant_words
43
  summarizer.stigma_words = parser.stigma_words