d0r1h commited on
Commit
9c9d2b1
1 Parent(s): 9eb4d18

Update app.py

Browse files

update for wordcloud and input choice

Files changed (1) hide show
  1. app.py +17 -4
app.py CHANGED
@@ -1,11 +1,21 @@
1
  import gradio as gr
2
  from summarizer import summarize
3
 
 
 
 
 
 
4
 
5
  with open("Example/File.txt", 'r', encoding="utf8") as f:
6
  text = f.read()
7
 
8
- sample = [text]
 
 
 
 
 
9
 
10
  interface = gr.Interface(fn = summarize,
11
  inputs = [gr.inputs.Textbox(lines=5,
@@ -14,10 +24,13 @@ interface = gr.Interface(fn = summarize,
14
  gr.inputs.Radio(["T5", "BART"], type="value", label='Model')
15
  ],
16
 
17
- outputs = [gr.outputs.Textbox(
18
- label="Sar")],
19
 
20
  title = "Hindi News Summarizer",
21
- examples=[sample])
 
 
 
22
 
23
  interface.launch(debug=True)
 
1
  import gradio as gr
2
  from summarizer import summarize
3
 
4
+ link1 = "https://www.amarujala.com/world/india-providing-dry-ration-packs-to-widows-and-needy-families-in-sri-lanka-ahead-of-eid-ins-gharial-brough-medicines-to-colombo-news-in-hindi"
5
+
6
+ link2 = "https://www.amarujala.com/lucknow/now-the-government-will-go-to-village-to-buy-wheat-in-up-and-wheat-will-also-be-purchased-from-mobile-purchasing-centers"
7
+
8
+ link3 = "https://www.amarujala.com/india-news/supreme-court-cannot-give-the-status-of-place-of-namaz-without-evidence-rajasthan-waqf-board-s-petition-challenging-the-high-court-order-dismissed?pageId=1"
9
 
10
  with open("Example/File.txt", 'r', encoding="utf8") as f:
11
  text = f.read()
12
 
13
+ description = """
14
+ <center>
15
+ SAR (सार) in Hindi means summary, It's a tool to summarize Hindi News with SOTA models
16
+ </center>
17
+ """
18
+ article="<p style='text-align: center'> Created by Pawan Trivedi 2022 | <a href='https://github.com/d0r1h/SAR/'>GitHub</a></p>"
19
 
20
  interface = gr.Interface(fn = summarize,
21
  inputs = [gr.inputs.Textbox(lines=5,
 
24
  gr.inputs.Radio(["T5", "BART"], type="value", label='Model')
25
  ],
26
 
27
+ outputs = [gr.outputs.Textbox(label="Sar"),
28
+ gr.outputs.Plot(type="auto", label="WordCloud")],
29
 
30
  title = "Hindi News Summarizer",
31
+ examples=[[link1, "BART"],
32
+ [link2, "BART"],
33
+ [link3, "BART"],
34
+ [text, "BART"]])
35
 
36
  interface.launch(debug=True)