Use microclassifiers in the cloud for spam detection, sentiment analysis and more.
Project description
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
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
Built Distribution
File details
Details for the file classr-2.0.0.tar.gz
.
File metadata
- Download URL: classr-2.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-135-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 756545207766c2355779016560801bd3fdff29b5a9068112ca72827b393f3eab |
|
MD5 | 446a0d8035eefc6ca0451a3e2a75b942 |
|
BLAKE2b-256 | 98c131392359b13fd5e494c709a07fa01f60cb7bb028415ee0a93333f9ef8259 |
File details
Details for the file classr-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: classr-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-135-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1b84d6d26ad920ef05b1daaf4563499b11d1662b4907c6cbe5fa62f75ebffdf |
|
MD5 | 5a81930d71ad112c4725fc4af8b2f35d |
|
BLAKE2b-256 | 29ede3e10987203b3f34fb5bcf8728809046f96c03ba976f3dfae0fef6ef08bb |