Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Suggestion: Make dependency of metrics on distill functions explicit? #729

Open
neubig opened this issue Apr 22, 2023 · 0 comments
Open

Comments

@neubig
Copy link
Contributor

neubig commented Apr 22, 2023

Within Zeno, some metrics are dependent on distill functions. For instance, in this example the avg_bert_score metric is dependent on the bert_score distill function.

However, it is possible that through human error, one might add a metric to ZenoParameters but forget to add the corresponding distill function, leading to a hard-to-debug error.

As a suggestion, what about adding an optional argument to specify dependencies as follows:

@distill
def my_distill(df: DataFrame, ops: ZenoOptions) -> DistillReturn:
  ...

@metric(dependencies={"my_distill": my_distill})
def my_metric(df: DataFrame, ops: ZenoOptions) -> MetricReturn:
  ...

The key indicates the destination column of the distill function, and the value specifies the function itself. Then, the metric decorator could add an automatic check that the dependencies have been calculated before-hand and throw a comprehensible error if not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant