Skip to main content

EnvBert is an easy-to-use Python library built on top of Bert models to identify essential environmental data as a part of due diligence in environmental site assessments.

Feature Output
EDD Prediction Categorizes the Environment data under different classes
Relevancy Classify whether it's relevant or not for the Environment domain
Ranking Relevance probability is returned against the predicted classes
Fine-tuning Train for your custom Environment data and save, use your model

Installation

Use the package manager pip to install EnvBert

pip install EnvBert

Usage

Predict with EnvBert

# load all the functions
from EnvBert.due_diligence import *

# returns the predicted class along with the probability of the actual EnvBert model
doc = """
	weathered shale was encountered below the surface area with fluvial deposits. 
	Sediments in the coastal plain region are found above and below the bedrock 
	with sandstones and shales that form the basement rock"
      """

envbert_predict(doc)

Fine-tune over EnvBert with your custom Environment data and labels

# load all the functions
from EnvBert.due_diligence import *

# define training config
training_config = {
    'learning_rate':5e-5,
    'epochs':10,
    'batch_size':16,
    'sentence column name':'Sentence', #training sentences column name
    'label column name': 'label', #encoded labels column name
    'save_dir': r'XX\XX\XXX' #model save path
    }

"""
please make sure you encode your labels
provide the save_dir path to automatically save the model after training
'sentence column name' and 'label column name' are mandatory fields in training config
you can tweak the other parameters or it will be taken by default
"""

# Train the model with just 1 line
new_model, new_tokenizer = finetune(df, training_config) #df is the dataframe with your sentences and labels

Load your fine-tuned model and predict

load_dir = r'XX\XX\XXX' #model save path

finetuned_model = finetune_predict(load_dir)

# single sentence prediction
doc= "contamination have been reported and remediation havent been carried out"
finetuned_model.sent(doc)

# predict over a dataframe column
df['prediction'] = finetuned_model.df(df, 'Sentence') #df is the dataframe and 'Sentence' is the column name

Change log

  1. Updated the transformers dependency to >=4.30,<4.40 for improved compatibility and stability.

  2. Modified the numerical output formatting to eliminate unintended floating-point artifacts.

About

This Package is part of the Research topic "AI for Environment Due-Diligence" conducted by Afreen Aman, Deepak John Reji. If you use this work (code, model or dataset),

Please cite us and star at: AI for Environment Due-Diligence, (2022), GitHub repository, https://github.com/dreji18/environmental-due-diligence

License

MIT License

Metadata

Release files for envbert 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envbert 1.0.9
File Size Uploaded
envbert-1.0.9.tar.gz 49.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for envbert 1.0.9
File Interpreter ABI Platform
envbert-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 97.5 kB

Release files / envbert-1.0.9.tar.gz

Download URL envbert-1.0.9.tar.gz
Size 49.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5c77fae386e44a1c1f1d95fdb2e44006620c50d38b3660d2c0dcfa9e5941b109
BLAKE2b-256 checksum
How to use checksums
c58056b22c943ac4a773865bc68bbe4ca298019232aea18bf8c56365be322809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / envbert-1.0.9-py3-none-any.whl

Download URL envbert-1.0.9-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88017734500e7a886b27b65c4483cb243cd7386bbc39f663c37402153e50b97e
BLAKE2b-256 checksum
How to use checksums
6422d07227a3638cd4cb5f0d76b3f4df24c61c1def496b52ac9669f731559648
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page