---WARNING--- this is the converted CrisperWhisper model into CTranslate2 to be compatible with
faster whisper
framework. However, due to the different implementation of the timestamp calculation in faster whisper or more precisely
CTranslate2
we do not guarantee the same timestamp accuracy as with the transformers implementation. The transcription accuracy and filler detection should work as expected.
CrisperWhisper
CrisperWhisper
is an advanced variant of OpenAI's Whisper, designed for fast, precise, and verbatim speech recognition with accurate (
crisp
) word-level timestamps. Unlike the original Whisper, which tends to omit disfluencies and follows more of a intended transcription style, CrisperWhisper aims to transcribe every spoken word exactly as it is, including fillers, pauses, stutters and false starts. Checkout our repo for more details:
https://github.com/nyrahealth/CrisperWhisper/blob/develop/README.md
Key Features
🎯
Accurate Word-Level Timestamps
: Provides precise timestamps, even around disfluencies and pauses, by utilizing an adjusted tokenizer and a custom attention loss during training.
📝
Verbatim Transcription
: Transcribes every spoken word exactly as it is, including and differentiating fillers like "um" and "uh".
🔍
Filler Detection
: Detects and accurately transcribes fillers.
🛡️
Hallucination Mitigation
: Minimizes transcription hallucinations to enhance accuracy.
📄
Paper Drop
: Check out our
paper
for details and reasoning behind our tokenizer adjustment.
✨
New Feature
: Not mentioned in the paper is a added AttentionLoss to further improve timestamp accuracy. By specifically adding a loss to train the attention scores used for the DTW alignment using timestamped data we significantly boosted the alignment performance.
Leider müssen wir in diesen schweren Zeiten auch unserem Tagesgeschäft nachgehen. Der hier vorgelegte Kulturhaushalt der Ampelregierung strebt an, den Erfolgskurs der Union zumindest fiskalisch fortzuführen.
Leider [UH] müssen wir in diesen [UH] schweren Zeiten auch [UH] unserem [UH] Tagesgeschäft nachgehen. Der hier [UH] vorgelegte [UH] Kulturhaushalt der [UH] Ampelregierung strebt an, den [UH] Erfolgskurs der Union [UH] zumindest [UH] fiskalisch fortzuführen. Es.
die über alle FRA-Fraktionen hinweg gut im Blick behalten sollten, auch weil sie teilweise sehr teeteuer sind. Aber nicht nur, weil sie teeteuer sind. Wir steigen mit diesem Endentwurf ein in die sogenannten Pandemie-Bereitschaftsverträge.
Die über alle Fr Fraktionen hinweg gut im [UH] Blick behalten sollten, auch weil sie teil teilweise sehr te teuer sind. Aber nicht nur, weil sie te teuer sind. Wir [UH] steigen mit diesem Ent Entwurf ein in die sogenannten Pand Pandemiebereitschaftsverträge.
and always find a place on the street to park and it was easy and you weren't a long distance away from wherever it was that you were trying to go. So I remember that being a lot of fun and easy to do and there were nice places to go and good events to attend. Come downtown and you had the Warner Theater and
And always find a place on the street to park. And and it was it was easy and you weren't a long distance away from wherever it was that you were trying to go. So, I I I remember that being a lot of fun and easy to do and there were nice places to go and, [UM] i good events to attend. Come downtown and you had the Warner Theater and, [UM]
you know, more masculine, who were rough, and that definitely wasn't me. Then, you know, I was very smart because my father made sure I was smart, you know. So, you know, I hung around those people, you know. And then you had the ones that were just out doing things that they shouldn't have been doing also. So, yeah, I was in the little geek squad. You were in the little geek squad. Yeah.
you know, more masculine, who were rough, and that definitely wasn't me. Then, you know, I was very smart because my father made sure I was smart. You know, so, [UM] you know, I I hung around those people, you know. And then you had the ones that were just just out doing things that they shouldn't have been doing also. So yeah, I was the l I was in the little geek squad. Do you
1.2 Quantitative Performance Overview
Transcription Performance
CrisperWhisper significantly outperforms Whisper Large v3, especially on datasets that have a more verbatim transcription style in the ground truth, such as AMI and TED-LIUM.
CrisperWhisper demonstrates superior performance segmentation performance. This performance gap is especially pronounced around disfluencies and pauses.
The following table uses the metrics as defined in the paper. For this table we used a collar of 50ms. Heads for each Model were selected using the method described in the
How
section and the result attaining the highest F1 Score was choosen for each model using varying number of heads.
Here's how to use CrisperWhisper in your Python scripts:
2.1 Usage with faster whisper
We also provide a converted model to be compatible with
faster whisper
. However, due to the different implementation of the timestamp calculation in faster whisper or more precisely
CTranslate2
the timestamp accuracy can not be guaranteed.
from faster_whisper import WhisperModel
from datasets import load_dataset
faster_whisper_model = "nyrahealth/faster_CrisperWhisper"# Initialize the Whisper model
device = "cuda:0"if torch.cuda.is_available() else"cpu"
torch_dtype = "float16"if torch.cuda.is_available() else"float32"
model = WhisperModel(faster_whisper_model, device=device, compute_type="float32")
dataset = load_dataset("distil-whisper/librispeech_long", "clean", split="validation")
sample = dataset[0]["audio"]
segments, info = model.transcribe(sample['array'], beam_size=1, language='en', word_timestamps = True, without_timestamps= True)
for segment in segments:
print(segment)
read more about the reasoning behind the pause distribution logic in our paper.
3. How?
We employ the popular Dynamic Time Warping (DTW) on the Whisper cross-attention scores, as detailed in our
paper
to derive word-level timestamps. By leveraging our retokenization process, this method allows us to consistently detect pauses. Given that the accuracy of the timestamps heavily depends on the DTW cost matrix and, consequently, on the quality of the cross-attentions, we developed a specialized loss function for the selected alignment heads to enhance precision.
Although this loss function was not included in the original
paper
due to time constraints preventing the completion of experiments and training before the submission deadline, it has been used to train our publicly available models.
Key Features of this loss are as follows:
Data Preparation
We used datasets with word-level timestamp annotations, such as
AMI IHM
and
TIMIT
, but required additional timestamped data.
To address this, we validated the alignment accuracy of several forced alignment tools using a small hand-labeled dataset.
Based on this validation, we chose the
PyTorch CTC aligner
to generate more time-aligned data from the CommonVoice dataset.
Because the
PyTorch CTC aligner
tends to overestimate pause durations, we applied the same pause-splitting method detailed in our
paper
to correct these errors. The effectiveness of this correction was confirmed using our hand-labeled dataset.
Token-Word Alignment
Due to retokenization as detailed in our
paper
, each token is either part of a word or a pause/space, but never both
Therefore each token can be cleanly aligned to a word OR a space/pause
Ground Truth Cross-Attention
We define the cross-attention ground truth for tokens as the L2-normalized vector, where:
A value of 1 indicates that the word is active according to the word-level ground truth timestamp.
A value of 0 indicates that no attention should be paid.
To account for small inaccuracies in the ground truth timestamps, we apply a linear interpolation of 4 steps (8 milliseconds) on both sides of the ground truth vector, transitioning smoothly from 0 to 1.
Loss Calculation
The loss function is defined as
1 - cosine similarity
between the predicted cross-attention vector (when predicting a token) and the ground truth cross-attention vector.
This loss is averaged across all predicted tokens and alignment heads.
Alignment Head selection
To choose the heads for alignment we evaluated the alignment performance of each individual decoder attention head on the timestamped timit dataset.
We choose the 15 best performing heads and finetune them using our attention loss.
Training Details
Since most of our samples during training were shorter than 30 seconds we shift the audio sample and corresponding timestamp ground truth around with a 50% probability to mitigate the cross attentions ,,overfitting" to early positions of the encoder output.
If we have more than 40ms of silence (before or after shifting) we prepend the ground truth transcript ( and corresponding cross attention ground truth) with a space so the model has to accurately predict the starting time of the first word.
We use
WavLM
augmentations during Training adding random speech samples or noise to the audio wave to generally increase robustness of the transcription and stability of the alignment heads.
We clip ,,predicted" values in the cross attention vectors 4 seconds before and 4 seconds after the groundtruth word they belong to to 0. This is to decrease the dimensionality of the cross attention vector and therefore emphasize the attention where it counts in the loss and ultimately for the alignment.
With a probability of 1% we use samples containing exclusively noise where the model has to return a empty prediction to improve hallucination.
The Model is trained on a mixture of english and german datasets so we only gurantee good performance on these languages
The Model is trained in three stages, in the first stage we use around 10000 hours of audio to adjust Whisper to the new tokenizer. In the second stage we exclusively use high quality datasets that are transcribed in a verbatim fashion. Finally we continue training on this verbatim mixture and add the attention loss for another 6000 steps.
License
license: cc-by-nc-4.0
Runs of nyralabs faster_CrisperWhisper on huggingface.co
265
Total runs
15
24-hour runs
23
3-day runs
29
7-day runs
63
30-day runs
More Information About faster_CrisperWhisper huggingface.co Model
faster_CrisperWhisper huggingface.co
faster_CrisperWhisper huggingface.co is an AI model on huggingface.co that provides faster_CrisperWhisper's model effect (), which can be used instantly with this nyralabs faster_CrisperWhisper model. huggingface.co supports a free trial of the faster_CrisperWhisper model, and also provides paid use of the faster_CrisperWhisper. Support call faster_CrisperWhisper model through api, including Node.js, Python, http.
faster_CrisperWhisper huggingface.co is an online trial and call api platform, which integrates faster_CrisperWhisper's modeling effects, including api services, and provides a free online trial of faster_CrisperWhisper, you can try faster_CrisperWhisper online for free by clicking the link below.
nyralabs faster_CrisperWhisper online free url in huggingface.co:
faster_CrisperWhisper is an open source model from GitHub that offers a free installation service, and any user can find faster_CrisperWhisper on GitHub to install. At the same time, huggingface.co provides the effect of faster_CrisperWhisper install, users can directly use faster_CrisperWhisper installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
faster_CrisperWhisper install url in huggingface.co: