Quantitative sustainability research depends on sustainability information that is often unavailable in a structured and comprehensive way for large samples of firms. Textual analysis can, hence, leverage sustainability information from unstructured text data. However, while there is a variety of different approaches to textual analysis, researchers rarely reflect on and validate their method choice, which might influence the results. Therefore, we study the choice of textual analysis techniques to extract sustainability information. For this purpose, we first develop models for textual analysis based on topic modeling, word embeddings (WE), and state-of-the-art bidirectional encoder representations from transformers (BERT) models. Regarding the BERT model, we suggest an approach to train a BERT model to identify sustainability information without manual labeling using categories from Wikipedia data. To benchmark the natural language processing models, we conduct an experiment with 75,000 sentences from 10-k annual reports that are triple-coded by researchers regarding whether there is information related to sustainability contained. Our results show that the BERT model outperforms the established approaches and generally shows a strong performance in identifying sustainability information. Therefore, our work contributes to measuring sustainability based on text data facilitating future research that can use the studied approaches.