Nodes/ComfyUI-speech-dataset-toolkit/nemo-asr Subword Property
ComfyUI Node

nemo-asr Subword Property

Token, token ID, and timestamp for one subword

By kale4eat·Created 2 years ago·Updated about a year ago· 23
nemo-asr Subword Property
  • subword
  • seconds
  • token_id
  • token

The most granular field-reader in the whole pack. Where SDT_NemoAsrSegmentProperty gives you sentence-level start/end/text, this one operates one tokenizer unit at a time - the actual pieces NeMo's decoding pipeline broke the transcript into, each with its own precise timing.

How it works

Reads three fields off a single exploded NEMO_ASR_SUBWORD item (from SDT_NemoAsrListSubwords) and exposes them directly - no aggregation, no reconstruction into readable text. This is the node to reach for specifically when segment-level timing isn't fine-grained enough for what you're building, and you need to know exactly when a specific token was produced and what it maps to in the model's own vocabulary.

The inputs and outputs that matter

  • subword (required, NEMO_ASR_SUBWORD) - one token, from SDT_NemoAsrListSubwords.
  • seconds (output, FLOAT) - the timestamp for this token, in seconds.
  • token_id (output, INT) - the raw integer ID for this token in the model's tokenizer vocabulary. Useful mainly if you're doing something that needs to reference the model's own vocabulary directly (debugging tokenization, aligning against another NeMo-format pipeline) rather than everyday transcript work.
  • token (output, STRING) - the token's text form, i.e. the actual subword piece.

How to install it

ComfyUI Manager: search ComfyUI-speech-dataset-toolkit, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/kale4eat/ComfyUI-speech-dataset-toolkit
cd ComfyUI-speech-dataset-toolkit
pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

No extra dependencies - a plain field-reader.

Common issues & troubleshooting

Fed in a raw NEMO_ASR_SUBWORDS bundle and got a type error. This node wants one exploded NEMO_ASR_SUBWORD item, not the bundle - run it through SDT_NemoAsrListSubwords first.

Not sure why you'd want token_id at all. Most people never touch it - it's the raw integer the tokenizer assigns internally, useful mainly for debugging or cross-referencing against the model's vocabulary directly. For everyday work, token (the text) and seconds (the timing) are the two outputs you'll actually use.

Concatenating token values across a whole clip and getting oddly spaced or fragmented text. Subword tokenization doesn't split cleanly at word boundaries, so naive concatenation of raw tokens can look wrong even when the underlying transcription is correct. SDT_NemoAsrTranscribe's text output already gives you the properly assembled transcript - reach for token-level data only when you specifically need per-token timing, not as a way to rebuild the transcript yourself.

This is about as niche as this pack gets. Token-level ASR timing isn't something most dataset-building workflows need day to day - it's aimed at forced-alignment or duration-modeling style work. If you're not sure you need this granularity, SDT_NemoAsrSegmentProperty at the segment level is very likely closer to what you actually want.

Categoryspeech-dataset-toolkit/ai/nemo-asr

Inputs (1)

NameTypeDefaultDescription
subwordNEMO_ASR_SUBWORD

Outputs (3)

NameTypeDescription
secondsFLOAT
token_idINT
tokenSTRING