Token Classification
Transformers
Safetensors
Armenian
qwen3_asr
armenian
eastern-armenian
forced-alignment
word-timestamps
Instructions to use Chillarmo/DpirASR-ForcedAligner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chillarmo/DpirASR-ForcedAligner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Chillarmo/DpirASR-ForcedAligner")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForTokenClassification processor = AutoProcessor.from_pretrained("Chillarmo/DpirASR-ForcedAligner") model = AutoModelForTokenClassification.from_pretrained("Chillarmo/DpirASR-ForcedAligner", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Chillarmo/DpirASR-ForcedAligner: direct link, hf CLI and curl.
- Browser
- Download file 3.35 kB
-
https://huggingface.co/Chillarmo/DpirASR-ForcedAligner/resolve/main/README.md
- Command line
-
hf download hf://Chillarmo/DpirASR-ForcedAligner/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/Chillarmo/DpirASR-ForcedAligner/resolve/main/README.md
3.35 kB
| language: | |
| - hy | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: token-classification | |
| base_model: Qwen/Qwen3-ForcedAligner-0.6B-hf | |
| base_model_relation: finetune | |
| tags: | |
| - armenian | |
| - eastern-armenian | |
| - forced-alignment | |
| - word-timestamps | |
| - safetensors | |
| # DpirASR-ForcedAligner | |
| DpirASR-ForcedAligner estimates word start and end times from 16 kHz mono audio and its transcript. It targets modern Eastern Armenian broadcast speech. The merged BF16 checkpoint uses Qwen's timestamp classifier with 80 ms classes. [Base model](https://huggingface.co/Qwen/Qwen3-ForcedAligner-0.6B-hf) | |
| ## Evaluation | |
| Both models aligned the same transcripts on 2,523 matched test clips from 28 held-out recordings (7.27 hours, 61,470 words). The table uses the standard Qwen timestamp decoder with smoothing and scores both boundaries of each word. | |
| | Model | Mean start error | Mean end error | Mean boundary error | Boundaries within 100 ms | Words with both boundaries within 100 ms | | |
| |---|---:|---:|---:|---:|---:| | |
| | DpirASR-ForcedAligner | 27.79 ms | 29.86 ms | **28.83 ms** | **98.02%** | **96.45%** | | |
| | Qwen3-ForcedAligner-0.6B-hf | 2,846.89 ms | 2,877.38 ms | 2,862.13 ms | 12.45% | 3.78% | | |
| The score measures agreement with automatically generated timestamps from the word-level transcripts. The matched test set excludes 201 continuous clips whose transcripts could not be fully reconciled with the word-timing export. [Raw and smoothed metrics](eval-results.json) | |
| ## Usage | |
| Load with Transformers 5.16.1 or later. Supply an Armenian transcript and leave the language hint unset to use the processor's whitespace-based word splitting. Use short clips of up to 30 seconds, the range used during fine-tuning. | |
| ```python | |
| import soundfile as sf | |
| import torch | |
| from transformers import AutoModelForTokenClassification, AutoProcessor | |
| repo = "Chillarmo/DpirASR-ForcedAligner" | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| dtype = torch.bfloat16 if device == "cuda" and torch.cuda.is_bf16_supported() else torch.float32 | |
| processor = AutoProcessor.from_pretrained(repo) | |
| model = AutoModelForTokenClassification.from_pretrained(repo, dtype=dtype).to(device).eval() | |
| audio, sample_rate = sf.read("speech.wav", dtype="float32") | |
| assert sample_rate == 16000 and audio.ndim == 1 | |
| inputs, words = processor.prepare_forced_aligner_inputs( | |
| audio=audio, transcript="Բարի օր։" | |
| ) | |
| inputs = inputs.to(device, dtype) | |
| with torch.inference_mode(): | |
| logits = model(**inputs).logits | |
| alignment = processor.decode_forced_alignment( | |
| logits, inputs["input_ids"], words, model.config.timestamp_token_id | |
| )[0] | |
| print(alignment) | |
| ``` | |
| The output contains `text`, `start_time`, and `end_time` for each word. Times are relative to the input clip and expressed in seconds. | |
| ## Training | |
| Fine-tuning used 23,359 continuous clips from 236 recordings with word-level transcripts covering 504,365 timestamped words. The run used rank-16 LoRA in the audio and language attention layers and trained the audio-to-text projector and timestamp classifier. The released checkpoint had the lowest raw boundary mean absolute error on 926 validation clips from 12 separate recordings. It was saved at step 1,095 after three epochs. | |
| ## License | |
| The weights are a fine-tuned derivative of Qwen3-ForcedAligner-0.6B-hf under Apache 2.0. [License text](LICENSE) | |