Skip to main content

Description needed

Project description

CLTrier PromptClassify

Usage

Python Module

from cltrier_promptClassify import Pipeline

# init pipeline object
pipeline = Pipeline({
    # pipeline objects
    'do_classification': True,
    'do_evaluation': True,
    'do_export': True,
    # path to export dir (only if do_export)
    'export_path': './path/dir/',
    # dataset configuration
    'dataset': {
        # path to data file (.csv)
        'path': './path/file.csv',
        # column containing src text
        'text_column': 'text',
        # column containing gold label (only if do_evaluation)
        'gold_column': 'gold',
        # (optional) batch size used during classification
        'batch_size': 16,
    },
    # classifier configuration
    'classifiers': [
        # label for export, slug/url from hugging face hub
        ['model_label', 'model_huggingface_slug'],
        # ...
    ],
    'templates': [
        # {classes}, {text} are dynamically replaced during runtime
        ['template_label', 'prompt_template (must include {classes} and {text})'],
        # ...
    ],
    # list of classes to use
    'classes': ['class_1', 'class_2']
})

# call pipeline object
pipeline()

Terminal Script

python3 -m cltrier_promptClassify ./path/to/config.toml
# pipeline objects
do_classification = true
do_evaluation = true
do_export = true
# path to export dir
export_path = './path/dir/'

# dataset configuration
[dataset]
# path to data file (.csv)
path = './path/file.csv'
# column containing src text
text_column = 'text'
# column containing gold label (only if do_evaluation)
gold_column = 'gold'
# (optional) batch size used during classification
batch_size = 16

# classifier configuration
[classify]
# label for export, slug/url from hugging face hub
models = [
    ['model_label', 'model_huggingface_slug'],
    # ...
]
# {classes}, {text} are dynamically replaced during runtime
templates = [
    ['template_label', 'prompt_template (must include {classes} and {text})'],
]
# list of classes to use
classes = ['class_1', 'class_2']

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

cltrier_promptclassify-0.0.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

cltrier_promptclassify-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file cltrier_promptclassify-0.0.1.tar.gz.

File metadata

File hashes

Hashes for cltrier_promptclassify-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9387ee757765d686cddd793edf59d6a6146cf5f053fd8ce332212cf9a7aac7d8
MD5 1920bb24ffce9e0bf05c42702fd893ba
BLAKE2b-256 a923fd6a22219acbb0ae46a1cd1f5dc0f3c100786b944e33dbbb2bafe2956389

See more details on using hashes here.

Provenance

File details

Details for the file cltrier_promptclassify-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cltrier_promptclassify-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc00c744be4fe5099799652c475371649500f7b2c7162716a3a90e654f658c57
MD5 3e7b9f6ad266fd9c27a0d917db9ccc39
BLAKE2b-256 eca8b82bab0e4ad8ce3c166215e59fa4cb579557dad5f7dfc82ebe5e41ec1716

See more details on using hashes here.

Provenance

Supported by

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