DrishtiSharma
commited on
Commit
•
e9269c8
1
Parent(s):
8314c44
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,10 @@ def load_and_fix_data(input_file, model_sampling_rate):
|
|
12 |
return speech
|
13 |
|
14 |
|
15 |
-
feature_extractor = AutoFeatureExtractor.from_pretrained("jonatasgrosman/wav2vec2-
|
16 |
sampling_rate = feature_extractor.sampling_rate
|
17 |
|
18 |
-
asr = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-
|
19 |
|
20 |
|
21 |
def predict_and_ctc_lm_decode(input_file):
|
@@ -26,6 +26,18 @@ def predict_and_ctc_lm_decode(input_file):
|
|
26 |
|
27 |
return sexism_detection
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
gr.Interface(
|
31 |
predict_and_ctc_lm_decode,
|
|
|
12 |
return speech
|
13 |
|
14 |
|
15 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("jonatasgrosman/wav2vec2-xls-r-1b-spanish")
|
16 |
sampling_rate = feature_extractor.sampling_rate
|
17 |
|
18 |
+
asr = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-xls-r-1b-spanish")
|
19 |
|
20 |
|
21 |
def predict_and_ctc_lm_decode(input_file):
|
|
|
26 |
|
27 |
return sexism_detection
|
28 |
|
29 |
+
description = """ This is a Gradio demo for Spanish audio transcription-based Sexism detection. To use this, simply provide an audio input (audio recording or via microphone), which will subsequently be transcribed and classified as sexism/non-sexism pertaining to audio (transcription) with the help of pre-trained models.
|
30 |
+
|
31 |
+
|
32 |
+
**NOTE: LABEL_0: "NON SEXISM" or LABEL_1: "SEXISM"**
|
33 |
+
|
34 |
+
|
35 |
+
Pre-trained Model used for Spanish ASR: [jonatasgrosman/wav2vec2-xls-r-1b-spanish](https://huggingface.co/jonatasgrosman/wav2vec2-xls-r-1b-spanish)
|
36 |
+
|
37 |
+
Pre-trained Model used for Sexism Detection : [hackathon-pln-es/twitter_sexismo-finetuned-robertuito-exist2021](https://huggingface.co/hackathon-pln-es/twitter_sexismo-finetuned-robertuito-exist2021)
|
38 |
+
|
39 |
+
"""
|
40 |
+
|
41 |
|
42 |
gr.Interface(
|
43 |
predict_and_ctc_lm_decode,
|