This project is a Flask API that allows you to transcribe audio from YouTube videos and generate questions based on the transcription. It utilizes several libraries, including yt-dlp, Vosk, transformers, and nltk.
- Transcription of audio from YouTube videos.
- Generation of questions from the transcription.
- Support for multiple audio formats.
Before running the project, ensure you have Python 3.7 or higher installed. You will also need the following libraries:
- Flask
- yt-dlp
- ffmpeg-python
- nltk
- sklearn
- transformers
- vosk
- python-dotenv
- pydub
-
Clone the repository:
git clone <https://github.com/spindart/test-yourself-python> cd <test-yourself-python>
-
Install the dependencies:
pip install -r requirements.txt
-
Download the required Vosk model and place it in the
vosk/models/directory. You can use thevosk-model-small-en-us-0.15. -
Create a
.envfile in the root of the project and define thePORTvariable (optional):PORT=3000
To start the server, run:
python server.pyThe API will be available at http://127.0.0.1:3000/.
Returns a greeting message.
Transcribes the audio from a YouTube video.
Request Body:
{
"videoUrl": "<VIDEO_URL>"
}Response:
{
"transcription": "<TRANSCRIPTION_OF_AUDIO>"
}Contributions are welcome! Feel free to open an issue or submit a pull request.