Update app.py
Browse files
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 |
-
|
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="
|
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 |
|