Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,33 +41,17 @@ def get_nlp(model_name: str):
|
|
| 41 |
|
| 42 |
# Enhanced label mapping with modern styling for dark blue theme
|
| 43 |
LABEL_MAPPINGS = {
|
| 44 |
-
#
|
| 45 |
-
"
|
| 46 |
-
"
|
| 47 |
-
"
|
| 48 |
-
"
|
| 49 |
-
"LABEL_4": {"code": 4, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 50 |
-
"LABEL_5": {"code": 5, "name": "very positive", "emoji": "🤩", "color": "#22c55e", "bg": "rgba(34, 197, 94, 0.2)", "description": "เชิงบวกมาก"},
|
| 51 |
|
| 52 |
-
#
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
"POSITIVE": {"code": 4, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 58 |
-
"VERY_POSITIVE": {"code": 5, "name": "very positive", "emoji": "🤩", "color": "#22c55e", "bg": "rgba(34, 197, 94, 0.2)", "description": "เชิงบวกมาก"},
|
| 59 |
-
|
| 60 |
-
# Mappings สำหรับรหัสตัวเลข (ถ้าจำเป็นต้องแปลงจาก 0, 1, 2, ... เป็นชื่อ)
|
| 61 |
-
"0": {"code": 0, "name": "question", "emoji": "🤔", "color": "#60a5fa", "bg": "rgba(96, 165, 250, 0.2)", "description": "คำถาม"},
|
| 62 |
-
"1": {"code": 1, "name": "very negative", "emoji": "😡", "color": "#ef4444", "bg": "rgba(239, 68, 68, 0.2)", "description": "เชิงลบมาก"},
|
| 63 |
-
"2": {"code": 2, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
| 64 |
-
"3": {"code": 3, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
| 65 |
-
"4": {"code": 4, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 66 |
-
"5": {"code": 5, "name": "very positive", "emoji": "🤩", "color": "#22c55e", "bg": "rgba(34, 197, 94, 0.2)", "description": "เชิงบวกมาก"},
|
| 67 |
-
|
| 68 |
-
"0": {"code": 0, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
| 69 |
-
"1": {"code": 1, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
| 70 |
-
"2": {"code": 2, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 71 |
}
|
| 72 |
|
| 73 |
def get_label_info(label: str) -> Dict:
|
|
|
|
| 41 |
|
| 42 |
# Enhanced label mapping with modern styling for dark blue theme
|
| 43 |
LABEL_MAPPINGS = {
|
| 44 |
+
"LABEL_0": {"code": 0, "name": "very negative", "emoji": "😡", "color": "#ef4444", "bg": "rgba(239, 68, 68, 0.2)", "description": "เชิงลบมาก"},
|
| 45 |
+
"LABEL_1": {"code": 1, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
| 46 |
+
"LABEL_2": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
| 47 |
+
"LABEL_3": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 48 |
+
"LABEL_4": {"code": 4, "name": "very positive", "emoji": "🤩", "color": "#22c55e", "bg": "rgba(34, 197, 94, 0.2)", "description": "เชิงบวกมาก"},
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
"0": {"code": 0, "name": "very negative", "emoji": "😡", "color": "#ef4444", "bg": "rgba(239, 68, 68, 0.2)", "description": "เชิงลบมาก"},
|
| 51 |
+
"1": {"code": 1, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
| 52 |
+
"2": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
| 53 |
+
"3": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
| 54 |
+
"4": {"code": 4, "name": "very positive", "emoji": "🤩", "color": "#22c55e", "bg": "rgba(34, 197, 94, 0.2)", "description": "เชิงบวกมาก"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
|
| 57 |
def get_label_info(label: str) -> Dict:
|