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/yourusername/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
pytest

# Run tests with coverage
pytest --cov=ailabel

License

MIT

uvx --no-cache --from . label -t school math

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.1.tar.gz (15.3 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.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ailabel-0.4.1.tar.gz
  • Upload date:
  • Size: 15.3 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.1.tar.gz
Algorithm Hash digest
SHA256 b21b08c0f0f279b960ec00d9a41a054de48ff5a91842e73d5fb366c12ce4efb8
MD5 fe98b38bdc93e58fdbe92535f85fdb24
BLAKE2b-256 edbef27d8a4c1776904cac74600f8628119faa8e56f83b2a7630a9fcf72a0090

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ailabel-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44b4b0d04dfbcf66702a40e819c11be6e3990dabae7de2f6bff8d9a8ca6016fe
MD5 102b7dc108c184de2f383fb2c1a3d22f
BLAKE2b-256 888beafbd2f678eb4df1706facaf6ef3d39dcd571218c7f3fb6d4d63f763dacf

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