Create controlled and compliant AI systems with PredictionGuard.
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-1.5.0.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for predictionguard-1.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bacf2d607f0c03dd113e9590ec58b6888b44e03f6437addd26b86066442acf4d |
|
MD5 | 48373916e2a92608b5ca40944ef68972 |
|
BLAKE2b-256 | 1a3de9f14a0cd13823a05cc3984be88baae0e2c68e2b28cd6ec6e9ffa2b64de9 |