Model Output Schema

Booklet expects your model’s predict output to return a JSON array matching the length of the input array. Each element in the array is a prediction result.

For example, if the input is performing model inference on two records:

[
  [1, 3, 5],
  [2, 5, 7]
]

The output should be a two-element array as well:

[
  0.6,
  0.8
]

The array elements can be a string, integer, float, Javascript object (like a Python dict), or an array. Of note: the JSON object result format is useful if additional metadata is required along with the prediction. For example:

[
  {
    'result': 1.0,
    'top_n_grams': ['hello', 'world']
  }
]