Spaces:
Running
Running
Commit
•
5821aac
1
Parent(s):
e5d9d12
change topik into static
Browse files- app/main.py +1 -1
- db/data.json +14 -20
app/main.py
CHANGED
@@ -90,7 +90,7 @@ async def upload_csv(
|
|
90 |
berita_db.add({"berita": berita_dict})
|
91 |
|
92 |
response = {
|
93 |
-
'topik':
|
94 |
'positif': len(df[df['sentiment'] == 1]),
|
95 |
'netral': len(df[df['sentiment'] == 0]),
|
96 |
'negatif': len(df[df['sentiment'] == -1]),
|
|
|
90 |
berita_db.add({"berita": berita_dict})
|
91 |
|
92 |
response = {
|
93 |
+
'topik': ["banjir", "PPDB", "sampah", "pemkot", "tambang"],
|
94 |
'positif': len(df[df['sentiment'] == 1]),
|
95 |
'netral': len(df[df['sentiment'] == 0]),
|
96 |
'negatif': len(df[df['sentiment'] == -1]),
|
db/data.json
CHANGED
@@ -1,21 +1,15 @@
|
|
1 |
{
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
"csv_url": "http://127.0.0.1:8000/static/csv/berita.csv",
|
17 |
-
"tanggal": "21 Juni 2024 - 27 Juni 2024",
|
18 |
-
"id": 168442591905113307
|
19 |
-
}
|
20 |
-
]
|
21 |
-
}
|
|
|
1 |
{
|
2 |
+
"data": [
|
3 |
+
{
|
4 |
+
"topik": ["banjir", "PPDB", "sampah", "pemkot", "tambang"],
|
5 |
+
"positif": 19,
|
6 |
+
"netral": 8,
|
7 |
+
"negatif": 34,
|
8 |
+
"total": 61,
|
9 |
+
"word_cloud": "http://127.0.0.1:8000/static/wordcloud/wordcloud.svg",
|
10 |
+
"csv_url": "http://127.0.0.1:8000/static/csv/berita.csv",
|
11 |
+
"tanggal": "21 Juni 2024 - 27 Juni 2024",
|
12 |
+
"id": 168442591905113307
|
13 |
+
}
|
14 |
+
]
|
15 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|