suinY00N commited on
Commit
e57ecae
โ€ข
1 Parent(s): 5239a8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -8,17 +8,14 @@ sentiment_analysis = pipeline("sentiment-analysis")
8
 
9
  def get_sentiment(text):
10
  # Perform sentiment analysis on the input text
11
- result = sentiment_analysis(text)
12
- # Format the result to display it nicely
13
- formatted_result = f"Label: {result[0]['label']}, Score: {result[0]['score']:.4f}"
14
- return formatted_result
15
 
16
  # Define the Gradio interface
17
  interface = gr.Interface(
18
  fn=get_sentiment, # function to call
19
  inputs=gr.inputs.Textbox(lines=2, placeholder="์—ฌ๊ธฐ์— ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”..."), # input component
20
  outputs="text", # output component
21
- title="Text Sentiment Analysis", # title of the interface
22
  description="This app analyzes the sentiment of input text. Enter text to see if it's positive or negative." # description
23
  )
24
 
 
8
 
9
  def get_sentiment(text):
10
  # Perform sentiment analysis on the input text
11
+ return sentiment_analysis(text)
 
 
 
12
 
13
  # Define the Gradio interface
14
  interface = gr.Interface(
15
  fn=get_sentiment, # function to call
16
  inputs=gr.inputs.Textbox(lines=2, placeholder="์—ฌ๊ธฐ์— ํ…์ŠคํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”..."), # input component
17
  outputs="text", # output component
18
+ title="Sentiment Analysis", # title of the interface
19
  description="This app analyzes the sentiment of input text. Enter text to see if it's positive or negative." # description
20
  )
21