Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from textblob import TextBlob
|
| 3 |
+
|
| 4 |
+
def sentiment_analysis(text):
|
| 5 |
+
p = TextBlob(text).sentiment.polarity
|
| 6 |
+
return "Positive" if p > 0 else "Negative" if p < 0 else "Neutral"
|
| 7 |
+
|
| 8 |
+
gr.Interface(sentiment_analysis,"text", "text").launch(ssr_mode=False)
|