mskov commited on
Commit
184643c
1 Parent(s): 5e7d9cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -88,10 +88,10 @@ def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, expli
88
  # classification_output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
89
  classification_output = text_classifier(sequence_to_classify, candidate_labels, multi_label=True)
90
  print("class output ", type(classification_output))
91
- classification_df = pd.DataFrame.from_dict(classification_output)
92
- print("df ", classification_df.columns)
93
 
94
- plot.update(x=classification_df["labels"], y=classification_df["scores"])
95
 
96
  return toxicity_score, classification_df, transcribed_text
97
  # return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
@@ -140,7 +140,7 @@ with gr.Blocks() as iface:
140
  submit_btn = gr.Button(label="Run")
141
  with gr.Column():
142
  out_val = gr.Textbox()
143
- plot = gr.BarPlot()
144
  out_text = gr.Textbox()
145
  submit_btn.click(fn=classify_toxicity, inputs=[aud_input, text, anxiety_class, emo_class, explit_preference], outputs=[out_val, plot, out_text])
146
 
 
88
  # classification_output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
89
  classification_output = text_classifier(sequence_to_classify, candidate_labels, multi_label=True)
90
  print("class output ", type(classification_output))
91
+ # classification_df = pd.DataFrame.from_dict(classification_output)
92
+ # print("df ", classification_df.columns)
93
 
94
+ # plot.update(x=classification_df["labels"], y=classification_df["scores"])
95
 
96
  return toxicity_score, classification_df, transcribed_text
97
  # return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
 
140
  submit_btn = gr.Button(label="Run")
141
  with gr.Column():
142
  out_val = gr.Textbox()
143
+ plot = gr.Label()
144
  out_text = gr.Textbox()
145
  submit_btn.click(fn=classify_toxicity, inputs=[aud_input, text, anxiety_class, emo_class, explit_preference], outputs=[out_val, plot, out_text])
146