nkululeko


Namenkululeko JSON
Version 0.95.5 PyPI version JSON
download
home_pagehttps://github.com/felixbur/nkululeko
SummaryMachine learning audio prediction experiments based on templates
upload_time2025-07-08 18:18:03
maintainerNone
docs_urlNone
authorFelix Burkhardt
requires_python>=3.9
licenseMIT
keywords machine learning audio emotion recognition speech processing
VCS
bugtrack_url
requirements audeer audformat audinterface audiofile audiomentations audmetric audonnx confidence-intervals datasets imageio matplotlib numpy opensmile pandas praat-parselmouth scikit_learn scipy seaborn sounddevice transformers umap-learn xgboost pylatex torch torchaudio torchvision imblearn shap splitutils
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Nkululeko

Nkululeko is a project to detect speaker characteristics by machine learning experiments with a high-level interface. The idea is to have a framework (based on e.g. sklearn and torch) that can be used to rapidly and automatically analyse audio data and explore machine learning models based on that data. 

Some abilities that Nkululeko provides: combines acoustic features and machine learning models (including feature selection and features concatenation); performs data exploration, selection and visualization the results; finetuning; ensemble learning models; soft labeling (predicting labels with pre-trained model); and inference the model on a test set.

Nkululeko orchestrates data loading, feature extraction, and model training, allowing you to specify your experiment in a configuration file. The framework handles the process from raw data to trained model and evaluation, making it easy to run machine learning experiments without directly coding in Python.

## Who is this for?
Nkululeko is for speech processing learners, researchers and ML practitioners focused on speaker characteristics, e.g., emotion, age, gender, or disorder detection.

## Installation

Nkululeko requires Python 3.9 or higher with the following build status:  

