NeMo
English
audio
speech
forced-alignment
reference-text-alignment
speech-processing
mfa
whisperx
python
metric:mae
Eval Results (legacy)
Instructions to use vertox-ai/speech-text-data-aligners with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use vertox-ai/speech-text-data-aligners with NeMo:
# tag did not correspond to a valid NeMo domain.
- Notebooks
- Google Colab
- Kaggle
Download tests/unit/core/test_models.py from vertox-ai/speech-text-data-aligners: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/vertox-ai/speech-text-data-aligners/resolve/main/tests/unit/core/test_models.py
- Command line
-
hf download hf://vertox-ai/speech-text-data-aligners/tests/unit/core/test_models.py
-
curl -L -o test_models.py https://huggingface.co/vertox-ai/speech-text-data-aligners/resolve/main/tests/unit/core/test_models.py
1.95 kB
| # License: Apache-2.0 License | |
| # Created by: Patrick Lumbantobing, VertoX-AI | |
| # Copyright (c) 2026 VertoX-AI. All rights reserved. | |
| # | |
| # This work is licensed under the Apache-2.0 License. | |
| # To view a copy of this license, visit | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| from __future__ import annotations | |
| from dataclasses import FrozenInstanceError | |
| from pathlib import Path | |
| import pytest | |
| from speech_text_data_aligners.core.models import ( | |
| AlignmentFailure, | |
| AlignmentOutcome, | |
| AlignmentProvenance, | |
| AlignmentRequest, | |
| AlignmentResult, | |
| Diagnostic, | |
| DiagnosticSeverity, | |
| LexicalWord, | |
| WordAlignment, | |
| ) | |
| def test_neutral_records_are_typed_and_immutable() -> None: | |
| diagnostic = Diagnostic("note", DiagnosticSeverity.INFO, "safe", "parse") | |
| request = AlignmentRequest("r", Path("a.wav"), "Hello", 1.0) | |
| word = LexicalWord(0, "Hello", 0, 5) | |
| alignment = WordAlignment(word, 0.1, 0.5, 0.9) | |
| provenance = AlignmentProvenance( | |
| backend_name="fake", artifacts=("ctm",), attributes=(("batch", 1),) | |
| ) | |
| result = AlignmentResult("r", (alignment,), provenance, (diagnostic,), 0.2) | |
| outcome = AlignmentOutcome(result=result) | |
| assert request.transcript == "Hello" | |
| assert outcome.succeeded | |
| assert outcome.request_id == "r" | |
| assert provenance.attributes == (("batch", 1),) | |
| with pytest.raises(FrozenInstanceError): | |
| word.text = "changed" # type: ignore[misc] | |
| def test_outcome_enforces_exactly_one_variant() -> None: | |
| failure = AlignmentFailure("r", "bad", "test", "no") | |
| outcome = AlignmentOutcome(failure=failure) | |
| assert not outcome.succeeded | |
| assert outcome.request_id == "r" | |
| with pytest.raises(ValueError, match="exactly one"): | |
| AlignmentOutcome() | |
| with pytest.raises(ValueError, match="exactly one"): | |
| AlignmentOutcome( | |
| result=AlignmentResult("r", (), AlignmentProvenance("fake")), | |
| failure=failure, | |
| ) | |