Log a human-readable version of your dataset. Galileo will join these samples with the model's outputs and present them in the Console.
import dataquality as dq
dq.init(task_type="text_classification", # Change this based on your task type
# 🔭🌕 Log the class labels in the order they are outputted by the model
labels_list = ["positive review", "negative review", "very positive review", "very negative review"]
# 🔭🌕 Log your pandas/huggingface/tf datasets to Galileo
Log model outputs from your TensorFlow model's forward function.
Your model must be defined in the TF model-subclass-style and be executing eagerly.
import tensorflow as tf
"""Defines a TensorFlow text classification model."""
def call(self, x, ids):
"""Model forward function."""
# classification_embedding has shape - [batch x emb_dim]
# Logits has shape - [batch x num_classes]
# Generally we select the [CLS] token for classification embedding
# 🔭🌕 Galileo logging
Now you are ready to train your model! Log where you are within the training pipeline (epoch and current split) and behind the scenes Galileo will track the different stages of training and will combine your model outputs with your logged input data.