Skip to main content

No project description provided

Project description

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 BonsaiTransformer, which identifies the BONSAI class most similar to a given source class through vector analysis and cosine similarity.

BonsaiT can be used to:

  • Identify the BONSAI class most similar to a given source class.
  • Translate classifications between different systems.
  • Harmonize LCA data from different sources.

Installation

To get started with BonsaiT, install it via pip:

pip install bonsait

Quick start

Here is how to quickly implement BonsaiT in your project:

from bonsait import BonsaiTransformer

source_class = "electricity from coal"

# Set up the BonsaiTransformer
class_transformer = BonsaiTransformer()

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

License

BonsaiT is released under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bonsait-0.1.4.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

bonsait-0.1.4-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page