A package to detect and debias text using pretrained models
Project description
UnBIASing
UnBIASing is a Python package that classifies, detects, and debiases textual content to promote unbiased information. By leveraging advanced machine learning models, UnBIASing provides users with tools to analyze and correct biases in their texts.
Features
-
Bias Classification: Classifies textual content based on its bias using state-of-the-art models.
-
Named Entity Recognition (NER): Detects named entities within the text that might be indicative of bias.
-
Text Debiasing: Provides unbiased or debiased versions of the input text using an ensemble of advanced models.
Installation
pip install UnBIASing
Usage
Here's a basic example of how to use the BiasPipeline
from UnBIASing:
from unbias import BiasPipeline
pipeline = BiasPipeline()
texts = ["Your sample text goes here."]
classification_results, ner_results, debiaser_results = pipeline.process(texts)
# If you wish to print the results
pipeline.pretty_print(texts, classification_results, ner_results, debiaser_results)
# Convert results to a Pandas DataFrame
df = results_to_dataframe(texts, classification_results, ner_results, debiaser_results)
print(df)
Dependencies
- Transformers
- Torch
- Pandas
- SentencePiece
License
We hope UnBIASing
proves useful in your journey to make the digital world a more inclusive and unbiased space. For any queries or feedback, feel free to Shaina Raza at shaina.raza@utoronto.ca
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file UnBIASing-1.0.tar.gz
.
File metadata
- Download URL: UnBIASing-1.0.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d4aea29b7d6100d3d78e396403c4bed5ea613b2fc8c06e1bc0845c40037dc0a |
|
MD5 | 2cca83bc048f4e3505c5e861813f6b3c |
|
BLAKE2b-256 | c287b30c9783efa370eb2dbb5506857b095bc1cf0921b9d055d824993fca1f03 |
File details
Details for the file UnBIASing-1.0-py3-none-any.whl
.
File metadata
- Download URL: UnBIASing-1.0-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb5f65ac6edbfeccdbfc6c7fc88499ea45ac7ec04e62a3b7d5d891855ec6a055 |
|
MD5 | 60d9003186bca0cdfd05bbcf06b50e33 |
|
BLAKE2b-256 | 84f3329426ae6a2ff4d18edf81f4f700b34358448db2b4ec7e10e06f68cef4a5 |