Spaces:
Sleeping
Sleeping
zanesmit29
commited on
Commit
Β·
b94ad4d
1
Parent(s):
18ec8eb
Initial commit
Browse files- README.md +47 -13
- app.py +22 -0
- requirements.txt +6 -0
README.md
CHANGED
|
@@ -1,13 +1,47 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ASR Application
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
This is an Automatic Speech Recognition (ASR) application.
|
| 5 |
+
|
| 6 |
+
## Features
|
| 7 |
+
- Speech-to-text conversion
|
| 8 |
+
- Audio file processing
|
| 9 |
+
- Real-time transcription support
|
| 10 |
+
|
| 11 |
+
## Installation
|
| 12 |
+
```bash
|
| 13 |
+
# Clone the repository
|
| 14 |
+
git clone <repository-url>
|
| 15 |
+
cd "ASR Application"
|
| 16 |
+
|
| 17 |
+
# Install dependencies
|
| 18 |
+
pip install -r requirements.txt
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## Usage
|
| 22 |
+
```bash
|
| 23 |
+
# Run the application
|
| 24 |
+
python app.py
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## Requirements
|
| 28 |
+
- Python 3.x
|
| 29 |
+
- Required libraries (see `requirements.txt`)
|
| 30 |
+
|
| 31 |
+
## Project Structure
|
| 32 |
+
```
|
| 33 |
+
ASR Application/
|
| 34 |
+
βββ README.md
|
| 35 |
+
βββ requirements.txt
|
| 36 |
+
βββ app.py
|
| 37 |
+
βββ ...
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## License
|
| 41 |
+
[Specify your license]
|
| 42 |
+
|
| 43 |
+
## Contributing
|
| 44 |
+
Contributions are welcome! Please open an issue or submit a pull request.
|
| 45 |
+
|
| 46 |
+
## Contact
|
| 47 |
+
[Your contact information]
|
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
import gradio as gr
|
| 5 |
+
from transformers import pipeline
|
| 6 |
+
|
| 7 |
+
asr = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-100h")
|
| 8 |
+
|
| 9 |
+
def transcribe_audio(audio):
|
| 10 |
+
text = asr(audio)["text"]
|
| 11 |
+
return text
|
| 12 |
+
|
| 13 |
+
demo = gr.Interface(
|
| 14 |
+
fn=transcribe_audio,
|
| 15 |
+
inputs=gr.Audio(sources=["microphone"], type="filepath"),
|
| 16 |
+
outputs="text",
|
| 17 |
+
title="Speech-to-Text Transcription",
|
| 18 |
+
description="Record your voice and get the transcribed text using a pre-trained Wav2Vec2 model."
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
demo.launch(share=True)
|
| 22 |
+
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
transformers
|
| 3 |
+
torch
|
| 4 |
+
torchaudio
|
| 5 |
+
|
| 6 |
+
|