Suhani0409 commited on
Commit
c09799d
·
verified ·
1 Parent(s): d1c50ff

create.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load sentiment model
5
+ classifier = pipeline("sentiment-analysis")
6
+
7
+ def analyze_sentiment(text):
8
+ result = classifier(text)
9
+ return result[0]
10
+
11
+ interface = gr.Interface(
12
+ fn=analyze_sentiment,
13
+ inputs="text",
14
+ outputs="label",
15
+ title="Sentiment Analysis App",
16
+ description="Analyze sentiment using Hugging Face model"
17
+ )
18
+
19
+ interface.launch()