# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['bornrule', 'bornrule.sql', 'bornrule.torch']

package_data = \
{'': ['*']}

install_requires = \
['numpy>=1.19.5', 'pandas>=1.1.5', 'scikit-learn>=0.24.2', 'scipy>=1.5.4']

setup_kwargs = {
    'name': 'bornrule',
    'version': '0.1.0',
    'description': "Classification with Born's rule",
    'long_description': '# Classification with Born\'s Rule\n\n<img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/08/Logo_for_Conference_on_Neural_Information_Processing_Systems.svg/1200px-Logo_for_Conference_on_Neural_Information_Processing_Systems.svg.png" align="right" height="128"/>This repository implements the classifier proposed in:\n\n> Emanuele Guidotti and Alfio Ferrara. Text Classification with Born’s Rule. *Advances in Neural Information Processing Systems*, 2022.\n\n<div align="center">\n  [<a href="https://openreview.net/pdf?id=sNcn-E3uPHA">Paper</a>] - \n  [<a href="https://nips.cc/media/neurips-2022/Slides/54723.pdf">Slides</a>] - \n  [<a href="https://nips.cc/media/PosterPDFs/NeurIPS%202022/8d7628dd7a710c8638dbd22d4421ee46.png">Poster</a>]\n</div>\n\n## Installation\n\n```bash\npip install bornrule\n```\n\n## Usage\n\n### Scikit-Learn\n\n```py\nfrom bornrule import BornClassifier\n```\n\n- Use it as any other `sklearn` classifier\n- Supports both dense and sparse input and GPU-accelerated computing via `cupy`\n- Documentation available [here](https://eguidotti.github.io/bornrule/sklearn/)\n\n### PyTorch\n\n```py\nfrom bornrule.torch import Born\n```\n\n- Use it as any other `torch` layer\n- Supports real and complex-valued inputs. Outputs probabilities in the range [0, 1]\n- Documentation available [here](https://eguidotti.github.io/bornrule/pytorch/)\n\n### SQL\n\n```py\nfrom bornrule.sql import BornClassifierSQL\n```\n\n- Use it for in-database classification\n- Supports inputs represented as json `{feature: value, ...}`\n- Documentation available [here](https://eguidotti.github.io/bornrule/sql/)\n\n## Paper replication\n\nAll the results in the paper are obtained using Python 3.9 on a Google Cloud Virtual Machine equipped with \nCentOS 7, 12 vCPU Intel Cascade Lake 85 GB RAM, 1 GPU NVIDIA Tesla A100, and CUDA 11.5.\n\nInstall this package:\n\n```commandline\npip install bornrule==0.1.0\n```\n\nInstall additional dependencies to replicate the paper:\n\n```commandline\npip install bs4==0.0.1 nltk==3.7 matplotlib==3.5.1\n```\n\nInstall [`pytorch`](https://pytorch.org) version `1.11.0` with GPU support. For CUDA 11.5 the command is:\n```commandline\npip install torch==1.11.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html\n```\n\nInstall [`cupy`](https://docs.cupy.dev/en/stable/install.html) version `10.4.0`. For CUDA 11.5 the command is:\n```commandline\npip install cupy-cuda115==10.4.0\n```\n\nRun the script `nips.py`:\n\n```commandline\npython -u nips.py > nips.log &\n```\n\nThe script generates a folder named `results` with all the results in the paper. Additional information are saved to the log file `nips.log`\n\n## Cite as\n\nPlease cite the following when using this software:\n\n```bibtex\n@inproceedings{guidotti2022text,\n  title={Text Classification with Born\'s Rule},\n  author={Emanuele Guidotti and Alfio Ferrara},\n  booktitle={Advances in Neural Information Processing Systems},\n  editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},\n  year={2022},\n  url={https://openreview.net/forum?id=sNcn-E3uPHA}\n}\n```\n\n',
    'author': 'Emanuele Guidotti',
    'author_email': 'emanuele.guidotti@unine.ch',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'https://eguidotti.github.io/bornrule/',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
