Gil-Simas commited on
Commit
9955f8a
·
1 Parent(s): c7f63d8

global -> overall

Browse files
Files changed (1) hide show
  1. user-friendly-metrics.py +9 -9
user-friendly-metrics.py CHANGED
@@ -113,13 +113,13 @@ class UserFriendlyMetrics(evaluate.Metric):
113
  debug: bool = False,
114
  ):
115
  """
116
- Logs metrics to Weights and Biases (wandb) for tracking and visualization, including categorized bar charts for global metrics.
117
 
118
  Args:
119
- results (dict): Results dictionary with 'global' and 'per_sequence' keys.
120
  wandb_section (str, optional): W&B section for metric grouping. Defaults to None.
121
  wandb_project (str, optional): The name of the wandb project. Defaults to 'user_friendly_metrics'.
122
- log_plots (bool, optional): Generates categorized bar charts for global metrics. Defaults to True.
123
  debug (bool, optional): Logs detailed summaries and histories to the terminal console. Defaults to False.
124
  """
125
 
@@ -160,14 +160,14 @@ class UserFriendlyMetrics(evaluate.Metric):
160
 
161
  chart_data = {key: [] for key in categories.keys()}
162
 
163
- # Log global metrics
164
- if "global" in results:
165
- for global_key, global_metrics in results["global"].items():
166
- for metric, value in global_metrics["all"].items():
167
  log_key = (
168
- f"{wandb_section}/global/{global_key}/{metric}"
169
  if wandb_section
170
- else f"global/{global_key}/{metric}"
171
  )
172
  run.log({log_key: value})
173
 
 
113
  debug: bool = False,
114
  ):
115
  """
116
+ Logs metrics to Weights and Biases (wandb) for tracking and visualization, including categorized bar charts for overall metrics.
117
 
118
  Args:
119
+ results (dict): Results dictionary with 'overall' and 'per_sequence' keys.
120
  wandb_section (str, optional): W&B section for metric grouping. Defaults to None.
121
  wandb_project (str, optional): The name of the wandb project. Defaults to 'user_friendly_metrics'.
122
+ log_plots (bool, optional): Generates categorized bar charts for overall metrics. Defaults to True.
123
  debug (bool, optional): Logs detailed summaries and histories to the terminal console. Defaults to False.
124
  """
125
 
 
160
 
161
  chart_data = {key: [] for key in categories.keys()}
162
 
163
+ # Log overall metrics
164
+ if "overall" in results:
165
+ for overall_key, overall_metrics in results["overall"].items():
166
+ for metric, value in overall_metrics["all"].items():
167
  log_key = (
168
+ f"{wandb_section}/overall/{overall_key}/{metric}"
169
  if wandb_section
170
+ else f"overall/{overall_key}/{metric}"
171
  )
172
  run.log({log_key: value})
173