This work shows the value of word-level statistical data from the US Congressional Record for studying the ideological positions and dynamic behavior of senators. Using classification techniques from machine learning, we predict senators’ party with near-perfect accuracy. We also develop text-based ideology scores to embed a politician’s ideological position in a one-dimensional policy space. Using these scores, we find that speech that diverges from voting positions may result in higher vote totals. To explain this behavior, we show that politicians use speech to move closer to their party’s average position. These results not only provide empirical support for political economy models of commitment, but also add to the growing literature of machine-learning-based text analysis in social science contexts.