Add progress bar to concatenate transcriptions script
Browse files- concat_transcriptions.py +3 -0
concat_transcriptions.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import argparse
|
| 2 |
import re
|
|
|
|
| 3 |
|
| 4 |
def sum_seconds(time, seconds):
|
| 5 |
# Get time in seconds
|
|
@@ -53,6 +54,7 @@ def concatenate_transcriptions(chunk_files, seconds):
|
|
| 53 |
# Concatenate transcriptions
|
| 54 |
transcription = ""
|
| 55 |
num_transcriptions = 1
|
|
|
|
| 56 |
for i, file in enumerate(files):
|
| 57 |
chunk = file
|
| 58 |
_, file = chunk.split("/")
|
|
@@ -79,6 +81,7 @@ def concatenate_transcriptions(chunk_files, seconds):
|
|
| 79 |
|
| 80 |
else:
|
| 81 |
transcription += f"{line}\n"
|
|
|
|
| 82 |
|
| 83 |
# Write transcription
|
| 84 |
file_split = file.split("_")[:-1]
|
|
|
|
| 1 |
import argparse
|
| 2 |
import re
|
| 3 |
+
from tqdm import tqdm
|
| 4 |
|
| 5 |
def sum_seconds(time, seconds):
|
| 6 |
# Get time in seconds
|
|
|
|
| 54 |
# Concatenate transcriptions
|
| 55 |
transcription = ""
|
| 56 |
num_transcriptions = 1
|
| 57 |
+
progress_bar = tqdm(total=len(files), desc='Concatenating transcriptions progress')
|
| 58 |
for i, file in enumerate(files):
|
| 59 |
chunk = file
|
| 60 |
_, file = chunk.split("/")
|
|
|
|
| 81 |
|
| 82 |
else:
|
| 83 |
transcription += f"{line}\n"
|
| 84 |
+
progress_bar.update(1)
|
| 85 |
|
| 86 |
# Write transcription
|
| 87 |
file_split = file.split("_")[:-1]
|