Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,13 +1,100 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Overview
|
2 |
+
|
3 |
+
This web app uses Gradio and Hugging Face Transformers to classify English accents from audio samples.
|
4 |
+
|
5 |
+
Upload or record English speech, and the app predicts the speaker’s accent from:
|
6 |
+
|
7 |
+
American
|
8 |
+
|
9 |
+
British
|
10 |
+
|
11 |
+
Indian
|
12 |
+
|
13 |
+
African
|
14 |
+
|
15 |
+
Australian
|
16 |
+
|
17 |
+
Results are displayed in a clear, color-coded table showing confidence percentages, highlighting the top predicted accent.
|
18 |
+
|
19 |
+
Demo
|
20 |
+
Try the live app on Hugging Face Spaces:
|
21 |
+
|
22 |
+
(Replace the URL above with your actual Space URL after deployment.)
|
23 |
+
|
24 |
+
Installation
|
25 |
+
Clone the repo and install dependencies:
|
26 |
+
|
27 |
+
bash
|
28 |
+
git clone https://github.com/your-username/english-accent-classifier.git
|
29 |
+
cd english-accent-classifier
|
30 |
+
|
31 |
+
# Optional: create and activate virtual environment
|
32 |
+
python -m venv venv
|
33 |
+
# On Linux/macOS:
|
34 |
+
source venv/bin/activate
|
35 |
+
# On Windows:
|
36 |
+
venv\Scripts\activate
|
37 |
+
|
38 |
+
pip install -r requirements.txt
|
39 |
+
If requirements.txt is not included, install manually:
|
40 |
+
|
41 |
+
bash
|
42 |
+
pip install gradio transformers torch
|
43 |
+
Running Locally
|
44 |
+
Start the app:
|
45 |
+
|
46 |
+
bash
|
47 |
+
python app.py
|
48 |
+
Open the local URL printed (usually http://127.0.0.1:7860) in your browser.
|
49 |
+
|
50 |
+
Deploying on Hugging Face Spaces
|
51 |
+
Create a new Space on Hugging Face using the Gradio SDK.
|
52 |
+
|
53 |
+
Upload your app.py and requirements.txt.
|
54 |
+
|
55 |
+
Ensure your app.py ends with:
|
56 |
+
|
57 |
+
#python
|
58 |
+
gr.Interface(...).launch()
|
59 |
+
(Do NOT use share=True on Spaces.)
|
60 |
+
|
61 |
+
Commit and wait for the build; your app will be publicly available.
|
62 |
+
|
63 |
+
How It Works
|
64 |
+
Uses the Hugging Face pipeline:
|
65 |
+
|
66 |
+
#python
|
67 |
+
|
68 |
+
pipeline("audio-classification", model="dima806/english_accents_classification")
|
69 |
+
Takes an audio input, predicts accents with confidence scores.
|
70 |
+
|
71 |
+
Displays top 3 accents in a styled table with the top accent highlighted.
|
72 |
+
|
73 |
+
Error Handling
|
74 |
+
Handles invalid audio files gracefully with user-friendly error messages.
|
75 |
+
|
76 |
+
Supports common audio formats like .wav and .mp3.
|
77 |
+
|
78 |
+
Customization
|
79 |
+
Change the model in app.py by editing:
|
80 |
+
|
81 |
+
python
|
82 |
+
Copy
|
83 |
+
Edit
|
84 |
+
pipe = pipeline("audio-classification", model="your_model_name")
|
85 |
+
Customize UI elements and theme in the Gradio interface.
|
86 |
+
|
87 |
+
License & Acknowledgments
|
88 |
+
|
89 |
+
This project leverages open-source libraries:
|
90 |
+
|
91 |
+
Gradio
|
92 |
+
|
93 |
+
Transformers
|
94 |
+
|
95 |
+
Model by dima806
|
96 |
+
|
97 |
+
|
98 |
+
Contact
|
99 |
+
For inquiries or support, contact:
|
100 |