AI models are irrelevant. Use Prediction Guard.
Project description
Prediction Guard - Python Client
This package provides functionality developed to simplify interfacing with Prediction Guard in Python 3.
Documentation
See the API documentation.
Installation
The package can be installed with pip
:
pip install --upgrade predictionguard
Requirements
- Python 3.6+
Quick Start
To use this library, you must have an access token and specify it as a string when creating the pg.Client
object. Access tokens can be created through the Prediction Guard platform (link coming soon). This is a basic example that:
- Instantiates a Prediction Guard client
- Defines some example model input/ output
- Creates a prediction proxy endpoint
- Uses the endpoint to make a prediction
import predictionguard as pg
# Initialize a Prediction Guard client.
client = Client(token=<your access token>)
# Create some examples illustrating the kind of predictions you
# want to make (domain/ use case specific).
examples = [
{
"input": {
"phrase": "I'm so excited about Prediction Guard. It's gonna be awesome!"
},
"output": {
"sentiment": "POS"
}
},
{
"input": {
"phrase": "AI development without Prediction Guard is bad. It's really terrible."
},
"output": {
"sentiment": "NEG"
}
}
]
# Create a prediction "proxy." This proxy will save your examples, evaluate
# SOTA models to find the best one for your use case, and expose the best model
# at an endpoint corresponding to the proxy.
client.create_proxy(task='sentiment', name='my-sentiment-proxy', examples=examples)
# Now your ready to start getting reliable, future proof predictions. No fuss!
client.predict(name='test-client-sentiment4', data={
"phrase": "Isn't this great! I'm so happy I'm using Prediction Guard"
})
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
predictionguard-0.2.5.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for predictionguard-0.2.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e0ac7f42fa0025d4c2a97901f53cccddbb0758df6ec97bb913d6ac8e0ba2966 |
|
MD5 | f4a108573376813376a88b1d06af7b50 |
|
BLAKE2b-256 | 1fbf2805ef4aa68e1b67fc3868e941383ca5a7bc4a6326063dae1e975ef9e850 |