DrishtiSharma commited on
Commit
2d1e119
1 Parent(s): 94e7f78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -33,13 +33,14 @@ def sexism_detector(transcribed_text):
33
  return sexism_detection
34
 
35
  #Defining a function which will output Spanish audio transcription and the detected sentiment
 
36
  def asr_and_sexism_detection(input_file):
37
  transcribed_text = speech_to_text(input_file)
38
  sexism_detection = sexism_detector(transcribed_text)
39
  if sexism_detection == "LABEL_0":
40
- return "The input audio contains NON-SEXIST language"
41
  else:
42
- return "SEXIST LANGUAGE DETECTED"
43
 
44
 
45
  inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record your audio")]
 
33
  return sexism_detection
34
 
35
  #Defining a function which will output Spanish audio transcription and the detected sentiment
36
+ new_line = "\n\n\n"
37
  def asr_and_sexism_detection(input_file):
38
  transcribed_text = speech_to_text(input_file)
39
  sexism_detection = sexism_detector(transcribed_text)
40
  if sexism_detection == "LABEL_0":
41
+ return f"Audio Transcription : {transcribed_text} {new_line} Sexism Detector Output: The input audio contains NON-SEXIST language"
42
  else:
43
+ return f"Audio Transcription : {transcribed_text} {new_line} Sexism Detector Output: SEXIST LANGUAGE DETECTED"
44
 
45
 
46
  inputs=[gr.inputs.Audio(source="microphone", type="filepath", label="Record your audio")]