Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambdacasserole/classr-py
Use microclassifiers in the cloud for spam detection, sentiment analysis and more.
https://github.com/lambdacasserole/classr-py
classification machine-learning mlaas python sdk
Last synced: 12 days ago
JSON representation
Use microclassifiers in the cloud for spam detection, sentiment analysis and more.
- Host: GitHub
- URL: https://github.com/lambdacasserole/classr-py
- Owner: lambdacasserole
- License: mit
- Created: 2023-01-12T22:56:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-15T10:00:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-10T22:14:56.226Z (about 1 month ago)
- Topics: classification, machine-learning, mlaas, python, sdk
- Language: Python
- Homepage: https://classr.dev
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Classr SDK for Python
Use microclassifiers in the cloud for spam detection, sentiment analysis and more.![Classr logo](./logo.svg)
## Requirements
- Python 3.6 or newer
## Installation
The Classr SDK for Python can be installed using `pip`:
```sh
pip install classr
```## Usage
Initiaize your microclassifier by passing its UUID to the `Classr` constructor like so:
```python
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:
```python
# 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:```python
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](https://github.com/lambdacasserole/classr) (but will work with a
self-hosted deployment too, of course).## License
[MIT](LICENSE) © [lambdacasserole](https://github.com/lambdacasserole).