Skip to main content
Glama
README.md
# `nbrain-arabic-media-asr-qc` — Arabic Clinical/Financial `ASR` Safety Scorer, `UAX#9` RTL Subtitle Fixer & Broadcast `WAV`/`MP4` QC + MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg)](./LICENSE)
[![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B%20Zero--Dep-blue.svg)](./pyproject.toml)
[![MCP Registry](https://img.shields.io/badge/MCP-io.github.NBrain--Studio%2Fnbrain--arabic--media--asr--qc-purple.svg)](./server.json)

Engineered by **[Eng. Nadeem Mohamed Badr El-Din](https://nadeembadr.com)** at **[NBrain (`منظومة إن برين` — nbra.in)](https://nbra.in)** for Arabic medical dictation, Whisper/ASR benchmarking, streaming subtitle localization, and broadcast media pipelines.

## Modules
1. **Arabic & Clinical ASR Safety Evaluator (`WER`, `CER` + High-Risk Entity Error Rate `HREER`)**:Orthographic/diacritic-normalized Levenshtein alignment PLUS safety-critical entity verification for **dosages/numbers**, **anatomical laterality** (`يمين`/`يسار`, `right`/`left`), and **clinical negation** (`لا يوجد`/`بدون`/`no`)—catching lethal transcription flips that hide behind `<5%` WER!
2. **Streaming Arabic `SRT` Timed-Text Auditor & `UAX#9` RTL BiDi Punctuation Fixer**: Enforces `<= 17.0 CPS`, `<= 42 CPL`, duration bounds (`833ms..7000ms`), and injects `U+200F (RLM)` around trailing weak/neutral punctuation so `.` / `!` / `?` / `%` never jump to the wrong side of Arabic subtitle lines.
3. **Broadcast `RIFF/WAV` PCM Loudness & Peak Inspector + `MP4/ISOBMFF` `moov` Faststart Verifier**: Pure-stdlib binary inspection of PCM sample peaks, clipping, DC offset, RMS loudness (`dBFS`/`LUFS` proxy), and MP4 progressive-streaming `moov`-before-`mdat` atom layout.

## Quick Verification
```bash
PYTHONPATH=src python -m unittest discover -s tests -v
```

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct artifact and concern: WAV audio QC, Arabic ASR safety/WER evaluation, SRT subtitle auditing/fixing, and MP4/ISOBMFF streaming checks. There is no meaningful overlap in selection intent despite all being media QC operations.

Naming Consistency4/5

All names use snake_case and begin with an action verb, making the set predictable. The only minor deviation is the conjunction in audit_and_fix_arabic_srt_subtitles, which still reads clearly.

Tool Count5/5

Four tools is well-scoped for a media ASR QC server: each covers a separate QC layer (audio, ASR output, subtitles, container) and no tool feels redundant. The count stays within the ideal 3–15 range.

Completeness4/5

The surface covers the core QC domains for Arabic media/ASR workflows: audio integrity, ASR accuracy/safety, subtitle compliance, and MP4 streaming readiness. Minor gaps exist, such as only SRT subtitle handling and no broader video/audio sync validation, but agents can work around them.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues