Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,4 +10,13 @@ def predict(text):
|
|
| 10 |
features = vectorizer.transform([text])
|
| 11 |
return str(model.predict(features)[0])
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
features = vectorizer.transform([text])
|
| 11 |
return str(model.predict(features)[0])
|
| 12 |
|
| 13 |
+
demo = gr.Interface(
|
| 14 |
+
fn=predict,
|
| 15 |
+
inputs=gr.Textbox(lines=3, placeholder="Unesi tekst...", label="Text"),
|
| 16 |
+
outputs=gr.Label(num_top_classes=1, label="Sentiment"),
|
| 17 |
+
title="Sentiment Analysis (SVM, TF-IDF)",
|
| 18 |
+
description="Five-class sentiment: mixed, negative, neutral, positive, sarcastic.",
|
| 19 |
+
examples=["Volim kavu", "Ovaj doktor je loš", "Dan je bio ok"],
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
demo.launch()
|