Party lines,
from speech alone.
The design
We split the corpus into four pairs, each one a left party against a right party: PSOE-PP (about 12.5 k speeches), Unidas Podemos-Vox (4 k), ERC-JxCat (3 k) and Bildu-PNV (2.6 k). Only the first pair is ever used for training. The others are held out entirely, not as unseen speeches, but as unseen parties.
Within PSOE-PP the split is by speaker, not by speech: 70% of deputies train, 30% test. A model that has simply memorised how one deputy phrases things gets no credit, because that deputy is not in the test set.
The cleaning is the experiment
Parliamentary transcripts are mostly not argument. They are procedure, thanks, and interruption. We dropped interventions under roughly a hundred tokens, sliced the long ones into chunks of at most three hundred, then dropped the stubs left over from slicing.
The consequential step was the list of giveaways: names of prominent deputies and of the parties themselves, removed from the vocabulary. Spanish parliamentary rhetoric is built on naming your opponent, so these terms are enormously predictive and entirely useless, because a model trained on them learns who is being attacked rather than how. Removing them cost more than five points in-sample. We kept them out anyway; the entire point was the transfer.
Models
Speeches are vectorised with TF-IDF over unigrams and bigrams, dropping terms in fewer than 1% or more than 40% of documents. On top of that, a Random Forest of a thousand trees and an XGBoost, with a random classifier as the floor.
On out-of-sample PSOE and PP speakers (5,166 chunks), the Random Forest reaches 0.83 accuracy and the XGBoost 0.82, against 0.49 for random. Their ROC-AUC is 0.90 and 0.91 respectively. The two models disagree in a useful way: the forest's probabilities cluster near 0.5, XGBoost's spread across the interval, and they still arrive at the same ranking.
The transfer
Now the model is shown Podemos and Vox, whose speech it has never seen, and asked the only question it knows: does this sound more like PSOE or more like PP? It separates them at 0.86 AUC. Nothing in the model understands ideology; it is matching vocabulary. That it works implies Podemos and PSOE share enough rhetoric (and Vox and PP likewise) for one to stand in for the other.
Where it breaks
On the Catalan pair the model has nothing to say. ERC and JxCat sit on opposite sides of the left-right axis in principle, but their parliamentary speech is organised around Catalan independence, an axis orthogonal to the one learned in the PSOE-PP data. The densities lie on top of each other, which is the correct answer rather than a failure of fitting.
What the features say
The heaviest n-grams are derecha, ciudadanía, transformación, socio and crear empleo. Much of the signal is positional rather than ideological: PSOE governs for most of the window, so terms of achievement (crear empleo, mayoría absoluta, extraordinario) sit on one side and terms of grievance (recorte, propaganda, destruir) on the other. In hindsight derecha and izquierda belonged on the giveaway list too.
Lessons
The degree of transfer is itself a measurement. A classifier that generalises to one unseen pair and collapses on another is telling you something substantive about which axis each pair is actually arguing along, and it will only tell you that if you take the easy words away first.