AnkitPatil commited on
Commit
3e6e828
·
1 Parent(s): 2c2bca9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -3,16 +3,17 @@ import gradio as gr
3
 
4
  summaizer = pipeline("summarization", model="t5-base", tokenizer="t5-small", truncation=True, framework="tf")
5
 
6
- def translate(text):
7
  #here text line of code is optional
8
- text = text.replace('"' '""')
9
  text = text.replace(''', "''")
10
  text = text.replace('&', "&")
11
  result = summarizer(text, min_length=180, truncation=True
12
  )
13
  iface = gr.Interface(
14
- fn=translate,
15
  inputs=gr.inputs.Textbox(lines=10, placeholder= "Enter or paste your Text and press Submit."),
16
  outputs="text"
17
  )
18
- iface.launch()
 
 
3
 
4
  summaizer = pipeline("summarization", model="t5-base", tokenizer="t5-small", truncation=True, framework="tf")
5
 
6
+ def analyze_text(text):
7
  #here text line of code is optional
8
+ text = text.replace('"', '""')
9
  text = text.replace(''', "''")
10
  text = text.replace('&', "&")
11
  result = summarizer(text, min_length=180, truncation=True
12
  )
13
  iface = gr.Interface(
14
+ fn=analyze_text,
15
  inputs=gr.inputs.Textbox(lines=10, placeholder= "Enter or paste your Text and press Submit."),
16
  outputs="text"
17
  )
18
+
19
+ iface.launch()