Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,19 +102,19 @@ def answer_question(news_content, question):
|
|
| 102 |
return f"Error: {str(e)}"
|
| 103 |
|
| 104 |
# ====================== GRADIO INTERFACE ======================
|
| 105 |
-
with gr.Blocks(title="
|
| 106 |
-
gr.Markdown("# π°
|
| 107 |
-
gr.Markdown("### Section 02 - Text Analytics Assignment")
|
| 108 |
|
| 109 |
with gr.Tabs():
|
| 110 |
-
with gr.Tab("π
|
| 111 |
gr.Markdown("Upload CSV with `content` column")
|
| 112 |
file_input = gr.File(label="Upload CSV", file_types=[".csv"])
|
| 113 |
classify_btn = gr.Button("π Classify News", variant="primary")
|
| 114 |
output_text = gr.Textbox(label="Status")
|
| 115 |
output_file = gr.File(label="Download output.csv")
|
| 116 |
bar_chart = gr.BarPlot(
|
| 117 |
-
label="Category Distribution",
|
| 118 |
x="Category",
|
| 119 |
y="Count",
|
| 120 |
|
|
@@ -139,6 +139,6 @@ with gr.Blocks(title="Daily Mirror News Classifier") as demo:
|
|
| 139 |
outputs=qa_output
|
| 140 |
)
|
| 141 |
|
| 142 |
-
gr.Markdown("Built for Text Analytics Assignment - Section 02")
|
| 143 |
|
| 144 |
demo.launch()
|
|
|
|
| 102 |
return f"Error: {str(e)}"
|
| 103 |
|
| 104 |
# ====================== GRADIO INTERFACE ======================
|
| 105 |
+
with gr.Blocks(title=" News Classifier & Question Answering App") as demo:
|
| 106 |
+
gr.Markdown("# π° DEnglish News Classifier")
|
| 107 |
+
#gr.Markdown("### Section 02 - Text Analytics Assignment")
|
| 108 |
|
| 109 |
with gr.Tabs():
|
| 110 |
+
with gr.Tab("π News Classification"):
|
| 111 |
gr.Markdown("Upload CSV with `content` column")
|
| 112 |
file_input = gr.File(label="Upload CSV", file_types=[".csv"])
|
| 113 |
classify_btn = gr.Button("π Classify News", variant="primary")
|
| 114 |
output_text = gr.Textbox(label="Status")
|
| 115 |
output_file = gr.File(label="Download output.csv")
|
| 116 |
bar_chart = gr.BarPlot(
|
| 117 |
+
label="Category Distribution Across 5 Classes",
|
| 118 |
x="Category",
|
| 119 |
y="Count",
|
| 120 |
|
|
|
|
| 139 |
outputs=qa_output
|
| 140 |
)
|
| 141 |
|
| 142 |
+
#gr.Markdown("Built for Text Analytics Assignment - Section 02")
|
| 143 |
|
| 144 |
demo.launch()
|