Transformer-based zero and few-shot classification in scikit-learn pipelines
Project description
stormtrooper
Transformer-based zero/few shot learning components for scikit-learn pipelines.
Example
pip install stormtrooper
from stormtrooper import ZeroShotClassifier
class_labels = ["atheism/christianity", "astronomy/space"]
classifier = ZeroShotClassifier().fit(None, class_labels)
example_texts = [
"God came down to earth to save us.",
"A new nebula was recently discovered in the proximity of the Oort cloud."
]
predictions = classifier.predict(example_texts)
assert list(predictions) == ["atheism/christianity", "astronomy/space"]
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
stormtrooper-0.1.0.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file stormtrooper-0.1.0.tar.gz
.
File metadata
- Download URL: stormtrooper-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c134be74ef24eb1099775871de2e82d9b6102b6aa1eb2accbb16de33e7c2df00 |
|
MD5 | c859d926a80ecf879791e58078d65ce6 |
|
BLAKE2b-256 | e59e7ab764d8c6182783d8925b4e61fde1a98d26e39c0671469c2917308d4d0c |
File details
Details for the file stormtrooper-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: stormtrooper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27578ad601c75f8f7a0a2a425ef695cfe16f77543fa1ce7d41ad6c7c7b2f25ae |
|
MD5 | 7583991a992313aedbb6991a9c358731 |
|
BLAKE2b-256 | a230b640906db471ded6971edb84841f223290558aff5ce7f9484da877599b51 |