Goldener - Make your data even more valuable
Project description
A python library orchestrating data during the full life cycle of machine learning pipelines.
Overview | Principles | Features | Installation | Contribute
Overview
Goldener is an open-source Python library (Apache 2 licence) designed to manage the orchestration of data (sampling, splitting) during the full life cycle of machine learning (ML) pipelines.
In the artificial intelligence (AI) era, the data is the new gold. Being able to collect it is already something but creating value from it is the real challenge. Goldener is designed to help to make the most of the available data. It provides tools to orchestrate data during the full life cycle of machine learning pipelines, from the training phase to the monitoring phase.
Goldener makes the right data available at the right time, allowing to optimize the performance of any ML pipelines while minimizing the costs (time, performance, computing resources) of data sampling and labeling.
When it's time to annotate data, Goldener find the most representative subset to annotate. During annotation, it can help to define annotation guidelines by spotting specific cases or as well run annotation quality checks. Once enough data is annotated, Goldener can split it in multiple sets (train, validation, test) ensuring the reproduction of the task variability. During the training phase, Goldener can balance efficiently the data to optimize the training time and the model performance. Finally, when the model is deployed, Goldener can find the most informative data to monitor the model performance and detect any drift in the data distribution.
Key design principles
Goldener is designed to process large datasets efficiently. It is built on the assumption that every AI lifecycle is most of the time iterative and incremental. Its design principles are:
- Progressive batch processing: Each task can be stopped and restarted on demand (or failure). Already computed results are not recomputed.
- Multipurposes embeddings: The same embeddings are used for the different for different tasks (selection, splitting, monitoring, etc.).
- Modality-agnostic: The same tool is actionable for any data modalities (text, image, video, tabular, etc.) and even for multimodality data.
This is not yet applied but for the next iterations, the following principles will be as well followed:
- Distributed first: Any task can be distributed across multiple machines.
- On demand access to pipelines: All processing pipelines are serializable. They are stored and available whenever a new request is made.
Example of features
Sampling among not annotated data
Goldener can find the most representative data subset to annotate. It can extract and store semantic knowledge of the data from embeddings extracted with pre-trained models. Then, it leverages this knowledge to find the most representative subset of data to annotate.
from goldener import (
GoldSelector,
GoldDescriptor,
TorchGoldFeatureExtractor,
TorchGoldFeatureExtractorConfig,
TensorVectorizer,
)
gd = GoldDescriptor(
table_path="my_table_for_description",
extractor=TorchGoldFeatureExtractor(
TorchGoldFeatureExtractorConfig(
model=my_model,
layers=my_layers,
)
),
vectorizer=TensorVectorizer()
)
gs = GoldSelector(
table_path="my_table_for_selection", selection_key="selection"
)
description = gd.describe_in_table(dataset)
selection_table = gs.select_in_table(description, 100, "to_annotate")
selected = GoldSelector.get_selection_indices(selection_table, "to_annotate", "selection")
Splitting annotated data in train and validation sets
Goldener can split data between the train and validation sets ensuring that the training set is containing most of the different situations for the tasks. From a description of the samples (embeddings), the most different/unique elements are kept for the training set while the least informative ones are kept for the validation set.
from goldener import (
GoldSet,
GoldSplitter,
GoldDescriptor,
GoldSelector,
)
gd = GoldDescriptor(...) # reuse the descriptor used for smart sampling
gselector = GoldSelector(...)
gs = GoldSplitter(
sets=[GoldSet("train", 0.7), GoldSet("val", 0.3)],
descriptor=gd,
selector=gselector,
)
split_table = gs.split_in_table(dataset)
splits = gs.get_split_indices(
split_table, selection_key="selected", idx_key="idx"
)
train_indices = splits["train"]
val_indices = splits["val"]
Clustering data to define annotation guidelines
Among the data, there are often multiple "modes" (e.g. different types of images, different types of text, etc.). Goldener can clusterize the data to find these different modes. Then, the different clusters can be leveraged to define annotation guidelines for each cluster.
from goldener import (
GoldClusterizer,
GoldSKLearnClusteringTool,
GoldDescriptor,
TorchGoldFeatureExtractor,
TorchGoldFeatureExtractorConfig,
TensorVectorizer,
)
from sklearn.cluster import KMeans
gd = GoldDescriptor(...) # reuse the descriptor used for smart sampling
gcluster = GoldClusterizer(
table_path="my_table_for_clusterization",
clustering_tool=GoldSKLearnClusteringTool(KMeans(n_clusters=10)),
cluster_key="cluster",
)
description = gd.describe_in_table(dataset)
clustered_table = gcluster.clusterize_in_table(description)
for cluster_id in range(10):
cluster_indices = get_cluster_indices(clustered_table, "cluster", cluster_id)
# sample few samples and use them to define annotation guidelines for this cluster
Installation
Installing Goldener is as simple as running the following command:
pip install goldener
Contribute
We welcome contributions to Goldener! Here's how you can help:
Getting Started
- Fork the repository
- Clone your fork
- Install the dependencies
- Create your branch and make your proposals
- Push to your fork and create a pull request
- The PR will be automatically tested by GitHub Actions
- A maintainer will review your PR and may request changes
- Once approved, your PR will be merged
Development
To set up the development environment:
- Install
uvif you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Create and activate a virtual environment (optional but recommended):
uv venv
source .venv/bin/activate # On Unix/macOS
- Install development dependencies:
uv sync --all-extras # Install all dependencies including development dependencies
- Run tests:
uv run pytest .
- Run type checking with mypy:
uv run mypy .
- Run linting with ruff:
# Run all checks
uv run ruff check .
# Format code
uv run ruff format .
- Set up pre-commit hooks:
# Install git hooks
uv run pre-commit install
# Run pre-commit on all files
uv run pre-commit run --all-files
The pre-commit hooks will automatically run:
- mypy for type checking
- ruff for linting and formatting
- pytest for tests
whenever you make a commit.
Release Process
To release a new version of the goldener package:
- Create a new branch for the release:
git checkout -b release-vX.Y.Z - Update the version
vX.Y.Zinpyproject.toml - Run
uv syncto update the lock file with the new version - Commit the changes with a message like
release vX.Y.Z - Merge the branch into
main - Trigger a new release on GitHub with the tag
vX.Y.Z
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goldener-4.2.0.tar.gz.
File metadata
- Download URL: goldener-4.2.0.tar.gz
- Upload date:
- Size: 80.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04bbedc8dc148a0d2ea2f645f235bed5cb3dc3c6fd099ee80899cd679411f838
|
|
| MD5 |
70fbf2543cf94ae197506e2773049aee
|
|
| BLAKE2b-256 |
dcf224a804fa2b4586f884c601ce2c154ac1a88c989c91713219269386918bed
|
Provenance
The following attestation bundles were made for goldener-4.2.0.tar.gz:
Publisher:
release.yaml on goldener-data/goldener
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goldener-4.2.0.tar.gz -
Subject digest:
04bbedc8dc148a0d2ea2f645f235bed5cb3dc3c6fd099ee80899cd679411f838 - Sigstore transparency entry: 983801959
- Sigstore integration time:
-
Permalink:
goldener-data/goldener@de7bd0d8a129fb6521b3b5fb488ce459401a269a -
Branch / Tag:
refs/tags/v4.2.0 - Owner: https://github.com/goldener-data
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@de7bd0d8a129fb6521b3b5fb488ce459401a269a -
Trigger Event:
release
-
Statement type:
File details
Details for the file goldener-4.2.0-py3-none-any.whl.
File metadata
- Download URL: goldener-4.2.0-py3-none-any.whl
- Upload date:
- Size: 64.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1049c894ce8f95808f54fcad026147769ed88be38b24163472f4c0219009078a
|
|
| MD5 |
6d9d9b0cef934ed506a1cbc59f14a52f
|
|
| BLAKE2b-256 |
964482068ddcdb6b28e89b1a79305f547fd7ecfb89ac4c29009a42e3eec5c5db
|
Provenance
The following attestation bundles were made for goldener-4.2.0-py3-none-any.whl:
Publisher:
release.yaml on goldener-data/goldener
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goldener-4.2.0-py3-none-any.whl -
Subject digest:
1049c894ce8f95808f54fcad026147769ed88be38b24163472f4c0219009078a - Sigstore transparency entry: 983801964
- Sigstore integration time:
-
Permalink:
goldener-data/goldener@de7bd0d8a129fb6521b3b5fb488ce459401a269a -
Branch / Tag:
refs/tags/v4.2.0 - Owner: https://github.com/goldener-data
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@de7bd0d8a129fb6521b3b5fb488ce459401a269a -
Trigger Event:
release
-
Statement type: