Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ tokenizer = BertTokenizer.from_pretrained('ProsusAI/finbert')
|
|
8 |
# Load pre-trained model
|
9 |
model = BertForSequenceClassification.from_pretrained('ProsusAI/finbert')
|
10 |
|
11 |
-
def
|
12 |
# Encode the text
|
13 |
tokens = tokenizer.encode_plus(sec_text, add_special_tokens=True, return_tensors="pt")
|
14 |
|
@@ -26,7 +26,7 @@ def analyze_sentiment(sec_text):
|
|
26 |
|
27 |
# Define the Gradio interface
|
28 |
gr_interface = gr.Interface(
|
29 |
-
fn=
|
30 |
inputs=gr.Textbox(lines=1, placeholder="..."),
|
31 |
outputs="text",
|
32 |
title="Sentiment Analysis"
|
|
|
8 |
# Load pre-trained model
|
9 |
model = BertForSequenceClassification.from_pretrained('ProsusAI/finbert')
|
10 |
|
11 |
+
def get_sentiment(입력):
|
12 |
# Encode the text
|
13 |
tokens = tokenizer.encode_plus(sec_text, add_special_tokens=True, return_tensors="pt")
|
14 |
|
|
|
26 |
|
27 |
# Define the Gradio interface
|
28 |
gr_interface = gr.Interface(
|
29 |
+
fn=get_sentiment,
|
30 |
inputs=gr.Textbox(lines=1, placeholder="..."),
|
31 |
outputs="text",
|
32 |
title="Sentiment Analysis"
|