Gilvan commited on
Commit
6b358d7
·
verified ·
1 Parent(s): 8e84963

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -14,7 +14,8 @@ pipe = pipeline(
14
  )
15
 
16
  # Define custom labels for classification
17
- pipe.model.config.id2label = {0: 'greeting', 1: 'farewell', 2: 'other'}
 
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="Enter Text"), # Textbox input for user
28
- outputs=gr.Label(label="Classification"), # Output label showing classification
29
- title="Text Classifier", # Title of the app
30
- description="Classify your text as 'greeting', 'farewell', or 'other'." # Description of the app
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