Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,16 @@ def analyze(text):
|
|
31 |
|
32 |
# ---------- CSS ----------
|
33 |
CSS = """
|
34 |
-
/*
|
35 |
-
body, .gradio-container, .gr-blocks, .gr-
|
|
|
|
|
|
|
|
|
|
|
36 |
background-color: #2b2b2b !important;
|
|
|
|
|
37 |
}
|
38 |
|
39 |
/* Keep text visible */
|
@@ -41,7 +48,7 @@ body, .gradio-container, .gr-blocks, .gr-box, .gr-panel {
|
|
41 |
color: #fff !important;
|
42 |
}
|
43 |
|
44 |
-
/*
|
45 |
textarea, input[type="text"] {
|
46 |
background-color: #1f1f1f !important;
|
47 |
border: 1px solid rgba(255,255,255,0.2) !important;
|
@@ -53,23 +60,23 @@ textarea, input[type="text"] {
|
|
53 |
with gr.Blocks(css=CSS, theme="default") as demo:
|
54 |
with gr.Row(equal_height=True):
|
55 |
with gr.Column(scale=1):
|
56 |
-
gr.
|
57 |
-
|
|
|
58 |
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
""")
|
73 |
|
74 |
with gr.Column(scale=3):
|
75 |
gr.Markdown("### Enter Arabic Text for Analysis")
|
@@ -90,4 +97,4 @@ with gr.Blocks(css=CSS, theme="default") as demo:
|
|
90 |
)
|
91 |
|
92 |
if __name__ == "__main__":
|
93 |
-
demo.launch()
|
|
|
31 |
|
32 |
# ---------- CSS ----------
|
33 |
CSS = """
|
34 |
+
/* Keep the main app and textboxes same dark grey */
|
35 |
+
body, .gradio-container, .gr-blocks, .gr-panel {
|
36 |
+
background-color: #1f1f1f !important;
|
37 |
+
}
|
38 |
+
|
39 |
+
/* Sidebar box styling */
|
40 |
+
.sidebar-box {
|
41 |
background-color: #2b2b2b !important;
|
42 |
+
padding: 20px;
|
43 |
+
border-radius: 10px;
|
44 |
}
|
45 |
|
46 |
/* Keep text visible */
|
|
|
48 |
color: #fff !important;
|
49 |
}
|
50 |
|
51 |
+
/* Match textboxes with main background */
|
52 |
textarea, input[type="text"] {
|
53 |
background-color: #1f1f1f !important;
|
54 |
border: 1px solid rgba(255,255,255,0.2) !important;
|
|
|
60 |
with gr.Blocks(css=CSS, theme="default") as demo:
|
61 |
with gr.Row(equal_height=True):
|
62 |
with gr.Column(scale=1):
|
63 |
+
with gr.Box(elem_classes="sidebar-box"):
|
64 |
+
gr.Markdown("""
|
65 |
+
## 🛡️ Arabic Content Safety Analyzer
|
66 |
|
67 |
+
**Purpose**
|
68 |
+
Analyze Arabic text for harmful or threatening language.
|
69 |
|
70 |
+
**Features**
|
71 |
+
- **Hate Speech Classification** (Offensive, Racism, Sexism, Religious Discrimination)
|
72 |
+
- **Dialect Detection** (Gulf, Levant, Egyptian, MSA)
|
73 |
+
- **Threat Severity Score** (0–1 based on label + confidence)
|
74 |
+
- **Recommended Action** (rule-based suggestion)
|
75 |
|
76 |
+
**How to Use:**
|
77 |
+
1. Enter Arabic text in the box.
|
78 |
+
2. Click **Analyze**.
|
79 |
+
3. Review the results and suggested action.
|
|
|
80 |
|
81 |
with gr.Column(scale=3):
|
82 |
gr.Markdown("### Enter Arabic Text for Analysis")
|
|
|
97 |
)
|
98 |
|
99 |
if __name__ == "__main__":
|
100 |
+
demo.launch()
|