g3casey commited on
Commit
fb4f8c6
·
1 Parent(s): 0b1a1c5

change to get_wiki of summarize

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -17,6 +17,7 @@ def summarize(text):
17
  print(f'Length of initial text: {len(text)}')
18
  print(f'Length of summary: {len(summary_text)}')
19
  print(summary_text)
 
20
 
21
  def greet(name):
22
  return "Hello " + name.orig_name + "!!"
@@ -31,8 +32,11 @@ def search_wiki(text):
31
 
32
 
33
  def get_wiki(search_term):
34
- text = summarize(wikipedia.summary(search_term))
35
- return text
 
 
 
36
 
37
 
38
  # def inference(file):
@@ -43,5 +47,5 @@ def get_wiki(search_term):
43
 
44
 
45
 
46
- iface = gr.Interface(fn=get_wiki, inputs="text", outputs="text")
47
  iface.launch()
 
17
  print(f'Length of initial text: {len(text)}')
18
  print(f'Length of summary: {len(summary_text)}')
19
  print(summary_text)
20
+ return summary_text
21
 
22
  def greet(name):
23
  return "Hello " + name.orig_name + "!!"
 
32
 
33
 
34
  def get_wiki(search_term):
35
+ text = wikipedia.summary(search_term)
36
+ orig_text_len = len(text)
37
+ text = summarize(text)
38
+ sum_length = len(text)
39
+ return [text,orig_text_len,sum_length]
40
 
41
 
42
  # def inference(file):
 
47
 
48
 
49
 
50
+ iface = gr.Interface(fn=get_wiki, inputs="text", outputs=["text",'orig_length','sum_length'])
51
  iface.launch()