In general, a common approach to demographic inference is supervised classification, from a training set of labeled users, a model is fit to predict user features from the content of their writings.
inferring user characteristics is framed as a predictive task validated on held-out data.