DrishtiSharma
commited on
Commit
·
c6bdae3
1
Parent(s):
e62fbf9
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):
|
@@ -30,7 +30,7 @@ def predict_and_ctc_lm_decode(input_file):
|
|
30 |
description = """ This is a Gradio demo for Spanish audio transcription-based harassment detection. To use this, simply provide an audio input (audio recording or via microphone), which will subsequently be transcribed and classified as Harassment/non-harassment pertaining to audio (transcription) with the help of pre-trained models.
|
31 |
|
32 |
|
33 |
-
Pre-trained model used for Spanish ASR: [jonatasgrosman/wav2vec2-
|
34 |
|
35 |
|
36 |
Pre-trained model used for translating Spanish audio transcription to the Nahuatl language: [hackathon-pln-es/Detect-Acoso-Twitter-Es](https://huggingface.co/hackathon-pln-es/Detect-Acoso-Twitter-Es)"""
|
|
|
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):
|
|
|
30 |
description = """ This is a Gradio demo for Spanish audio transcription-based harassment detection. To use this, simply provide an audio input (audio recording or via microphone), which will subsequently be transcribed and classified as Harassment/non-harassment pertaining to audio (transcription) with the help of pre-trained models.
|
31 |
|
32 |
|
33 |
+
Pre-trained model used for Spanish ASR: [jonatasgrosman/wav2vec2-xls-r-1b-spanish](https://huggingface.co/jonatasgrosman/wav2vec2-xls-r-1b-spanish)
|
34 |
|
35 |
|
36 |
Pre-trained model used for translating Spanish audio transcription to the Nahuatl language: [hackathon-pln-es/Detect-Acoso-Twitter-Es](https://huggingface.co/hackathon-pln-es/Detect-Acoso-Twitter-Es)"""
|