Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def classify_subjects(abstract: str):
|
|
| 34 |
# Return dictionary of all subjects with probabilities
|
| 35 |
return dict(zip(subjects, map(float, probs)))
|
| 36 |
|
| 37 |
-
# --- Gradio
|
| 38 |
with gr.Blocks(theme="gradio/soft") as iface:
|
| 39 |
gr.Markdown("## 🧠 Computer Science Research Article Subject Classifier")
|
| 40 |
gr.Markdown(
|
|
@@ -58,7 +58,6 @@ with gr.Blocks(theme="gradio/soft") as iface:
|
|
| 58 |
label="📘 Example Abstracts"
|
| 59 |
)
|
| 60 |
|
| 61 |
-
gr.Button("Classify").click(fn=classify_subjects, inputs=abstract_input, outputs=output_label)
|
| 62 |
|
| 63 |
# Launch app
|
| 64 |
iface.launch(inline=False)
|
|
|
|
| 34 |
# Return dictionary of all subjects with probabilities
|
| 35 |
return dict(zip(subjects, map(float, probs)))
|
| 36 |
|
| 37 |
+
# --- Gradio interface ---
|
| 38 |
with gr.Blocks(theme="gradio/soft") as iface:
|
| 39 |
gr.Markdown("## 🧠 Computer Science Research Article Subject Classifier")
|
| 40 |
gr.Markdown(
|
|
|
|
| 58 |
label="📘 Example Abstracts"
|
| 59 |
)
|
| 60 |
|
|
|
|
| 61 |
|
| 62 |
# Launch app
|
| 63 |
iface.launch(inline=False)
|