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