Skip to main content

A tool for creating and managing labeled datasets for AI training

Project description

AILabel

PyPI version Python Package

A tool for creating and managing labeled datasets for AI training.

Features

  • Create and manage topics (categories for classification)
  • Label text payloads within topics
  • Predict labels for new data using AI (Google Gemini)
  • Fast, Unix-style CLI with streaming and batch processing support

Quickstart

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install ailabel
uv tool install ailabel
# Set your gemini api key
export GOOGLE_API_KEY="AIz..."
# Example labelling
label "This product is amazing" --topic=sentiment --as=positive
label "This product is horrible" --topic=sentiment --as=negative 
# Test the labelling
label -t sentiment "I'm not sure how i feel. i don't like it"
# negative

Installation

From PyPI

# Install from PyPI using uv
uv pip install ailabel

# For development, install test dependencies
uv pip install "ailabel[test]"

From Source

# Clone the repository
git clone https://github.com/thornewolf/ailabel.git
cd ailabel

# Install the package using uv
uv pip install -e .

# For development, install test dependencies
uv pip install -e ".[test]"

Usage

# Create a new topic
label topics new sentiment

# List all topics
label topics list

# Get information about a topic
label topics info sentiment --labels

# Label a payload
label label "This product is amazing!" --topic=sentiment --as=positive

# Label from stdin
echo "This product is amazing!" | label label - --topic=sentiment --as=positive

# Interactive labeling
label label --topic=sentiment --interactive

# JSON output format
label label "Product was great" --topic=sentiment --as=positive --json

# Predict a label for a new payload
label predict "I love this product" --topic=sentiment

# Predict from stdin and get JSON output
echo "I love this product" | label predict - --topic=sentiment --json

# Process multiple items in batch mode
cat items.txt | label predict - --topic=lang-or-animal --batch

# Show debug information
label --debug

Environment Variables

Create a .env.secret file with the following variables or export directly:

GOOGLE_API_KEY=your_gemini_api_key

Development

Running Tests

# Run all tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=ailabel

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ailabel-0.4.2.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ailabel-0.4.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file ailabel-0.4.2.tar.gz.

File metadata

  • Download URL: ailabel-0.4.2.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for ailabel-0.4.2.tar.gz
Algorithm Hash digest
SHA256 040c879c42a6b0dcdd74cb4427d3b9d8eb9316d0a4f0694479b0577d2c79f054
MD5 2f4db92a5b97a16d34f7f04409453f66
BLAKE2b-256 84aeac41c8eae5dee35bc55e0a3efc77c30a7851dd9af26d7a38e469e41383e8

See more details on using hashes here.

File details

Details for the file ailabel-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: ailabel-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for ailabel-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e29262b7f332200fbe952796855a44693ac7a3f6acfb6d9aab9e704d43ba9ddf
MD5 7ed575beca918511797c628f64eb5d6b
BLAKE2b-256 ee62e7889e46d8aa12e6efee7f8681fc562cad40da36293c7cb2999f80cf8b13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page