semvec/pypi-packages huggingface dataset:
kinya-tn 0.0.1.3.1
A small package that convert time, cardinal numbers, some acronyms and transliterations cases from their written form to their verbalized form. It can be used to normalize text before feeding it into a text-to-speech model.
Requires Python: >=3.8

# Kinya_TN

Kinyarwanda_TextNormalization(Kinya_TN) is a small package that convert time, cardinal numbers, some acronyms and transliterations cases from their written form to their verbalized form. It can be used to preprocess text to an adequate form for text-to-speech models.

## Installation

```
pip install kinya_tn
```

## Usage

```
from kinya_tn import text_normalization

text_normalization.normalize("abantu 2000 baje kure ikiganiro cya covid cyatangiye 12:40")
```
fairbalance 0.1.20
bias mitigation by balancing target and/or protected attributes using resampling techniques

# FairBalance

## Overview

FairBalance is a Python package that provides a suite of tools for evaluating and enhancing fairness in datasets. It includes a variety of fairness evaluation metrics and resampling methods to help address and mitigate bias in your data. This package is designed to be easily integrated into your machine learning pipeline, ensuring that your models are built on fair and balanced datasets.

## Installation

You can install FairBalance using pip:

```bash
pip install fairbalance
```

## Features
- **Easily load fairness datasets**: Load ready-to-use famous datasets such as adult to test fairbalance features.
- **Fairness Evaluation Metrics**: Compute various fairness metrics to evaluate the fairness of your dataset.
- **Resampling Methods**: Implement resampling techniques to mitigate bias in your dataset.
- **Balanced train test split**: split your dataset and rebalance your training data easily.
- **Easy Integration**: Seamlessly integrate FairBalance into your existing machine learning pipeline.

## Quick Start

Here is a quick example to get started with FairBalance:

### Evaluating the balance of your dataset
```python
from fairbalance.metrics import FairnessAnalysis
from fairbalance.datasets import load_adult

data, target, _, _ = load_adult()
FA = FairnessAnalaysis(data, target, 1, ["sex","race"], {"sex": "Male", "race": "White"})
FA.get_fairness_analysis()
```

### Applying rebalancing strategies
```python
from fairbalance.mitigation_strategies import balanceOutputForAttributes
from fairbalance.processors import RandomOverSamplerProcessor
from fairbalance.datasets import load_adult

data, target, cont_columns, cat_columns = load_adult()
mitigation = balanceOutputForAttributes(processor = RandomOverSamplerProcessor())
X_balanced, y_balanced = mitigation.resample(data, target, ["sex","race"], cont_columns, cat_columns)
```

### Creating a balanced train/test split
Fairbalance balances only the training set so that you can test your model on real, untransformed data.

```python
from fairbalance.utils import balanced_train_test_split
from fairbalance.mitigation_strategies import balanceOutputForAttributes
from fairbalance.processors import RandomOverSamplerProcessor
from fairbalance.datasets import load_adult

data, target, cont_columns, cat_columns = load_adult()
mitigation = balanceOutputForAttributes(processor = RandomOverSamplerProcessor())
X_train, X_test, y_train, y_test = balanced_train_test_split(data, target, ["sex", "race"], mitigation, cont_columns, cat_columns)
```