Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,8 @@ pipe = pipeline(
|
|
14 |
)
|
15 |
|
16 |
# Define custom labels for classification
|
17 |
-
pipe.model.config.id2label = {0: '
|
|
|
18 |
|
19 |
# Function to classify input text
|
20 |
def classify_text(text):
|
@@ -24,10 +25,10 @@ def classify_text(text):
|
|
24 |
# Create Gradio interface
|
25 |
iface = gr.Interface(
|
26 |
fn=classify_text, # Function to be called
|
27 |
-
inputs=gr.Textbox(label="
|
28 |
-
outputs=gr.Label(label="
|
29 |
-
title="
|
30 |
-
description="
|
31 |
)
|
32 |
|
33 |
# Launch the Gradio app
|
|
|
14 |
)
|
15 |
|
16 |
# Define custom labels for classification
|
17 |
+
pipe.model.config.id2label = {0: 'saudação', 1: 'fim de conversa', 2: 'outro'}
|
18 |
+
pipe.model.config.label2id = {'saudação': 0, 'fim de conversa': 1, 'outro': 2}
|
19 |
|
20 |
# Function to classify input text
|
21 |
def classify_text(text):
|
|
|
25 |
# Create Gradio interface
|
26 |
iface = gr.Interface(
|
27 |
fn=classify_text, # Function to be called
|
28 |
+
inputs=gr.Textbox(label="Digite o texto"), # Textbox input for user
|
29 |
+
outputs=gr.Label(label="Classificação"), # Output label showing classification
|
30 |
+
title="Classificação Textual", # Title of the app
|
31 |
+
description="Classifique seu texto como 'saudação', 'fim de conversa', ou 'outro'." # Description of the app
|
32 |
)
|
33 |
|
34 |
# Launch the Gradio app
|