DrishtiSharma
commited on
Commit
•
94e7f78
1
Parent(s):
ada522a
Update app.py
Browse files
app.py
CHANGED
@@ -28,14 +28,14 @@ def speech_to_text(input_file):
|
|
28 |
return transcribed_text
|
29 |
|
30 |
#Defining a function for sexism detection
|
31 |
-
def
|
32 |
sexism_detection = classifier(transcribed_text)[0]["label"]
|
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 =
|
39 |
if sexism_detection == "LABEL_0":
|
40 |
return "The input audio contains NON-SEXIST language"
|
41 |
else:
|
|
|
28 |
return transcribed_text
|
29 |
|
30 |
#Defining a function for sexism detection
|
31 |
+
def sexism_detector(transcribed_text):
|
32 |
sexism_detection = classifier(transcribed_text)[0]["label"]
|
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:
|