An easy-to-use library for training personalized AI models
Project description
Personal Trainer
Personal Trainer is a Python library for easily training models on your own data using open source models.
Personal Trainer is still under development.
Usage
Each type of model is represented by a class in Personal Trainer. For example, one of the simplest models to use is a TextClassifier.
from personal_trainer import TextClassifier
classifier = TextClassifier()
A text classifier takes some text and returns whether it's thing A or thing B. To train the model
you first construct a series of examples of text and how it should be classified. You can then pass
those examples to the train method of the classifier.
examples = [
('oscar meyer', 'hot dog'),
('choripan', 'hot dog'),
('bratwurst', 'hot dog'),
('vienna sausage', 'hot dog'),
('sandwich', 'not'),
('burger', 'not'),
('dumpling', 'not'),
('bun', 'not'),
]
classifier.train(examples)
Once you've trained your model you can then use it. For a classifier that means calling the classify method.
res = classifier.classify('taco')
print('res:', res)
If training was successful res should be not. A classifier output can be any string, integer, or Boolean.
To save your model for later use using the save method. This writes the model out to the path that you
provide.
classifier.save('hot-dog-or-not.model')
To load the model later, provide the same path when constructing the classifier.
classifier = TextClassifier('hot-dog-or-not.model')
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
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 model_personal_trainer-0.1.0.tar.gz.
File metadata
- Download URL: model_personal_trainer-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.6 Linux/6.2.6-76060206-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f12fe4cf94811b86aa91f6f89430832752c7a7d83aedadffdbc770c40cfb30dd
|
|
| MD5 |
1c50374e0496e3cdf4d8c7413bd9afc2
|
|
| BLAKE2b-256 |
e985b789abed341b47c9faf497e3c378e29c0444d14eef6bdec84607dfdfbef6
|
File details
Details for the file model_personal_trainer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: model_personal_trainer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.6 Linux/6.2.6-76060206-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91677cce25ad814fadb71c38cf043916da296ae5f05df5313b27609db96663f4
|
|
| MD5 |
285f11759f6225762150f616edea8c90
|
|
| BLAKE2b-256 |
bff29e19ba7c6d9c097d810d4bba988e98d002a7f9f729e23acf9c7eca0d0ace
|