usamaijaz-ai commited on
Commit
6e7344a
·
1 Parent(s): c8c0038

added readme file

Browse files
Files changed (1) hide show
  1. README.md +68 -10
README.md CHANGED
@@ -1,13 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: Accent Classifier
3
- emoji: 🌖
4
- colorFrom: purple
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 5.29.0
8
- app_file: app.py
9
- pinned: false
10
- short_description: classifies the accents in an audio file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Accent Classifier + Speech Transcriber
2
+
3
+ This Gradio app allows you to:
4
+
5
+ - Upload or link to audio/video files
6
+ - Automatically transcribe the speech (via OpenAI Whisper)
7
+ - Detect the speaker's accent (28-class Wav2Vec2 model)
8
+ - View a top-5 ranked list of likely accents with confidence scores
9
+
10
+ ---
11
+
12
+ ## How to Use
13
+
14
+ Option 1: Upload an audio file
15
+ - Supported formats: .mp3, .wav
16
+
17
+ Option 2: Upload a video file
18
+ - Supported format: .mp4 (audio will be extracted automatically)
19
+
20
+ Option 3: Paste a direct .mp4 video URL
21
+ - Must be a direct video file URL (not a webpage)
22
+ - Example: a file hosted on archive.org or a CDN
23
+
24
+ ---
25
+
26
+
27
+ ## Not Supported
28
+
29
+ - Loom, YouTube, Dropbox, or other webpage links (they don't serve real video files)
30
+ - Download the video manually and upload it if needed
31
+
32
  ---
33
+
34
+ ## Models Used
35
+
36
+ Transcription:
37
+ - openai/whisper-tiny: https://huggingface.co/openai/whisper-tiny
38
+
39
+ Accent Classification:
40
+ - ylacombe/accent-classifier: https://huggingface.co/ylacombe/accent-classifier
41
+
42
+ ---
43
+
44
+ ## Dependencies
45
+
46
+ Handled automatically in Hugging Face Spaces.
47
+ For local testing:
48
+
49
+ pip install gradio transformers torch moviepy requests safetensors soundfile scipy
50
+
51
+ You must also install ffmpeg:
52
+
53
+ - macOS: brew install ffmpeg
54
+ - Ubuntu: sudo apt install ffmpeg
55
+ - Windows: Download from https://ffmpeg.org/
56
+
57
  ---
58
 
59
+ ## How It Works
60
+
61
+ 1. Audio is extracted (if input is a video)
62
+ 2. Audio is converted to .wav and resampled to 16kHz
63
+ 3. Speech is transcribed using Whisper
64
+ 4. Accent is classified using a Wav2Vec2 model
65
+ 5. Output includes:
66
+ - Top accent prediction
67
+ - Confidence score
68
+ - Top-5 accent list
69
+ - Full transcription
70
+
71
+ ---