Classr SDK for Python
Use microclassifiers in the cloud for spam detection, sentiment analysis and more.
Requirements
- Python 3.6 or newer
Installation
The Classr SDK for Python can be installed using pip:
pip install classr
Usage
Initiaize your microclassifier by passing its UUID to the Classr constructor like so:
from classr import Classr
# Initialize cloud microclassifier.
classifier = Classr('acd78708-850b-4cea-aeaa-23cec50d13b6')
Now, call the classify or get_info functions of classifier to make use of it:
# Classify unseen input.
document = input('Enter your input: ')
print(f'Predicted class: {classifier.classify(document)}')
# Print macro F1 score of classifier.
info = classifier.get_info()
print(f'Classifier macro F1 score is: {info.f1_score}')
If you'd like to use a self-hosted deployment of the Classr application (i.e. not the default official API), you can
pass a different base URL when constructing your Classr object:
from classr import Classr
# Initialize cloud microclassifier.
classifier = Classr('acd78708-850b-4cea-aeaa-23cec50d13b6', 'https://self-hosted-classr.example.com/')
Related Projects
This SDK is for the official Classr application (but will work with a self-hosted deployment too, of course).
License
Metadata
Release files for classr 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| classr-2.0.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| classr-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / classr-2.0.0.tar.gz
| Download URL | classr-2.0.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
756545207766c2355779016560801bd3fdff29b5a9068112ca72827b393f3eab
|
|
BLAKE2b-256 checksum How to use checksums |
98c131392359b13fd5e494c709a07fa01f60cb7bb028415ee0a93333f9ef8259
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-135-generic
|
Release files / classr-2.0.0-py3-none-any.whl
| Download URL | classr-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1b84d6d26ad920ef05b1daaf4563499b11d1662b4907c6cbe5fa62f75ebffdf
|
|
BLAKE2b-256 checksum How to use checksums |
29ede3e10987203b3f34fb5bcf8728809046f96c03ba976f3dfae0fef6ef08bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-135-generic
|