File size: 448 Bytes
2ef9bf7
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr

from sentiment_tools import analyze_sentiment

demo = gr.Interface(fn=analyze_sentiment, 
                 inputs=gr.Textbox(placeholder="Enter text to analyze..."), 
                 outputs=gr.JSON(),
                 title="Sentiment Analysis",
                 description="Enter text to analyze its sentiment.")
if __name__ == "__main__":
    # Launch the Gradio UI for sentiment analysis
    demo.launch(mcp_server=True)