Wav2Vec2-based transcriptor fine tuned on chilean lessons
Project description
CLTranscriptor
Wrapper for spanish speech-to-text model based on huggingface's Wav2Vec2ForCTC and finetuned on Chilean lessons + PySpellChecker's spanish spellchecking algorithm.
Install
To install, simply use pip
:
pip install cltranscriptor
Usage
To use, initialize a Transcriptor
object:
from cltranscriptor.cltranscriptor import Transcriptor
transcriptor = Transcriptor()
By default, spell checking is set to True
and the model name is the one available at dannersm/wav2vec2-large-xlsr-53-chilean-lessons, which is based on Jonatas Grosman's model and finetuned on a 6 hour set of chilean lessons.
To transcribe a file, call Transcriptor.transcribe()
:
transcriptor.transcribe('/path/to/your/audio_file.wav')
By default, the file is streamed into 10 second intervals (to avoid loading it in memory) and returns a list with the transcripts for each segment. If you want to transcribe a relatively short file all at once you can pass interval=None
:
transcriptor.transcribe('my_file.wav', interval=None)
You can also pass the offset
and duration
parameters which will be passed to librosa.stream
to set the start time and a maximum duration to the transcription
transcriptor.transcribe('my_file.wav', offset=600, duration=120) # transcribe 2 minutes of audio starting from minute 10
Finally, you can control the length of the streamed segments passing interval
:
transcriptor.transcribe('my_file.wav', interval=15) # transcribe every 15 seconds
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file CLTranscriptor-0.0.6.tar.gz
.
File metadata
- Download URL: CLTranscriptor-0.0.6.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfbd252c5ba87473155dda3396ea0bfb8bcea1d53f19a47cb021e6a236cf34ba |
|
MD5 | 89630557da8df2463c56efddd19f62f0 |
|
BLAKE2b-256 | 4bdb164c7f20fa07f8e00e5df21e9b80f27cbafbd10fb2f7db8b157f7b52bf7a |
File details
Details for the file CLTranscriptor-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: CLTranscriptor-0.0.6-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8490e1e465eccac4284e81a32f2c5cac70ef7deec9b8862afd8d887858c00694 |
|
MD5 | c3f2d4c906cdd138c8a4e4f38767b1a9 |
|
BLAKE2b-256 | a859549bb0ed6d02864e765421ae416e931e8a6aef89bd9bcfc25d18ef879f15 |