Skip to main content

Accent Detective

Accent Detective is a lightweight, text-free and alignment-free neural network that measures how Taiwanese-accented Mandarin speech sounds. It offers multiple model sizes with shared weights, designed for speech data filtering and TTS accent evaluation.

Install

pip install AccentDetective

Use

from accent_detective import load

det = load()                                         # downloads the checkpoint from the Hugging Face Hub
det.score("clip.wav")                                # the largest size, audio only
# {"logit": 5.25, "probability": 0.995, "index": 0.76, "size": "small", "mode": "audio", ...}
det.score("clip.wav", "這麼長的時間", size="nano")     # with the text it reads, the smallest size
det.score_sizes("clip.wav")                          # every size from one pass
det.score_recording("talk.wav")                      # any length: long audio is cut at pauses
for r in det.score_progressive("clip.wav"):          # anytime: each size's score as soon as its exit is reached
    print(r["size"], r["probability"])
accent-detective clip.wav other.mp3 --all-sizes

probability is the calibrated probability that the recording is Taiwan Mandarin rather than Mainland Mandarin. logit is the same value as log-odds. The text is optional: without it, the model judges the audio alone, and neither mode needs a forced alignment.

Sizes

All four sizes are prefixes of one network: a smaller size is the first part of every larger one.

Size Parameters (audio only) CPU latency, 5 s clip, 1 thread Sealed AUC, published / listener-checked labels BreezyVoice ranked above CosyVoice
Nano 9.5 M 74 ms .888 / .956 79%
Tiny 16.2 M 132 ms .903 / .961 79%
Mini 22.9 M 190 ms .905 / .960 80%
Small 43.0 M 352 ms .913 / .962 80%
  • The evaluation: the sealed set is Common Voice speakers held back for testing. The second column of each AUC pair uses labels corrected by a blind listening check.
  • Synthetic check: BreezyVoice is CosyVoice-300M fine-tuned on Taiwan Mandarin, and a valid judge must score it as more Taiwanese.
  • Details: in the paper.

Intended use

  • For:
    • Screening speech data for Taiwan-accented Mandarin.
    • Evaluating how Taiwanese a speech synthesiser sounds.
    • Research on Mandarin accents.
  • What the scores describe: recordings, not people. Do not use them to infer anyone's origin or nationality.
  • Not a language detector: the model scores any audio, including silence and other languages, so check that the input is Mandarin speech first.
  • Known weaknesses:
    • Standard Mandarin from the Southwestern Mandarin region is judged Taiwan-accented more often than that of other Mainland regions.
    • Real noise and reverberation lower accuracy.

Repository

Path Content
src/accent_detective The AccentDetective package: inference only, published to PyPI
research The code behind the paper and the dataset, and the exact data splits
paper The paper: LaTeX source, figures, tables and the data behind them
dataset The dataset card, the screening summaries and the blind listening check
demo The Gradio demo

Licence

  • Code and model weights: MIT.
  • The dataset: CC0, like its source, Common Voice.
  • The lexicons the model downloads:
    • 教育部《國語辭典簡編本》: CC BY-ND 3.0 TW.
    • CC-CEDICT: CC BY-SA 4.0.

Citation

@misc{lin2026accentdetective,
  title        = {Accent Detective: One Small Judge to Clean Taiwan Mandarin Speech Data and to Evaluate Speech Synthesis},
  author       = {Lin, Jhen-Ke},
  year         = {2026},
  howpublished = {\url{https://github.com/JacobLinCool/AccentDetective}}
}

Metadata

Release files for AccentDetective 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for AccentDetective 0.1.0
File Size Uploaded Provenance Actions
accentdetective-0.1.0.tar.gz 19.6 kB With provenance Details for accentdetective-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AccentDetective 0.1.0
File Interpreter ABI Platform Actions
accentdetective-0.1.0-py3-none-any.whl Python 3 none any Details for accentdetective-0.1.0-py3-none-any.whl

Total release size: 35.4 kB

Release files / accentdetective-0.1.0.tar.gz

Download URL accentdetective-0.1.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f6f9a92bc3e1af9c502f7a50c32c9650fe48b153100fc67e157b66b37aaaf309
BLAKE2b-256 checksum
How to use checksums
0e07f2e83a04b6f10530266ff41bc8f855110954cfca9a6a27526025d4c28073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / accentdetective-0.1.0-py3-none-any.whl

Download URL accentdetective-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0055a6aaeae7eda7bef52a392252af0382ccd10053bfa7b9527c04887a8eb2c0
BLAKE2b-256 checksum
How to use checksums
b14477d6e64ef9fe86eaaaf5587b1d4f7a96712c1cc638468de7e92f40a4e849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for AccentDetective 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for accentdetective-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page