ChordLM-Mandopop β€” melody β†’ chord harmonizer

A small (~1M-param) decoder-only transformer that predicts a chord per measure from melody pitch-class features, trained on a hand-transcribed Mandopop/Cantopop lead-sheet corpus. The idiom is computationally unstudied β€” there is no published baseline; the honest reference point is a key-prior floor computed on the same split.

Results (leak-safe test split)

metric value
model (greedy decode) 0.2325
key-prior floor (tonic triad of the chart's key) 0.2241

Measures vote once each (micro accuracy over chord-bearing measures, 60-class vocab: 12 roots Γ— {maj, min, dom7, min7, maj7}).

Why the number is trustworthy

  • Leak-safe split: no song appears on two sides β€” covers, transpositions and re-transcriptions are grouped before splitting (title normalization + transposition-invariant chord fingerprints).
  • The floor is recomputed on the same test split as the model.
  • Single-best-chord accuracy is necessary-but-insufficient for harmonization (many valid harmonizations exist); treat this as a floor-beating signal, not a quality ceiling.

Intended use & limitations

Research/demo use for Mandopop/Cantopop-idiom harmonization. Not a general-purpose harmonizer: trained on one idiom, one chord-per-measure granularity, 60-class triad+7th vocabulary (slash basses dropped, dim/aug/sus collapsed to nearest bucket). Inputs must be key-normalized to a C tonic (see the code snippet).

Usage

The model class lives in the training repo; it is a plain nn.Module with PyTorchModelHubMixin:

model = ChordTransformer.from_pretrained("chrisamber/chordlm-mandopop")
# melody: (1, T, 12) float pitch-class weights per measure, key-normalized to C
# prev:   (1, T) long, teacher-forcing chord ids, BOS=60
# mask:   (1, T) bool

Linked artifacts

Downloads last month
2
Safetensors
Model size
810k params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train chrisamber/chordlm-mandopop

Space using chrisamber/chordlm-mandopop 1