Spaces:
Sleeping
Sleeping
Commit
·
3e6e828
1
Parent(s):
2c2bca9
Update app.py
Browse files
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
|
| 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=
|
| 15 |
inputs=gr.inputs.Textbox(lines=10, placeholder= "Enter or paste your Text and press Submit."),
|
| 16 |
outputs="text"
|
| 17 |
)
|
| 18 |
-
|
|
|
|
|
|
| 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()
|