Easy Embedding-Based Zero-Shot Classfication
Project description
zerohero
Example:
from pprint import pprint
from zerohero import make_zero_shot_classifier
categories = ["cat", "dog", "mouse", "human"]
zsc = make_zero_shot_classifier(
categories=categories,
model_type="sentence-transformers",
model_name="paraphrase-albert-small-v2",
)
cat_text = (
"""The cat (Felis catus),
commonly referred to as the domestic cat or house cat,
is the only domesticated species in the family Felidae.
"""
)
result = zsc(cat_text)
pprint(result)
Development Instructions
Install Dependencies: poetry install --with dev
Configure pre-commit hooks: poetry run pre-commit install
Manually run black: poetry run black zerohero/* tests/*
Manually run pylint: poetry run pylint zerohero/* tests/*
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
zerohero-0.1.1.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zerohero-0.1.1.tar.gz.
File metadata
- Download URL: zerohero-0.1.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f3c67040068fed89628e90dd5a270322adab400a58c6104182cfae3d83f7cac
|
|
| MD5 |
91a5efcf81843f16f62711c845ad322c
|
|
| BLAKE2b-256 |
9f8937ba1008ee445cdf5c93c85f4e7558bd755642cfe2d5b43fd9eb41513c84
|
File details
Details for the file zerohero-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zerohero-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1af03aa89d8919ddf0d5e45895ce56ac06d0959a48f14d496d4a37a88e3f55c8
|
|
| MD5 |
6cbaf19364dcf91f0042466307fb1c7f
|
|
| BLAKE2b-256 |
9cf7d4d950d244bc030f2e6d0a8eab2dc9536d19842a46f670ddaf1cb009792f
|