Skip to content

Commit

Permalink
Add docstring for SetFitNotebookProgressCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Sep 19, 2024
1 parent 8ea6fc3 commit b13929e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/setfit/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@


class SetFitNotebookProgressCallback(NotebookProgressCallback):
"""
A variation of NotebookProgressCallback that accepts logs/metrics other than "loss" and "eval_loss".
In particular, it accepts "embedding_loss", "aspect_embedding_loss", and "polarity_embedding_loss"
and the corresponding metrics for the validation set.
"""
def on_log(self, *args, logs=None, **kwargs):
if logs is not None:
logs = {key if key != "embedding_loss" else "loss": value for key, value in logs.items()}
Expand Down

0 comments on commit b13929e

Please sign in to comment.