Timestamps for transcript ?

#14
by gaber - opened

is there a way to get this to output timestamps or speaker ids ? for a full transcript .

Yes. The Nemotron ASR model already outputs alignment information that can be converted into timestamps for words or tokens, so generating a timestamped transcript is possible from the inference output.

However, speaker IDs are not part of the Nemotron ASR output. If you need speaker attribution (e.g., "Speaker 1", "Speaker 2"), you'll need to run a separate diarization model alongside ASR, such as Sortformer.

Yes. The Nemotron ASR model already outputs alignment information that can be converted into timestamps for words or tokens, so generating a timestamped transcript is possible from the inference output.

However, speaker IDs are not part of the Nemotron ASR output. If you need speaker attribution (e.g., "Speaker 1", "Speaker 2"), you'll need to run a separate diarization model alongside ASR, such as Sortformer.

How do you do this?

Yes. The Nemotron ASR model already outputs alignment information that can be converted into timestamps for words or tokens, so generating a timestamped transcript is possible from the inference output.

However, speaker IDs are not part of the Nemotron ASR output. If you need speaker attribution (e.g., "Speaker 1", "Speaker 2"), you'll need to run a separate diarization model alongside ASR, such as Sortformer.

How do you do this?

The inference output from the NeMo model itself contains the frame-level alignment information needed to generate timestamps.

I'm not sure whether NVIDIA's Python inference library exposes those alignment outputs directly. However, if you can access the model's raw outputs, you have everything you need to build a timestamped transcript.

In my case, I'm running the ONNX-converted model directly, so I can read the alignment output, calculate the duration represented by each frame (based on the audio chunk length and the number of output frames), and map the decoded tokens/words to those frames to generate timestamps.

Please have a look at https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b/discussions/22#6a4e6dd2203e78da12d8d5c5

Hi, this solution is great when running using Transformers. Is it also possible to do this using NeMo package for Python? I've tried running the following, but still not getting any timestamps. Same approach works for Parakeet V3 though

        cfg = self.model.get_transcribe_config()  # type: ignore
        cfg.target_lang = "auto"
        cfg.timestamps = True
        transcription = self.model.transcribe(  # type: ignore
            [audio_file_path], timestamps=True, override_config=cfg
        )

Please have a look at https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b/discussions/22#6a4e6dd2203e78da12d8d5c5

Hi, this solution is great when running using Transformers. Is it also possible to do this using NeMo package for Python? I've tried running the following, but still not getting any timestamps. Same approach works for Parakeet V3 though

        cfg = self.model.get_transcribe_config()  # type: ignore
        cfg.target_lang = "auto"
        cfg.timestamps = True
        transcription = self.model.transcribe(  # type: ignore
            [audio_file_path], timestamps=True, override_config=cfg
        )

After a full day of diving deeper into the NeMo package code, I finally found what is happening. When using the override_config, return_hypotheses by default gets set to False, and you have to manually override it. Below is how to properly set the config when using this model

        config = RNNTPromptTranscribeConfig(
            target_lang="auto", return_hypotheses=True, timestamps=True
        )
        transcription = self.model.transcribe(  # type: ignore
            [audio_file_path],
            override_config=config,
        )

Sign up or log in to comment