Retrieve one or more predictions for an ad-hoc request
The following will retrieve predictions from the specified predictors for a given set of ad-hoc items (not held within Graft), the unknown items may be text or URIs to images/video/audio
NUMBER & SEQUENCE OF PREDICTORSYou can stipulate any combination of predictors in any order when making this query as well as provide more than one ad-hoc item to classify |
Output is in the form of an array
curl https://app.graft.com/v1/query -X POST -d '{
"secret": "your_secret",
"organization": "<your_organization_name>",
"project": "my_project",
"output_format": "csv",
"entity": "MyEntity",
"entity_predictors": [
"predictor_1",
"predictor_2"
],
"entity_predict_adhoc": [
{
"field_name": "item_1"
},
{
"field_name": "item_2"
},
]
}'
Simple Example
Please see REST API overview for the example values
“For the following minion resumes predict their charisma and despicability rating”
curl https://app.graft.com/v1/query -X POST -d '{
"secret": "somethingiamnotgoingtosaveingithub",
"organization": "<your_organization_name>",
"project": "supervillain",
"output_format": "csv",
"entity": "despicable_plan_1",
"entity_predictors": [
"charisma",
"despicability"
],
"entity_predict_adhoc": [
{
"resume_location": "https://www.minionresumes.org/dave.pdf"
},
{
"resume_location": "https://www.minionresumes.org/bob.pdf"
},
]
}'
And the output being
charisma,despicability
mildly charismatic, somewhat despicable
very cute, no idea how to be despicable