mskov commited on
Commit
1ff03d5
·
1 Parent(s): b44113d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -27,11 +27,14 @@ def classify_toxicity(audio_file, text_input, selected_model):
27
 
28
  # Load the selected toxicity classification model
29
  toxicity_module = evaluate.load("toxicity", selected_model)
 
 
30
  toxicity_results = toxicity_module.compute(predictions=[transcribed_text])
31
 
32
  toxicity_score = toxicity_results["toxicity"][0]
 
33
 
34
- return transcribed_text, f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
35
 
36
  iface = gr.Interface(
37
  fn=classify_toxicity,
 
27
 
28
  # Load the selected toxicity classification model
29
  toxicity_module = evaluate.load("toxicity", selected_model)
30
+ # toxicity = evaluate.load("toxicity", 'DaNLP/da-electra-hatespeech-detection', module_type="measurement",)
31
+
32
  toxicity_results = toxicity_module.compute(predictions=[transcribed_text])
33
 
34
  toxicity_score = toxicity_results["toxicity"][0]
35
+ print(toxicity_score)
36
 
37
+ return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
38
 
39
  iface = gr.Interface(
40
  fn=classify_toxicity,