Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ arabic_sentiment_model = pipeline("text-classification", model="CAMeL-Lab/bert-b
|
|
9 |
arabic_labels = {
|
10 |
"positive": "إيجابي",
|
11 |
"negative": "سلبي",
|
12 |
-
"neutral": "محايد"
|
13 |
}
|
14 |
|
15 |
def analyze_sentiment(text, language):
|
@@ -22,7 +22,7 @@ def analyze_sentiment(text, language):
|
|
22 |
arabic_label = arabic_labels.get(label, "غير معروف") # Default to "Unknown" if label not found
|
23 |
return arabic_label, result[0]['score']
|
24 |
|
25 |
-
#
|
26 |
css = """
|
27 |
body {
|
28 |
background-color: #f4f7f6;
|
@@ -49,10 +49,6 @@ input, select, textarea {
|
|
49 |
button {
|
50 |
background-color: #3e606f;
|
51 |
color: white;
|
52 |
-
border: none;
|
53 |
-
border-radius: 5px;
|
54 |
-
padding: 10px 15px;
|
55 |
-
cursor: pointer;
|
56 |
}
|
57 |
|
58 |
button:hover {
|
@@ -83,7 +79,7 @@ iface = gr.Interface(
|
|
83 |
["أنا سعيد جدًا بهذا!", "Arabic"],
|
84 |
["هذا المكان سيء للغاية.", "Arabic"]
|
85 |
],
|
86 |
-
css=css
|
87 |
)
|
88 |
|
89 |
iface.launch()
|
|
|
9 |
arabic_labels = {
|
10 |
"positive": "إيجابي",
|
11 |
"negative": "سلبي",
|
12 |
+
"neutral": "محايد"
|
13 |
}
|
14 |
|
15 |
def analyze_sentiment(text, language):
|
|
|
22 |
arabic_label = arabic_labels.get(label, "غير معروف") # Default to "Unknown" if label not found
|
23 |
return arabic_label, result[0]['score']
|
24 |
|
25 |
+
# custom CSS
|
26 |
css = """
|
27 |
body {
|
28 |
background-color: #f4f7f6;
|
|
|
49 |
button {
|
50 |
background-color: #3e606f;
|
51 |
color: white;
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
button:hover {
|
|
|
79 |
["أنا سعيد جدًا بهذا!", "Arabic"],
|
80 |
["هذا المكان سيء للغاية.", "Arabic"]
|
81 |
],
|
82 |
+
css=css
|
83 |
)
|
84 |
|
85 |
iface.launch()
|