ganeshkamath89 commited on
Commit
eb21b56
1 Parent(s): 51fa6dc

Using transformers pipeline summarization instead of wikipediaapi summary

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -12,8 +12,10 @@ def get_wiki_summary(search):
12
  return isExist, "Not found", "Not found", "Not found", "Not found"
13
  url = page.fullurl
14
  tittle = page.title
15
- summary = page.summary[0:300]
16
  text = page.text
 
 
 
17
 
18
  return isExist, url, tittle, summary, text
19
 
 
12
  return isExist, "Not found", "Not found", "Not found", "Not found"
13
  url = page.fullurl
14
  tittle = page.title
 
15
  text = page.text
16
+ #summary = page.summary[0:300]
17
+ summarizer = pipeline("summarization")
18
+ summary = summarizer(text)[0]["summary_text"]
19
 
20
  return isExist, url, tittle, summary, text
21