Commit
·
0078639
1
Parent(s):
80cacdd
fix styling
Browse files
app.py
CHANGED
@@ -57,18 +57,18 @@ def classify_text(text):
|
|
57 |
return f'<div style="background-color: {color_mapping[predicted_label]}; padding: 10px; border-radius: 5px;">{predicted_label}</div>'
|
58 |
|
59 |
# Create the Gradio interface using Blocks for custom layout
|
60 |
-
with gr.Blocks() as interface:
|
61 |
-
gr.Markdown("#
|
62 |
-
gr.Markdown("
|
63 |
|
64 |
# Input text box set for single-line input
|
65 |
-
text_input = gr.Textbox(lines=1, placeholder="
|
66 |
|
67 |
# Submit button
|
68 |
-
submit_btn = gr.Button("
|
69 |
|
70 |
# Placeholder for result with an initial message
|
71 |
-
result_output = gr.HTML(value="<div style='color:gray;'>
|
72 |
|
73 |
# Connect the submit button to the classification function
|
74 |
submit_btn.click(fn=classify_text, inputs=text_input, outputs=result_output)
|
|
|
57 |
return f'<div style="background-color: {color_mapping[predicted_label]}; padding: 10px; border-radius: 5px;">{predicted_label}</div>'
|
58 |
|
59 |
# Create the Gradio interface using Blocks for custom layout
|
60 |
+
with gr.Blocks(css=".gradio-container { max-width: 800px; margin: auto; }") as interface:
|
61 |
+
gr.Markdown("# ePA Classifier")
|
62 |
+
gr.Markdown("Gib einen Satz oder Text ein, der in 'Ablehnung', 'Neutral', oder 'Zustimmung' klassifiziert werden soll.")
|
63 |
|
64 |
# Input text box set for single-line input
|
65 |
+
text_input = gr.Textbox(lines=1, placeholder="Hier Text...") # Single-line input
|
66 |
|
67 |
# Submit button
|
68 |
+
submit_btn = gr.Button("Klassifizieren")
|
69 |
|
70 |
# Placeholder for result with an initial message
|
71 |
+
result_output = gr.HTML(value="<div style='color:gray;'>Das Ergebnis wird hier angezeigt</div>")
|
72 |
|
73 |
# Connect the submit button to the classification function
|
74 |
submit_btn.click(fn=classify_text, inputs=text_input, outputs=result_output)
|