Skip to content

Commit 00012bf

Browse files
committed
add readme
1 parent 5cd5909 commit 00012bf

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
## Setup
3+
Create a new python virtual env and install the requirements:
4+
5+
```bash
6+
python3 -m venv venv
7+
source venv/bin/activate
8+
pip install -r requirements.txt
9+
```
10+
11+
## Transcribing a single video
12+
update the `youtube_url` variable at line 36 in `youtube_video_transcription.py` with the url of the video you want to transcribe.
13+
14+
Run the script:
15+
16+
```bash
17+
python3 transcribe_youtube_video.py
18+
```
19+
The result should contain the transcription of the video.
20+
21+
## Multiple Videos
22+
For transcribing a list of videos, update the `youtube_urls` variable at line 8 in `youtube_video_transcription.py` with the list of urls of the videos you want to transcribe.
23+
24+
Then execute the script:
25+
26+
```bash
27+
python transcribe_multiple_youtube_videos.py
28+
```
29+
30+
This will print a list of transcription texts.
31+
32+
33+
For more information, read our docs at https://docs.slashml.com/reference/service/speech_to_text.html
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from transcribe_youtube_video import transcribe_youtube_file
2+
3+
def transcribe_multiple_youtube_videos(*, youtube_urls:list):
4+
return list(map(transcribe_youtube_file, youtube_urls))
5+
6+
7+
if __name__=="__main__":
8+
youtube_urls = ['https://youtu.be/5-TgqZ8nado','https://youtu.be/5-TgqZ8nado']
9+
10+
list_of_transcriptions = transcribe_multiple_youtube_videos(youtube_urls=youtube_url)
11+
12+
from pprint import pprint as pp
13+
pp(list_of_transcriptions)

examples/youtube-video-transcription/transcribe_video_files.py renamed to examples/youtube-video-transcription/transcribe_youtube_video.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ def transcribe_youtube_file(*, youtube_url:str):
3232

3333
return response.transcription_data.transcription
3434

35-
def transcribe_multiple_youtube_videos(*, youtube_urls:list):
36-
return list(map(transcribe_youtube_file, youtube_urls))
37-
3835
if __name__=='__main__':
3936
youtube_url = 'https://youtu.be/5-TgqZ8nado'
4037
print(transcribe_youtube_file(youtube_url=youtube_url))

0 commit comments

Comments
 (0)