Spaces:
Running
Running
Upload 4 files
Browse files
app.py
CHANGED
|
@@ -5,17 +5,17 @@ from fastapi import FastAPI, HTTPException, Request
|
|
| 5 |
from pydantic import BaseModel
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
-
MODEL_NAME = "
|
| 9 |
API_KEY = os.getenv("API_KEY")
|
| 10 |
|
| 11 |
-
# Label mapping —
|
| 12 |
LABEL_MAP = {
|
| 13 |
-
"positive": "positive",
|
| 14 |
-
"neutral": "neutral",
|
| 15 |
-
"negative": "negative",
|
| 16 |
"label_0": "positive",
|
| 17 |
"label_1": "neutral",
|
| 18 |
"label_2": "negative",
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
classifier = None
|
|
|
|
| 5 |
from pydantic import BaseModel
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
+
MODEL_NAME = "ihsan31415/indo-roBERTa-financial-sentiment"
|
| 9 |
API_KEY = os.getenv("API_KEY")
|
| 10 |
|
| 11 |
+
# Label mapping — flipped: 0=Positive, 1=Neutral, 2=Negative
|
| 12 |
LABEL_MAP = {
|
|
|
|
|
|
|
|
|
|
| 13 |
"label_0": "positive",
|
| 14 |
"label_1": "neutral",
|
| 15 |
"label_2": "negative",
|
| 16 |
+
"positive": "positive",
|
| 17 |
+
"neutral": "neutral",
|
| 18 |
+
"negative": "negative",
|
| 19 |
}
|
| 20 |
|
| 21 |
classifier = None
|