Metadata-Version: 2.1
Name: bonsait
Version: 0.1.1a0
Summary: 
Author: mikoto
Author-email: fanyang@plan.aau.dk
Requires-Python: >=3.9
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: ipython (>=8.16.1,<9.0.0)
Requires-Dist: nltk (==3.8.1)
Requires-Dist: numpy (==1.24.2)
Requires-Dist: openpyxl (==3.1.2)
Requires-Dist: pandas (==1.5.3)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: scikit-learn (==1.2.1)
Requires-Dist: sentence-transformers (==2.2.2)
Requires-Dist: torch (>=2.1.0,<3.0.0)
Requires-Dist: tqdm (==4.64.1)
Requires-Dist: xlrd (==2.0.1)
Description-Content-Type: text/markdown

# BonsaiT: an Interface for BONSAI classifications

BonsaiT is a Python package for the standardization of classifications in Life-Cycle Assessment (LCA). It leverages NLP to aligns external classification systems with the BONSAI framework, ensuring data consistency across LCA datasets.

Key components include the Encoder, which converts text to vectors via language models like Sentence Transformers and Hugging Face's BERT, and the ClassTransformer, which identifies the BONSAI class most similar to a given source class through vector analysis and cosine similarity.

BonsaiT streamlines LCA data harmonization, enabling more accurate environmental impact assessments.

## Installation

To get started with BonsaiT, install it via pip:
```Bash
pip install bonsait
```

## Quick start

Here’s how to quickly implement BonsaiT in your project:

```Python
from bonsait import ClassTransformer

source_class = "electricity from coal"

# Set up the ClassTransformer with your source classification
class_transformer = ClassTransformer(source_class=source_class)

# Perform the transformation to find the BONSAI equivalent
transformed_class = class_transformer.transform()
print(f"The source classification <{source_class}> is transformed into BONSAI classification: <{transformed_class}>")
```


## License

BonsaiT is released under the MIT License
