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.6.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for predictionguard-1.6.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a139dfdc39435afc5e193859efc475c6a66affe2c0217c6b02e6218dd64468ea |
|
MD5 | af40a15a23e453d9ba811d7675d84f9b |
|
BLAKE2b-256 | 9f8b47dc5c5f39b300a4bf535cf8c50b513ad6f66a527c8b368be969c5c812af |