Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,6 @@ MODEL_LIST = [
|
|
24 |
("ZombitX64/Sentiment-02", "🔬 Sentiment v2"),
|
25 |
("ZombitX64/Sentiment-03", "🔬 Sentiment v3"),
|
26 |
("ZombitX64/sentiment-103", "🔬 Sentiment 103"),
|
27 |
-
("nlptown/bert-base-multilingual-uncased-sentiment", "🌍 BERT Multilingual"),
|
28 |
-
("ZombitX64/sentimentv2","🔍 sentimentv2")
|
29 |
]
|
30 |
|
31 |
# Cache for model loading
|
@@ -44,12 +42,17 @@ LABEL_MAPPINGS = {
|
|
44 |
"LABEL_2": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
45 |
"LABEL_3": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
46 |
|
|
|
|
|
|
|
|
|
47 |
"POSITIVE": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
48 |
"NEGATIVE": {"code": 1, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
49 |
"NEUTRAL": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
50 |
|
51 |
-
"
|
52 |
-
"
|
|
|
53 |
}
|
54 |
|
55 |
def get_label_info(label: str) -> Dict:
|
|
|
24 |
("ZombitX64/Sentiment-02", "🔬 Sentiment v2"),
|
25 |
("ZombitX64/Sentiment-03", "🔬 Sentiment v3"),
|
26 |
("ZombitX64/sentiment-103", "🔬 Sentiment 103"),
|
|
|
|
|
27 |
]
|
28 |
|
29 |
# Cache for model loading
|
|
|
42 |
"LABEL_2": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
43 |
"LABEL_3": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
44 |
|
45 |
+
"0": {"code": 1, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
46 |
+
"1": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
47 |
+
"2": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
48 |
+
|
49 |
"POSITIVE": {"code": 3, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
50 |
"NEGATIVE": {"code": 1, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
51 |
"NEUTRAL": {"code": 2, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
52 |
|
53 |
+
"neg": {"code": 2, "name": "negative", "emoji": "😢", "color": "#f87171", "bg": "rgba(248, 113, 113, 0.2)", "description": "เชิงลบ"},
|
54 |
+
"neu": {"code": 1, "name": "neutral", "emoji": "😐", "color": "#facc15", "bg": "rgba(250, 204, 21, 0.2)", "description": "เป็นกลาง"},
|
55 |
+
"pos": {"code": 0, "name": "positive", "emoji": "😊", "color": "#34d399", "bg": "rgba(52, 211, 153, 0.2)", "description": "เชิงบวก"},
|
56 |
}
|
57 |
|
58 |
def get_label_info(label: str) -> Dict:
|