Prediction
A prediction is a column that captures the output of the model. Predictions are prefixed with the category :prediction:
in the column name.
Single Value Predictions
predictions have a few reserved specifiers that can be used to capture specific reserved information about the prediction. The following is a list of specifiers that are supported by OpenInference:
- score: the score of the prediction. This is a numeric value.
- label: the label of the prediction. This is a string or bool.
Here is an example of a set of prediction columns:
:prediction.float.score:confidence |
:prediction.str.label:predicted_animal |
0.8 |
cat |
0.9 |
dog |
0.2 |
cat |
</tbody>
</table>
## Text Predictions
In some cases (e.g. LLMs, NLP), the prediction is a sentence or paragraph. In this case, the prediction is prefixed with `:prediction:text:`. Here is an example of a text prediction:
:prediction.text:response |
Yes, the capital of Japan is Tokyo |
The population of Ireland is less than England |
the quick brown fox jumped over the lazy dog |
</tbody>
</table>
## Embedding Predictions
In some cases (e.g. LLMs, NLP), the prediction can be encoded as an embedding. The following is an example of a set of embedding predictions:
:prediction.vector:response |
:prediction.text:response |
[0.1, 0.2, 0.3] |
Yes, the capital of Japan is Tokyo |
[0.1, 0.2, 0.3] |
The population of Ireland is less than England |
[0.1, 0.2, 0.3] |
the quick brown fox jumped over the lazy dog |
</tbody>
</table>
Embedding predictions can also be associated with a URL to the raw data of the embedding. This is a string but is a URL to a file (e.g., an image or audio file). In this case, the prediction is prefixed with `:prediction.url:`. Here is an example of a set of embedding predictions with a URL:
:prediction.vector:response |
:prediction.text:response |
:prediction.url:response |
[0.1, 0.2, 0.3] |
An image of tokyo |
https://example.com/image.jpg |
[0.1, 0.2, 0.3] |
A map of Ireland |
https://example.com/image.jpg |
[0.1, 0.2, 0.3] |
The Eiffel tower |
https://example.com/image.jpg |
</tbody>
</table>