Spaces:
Sleeping
Sleeping
Commit ·
801be53
1
Parent(s): ab753b8
pls last
Browse files
app.py
CHANGED
|
@@ -32,15 +32,18 @@ def text_summarization(text):
|
|
| 32 |
summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]['summary_text']
|
| 33 |
return summary
|
| 34 |
|
| 35 |
-
# Define
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
)
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# Launch the app
|
| 45 |
if __name__ == "__main__":
|
| 46 |
-
|
|
|
|
| 32 |
summary = summarizer(text, max_length=130, min_length=30, do_sample=False)[0]['summary_text']
|
| 33 |
return summary
|
| 34 |
|
| 35 |
+
# Define interfaces for each function
|
| 36 |
+
text_analysis_interface = gr.Interface(fn=text_analysis,
|
| 37 |
+
inputs=gr.Textbox(lines=4, placeholder="Type something here..."),
|
| 38 |
+
outputs=gr.JSON(label="Text Analysis"))
|
| 39 |
+
|
| 40 |
+
text_summarization_interface = gr.Interface(fn=text_summarization,
|
| 41 |
+
inputs=gr.Textbox(lines=4, placeholder="Type something here..."),
|
| 42 |
+
outputs="text")
|
| 43 |
+
|
| 44 |
+
# Combine interfaces using gr.Parallel
|
| 45 |
+
iface = gr.Parallel(text_analysis_interface, text_summarization_interface)
|
| 46 |
|
| 47 |
# Launch the app
|
| 48 |
if __name__ == "__main__":
|
| 49 |
+
iface.launch()
|