Spaces:
Runtime error
Runtime error
Commit
·
d961c51
1
Parent(s):
a60235f
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,12 @@ sentiment = pipeline(
|
|
| 12 |
)
|
| 13 |
|
| 14 |
examples = [
|
| 15 |
-
"
|
| 16 |
]
|
| 17 |
|
| 18 |
def sentiment_analysis(text):
|
| 19 |
output = sentiment(text)
|
| 20 |
-
return output[0]
|
| 21 |
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=sentiment_analysis,
|
|
|
|
| 12 |
)
|
| 13 |
|
| 14 |
examples = [
|
| 15 |
+
"Masyarakat sangat kecewa dengan tragedi Kanjuruhan",
|
| 16 |
]
|
| 17 |
|
| 18 |
def sentiment_analysis(text):
|
| 19 |
output = sentiment(text)
|
| 20 |
+
return {elm["label"]: elm["score"] for elm in output[0]}
|
| 21 |
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=sentiment_analysis,
|