TabuLLM: Feature extraction and interpretation of text columns in tabular data using large language models
TabuLLM is a Python package for extracting and interpreting LLM-based text features from datasets that combine free-text and structured columns. Motivated by a clinical study predicting postoperative acute kidney injury in paediatric cardiopulmonary bypass patients from electronic health records, the package integrates large language model (LLM) embeddings into scikit-learn -compatible pipelines for tabular datasets containing text columns alongside structured features. The package provides three core components: 1) TextColumnTransformer wraps the LangChain embedding ecosystem in a scikit-learn transformer interface with native multi-column handling; 2) GMMFeatureExtractor extends scikit-learn ’s Gaussian mixture model with a transform() method that returns per-cluster log-joint features for dimensionality reduction; and 3) ClusterExplainer generates natural language cluster descriptions using LLMs with recursive summarization, optional outcome-based statistical testing, and narrative synthesis. On a fraud detection benchmark (4.8% fraud rate), incorporating text features via TabuLLM improves PR-AUC from 0.64 (structured features only) to 0.82 (text concatenation), with per-column stacking ensembles reaching 0.91. TabuLLM thus lowers the barrier to text–tabular integration: state-of-the-art embeddings become a drop-in addition to existing scikit-learn pipelines, with interpretability tools to understand what the text features capture. The package is available via pip install tabullm .
Authors
- Alireza S. Mahani
- Alex Bottle
- Mansour T.A. Sharabiani
Institutions
- Imperial College London (GB)
Publication Details
- Journal
- SoftwareX
- Published
- 2026-06-17
- DOI
- https://doi.org/10.1016/j.softx.2026.102810
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 0.00