Spaces:
Runtime error
Runtime error
swastikanata
commited on
Commit
•
a5faac0
1
Parent(s):
279fd64
Update app.py
Browse files
app.py
CHANGED
@@ -40,11 +40,19 @@ def get_sentiment(input_text):
|
|
40 |
res = query({"inputs": clean_tweet(input_text)})
|
41 |
formatted_output = format_sentiment(res[0])
|
42 |
return formatted_output
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
iface.launch(inline = False)
|
|
|
40 |
res = query({"inputs": clean_tweet(input_text)})
|
41 |
formatted_output = format_sentiment(res[0])
|
42 |
return formatted_output
|
43 |
+
|
44 |
+
examples = list()
|
45 |
+
examples.append("Semoga saja pelayanan BPJS ke depannya semakin baik. #BPJSKesehatan #TerimaKasihBPJS #BPJSMelayani https://t.co/iDETFSXFJR")
|
46 |
+
examples.append("min ini mau bayar ko ga bisa yaa m banking sama shopee nya kenapa. Help min udah tenggat nih")
|
47 |
+
examples.append("Kenaikan harga bpjs yg makin mahal bikin rakyat jadi tambah sengsara pak!")
|
48 |
+
|
49 |
+
iface = gr.Interface(
|
50 |
+
fn = get_sentiment,
|
51 |
+
inputs = 'text',
|
52 |
+
outputs = ['label'],
|
53 |
+
title = 'Analisis Sentimen Twitter',
|
54 |
+
description="Dapatkan sentimen positif, negatif, atau netral untuk tweet yang dimasukkan.",
|
55 |
+
examples=examples
|
56 |
+
)
|
57 |
|
58 |
iface.launch(inline = False)
|