Instructions to use Hishambarakat/Bahraini_ASR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hishambarakat/Bahraini_ASR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="Hishambarakat/Bahraini_ASR")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Hishambarakat/Bahraini_ASR", dtype="auto") - Notebooks
- Google Colab
- Kaggle
| license: cc-by-nc-4.0 | |
| language: | |
| - ar | |
| tags: | |
| - automatic-speech-recognition | |
| - whisper | |
| - arabic | |
| - bahraini | |
| library_name: transformers | |
| pipeline_tag: automatic-speech-recognition | |
| # Bahraini ASR (Whisper Fine-tune) | |
| Bahraini Arabic ASR fine-tune based on `MohamedRashad/Arabic-Whisper-CodeSwitching-Edition`. | |
| ## Public model package | |
| - `bahraini_asr_codeswitching` | |
| - this public package is the Bahraini ASR release bundle kept under a stable name instead of a raw checkpoint folder | |
| - tokenizer config was normalized for direct `WhisperProcessor.from_pretrained(...)` loading | |
| - interactive listening page: [`Hishambarakat/Bahraini_ASR_Review`](https://huggingface.co/spaces/Hishambarakat/Bahraini_ASR_Review) | |
| ## Inference | |
| Install the Python dependencies listed in [`requirements.txt`](requirements.txt) first: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ```python | |
| import torch | |
| from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline | |
| model_id = "Hishambarakat/Bahraini_ASR" | |
| subfolder = "bahraini_asr_codeswitching" | |
| processor = WhisperProcessor.from_pretrained(model_id, subfolder=subfolder) | |
| model = WhisperForConditionalGeneration.from_pretrained(model_id, subfolder=subfolder) | |
| pipe = pipeline( | |
| "automatic-speech-recognition", | |
| model=model, | |
| tokenizer=processor.tokenizer, | |
| feature_extractor=processor.feature_extractor, | |
| device=0 if torch.cuda.is_available() else -1, | |
| ) | |
| result = pipe("/path/to/audio.wav", generate_kwargs={"language": "ar", "task": "transcribe"}) | |
| print(result["text"]) | |
| ``` | |
| ## What was trained | |
| - Base model: `MohamedRashad/Arabic-Whisper-CodeSwitching-Edition` | |
| - Baseline pretraining data included `MohamedRashad/arabic-english-code-switching` | |
| - Private Bahraini speech corpus with manual transcript cleanup | |
| - Dialect-specific correction passes for Bahraini phrasing | |
| - Review-driven checkpoint selection from unseen clips | |
| - The public release is packaged under `bahraini_asr_codeswitching` | |
| ## Why Bahraini fine-tuning matters | |
| The baseline model is useful, but its upstream code-switching data includes a broader Arabic mix and is not specialized for Bahraini dialect preservation. In practice, that means some outputs can be semantically plausible while still drifting away from the speaker's local wording. | |
| This matters for Bahraini ASR because a transcript can look "close enough" in standard Arabic or another dialect while still failing to preserve the actual form that was spoken. | |
|  | |
| ## Evaluation summary | |
| This checkpoint was selected from a manual unseen-clip review rather than a formal WER/CER benchmark. | |
| On the original `50`-clip `checkpoint-1250` review sheet: | |
| - `ours`: `22` | |
| - `tie`: `20` | |
| - `baseline`: `4` | |
| - `both_bad`: `4` | |
| Raw counts from that sheet suggest a strong advantage for the fine-tuned model, but for public-facing reporting we should be more conservative than the raw sheet alone: | |
| - a reasonable conservative takeaway is that the fine-tuned model was better on at least roughly `60%+` of meaningful cases | |
| - it was at minimum competitive with the baseline on a clear majority of the reviewed clips | |
| - exact percentages should be treated as approximate because some rows were later re-checked manually and a few public-facing examples were judged more cautiously | |
| This original review result is the main reason `checkpoint-1250` was chosen as the public release over later checkpoints. | |
| Important note: | |
| - these counts come from the original `checkpoint-1250` review CSV | |
| - the local example table below was re-vetted manually afterward | |
| - some later local proxy review files had labeling inconsistencies, so the example table is treated as the more conservative public-facing evidence set | |
| - in other words: the counts below are from the original 1250 review pass, while the example rows were hand-pruned to avoid overstating wins | |
| ## Dialect preservation candidates | |
| In addition to the manual 50-clip review, we ran a separate text-only mining pass over the private training corpus to look for likely dialect-preservation patterns between: | |
| - `text` | |
| - `text_asr_v5_raw` | |
| This is not a benchmark and should not be read as ASR accuracy. It is a heuristic analysis meant to surface likely cases where a local Bahraini form was shifted toward a more common outside-dialect form. | |
| Topline from that pass: | |
| - total train rows scanned: `52,695` | |
| - changed transcript rows (`text != text_asr_v5_raw`): `50,335` | |
| - heuristic dialect-shift candidates: `360` | |
| - strict local-to-common substitution cases: `37` | |
| Conservative interpretation: | |
| - heuristic dialect-shift candidates account for about `0.72%` of changed rows | |
| - the stricter local-to-common subset accounts for about `0.07%` of changed rows | |
| - these are small percentages in absolute terms, but they are high-value because they target the exact dialect-preservation failure mode we care about | |
| Most common strict patterns found: | |
| - `ููุด -> ููู`: `19` | |
| - `ู ุจ -> ู ุด`: `18` | |
| Useful framing: | |
| - some baseline outputs are semantically plausible, but they do not preserve the speaker's original dialect wording | |
| - this analysis is best treated as **dialect preservation candidate mining**, not formal detection accuracy | |
| ## Review examples | |
| These clips are the strongest remaining `ours` wins from the corrected local review file after removing rows that we manually judged as baseline, tie, or both_bad. | |
| Hugging Face model cards do not show a built-in inline playbar for these samples here. Click a `.wav` link below and Hugging Face/browser will open the file in its audio player. | |
| | Sample | Ours (`checkpoint-1250`) | Baseline | Vote | | |
| | --- | --- | --- | --- | | |
| | [sample_01.wav](review_evidence/audio/sample_01.wav) | ุนูุดุงู ุงุญูุง ูุณูู ูุฐุง ุงููุฒูู ุงู ููุฏู ููุฐุง ุงูููุน ู ู ุงููุฒูู | ุนูุดุงู ููุฏู ููุฐุง ุงููุฒูู ู ูู | ours | | |
| | [sample_02.wav](review_evidence/audio/sample_02.wav) | ููุชูู ู ู ุงูุดู ุงูุจุตุฑู ุฅูู ุงูุดู ุงููุชุงุจู ูุฃู ุงููุชุงุจุฉ ูู ููุน ู ู ููุน ุงูุฎูุงู ุจุนุฏ | ููุชูู ู ู ุงูุดู ุงูุจุตุฑู ุฅูู ุงูุดู ุงููุชุงุจู ูุฃู ุงููุชุงุจ ูู ููุน ู ู ููุน ุงูุฎูุงู ุจุนุฏ | ours | | |
| | [sample_03.wav](review_evidence/audio/sample_03.wav) | ุดูู ูุนูู ู ู ูุตุต ุชุนุฑููููุง ูู ูุฐู ุงูุตุฏุฏุ | ู ู ูุตุต ุชุนุฑููููุง ูู ูุฐู ุงูุตุฏุฏุ | ours | | |
| | [sample_04.wav](review_evidence/audio/sample_04.wav) | ุงูููุงู ุงุชูุงุถุญูู ุงุดููู ุงูุง ุงุจู ุงูุตู ุญู ูุงู ุงูุฃูุฏุงู | ุงูููุงู ุชูุถุญ ูู ุฃุดููู ูุฃูุง ุจููุตู ุญู ูุฐู ุงูุฃูุฏุงู | ours | | |
| | [sample_05.wav](review_evidence/audio/sample_05.wav) | ูุงุฆู ุง ูุนูู ูุฒู ุญู ู ูุงุฒู ูุฐู ุงููุงุณ ูุฎููู ูุนูู ุฃุฏู ู ููู | ุทุงูู ุงู ูุนูู ุงูุฒู ุญุฌู ูุงุฒู ูุฐู ุงููุงุณ ู ุฎูู ูุนูู ุฃุฏูู ู ููู | ours | | |
| | [sample_06.wav](review_evidence/audio/sample_06.wav) | ูุนูู ููุฏูู ุณุญุจู ุนูู ููุฏูู ุณุญุจู ุนูู ุงูุซุงูู ู ูุนุช ุงูุฃุทุงูู ุณุงุนุฉ ุซูุชูู | ูุนูู ููุฏูู ุณุญุจู ุนูู ููุฏูู ุณุญุจู ุนูู ุซุงูู ู ุงูุนูุชู ูุชุทูุน ุงูุณุงุนุฉ ุงุซูุชูู | ours | | |
| | [sample_07.wav](review_evidence/audio/sample_07.wav) | ูุฏุงุฆู ุง ููุง ุฌููุงุช ุงูุฃูู ูู ุงููู ุชุฑุจุทู | ู ุฏุงุฆู ุง ููุง ุฌููุงุช ุงูุฃูู ูู ุงููู ุชุฑุจุทู | ours | | |
| ## Notes | |
| - This repo is model-only. | |
| - The training dataset is private and published separately. | |
| - These examples are kept conservative to avoid showing rows that we manually disagree with. | |
| - The sample links above open the WAV files directly from the Hub rather than embedding a playbar inside the model card. | |