This repository contains a pipeline for audio transcription and diarization using wav2vec2 and whisper. The pipeline processes audio files, splits them into chunks, performs transcription and diarization (on whole audio), and merges the results into a single XML file.
Clone the repository:
git clone https://github.com/anindyamitra2002/Indic-ASR-Transcript-Generator.git
cd Indic-ASR-Transcript-Generator
Install the required packages:
pip install -r requirements.txt
The main entry point for running the pipeline is the run_pipeline function. This function handles the entire process from splitting the audio into chunks to merging the XML results. But before running the pipeline you need to follow some step to get the average silence duration in the input or extracted audio. This is optional when you want to split the line in transcript based on the silence threshold.
Calculate the average silence duration (optional):
utils\mp3_converter.py.cd utils
path C:\Program Files (x86)\mp3splt;%PATH%
mp3splt -s -p th=-35,min=0.4,rm=50_50,trackjoin=2.5 <your-input-mp3-filepath> -o @f-@n -d ./temp
Run utils\avg_silence.py to get the average silence duration from the logfile.
Edit line 49 of xml_creation.py and line 92 of xml_merger.py by replacing the threshold time with the new duration threshold.
Running the Pipeline: Edit following variables before running the pipeline. Keep your input videos/audios in a subfolder (named with the language) within video directory.
video_input = "path/to/your/video.mp4" # .\videos\english\Video.mp4
audio_dir = "path/to/audio/output" # .\audios
lang = "language" # english
json_dir = "path/to/json/output" # .\transcripts\jsons
transcript_xml_dir = "path/to/xml/output" # .\transcripts\xmls
chunk_length_s = 30 # chunk length in seconds
After setting all the parameters run the wav2vec2_pipeline.py file.
7 commits
Python
99.1%
This repository contains a pipeline for audio transcription and diarization using wav2vec2 and whisper. The pipeline processes audio files, splits them into chunks, performs transcription and diarization (on whole audio), and merges the results into a single XML file.
Clone the repository:
git clone https://github.com/anindyamitra2002/Indic-ASR-Transcript-Generator.git
cd Indic-ASR-Transcript-Generator
Install the required packages:
pip install -r requirements.txt
The main entry point for running the pipeline is the run_pipeline function. This function handles the entire process from splitting the audio into chunks to merging the XML results. But before running the pipeline you need to follow some step to get the average silence duration in the input or extracted audio. This is optional when you want to split the line in transcript based on the silence threshold.
Calculate the average silence duration (optional):
utils\mp3_converter.py.cd utils
path C:\Program Files (x86)\mp3splt;%PATH%
mp3splt -s -p th=-35,min=0.4,rm=50_50,trackjoin=2.5 <your-input-mp3-filepath> -o @f-@n -d ./temp
Run utils\avg_silence.py to get the average silence duration from the logfile.
Edit line 49 of xml_creation.py and line 92 of xml_merger.py by replacing the threshold time with the new duration threshold.
Running the Pipeline: Edit following variables before running the pipeline. Keep your input videos/audios in a subfolder (named with the language) within video directory.
video_input = "path/to/your/video.mp4" # .\videos\english\Video.mp4
audio_dir = "path/to/audio/output" # .\audios
lang = "language" # english
json_dir = "path/to/json/output" # .\transcripts\jsons
transcript_xml_dir = "path/to/xml/output" # .\transcripts\xmls
chunk_length_s = 30 # chunk length in seconds
After setting all the parameters run the wav2vec2_pipeline.py file.
7 commits
Python
99.1%