Spaces:
Running
Running
initial commit
Browse files
app.py
CHANGED
@@ -38,7 +38,6 @@ def detect_stress(input_text):
|
|
38 |
f"Level stress anda : {level}<br>{message}" \
|
39 |
f"</div>"
|
40 |
|
41 |
-
# Komponen Gradio
|
42 |
with gr.Blocks(css="""
|
43 |
body {
|
44 |
background-color: black;
|
@@ -68,7 +67,7 @@ textarea {
|
|
68 |
|
69 |
textarea:focus {
|
70 |
border-color: #ff7a33 !important;
|
71 |
-
}
|
72 |
.button_detect {
|
73 |
background-color: #ff7a33;
|
74 |
color: white;
|
@@ -85,26 +84,20 @@ textarea:focus {
|
|
85 |
""") as demo:
|
86 |
with gr.Row():
|
87 |
gr.Markdown("<h1 id='title'>Stress Detector</h1>")
|
88 |
-
|
89 |
with gr.Row():
|
90 |
-
input_text = gr.Textbox(label="Masukkan teks", placeholder="
|
91 |
|
92 |
# Tombol submit
|
93 |
with gr.Row():
|
94 |
btn_submit = gr.Button("Deteksi", elem_classes ="button_detect")
|
95 |
-
|
96 |
with gr.Row():
|
97 |
output_label = gr.HTML(label="Hasil Deteksi")
|
98 |
-
|
99 |
-
with gr.Row():
|
100 |
-
gr.Markdown(
|
101 |
-
"<p style='text-align: center;'>"
|
102 |
-
"0 untuk <b>Tidak Stress</b>, 1 untuk <b>Stress</b>, dan 2 untuk <b>Stress Berat</b>."
|
103 |
-
"</p>"
|
104 |
-
)
|
105 |
|
106 |
# Interaksi Gradio
|
107 |
btn_submit.click(fn=detect_stress, inputs=input_text, outputs=output_label)
|
108 |
|
109 |
# Jalankan demo
|
110 |
-
demo.launch(
|
|
|
|
38 |
f"Level stress anda : {level}<br>{message}" \
|
39 |
f"</div>"
|
40 |
|
|
|
41 |
with gr.Blocks(css="""
|
42 |
body {
|
43 |
background-color: black;
|
|
|
67 |
|
68 |
textarea:focus {
|
69 |
border-color: #ff7a33 !important;
|
70 |
+
}
|
71 |
.button_detect {
|
72 |
background-color: #ff7a33;
|
73 |
color: white;
|
|
|
84 |
""") as demo:
|
85 |
with gr.Row():
|
86 |
gr.Markdown("<h1 id='title'>Stress Detector</h1>")
|
87 |
+
|
88 |
with gr.Row():
|
89 |
+
input_text = gr.Textbox(label="Masukkan teks", placeholder="Ceritakan keluhanmu disini...", lines=3)
|
90 |
|
91 |
# Tombol submit
|
92 |
with gr.Row():
|
93 |
btn_submit = gr.Button("Deteksi", elem_classes ="button_detect")
|
94 |
+
|
95 |
with gr.Row():
|
96 |
output_label = gr.HTML(label="Hasil Deteksi")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
# Interaksi Gradio
|
99 |
btn_submit.click(fn=detect_stress, inputs=input_text, outputs=output_label)
|
100 |
|
101 |
# Jalankan demo
|
102 |
+
demo.launch()
|
103 |
+
|