calvin-vin commited on
Commit
5821aac
1 Parent(s): e5d9d12

change topik into static

Browse files
Files changed (2) hide show
  1. app/main.py +1 -1
  2. 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': 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
- "data": [
3
- {
4
- "topik": [
5
- "sampah",
6
- "banjir",
7
- "pemkot",
8
- "kota",
9
- "bersih"
10
- ],
11
- "positif": 19,
12
- "netral": 8,
13
- "negatif": 34,
14
- "total": 61,
15
- "word_cloud": "http://127.0.0.1:8000/static/wordcloud/wordcloud.svg",
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
+ }