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 hashes)
Built Distribution
Close
Hashes for stormtrooper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27578ad601c75f8f7a0a2a425ef695cfe16f77543fa1ce7d41ad6c7c7b2f25ae |
|
MD5 | 7583991a992313aedbb6991a9c358731 |
|
BLAKE2b-256 | a230b640906db471ded6971edb84841f223290558aff5ce7f9484da877599b51 |