steevshaji123 commited on
Commit
5489a32
·
verified ·
1 Parent(s): 393c801

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -1,19 +1,20 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
 
4
  sentiment_pipeline = pipeline("sentiment-analysis")
 
5
  def get_sentiment(input_text):
6
- result = sentiment_pipleline(input_text)
7
  return result[0]['label']
8
 
9
-
10
- #Launch the web UI
11
  iface = gr.Interface(
12
- fn = get_sentiment,
13
- inputs = 'text',
14
- outputs = "text",
15
- title = "My First AI App",
16
- description = "Enter some text and i will tell you wheather it is positive or negative"
17
  )
18
- iface.launch()
19
 
 
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # Initialize the sentiment analysis pipeline
5
  sentiment_pipeline = pipeline("sentiment-analysis")
6
+
7
  def get_sentiment(input_text):
8
+ result = sentiment_pipeline(input_text) # fixed typo
9
  return result[0]['label']
10
 
11
+ # Launch the web UI
 
12
  iface = gr.Interface(
13
+ fn=get_sentiment,
14
+ inputs='text',
15
+ outputs='text',
16
+ title="My First AI App",
17
+ description="Enter some text and I will tell you whether it is positive or negative"
18
  )
 
19
 
20
+ iface.launch()