GeorgHCundK commited on
Commit
0078639
·
1 Parent(s): 80cacdd

fix styling

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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("# Text Classification with API")
62
- gr.Markdown("Enter a sentence and get it classified into 'Ablehnung', 'Neutral', or 'Zustimmung'.")
63
 
64
  # Input text box set for single-line input
65
- text_input = gr.Textbox(lines=1, placeholder="Enter your text here...") # Single-line input
66
 
67
  # Submit button
68
- submit_btn = gr.Button("Submit")
69
 
70
  # Placeholder for result with an initial message
71
- result_output = gr.HTML(value="<div style='color:gray;'>The classification result will be displayed here.</div>")
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)