This repository contains the code for the papers Text Classification with Born's Rule and In-Database Text Classification with BornSQL (EDBT 2026, forthcoming). The code to reproduce the papers is available in the folders nips and edbt, respectively. The classifier is implemented in python and available on PyPI. The complete documentation is available here.
Install via pip with:
pip install bornruleThe package implements three versions of the classifier. The classification algorithm is compatible with the scikit-learn ecosystem. The neural version is compatible with pytorch. The SQL version supports in-database classification currently in PostgreSQL, SQLite, and MySQL.
from bornrule import BornClassifier- Use it as any other
sklearnclassifier - Supports both dense and sparse input and GPU-accelerated computing via
cupy
from bornrule.torch import Born- Use it as any other
torchlayer - Supports real and complex-valued inputs. Outputs probabilities in the range [0, 1]
from bornrule.sql import BornClassifierSQL- Equivalent to the class
BornClassifierbut for in-database classification - Supports inputs represented as json
{feature: value, ...}
Emanuele Guidotti and Alfio Ferrara. Text Classification with Born's Rule. In Advances in Neural Information Processing Systems, volume 35, pages 30990–31001, 2022.
A BibTeX entry for LaTeX users is:
@inproceedings{guidotti2022born,
title = {Text Classification with Born's Rule},
author = {Guidotti, Emanuele and Ferrara, Alfio},
booktitle = {Advances in Neural Information Processing Systems},
pages = {30990--31001},
volume = {35},
year = {2022}
}Emanuele Guidotti, Darya Shlyk, Stefano Montanelli, and Alfio Ferrara. In-Database Text Classification with BornSQL. Proceedings of the 29th international conference on extending database technology, forthcoming, 2026.
A BibTeX entry for LaTeX users is:
@inproceedings{guidotti2026bornsql,
author = {Guidotti, Emanuele and Shlyk, Darya and Montanelli, Stefano and Ferrara, Alfio},
title = {In-Database Text Classification with BornSQL},
booktitle = {Proceedings of the 29th International Conference on Extending Database Technology (EDBT)},
year = {2026},
note = {Forthcoming}
}