{"id":33003443,"url":"https://github.com/akashmjn/tinydiarize","last_synced_at":"2026-01-18T08:14:13.334Z","repository":{"id":155341564,"uuid":"612504890","full_name":"akashmjn/tinydiarize","owner":"akashmjn","description":"Minimal extension of OpenAI's Whisper adding speaker diarization with special tokens","archived":false,"fork":false,"pushed_at":"2023-11-06T07:53:32.000Z","size":15606,"stargazers_count":251,"open_issues_count":6,"forks_count":7,"subscribers_count":20,"default_branch":"main","last_synced_at":"2023-11-06T08:45:54.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akashmjn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-11T06:17:48.000Z","updated_at":"2023-11-06T03:05:13.000Z","dependencies_parsed_at":"2023-11-06T08:41:22.786Z","dependency_job_id":null,"html_url":"https://github.com/akashmjn/tinydiarize","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/akashmjn/tinydiarize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashmjn%2Ftinydiarize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashmjn%2Ftinydiarize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashmjn%2Ftinydiarize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashmjn%2Ftinydiarize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akashmjn","download_url":"https://codeload.github.com/akashmjn/tinydiarize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashmjn%2Ftinydiarize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-13T15:00:25.030Z","updated_at":"2026-01-18T08:14:13.324Z","avatar_url":"https://github.com/akashmjn.png","language":"Python","funding_links":[],"categories":["Software"],"sub_categories":["Speaker change detection"],"readme":"# tinydiarize 🐥🗣️\n\n- *Speaker diarization* labels who said what in a transcript (e.g. Speaker A, Speaker B …). It is essential for conversation transcripts like meetings or podcasts.\n- *tinydiarize*  aims to be a minimal, interpretable  extension of OpenAI's [Whisper](https://github.com/openai/whisper) models that adds speaker diarization with few extra dependencies (inspired by [minGPT](https://github.com/karpathy/minGPT)).\n- This uses a finetuned model that adds special tokens to mark speaker changes [[1,2,3,4]](#references). It can use *both voice and semantic context to tell speakers apart*, which is a unique benefit of this approach.\n- You can refer to [tdrz_dev](https://github.com/akashmjn/tinydiarize/tree/main/tdrz_dev) for a detailed analysis of performance. Note that this is intended to be a prototype/proof-of-concept.\n- Experimental support is also added to [whisper.cpp](https://github.com/ggerganov/whisper.cpp#speaker-segmentation-via-tinydiarize-experimental) so this can run on consumer hardware like MacBooks and iPhones. A tiny change is needed to original inference code (\u003c50 lines), enabling simple and cheap speaker segmentation, compared with conventional approaches.\n\n\n## Demo\n\nhttps://user-images.githubusercontent.com/13268767/229617067-eca0f614-d334-480d-9801-7c30d88acdc6.mp4\n\nYou can try it out on other such gems from YouTube using this notebook. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/akashmjn/tinydiarize/blob/main/notebooks/Demo_YouTube.ipynb)\n\n\n## Quickstart \n\nInstall `ffmpeg` following the [original repo](https://github.com/openai/whisper#Setup), then run:\n\n```\npip install -e .\nwhisper --model small.en-tdrz AUDIO \n```\n\nThe only change is the `small.en-tdrz` model instead of `small.en`. That's it! 🎉\n\n\n## What's included?\n\n- Finetuned checkpoint for the `small.en-tdrz` model (located [here](whisper/__init__.py)) and example inference code (relevant edits in [[#4]](https://github.com/akashmjn/tinydiarize/pull/4) [[#11]](https://github.com/akashmjn/tinydiarize/pull/11)). This has the same dependencies as the original whisper repo.\n- Tools for comparison and analysis (under [/tdrz_dev](tdrz_dev)):\n    - A scoring tool to measure and compare accuracy on your own data in an easy to interpret way.\n    - A reference script to run and compare various diarization pipelines.\n    - A Jupyter notebook to compare and understand performance in detail.\n- See [Roadmap](#roadmap) for more info.\n\nWe aim to demonstrate a starting point enabling anyone (or even OpenAI themselves!) to improve performance and extend support (multilingual, speech translation etc.).\n\n## Performance\n\n|metric|small.en|small.en-tdrz|\n|:----|:----|:----|\n|spk_turn_precision|-|97.7|\n|spk_turn_recall|-|70.8|\n|wer_overall|11.0|10.3|\n|wer_speaker_switch|15.0|15.5|\n\nOn a (tiny) benchmark set of 3 [earnings calls](https://github.com/revdotcom/speech-datasets/tree/main/earnings21), `tdrz` gets near-perfect speaker turn precision at fairly decent recall. A similar WER is retained as the original model. Not too shabby for a tiny finetuning setup, and \u003c10% extra inference cost!\n\nRefer to [tdrz_dev](tdrz_dev/) for details on performance analysis and comparisons.\n\n## More info\n- Whisper `small.en` checkpoints were finetuned on ~100hrs of [AMI meetings](https://groups.inf.ed.ac.uk/ami/corpus/) using HuggingFace [Transformers](https://github.com/huggingface/transformers) and [Datasets](https://github.com/huggingface/datasets).\n- With some tricks, this could be done relatively cheaply with just 30mins of 1 GPU training starting to produce decent results. Tiny indeed 😊.\n- We used helpful tools from [pyannote](https://github.com/pyannote/pyannote-core) (the OG open-source diarization toolkit) for finetuning data preparation and also analyze its performance.\n- We make use of the excellent open-source [revdotcom/fstalign](https://github.com/revdotcom/fstalign) tool for scoring and analysis.\n\n## Gotchas\n\nNote that this still an early proof-of-concept and there are a few things to be aware of:\n- Only the `small.en` English model has been finetuned.\n- Word-error-rate (WER) is close to original models, although not yet extensively tested. Ad-hoc inspection does show some differences in timestamp behavior (longer segments) or deletion errors. See the notebook under [tdrz_dev](tdrz_dev/) for details.\n- Given a pretty tiny finetuning setup, there's likely a lot of room for further accuracy improvements.\n- Only local diarization (segmentation into speaker turns) is handled so far. Extension with global diarization (speaker clustering) is planned for later.\n- Stuff is still hacky and subject to change, so hold your horses just yet! 🐎\n\n## Roadmap\n- [x] inference code \u0026 demo\n- [x] scoring and analysis tools\n- [x] [whisper.cpp integration](https://github.com/ggerganov/whisper.cpp/pull/1058)\n- [ ] *reproducible dataprep + finetuning\\**\n- [ ] *blog post explainer\\**\n- [ ] HuggingFace integration\n- [ ] better LoRa-based `small.en` checkpoint\n- [ ] possibly clustering with [NME-SC](https://github.com/tango4j/Auto-Tuning-Spectral-Clustering)?\n- [ ] possibly `large-v2` checkpoint?\n\n*\\* is a pointer to the current state of the repo. Please see https://github.com/akashmjn/tinydiarize/issues/14 for an update on plans. TLDR; things have had to be put on pause :/*\n\n## References\n\n[[1]](https://arxiv.org/abs/1907.05337) Joint Speech Recognition and Speaker Diarization via Sequence Transduction\n[[2]](https://arxiv.org/abs/2003.12687) Serialized Output Training for End-to-End Overlapped Speech Recognition\n[[3]](https://arxiv.org/abs/2109.11641) Turn-to-Diarize: Online Speaker Diarization Constrained by Transformer Transducer Speaker Turn Detection\n[[4]](https://arxiv.org/abs/2305.18747) Adapting Multi-Lingual ASR Models for Handling Multiple Talkers\n\nFor information on the underlying Whisper model, please refer to the [original documentation (release: `20230308`)](https://github.com/openai/whisper/tree/v20230308)\n\n## License\n\nCode and model weights are released under the MIT License. See [LICENSE](https://github.com/openai/whisper/blob/main/LICENSE) for further details.\n\n## Citation\n\nIf you please to use this in your research, you can cite this work as \n```\n@software{mahajan2023tinydiarize,\n  author = {Mahajan, Akash},\n  month = {08},\n  title = {tinydiarize: Minimal extension of Whisper for speaker segmentation with special tokens},\n  url = {https://github.com/akashmjn/tinyDiarize},\n  year = {2023}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashmjn%2Ftinydiarize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakashmjn%2Ftinydiarize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashmjn%2Ftinydiarize/lists"}