Natural Language Processing (NLP)
How to log your model schema for classification models at the sentence(s) level
Accuracy, Recall, Precision, FPR, FNR, F1, Sensitivity, Specificity
Arize supports logging the prediction & actual category and score, as well as the embedding features associated with the text the model is acting on, and the text itself.
In addition, the
EmbeddingColumnNamesobject that Arize provides have its own fields described below,
vectoris the dense vector representation of the unstructured input. The embedding
datais the raw data associated with the vector. It is the field typically chosen for NLP use-cases since you can introduce both strings (full sentences) or list of strings (token arrays).
Arize offers the
Embeddingclass to construct your embedding objects. You can log them into the platform using a dictionary that maps the embedding feature names (how they will appear in the UI) to the embedding objects. See our API reference for more details.
# Example embedding features
embedding_features = [
# Declare the schema of the dataframe you're sending (predictions, timestamp, actuals)
schema = Schema(
# Log data into the Arize platform
response = arize_client.log(
Is this a positive product review?
How likely is this to be positive?
"Was this actually a positive product review?"
"Was this actually positive?"