![Python 3.10](https://github.com/bagustris/nkululeko/actions/workflows/py310-aud-csv.yml/badge.svg)  
![Python 3.11](https://github.com/bagustris/nkululeko/actions/workflows/py311.yml/badge.svg)    
![Python 3.12](https://github.com/bagustris/nkululeko/actions/workflows/py312.yml/badge.svg)  
![Python 3.13](https://github.com/bagustris/nkululeko/actions/workflows/py313.yml/badge.svg)    

Create and activate a virtual Python environment and simply install Nkululeko:

```bash
# using python venv
python -m venv .env
source .env/bin/activate  # specify OS versions, add a separate line for Windows users 
pip install nkululeko
# using uv in development mode
uv venv --python 3.12
source .venv/bin/activate
uv pip install -r requirements.txt
# or run directly using uv run after cloning
uv run python -m nkululeko.nkululeko --config examples/exp_polish_tree.ini
```

### Optional Dependencies

Nkululeko supports optional dependencies through extras:

```bash
# Install with PyTorch support
pip install nkululeko[torch]

# Install with CPU-only PyTorch
pip install nkululeko[torch-cpu]

# Install with TensorFlow support
pip install nkululeko[tensorflow]

# Install all optional dependencies
pip install nkululeko[all]
```

#### Manual Installation Options

You can also install dependencies manually:

##### PyTorch Installation

For CPU-only installation (recommended for most users):
```bash
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --index-url https://download.pytorch.org/whl/cpu
```

For GPU support (cuda 12.6):
```bash
pip install torch torchvision torchaudio
```

Some functionalities require extra packages to be installed, which we didn't include automatically:

* For spotlight adapter:
  ```bash
  pip install PyYAML  # Install PyYAML first to avoid dependency issues
  pip install nkululeko[spotlight]
  ```

Some examples for *ini*-files (which you use to control nkululeko) are in the [examples folder](https://github.com/felixbur/nkululeko/tree/main/examples).



## Documentation
The documentation, along with extensions of installation, usage, INI file format, and examples, can be found [nkululeko.readthedocs.io](https://nkululeko.readthedocs.io).


## Usage

### [ini-file values](./ini_file.md)

Basically, you specify your experiment in an ["ini" file](./ini_file.md) (e.g. *experiment.ini*) and then call one of the Nkululeko interfaces to run the experiment like this:

  ```bash
  python -m nkululeko.nkululeko --config experiment.ini
  ```

A basic configuration looks like this:

```ini
[EXP]
root = ./
name = exp_emodb
[DATA]
databases = ['emodb']
emodb = ./emodb/
emodb.split_strategy = speaker_split
target = emotion
labels = ['anger', 'boredom', 'disgust', 'fear']
[FEATS]
type = ['praat']
[MODEL]
type = svm
[EXPL]
model = tree
plot_tree = True
```
Read the [Hello World example](#hello-world-example) for initial usage with Emo-DB dataset.

Here is an overview of the interfaces/modules:

All of them take *--config <my_config.ini>* as an argument.

* **nkululeko.nkululeko**: do machine learning experiments combining features and learners (e.g. opensmile with SVM)
* **nkululeko.ensemble**: [combine several nkululeko experiments](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/) and report on late fusion results
* **nkululeko.multidb**: do [multiple experiments](http://blog.syntheticspeech.de/2024/01/02/nkululeko-compare-several-databases/), comparing several databases cross and in itself
* **nkululeko.demo**: [demo the current best model](http://blog.syntheticspeech.de/2022/01/24/nkululeko-try-out-demo-a-trained-model/) on the command line
* **nkululeko.test**: predict a [given data set](http://blog.syntheticspeech.de/2022/09/01/nkululeko-how-to-evaluate-a-test-set-with-a-given-best-model/) with the current best model
* **nkululeko.explore**: perform [data exploration](http://blog.syntheticspeech.de/2023/05/11/nkululeko-how-to-visualize-your-data-distribution/)
* **nkululeko.augment**: [augment](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/) the current training data
* **nkululeko.aug_train**: augment the current training data [and do a training](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/) including this data
* **nkululeko.predict**: [predict features](http://blog.syntheticspeech.de/2023/08/16/nkululeko-how-to-predict-labels-for-your-data-from-existing-models-and-check-them/) like SNR, MOS, arousal/valence, age/gender, with DNN models
* **nkululeko.segment**: [segment a database](http://blog.syntheticspeech.de/2023/07/14/nkululeko-segmenting-a-database/) based on VAD (voice activity detection)
* **nkululeko.resample**: check on all [sampling rates and change](http://blog.syntheticspeech.de/2023/08/31/how-to-fix-different-sampling-rates-in-a-dataset-with-nkululeko/) to 16kHz 
* **nkululeko.nkuluflag**: a convenient module to specify configuration parameters on the command line.

## <a name="helloworld">Hello World example</a>
* NEW: [Here's a Google colab that runs this example out-of-the-box](https://colab.research.google.com/drive/1Up7t5Nn7VwDPCCEpTg2U7cpZ_PdoEgj-?usp=sharing), and here is the same [with Kaggle](https://www.kaggle.com/felixburk/nkululeko-hello-world-example)
* [I made a video to show you how to do this on Windows](https://www.youtube.com/playlist?list=PLRceVavtxLg0y2jiLmpnUfiMtfvkK912D)
* Set up Python on your computer, version >= 3.8
* Open a terminal/command line/console window
* Test python by typing ```python```, python should start with version >3 (NOT 2!). You can leave the Python Interpreter by typing *exit()*
* Create a folder on your computer for this example, let's call it `nkulu_work`
* Get a copy of the [Berlin emodb in audformat](https://zenodo.org/records/7447302/files/emodb.zip?download=1) and unpack inside the folder you just created (`nkulu_work`)
* Make sure the folder is called "emodb" and does contain the database files directly (not box-in-a-box)
* Also, in the `nkulu_work` folder: 
  * Create a Python environment
    * ```python -m venv venv```
  * Then, activate it:
    * under Linux / mac
      * ```source venv/bin/activate```
    * under Windows
      * ```venv\Scripts\activate.bat```
    * if that worked, you should see a ```(venv)``` in front of your prompt
  * Install the required packages in your environment
    * ```pip install nkululeko```
    * Repeat until all error messages vanish (or fix them, or try to ignore them)...
* Now you should have two folders in your *nkulu_work* folder:
  * *emodb* and *venv*
* Download a copy of the file [exp_emodb.ini](meta/demos/exp_emodb.ini) to the current working directory (```nkulu_work```)
* Run the demo
  * ```python -m nkululeko.nkululeko --config exp_emodb.ini```
* Find the results in the newly created folder exp_emodb 
  * Inspect ```exp_emodb/images/run_0/emodb_xgb_os_0_000_cnf.png```
  * This is the main result of your experiment: a confusion matrix for the emodb emotional categories
* Inspect and play around with the [demo configuration file](meta/demos/exp_emodb.ini) that defined your experiment, then re-run.
* There are many ways to experiment with different classifiers and acoustic feature sets, [all described here](https://github.com/felixbur/nkululeko/blob/main/ini_file.md)
  
## Features
The framework is targeted at the speech domain and supports experiments where different classifiers are combined with different feature extractors.

* Classifiers: Naive Bayes, KNN, Tree, XGBoost, SVM, MLP
* Feature extractors: Praat, Opensmile, openXBOW BoAW, TRILL embeddings, Wav2vec2 embeddings, audModel embeddings, ...
* Feature scaling
* Label encoding
* Binning (continuous to categorical)
* Online demo interface for trained models 
* Visualization: confusion matrix, feature importance, feature distribution, epoch progression, t-SNE plot, data distribution, bias checking, uncertainty estimation

Here's a rough UML-like sketch of the framework (and [here's the real one done with pyreverse](meta/images/classes.png)).
![sketch](meta/images/class_diagram.png)

Currently, the following linear classifiers are implemented (integrated from sklearn):
* SVM, SVR, XGB, XGR, Tree, Tree_regressor, KNN, KNN_regressor, NaiveBayes, GMM
  and the following ANNs (artificial neural networks)
* MLP (multi-layer perceptron), CNN (convolutional neural network)

For visualization, besides confusion matrix, feature importance, feature distribution, t-SNE plot, data distribution (just names a few), Nkululeko can also be used for bias checking, uncertainty estimation, and epoch progression.

### Bias checking

<details>
In some cases, you might wonder if there's bias in your data. You can try to detect this with automatically estimated speech properties by visualizing the correlation of target labels and predicted labels.

<img src="meta/images/emotion-pesq.png" width="500px"/>

</details>

### Uncertainty

<details>
Nkululeko estimates the uncertainty of model decisions (only for classifiers) with entropy over the class probabilities or logits per sample.

<img src="meta/images/uncertainty.png" width="500px"/>

</details>

Here's [an animation that shows the progress of classification done with nkululeko](https://youtu.be/6Y0M382GjvM).

## News

<details> 

There's Felix [blog](http://blog.syntheticspeech.de/?s=nkululeko) with tutorials below:  
* [Ensemble learning with Nkululeko](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/)
* [Finetune transformer-models with Nkululeko](http://blog.syntheticspeech.de/2024/05/29/nkululeko-how-to-finetune-a-transformer-model/)
* Below is a [Hello World example for Nkululeko](#helloworld) that should set you up fastly, also on [Google Colab](https://colab.research.google.com/drive/1GYNBd5cdZQ1QC3Jm58qoeMaJg3UuPhjw?usp=sharing#scrollTo=4G_SjuF9xeQf), and [with Kaggle](https://www.kaggle.com/felixburk/nkululeko-hello-world-example)
* [Thanks to deepwiki, here's an analysis of the source code](https://deepwiki.com/felixbur/nkululeko)
* [Here's a blog post on how to set up nkululeko on your computer.](http://blog.syntheticspeech.de/2021/08/30/how-to-set-up-your-first-nkululeko-project/)
* [Here's a slide presentation about nkululeko](docs/nkululeko.pdf)
* [Here's a video presentation about nkululeko](https://www.youtube.com/playlist?list=PLRceVavtxLg0y2jiLmpnUfiMtfvkK912D)
* [Here's the 2022 LREC article on nkululeko](http://felix.syntheticspeech.de/publications/Nkululeko_LREC.pdf)
* [Introduction](http://blog.syntheticspeech.de/2021/08/04/machine-learning-experiment-framework/)
* [Nkululeko FAQ](http://blog.syntheticspeech.de/2022/07/07/nkululeko-faq/)
* [How to set up your first nkululeko project](http://blog.syntheticspeech.de/2021/08/30/how-to-set-up-your-first-nkululeko-project/)
* [Setting up a base nkululeko experiment](http://blog.syntheticspeech.de/2021/10/05/setting-up-a-base-nkululeko-experiment/)
* [How to import a database](http://blog.syntheticspeech.de/2022/01/27/nkululeko-how-to-import-a-database/) 
* [Comparing classifiers and features](http://blog.syntheticspeech.de/2021/10/05/nkululeko-comparing-classifiers-and-features/)
* [Use Praat features](http://blog.syntheticspeech.de/2022/06/27/how-to-use-selected-features-from-praat-with-nkululeko/)
* [Combine feature sets](http://blog.syntheticspeech.de/2022/06/30/how-to-combine-feature-sets-with-nkululeko/)
* [Classifying continuous variables](http://blog.syntheticspeech.de/2022/01/26/nkululeko-classifying-continuous-variables/) 
* [Try out / demo a trained model](http://blog.syntheticspeech.de/2022/01/24/nkululeko-try-out-demo-a-trained-model/) 
* [Perform cross-database experiments](http://blog.syntheticspeech.de/2021/10/05/nkululeko-perform-cross-database-experiments/)
* [Meta parameter optimization](http://blog.syntheticspeech.de/2021/09/03/perform-optimization-with-nkululeko/)
* [How to set up wav2vec embedding](http://blog.syntheticspeech.de/2021/12/03/how-to-set-up-wav2vec-embedding-for-nkululeko/)
* [How to soft-label a database](http://blog.syntheticspeech.de/2022/01/24/how-to-soft-label-a-database-with-nkululeko/) 
* [Re-generate the progressing confusion matrix animation wit a different framerate](demos/plot_faster_anim.py)
* [How to limit/filter a dataset](http://blog.syntheticspeech.de/2022/02/22/how-to-limit-a-dataset-with-nkululeko/)
* [Specifying database disk location](http://blog.syntheticspeech.de/2022/02/21/specifying-database-disk-location-with-nkululeko/) 
* [Add dropout with MLP models](http://blog.syntheticspeech.de/2022/02/25/adding-dropout-to-mlp-models-with-nkululeko/)
* [Do cross-validation](http://blog.syntheticspeech.de/2022/03/23/how-to-do-cross-validation-with-nkululeko/)
* [Combine predictions per speaker](http://blog.syntheticspeech.de/2022/03/24/how-to-combine-predictions-per-speaker-with-nkululeko/)
* [Run multiple experiments in one go](http://blog.syntheticspeech.de/2022/03/28/how-to-run-multiple-experiments-in-one-go-with-nkululeko/)
* [Compare several MLP layer layouts with each other](http://blog.syntheticspeech.de/2022/04/11/how-to-compare-several-mlp-layer-layouts-with-each-other/)
* [Import features from outside the software](http://blog.syntheticspeech.de/2022/10/18/how-to-import-features-from-outside-the-nkululeko-software/)
* [Export acoustic features](http://blog.syntheticspeech.de/2024/05/30/nkululeko-export-acoustic-features/)
* [Explore feature importance](http://blog.syntheticspeech.de/2023/02/20/nkululeko-show-feature-importance/)
* [Plot distributions for feature values](http://blog.syntheticspeech.de/2023/02/16/nkululeko-how-to-plot-distributions-of-feature-values/)
* [Show feature importance](http://blog.syntheticspeech.de/2023/02/20/nkululeko-show-feature-importance/)
* [Augment the training set](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/)
* [Visualize clusters of acoustic features](http://blog.syntheticspeech.de/2023/04/20/nkululeko-visualize-clusters-of-your-acoustic-features/)
* [Visualize your data distribution](http://blog.syntheticspeech.de/2023/05/11/nkululeko-how-to-visualize-your-data-distribution/)
* [Check your dataset](http://blog.syntheticspeech.de/2023/07/11/nkululeko-check-your-dataset/) 
* [Segmenting a database](http://blog.syntheticspeech.de/2023/07/14/nkululeko-segmenting-a-database/)
* [Predict new labels for your data from public models and check bias](http://blog.syntheticspeech.de/2023/08/16/nkululeko-how-to-predict-labels-for-your-data-from-existing-models-and-check-them/)
* [Resample](http://blog.syntheticspeech.de/2023/08/31/how-to-fix-different-sampling-rates-in-a-dataset-with-nkululeko/)
* [Get some statistics on correlation and effect-size](http://blog.syntheticspeech.de/2023/09/05/nkululeko-get-some-statistics-on-correlation-and-effect-size/)
* [Automatic generation of a latex/pdf report](http://blog.syntheticspeech.de/2023/09/26/nkululeko-generate-a-latex-pdf-report/) 
* [Inspect your data with Spotlight](http://blog.syntheticspeech.de/2023/10/31/nkululeko-inspect-your-data-with-spotlight/)
* [Automatically stratify your split sets](http://blog.syntheticspeech.de/2023/11/07/nkululeko-automatically-stratify-your-split-sets/)
* [re-name data column names](http://blog.syntheticspeech.de/2023/11/16/nkululeko-re-name-data-column-names/)
* [Oversample the training set](http://blog.syntheticspeech.de/2023/11/16/nkululeko-oversample-the-training-set/)  
* [Compare several databases](http://blog.syntheticspeech.de/2024/01/02/nkululeko-compare-several-databases/)
* [Tweak the target variable for database comparison](http://blog.syntheticspeech.de/2024/03/13/nkululeko-how-to-tweak-the-target-variable-for-database-comparison/)
* [How to run multiple experiments in one go](http://blog.syntheticspeech.de/2022/03/28/how-to-run-multiple-experiments-in-one-go-with-nkululeko/)
* [How to finetune a transformer-model](http://blog.syntheticspeech.de/2024/05/29/nkululeko-how-to-finetune-a-transformer-model/)
* [Ensemble (combine) classifiers with late-fusion](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/)
* [Use train, dev and test splits](https://blog.syntheticspeech.de/2025/03/31/nkululeko-how-to-use-train-dev-test-splits/)

</details>

## License
Nkululeko can be used under the [MIT license](https://choosealicense.com/licenses/mit/).


## Contributing
Contributions are welcome and encouraged. To learn more about how to contribute to nkululeko, please refer to the [Contributing guidelines](./CONTRIBUTING.md).

## Citation
If you use Nkululeko, please cite the paper:

> F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Björn Schuller: Nkululeko: A Tool For Rapid Speaker Characteristics Detection, Proc. Proc. LREC, 2022


```
@inproceedings{Burkhardt:lrec2022,
   title = {Nkululeko: A Tool For Rapid Speaker Characteristics Detection},
   author = {Felix Burkhardt and Johannes Wagner and Hagen Wierstorf and Florian Eyben and Björn Schuller},
   isbn = {9791095546726},
   journal = {2022 Language Resources and Evaluation Conference, LREC 2022},
   keywords = {machine learning,speaker characteristics,tools},
   pages = {1925-1932},
   publisher = {European Language Resources Association (ELRA)},
   year = {2022},
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/felixbur/nkululeko",
    "name": "nkululeko",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "machine learning, audio, emotion recognition, speech processing",
    "author": "Felix Burkhardt",
    "author_email": "Felix Burkhardt <fxburk@gmail.com>, Bagus Tris Atmaja <btatmaja@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e6/4c/76ae2361eeebc5ca6fd75619dc6253ff04f51e950ca7c92f07706f221172/nkululeko-0.95.5.tar.gz",
    "platform": null,
    "description": "## Nkululeko\n\nNkululeko is a project to detect speaker characteristics by machine learning experiments with a high-level interface. The idea is to have a framework (based on e.g. sklearn and torch) that can be used to rapidly and automatically analyse audio data and explore machine learning models based on that data. \n\nSome abilities that Nkululeko provides: combines acoustic features and machine learning models (including feature selection and features concatenation); performs data exploration, selection and visualization the results; finetuning; ensemble learning models; soft labeling (predicting labels with pre-trained model); and inference the model on a test set.\n\nNkululeko orchestrates data loading, feature extraction, and model training, allowing you to specify your experiment in a configuration file. The framework handles the process from raw data to trained model and evaluation, making it easy to run machine learning experiments without directly coding in Python.\n\n## Who is this for?\nNkululeko is for speech processing learners, researchers and ML practitioners focused on speaker characteristics, e.g., emotion, age, gender, or disorder detection.\n\n## Installation\n\nNkululeko requires Python 3.9 or higher with the following build status:  \n\n![Python 3.10](https://github.com/bagustris/nkululeko/actions/workflows/py310-aud-csv.yml/badge.svg)  \n![Python 3.11](https://github.com/bagustris/nkululeko/actions/workflows/py311.yml/badge.svg)    \n![Python 3.12](https://github.com/bagustris/nkululeko/actions/workflows/py312.yml/badge.svg)  \n![Python 3.13](https://github.com/bagustris/nkululeko/actions/workflows/py313.yml/badge.svg)    \n\nCreate and activate a virtual Python environment and simply install Nkululeko:\n\n```bash\n# using python venv\npython -m venv .env\nsource .env/bin/activate  # specify OS versions, add a separate line for Windows users \npip install nkululeko\n# using uv in development mode\nuv venv --python 3.12\nsource .venv/bin/activate\nuv pip install -r requirements.txt\n# or run directly using uv run after cloning\nuv run python -m nkululeko.nkululeko --config examples/exp_polish_tree.ini\n```\n\n### Optional Dependencies\n\nNkululeko supports optional dependencies through extras:\n\n```bash\n# Install with PyTorch support\npip install nkululeko[torch]\n\n# Install with CPU-only PyTorch\npip install nkululeko[torch-cpu]\n\n# Install with TensorFlow support\npip install nkululeko[tensorflow]\n\n# Install all optional dependencies\npip install nkululeko[all]\n```\n\n#### Manual Installation Options\n\nYou can also install dependencies manually:\n\n##### PyTorch Installation\n\nFor CPU-only installation (recommended for most users):\n```bash\npip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --index-url https://download.pytorch.org/whl/cpu\n```\n\nFor GPU support (cuda 12.6):\n```bash\npip install torch torchvision torchaudio\n```\n\nSome functionalities require extra packages to be installed, which we didn't include automatically:\n\n* For spotlight adapter:\n  ```bash\n  pip install PyYAML  # Install PyYAML first to avoid dependency issues\n  pip install nkululeko[spotlight]\n  ```\n\nSome examples for *ini*-files (which you use to control nkululeko) are in the [examples folder](https://github.com/felixbur/nkululeko/tree/main/examples).\n\n\n\n## Documentation\nThe documentation, along with extensions of installation, usage, INI file format, and examples, can be found [nkululeko.readthedocs.io](https://nkululeko.readthedocs.io).\n\n\n## Usage\n\n### [ini-file values](./ini_file.md)\n\nBasically, you specify your experiment in an [\"ini\" file](./ini_file.md) (e.g. *experiment.ini*) and then call one of the Nkululeko interfaces to run the experiment like this:\n\n  ```bash\n  python -m nkululeko.nkululeko --config experiment.ini\n  ```\n\nA basic configuration looks like this:\n\n```ini\n[EXP]\nroot = ./\nname = exp_emodb\n[DATA]\ndatabases = ['emodb']\nemodb = ./emodb/\nemodb.split_strategy = speaker_split\ntarget = emotion\nlabels = ['anger', 'boredom', 'disgust', 'fear']\n[FEATS]\ntype = ['praat']\n[MODEL]\ntype = svm\n[EXPL]\nmodel = tree\nplot_tree = True\n```\nRead the [Hello World example](#hello-world-example) for initial usage with Emo-DB dataset.\n\nHere is an overview of the interfaces/modules:\n\nAll of them take *--config <my_config.ini>* as an argument.\n\n* **nkululeko.nkululeko**: do machine learning experiments combining features and learners (e.g. opensmile with SVM)\n* **nkululeko.ensemble**: [combine several nkululeko experiments](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/) and report on late fusion results\n* **nkululeko.multidb**: do [multiple experiments](http://blog.syntheticspeech.de/2024/01/02/nkululeko-compare-several-databases/), comparing several databases cross and in itself\n* **nkululeko.demo**: [demo the current best model](http://blog.syntheticspeech.de/2022/01/24/nkululeko-try-out-demo-a-trained-model/) on the command line\n* **nkululeko.test**: predict a [given data set](http://blog.syntheticspeech.de/2022/09/01/nkululeko-how-to-evaluate-a-test-set-with-a-given-best-model/) with the current best model\n* **nkululeko.explore**: perform [data exploration](http://blog.syntheticspeech.de/2023/05/11/nkululeko-how-to-visualize-your-data-distribution/)\n* **nkululeko.augment**: [augment](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/) the current training data\n* **nkululeko.aug_train**: augment the current training data [and do a training](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/) including this data\n* **nkululeko.predict**: [predict features](http://blog.syntheticspeech.de/2023/08/16/nkululeko-how-to-predict-labels-for-your-data-from-existing-models-and-check-them/) like SNR, MOS, arousal/valence, age/gender, with DNN models\n* **nkululeko.segment**: [segment a database](http://blog.syntheticspeech.de/2023/07/14/nkululeko-segmenting-a-database/) based on VAD (voice activity detection)\n* **nkululeko.resample**: check on all [sampling rates and change](http://blog.syntheticspeech.de/2023/08/31/how-to-fix-different-sampling-rates-in-a-dataset-with-nkululeko/) to 16kHz \n* **nkululeko.nkuluflag**: a convenient module to specify configuration parameters on the command line.\n\n## <a name=\"helloworld\">Hello World example</a>\n* NEW: [Here's a Google colab that runs this example out-of-the-box](https://colab.research.google.com/drive/1Up7t5Nn7VwDPCCEpTg2U7cpZ_PdoEgj-?usp=sharing), and here is the same [with Kaggle](https://www.kaggle.com/felixburk/nkululeko-hello-world-example)\n* [I made a video to show you how to do this on Windows](https://www.youtube.com/playlist?list=PLRceVavtxLg0y2jiLmpnUfiMtfvkK912D)\n* Set up Python on your computer, version >= 3.8\n* Open a terminal/command line/console window\n* Test python by typing ```python```, python should start with version >3 (NOT 2!). You can leave the Python Interpreter by typing *exit()*\n* Create a folder on your computer for this example, let's call it `nkulu_work`\n* Get a copy of the [Berlin emodb in audformat](https://zenodo.org/records/7447302/files/emodb.zip?download=1) and unpack inside the folder you just created (`nkulu_work`)\n* Make sure the folder is called \"emodb\" and does contain the database files directly (not box-in-a-box)\n* Also, in the `nkulu_work` folder: \n  * Create a Python environment\n    * ```python -m venv venv```\n  * Then, activate it:\n    * under Linux / mac\n      * ```source venv/bin/activate```\n    * under Windows\n      * ```venv\\Scripts\\activate.bat```\n    * if that worked, you should see a ```(venv)``` in front of your prompt\n  * Install the required packages in your environment\n    * ```pip install nkululeko```\n    * Repeat until all error messages vanish (or fix them, or try to ignore them)...\n* Now you should have two folders in your *nkulu_work* folder:\n  * *emodb* and *venv*\n* Download a copy of the file [exp_emodb.ini](meta/demos/exp_emodb.ini) to the current working directory (```nkulu_work```)\n* Run the demo\n  * ```python -m nkululeko.nkululeko --config exp_emodb.ini```\n* Find the results in the newly created folder exp_emodb \n  * Inspect ```exp_emodb/images/run_0/emodb_xgb_os_0_000_cnf.png```\n  * This is the main result of your experiment: a confusion matrix for the emodb emotional categories\n* Inspect and play around with the [demo configuration file](meta/demos/exp_emodb.ini) that defined your experiment, then re-run.\n* There are many ways to experiment with different classifiers and acoustic feature sets, [all described here](https://github.com/felixbur/nkululeko/blob/main/ini_file.md)\n  \n## Features\nThe framework is targeted at the speech domain and supports experiments where different classifiers are combined with different feature extractors.\n\n* Classifiers: Naive Bayes, KNN, Tree, XGBoost, SVM, MLP\n* Feature extractors: Praat, Opensmile, openXBOW BoAW, TRILL embeddings, Wav2vec2 embeddings, audModel embeddings, ...\n* Feature scaling\n* Label encoding\n* Binning (continuous to categorical)\n* Online demo interface for trained models \n* Visualization: confusion matrix, feature importance, feature distribution, epoch progression, t-SNE plot, data distribution, bias checking, uncertainty estimation\n\nHere's a rough UML-like sketch of the framework (and [here's the real one done with pyreverse](meta/images/classes.png)).\n![sketch](meta/images/class_diagram.png)\n\nCurrently, the following linear classifiers are implemented (integrated from sklearn):\n* SVM, SVR, XGB, XGR, Tree, Tree_regressor, KNN, KNN_regressor, NaiveBayes, GMM\n  and the following ANNs (artificial neural networks)\n* MLP (multi-layer perceptron), CNN (convolutional neural network)\n\nFor visualization, besides confusion matrix, feature importance, feature distribution, t-SNE plot, data distribution (just names a few), Nkululeko can also be used for bias checking, uncertainty estimation, and epoch progression.\n\n### Bias checking\n\n<details>\nIn some cases, you might wonder if there's bias in your data. You can try to detect this with automatically estimated speech properties by visualizing the correlation of target labels and predicted labels.\n\n<img src=\"meta/images/emotion-pesq.png\" width=\"500px\"/>\n\n</details>\n\n### Uncertainty\n\n<details>\nNkululeko estimates the uncertainty of model decisions (only for classifiers) with entropy over the class probabilities or logits per sample.\n\n<img src=\"meta/images/uncertainty.png\" width=\"500px\"/>\n\n</details>\n\nHere's [an animation that shows the progress of classification done with nkululeko](https://youtu.be/6Y0M382GjvM).\n\n## News\n\n<details> \n\nThere's Felix [blog](http://blog.syntheticspeech.de/?s=nkululeko) with tutorials below:  \n* [Ensemble learning with Nkululeko](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/)\n* [Finetune transformer-models with Nkululeko](http://blog.syntheticspeech.de/2024/05/29/nkululeko-how-to-finetune-a-transformer-model/)\n* Below is a [Hello World example for Nkululeko](#helloworld) that should set you up fastly, also on [Google Colab](https://colab.research.google.com/drive/1GYNBd5cdZQ1QC3Jm58qoeMaJg3UuPhjw?usp=sharing#scrollTo=4G_SjuF9xeQf), and [with Kaggle](https://www.kaggle.com/felixburk/nkululeko-hello-world-example)\n* [Thanks to deepwiki, here's an analysis of the source code](https://deepwiki.com/felixbur/nkululeko)\n* [Here's a blog post on how to set up nkululeko on your computer.](http://blog.syntheticspeech.de/2021/08/30/how-to-set-up-your-first-nkululeko-project/)\n* [Here's a slide presentation about nkululeko](docs/nkululeko.pdf)\n* [Here's a video presentation about nkululeko](https://www.youtube.com/playlist?list=PLRceVavtxLg0y2jiLmpnUfiMtfvkK912D)\n* [Here's the 2022 LREC article on nkululeko](http://felix.syntheticspeech.de/publications/Nkululeko_LREC.pdf)\n* [Introduction](http://blog.syntheticspeech.de/2021/08/04/machine-learning-experiment-framework/)\n* [Nkululeko FAQ](http://blog.syntheticspeech.de/2022/07/07/nkululeko-faq/)\n* [How to set up your first nkululeko project](http://blog.syntheticspeech.de/2021/08/30/how-to-set-up-your-first-nkululeko-project/)\n* [Setting up a base nkululeko experiment](http://blog.syntheticspeech.de/2021/10/05/setting-up-a-base-nkululeko-experiment/)\n* [How to import a database](http://blog.syntheticspeech.de/2022/01/27/nkululeko-how-to-import-a-database/) \n* [Comparing classifiers and features](http://blog.syntheticspeech.de/2021/10/05/nkululeko-comparing-classifiers-and-features/)\n* [Use Praat features](http://blog.syntheticspeech.de/2022/06/27/how-to-use-selected-features-from-praat-with-nkululeko/)\n* [Combine feature sets](http://blog.syntheticspeech.de/2022/06/30/how-to-combine-feature-sets-with-nkululeko/)\n* [Classifying continuous variables](http://blog.syntheticspeech.de/2022/01/26/nkululeko-classifying-continuous-variables/) \n* [Try out / demo a trained model](http://blog.syntheticspeech.de/2022/01/24/nkululeko-try-out-demo-a-trained-model/) \n* [Perform cross-database experiments](http://blog.syntheticspeech.de/2021/10/05/nkululeko-perform-cross-database-experiments/)\n* [Meta parameter optimization](http://blog.syntheticspeech.de/2021/09/03/perform-optimization-with-nkululeko/)\n* [How to set up wav2vec embedding](http://blog.syntheticspeech.de/2021/12/03/how-to-set-up-wav2vec-embedding-for-nkululeko/)\n* [How to soft-label a database](http://blog.syntheticspeech.de/2022/01/24/how-to-soft-label-a-database-with-nkululeko/) \n* [Re-generate the progressing confusion matrix animation wit a different framerate](demos/plot_faster_anim.py)\n* [How to limit/filter a dataset](http://blog.syntheticspeech.de/2022/02/22/how-to-limit-a-dataset-with-nkululeko/)\n* [Specifying database disk location](http://blog.syntheticspeech.de/2022/02/21/specifying-database-disk-location-with-nkululeko/) \n* [Add dropout with MLP models](http://blog.syntheticspeech.de/2022/02/25/adding-dropout-to-mlp-models-with-nkululeko/)\n* [Do cross-validation](http://blog.syntheticspeech.de/2022/03/23/how-to-do-cross-validation-with-nkululeko/)\n* [Combine predictions per speaker](http://blog.syntheticspeech.de/2022/03/24/how-to-combine-predictions-per-speaker-with-nkululeko/)\n* [Run multiple experiments in one go](http://blog.syntheticspeech.de/2022/03/28/how-to-run-multiple-experiments-in-one-go-with-nkululeko/)\n* [Compare several MLP layer layouts with each other](http://blog.syntheticspeech.de/2022/04/11/how-to-compare-several-mlp-layer-layouts-with-each-other/)\n* [Import features from outside the software](http://blog.syntheticspeech.de/2022/10/18/how-to-import-features-from-outside-the-nkululeko-software/)\n* [Export acoustic features](http://blog.syntheticspeech.de/2024/05/30/nkululeko-export-acoustic-features/)\n* [Explore feature importance](http://blog.syntheticspeech.de/2023/02/20/nkululeko-show-feature-importance/)\n* [Plot distributions for feature values](http://blog.syntheticspeech.de/2023/02/16/nkululeko-how-to-plot-distributions-of-feature-values/)\n* [Show feature importance](http://blog.syntheticspeech.de/2023/02/20/nkululeko-show-feature-importance/)\n* [Augment the training set](http://blog.syntheticspeech.de/2023/03/13/nkululeko-how-to-augment-the-training-set/)\n* [Visualize clusters of acoustic features](http://blog.syntheticspeech.de/2023/04/20/nkululeko-visualize-clusters-of-your-acoustic-features/)\n* [Visualize your data distribution](http://blog.syntheticspeech.de/2023/05/11/nkululeko-how-to-visualize-your-data-distribution/)\n* [Check your dataset](http://blog.syntheticspeech.de/2023/07/11/nkululeko-check-your-dataset/) \n* [Segmenting a database](http://blog.syntheticspeech.de/2023/07/14/nkululeko-segmenting-a-database/)\n* [Predict new labels for your data from public models and check bias](http://blog.syntheticspeech.de/2023/08/16/nkululeko-how-to-predict-labels-for-your-data-from-existing-models-and-check-them/)\n* [Resample](http://blog.syntheticspeech.de/2023/08/31/how-to-fix-different-sampling-rates-in-a-dataset-with-nkululeko/)\n* [Get some statistics on correlation and effect-size](http://blog.syntheticspeech.de/2023/09/05/nkululeko-get-some-statistics-on-correlation-and-effect-size/)\n* [Automatic generation of a latex/pdf report](http://blog.syntheticspeech.de/2023/09/26/nkululeko-generate-a-latex-pdf-report/) \n* [Inspect your data with Spotlight](http://blog.syntheticspeech.de/2023/10/31/nkululeko-inspect-your-data-with-spotlight/)\n* [Automatically stratify your split sets](http://blog.syntheticspeech.de/2023/11/07/nkululeko-automatically-stratify-your-split-sets/)\n* [re-name data column names](http://blog.syntheticspeech.de/2023/11/16/nkululeko-re-name-data-column-names/)\n* [Oversample the training set](http://blog.syntheticspeech.de/2023/11/16/nkululeko-oversample-the-training-set/)  \n* [Compare several databases](http://blog.syntheticspeech.de/2024/01/02/nkululeko-compare-several-databases/)\n* [Tweak the target variable for database comparison](http://blog.syntheticspeech.de/2024/03/13/nkululeko-how-to-tweak-the-target-variable-for-database-comparison/)\n* [How to run multiple experiments in one go](http://blog.syntheticspeech.de/2022/03/28/how-to-run-multiple-experiments-in-one-go-with-nkululeko/)\n* [How to finetune a transformer-model](http://blog.syntheticspeech.de/2024/05/29/nkululeko-how-to-finetune-a-transformer-model/)\n* [Ensemble (combine) classifiers with late-fusion](http://blog.syntheticspeech.de/2024/06/25/nkululeko-ensemble-classifiers-with-late-fusion/)\n* [Use train, dev and test splits](https://blog.syntheticspeech.de/2025/03/31/nkululeko-how-to-use-train-dev-test-splits/)\n\n</details>\n\n## License\nNkululeko can be used under the [MIT license](https://choosealicense.com/licenses/mit/).\n\n\n## Contributing\nContributions are welcome and encouraged. To learn more about how to contribute to nkululeko, please refer to the [Contributing guidelines](./CONTRIBUTING.md).\n\n## Citation\nIf you use Nkululeko, please cite the paper:\n\n> F. Burkhardt, Johannes Wagner, Hagen Wierstorf, Florian Eyben and Bj\u00f6rn Schuller: Nkululeko: A Tool For Rapid Speaker Characteristics Detection, Proc. Proc. LREC, 2022\n\n\n```\n@inproceedings{Burkhardt:lrec2022,\n   title = {Nkululeko: A Tool For Rapid Speaker Characteristics Detection},\n   author = {Felix Burkhardt and Johannes Wagner and Hagen Wierstorf and Florian Eyben and Bj\u00f6rn Schuller},\n   isbn = {9791095546726},\n   journal = {2022 Language Resources and Evaluation Conference, LREC 2022},\n   keywords = {machine learning,speaker characteristics,tools},\n   pages = {1925-1932},\n   publisher = {European Language Resources Association (ELRA)},\n   year = {2022},\n}\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Machine learning audio prediction experiments based on templates",
    "version": "0.95.5",
    "project_urls": {
        "Documentation": "https://github.com/felixbur/nkululeko",
        "Homepage": "https://github.com/felixbur/nkululeko",
        "Issues": "https://github.com/felixbur/nkululeko/issues",
        "Repository": "https://github.com/felixbur/nkululeko"
    },
    "split_keywords": [
        "machine learning",
        " audio",
        " emotion recognition",
        " speech processing"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a118a752d60c8df22aa1636a36c5a8cf8ec1532d45ab3723459945735103e11c",
                "md5": "00831a6f712b138dcb9df419d40fbabf",
                "sha256": "66c83f24ce48a97fb702a746a9c54a62df9e245e83653edca22e928b0000ff25"
            },
            "downloads": -1,
            "filename": "nkululeko-0.95.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "00831a6f712b138dcb9df419d40fbabf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 221779,
            "upload_time": "2025-07-08T18:18:00",
            "upload_time_iso_8601": "2025-07-08T18:18:00.446172Z",
            "url": "https://files.pythonhosted.org/packages/a1/18/a752d60c8df22aa1636a36c5a8cf8ec1532d45ab3723459945735103e11c/nkululeko-0.95.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e64c76ae2361eeebc5ca6fd75619dc6253ff04f51e950ca7c92f07706f221172",
                "md5": "4d2d93a54b9043f869272b68ddf558e0",
                "sha256": "d744d9e55f61693ba0a5f52ddea01a41961d3f4fcb06f9aa00ed6eed5e1e9d0d"
            },
            "downloads": -1,
            "filename": "nkululeko-0.95.5.tar.gz",
            "has_sig": false,
            "md5_digest": "4d2d93a54b9043f869272b68ddf558e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 201022,
            "upload_time": "2025-07-08T18:18:03",
            "upload_time_iso_8601": "2025-07-08T18:18:03.087468Z",
            "url": "https://files.pythonhosted.org/packages/e6/4c/76ae2361eeebc5ca6fd75619dc6253ff04f51e950ca7c92f07706f221172/nkululeko-0.95.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 18:18:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "felixbur",
    "github_project": "nkululeko",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "audeer",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "audformat",
            "specs": [
                [
                    ">=",
                    "1.3.1"
                ]
            ]
        },
        {
            "name": "audinterface",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "audiofile",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "audiomentations",
            "specs": [
                [
                    "==",
                    "0.31.0"
                ]
            ]
        },
        {
            "name": "audmetric",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "audonnx",
            "specs": [
                [
                    ">=",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "confidence-intervals",
            "specs": [
                [
                    ">=",
                    "0.0.2"
                ]
            ]
        },
        {
            "name": "datasets",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "imageio",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.20.0"
                ]
            ]
        },
        {
            "name": "opensmile",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "praat-parselmouth",
            "specs": [
                [
                    ">=",
                    "0.4.0"
                ]
            ]
        },
        {
            "name": "scikit_learn",
            "specs": [
                [
                    ">=",
                    "1.4.2"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "seaborn",
            "specs": [
                [
                    ">=",
                    "0.11.0"
                ]
            ]
        },
        {
            "name": "sounddevice",
            "specs": [
                [
                    ">=",
                    "0.4.0"
                ]
            ]
        },
        {
            "name": "transformers",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "umap-learn",
            "specs": [
                [
                    "==",
                    "0.5.7"
                ]
            ]
        },
        {
            "name": "xgboost",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "pylatex",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "torchaudio",
            "specs": [
                [
                    ">=",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "torchvision",
            "specs": [
                [
                    ">=",
                    "0.10.0"
                ]
            ]
        },
        {
            "name": "imblearn",
            "specs": [
                [
                    ">=",
                    "0.0.0"
                ]
            ]
        },
        {
            "name": "shap",
            "specs": [
                [
                    ">=",
                    "0.47.2"
                ]
            ]
        },
        {
            "name": "splitutils",
            "specs": [
                [
                    ">=",
                    "0.0.1"
                ]
            ]
        }
    ],
    "lcname": "nkululeko"
}
        
Elapsed time: 0.41159s