Yuchan5386 commited on
Commit
6617185
·
verified ·
1 Parent(s): b3998ae

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +5 -4
api.py CHANGED
@@ -283,10 +283,11 @@ def textrank_summarize(text, top_n=3):
283
  summary = ' '.join([sentences[i] for i in selected_idx])
284
  return summary
285
 
286
- def summarize_from_wikipedia(query, top_n=3):
287
- raw_summary = get_wikipedia_summary(query)
288
- return textrank_summarize(raw_summary, top_n=top_n)
289
-
 
290
  # 의도 분류기
291
  def simple_intent_classifier(text):
292
  text = text.lower()
 
283
  summary = ' '.join([sentences[i] for i in selected_idx])
284
  return summary
285
 
286
+ def summarize_from_wikipedia(query, top_n=3):
287
+ raw_summary = get_wikipedia_summary(query)
288
+ first_summary = textrank_summarize(raw_summary, top_n=top_n)
289
+ second_summary = textrank_summarize(first_summary, top_n=top_n)
290
+ return second_summary
291
  # 의도 분류기
292
  def simple_intent_classifier(text):
293
  text = text.lower()