File size: 330 Bytes
3fe2828
97cbec3
 
 
3fe2828
 
97cbec3
 
3fe2828
 
97cbec3
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

analyzer = SentimentIntensityAnalyzer()

def analyze_sentiment(text):
    sentiment = analyzer.polarity_scores(text)
    return sentiment

iface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs=["json"], live=True)
iface.launch()