guipenedo HF staff commited on
Commit
ea8de33
·
1 Parent(s): 4ac9bcc

added score_by_dump plot

Browse files
Files changed (3) hide show
  1. data/plots/score_by_dump.json +0 -0
  2. index.html +6 -1
  3. src/plotting.js +34 -30
data/plots/score_by_dump.json ADDED
The diff for this file is too large to render. See raw diff
 
index.html CHANGED
@@ -660,7 +660,12 @@
660
  the last 3 checkpoints for both seeds and plotted the average of these 6 data points per dump. </p>
661
  <p>The plot below clearly shows that some dumps perform far
662
  worse than others. Each year has a different color, and the number of crawls per year also changes.</p>
663
- <figure><img src="plots/score_by_dump.png"/></figure>
 
 
 
 
 
664
  <p>We identified 5 main relevant time intervals:</p>
665
  <ul>
666
  <li>2013 to 2016: relatively stable, average quality</li>
 
660
  the last 3 checkpoints for both seeds and plotted the average of these 6 data points per dump. </p>
661
  <p>The plot below clearly shows that some dumps perform far
662
  worse than others. Each year has a different color, and the number of crawls per year also changes.</p>
663
+
664
+ <div class="main-plot-container l-page">
665
+ <figure><img src="plots/score_by_dump.png"/></figure>
666
+ <div id="plot-score_by_dump"></div>
667
+ </div>
668
+
669
  <p>We identified 5 main relevant time intervals:</p>
670
  <ul>
671
  <li>2013 to 2016: relatively stable, average quality</li>
src/plotting.js CHANGED
@@ -1,10 +1,9 @@
1
  const TASK_ID_TO_NAME = {
2
  'agg_score': 'Aggregate Score',
3
- 'commonsense_qa/acc_norm': 'Commonsense QA Norm',
4
- 'hellaswag/acc_norm': 'HellaSwag Norm',
5
- 'openbookqa/acc_norm': 'OpenBook QA Norm',
6
  'piqa/acc_norm': 'PIQA',
7
- 'siqa/acc_norm': 'Social IQA',
8
  'winogrande/acc_norm': 'WinoGrande',
9
  'arc/acc_norm': 'ARC',
10
  'mmlu/acc_norm': 'MMLU'
@@ -82,38 +81,41 @@ const init_plot = function() {
82
  plotElements.forEach(async (plotElement) => {
83
  const plotName = plotElement.id.replace('plot-', '');
84
  const data = await fetch(`data/plots/${plotName}.json`).then((response) => response.json());
85
- const {dropdown, slider, plot} = createPlottingElements(plotElement, data.data, data.defaultMetric ?? "agg_score", data.defaultWindowSize ?? 0);
86
  plot.id = `graph-${plotName}`;
87
  dropdown.addEventListener('change', () => updatePlot(dropdown, slider));
88
  let timeoutId;
89
  // Debounce the slider
90
- slider.addEventListener('input', () => {
91
- clearTimeout(timeoutId);
92
- timeoutId = setTimeout(() => {
93
- updatePlot(dropdown, slider);
94
- }, 500);
95
- });
 
96
 
97
  function updatePlot(dropdown, slider) {
98
  const metric = dropdown.value;
99
- const sliderValue = parseInt(slider.value);
100
- const traces = [];
101
- const metricData = data.data[metric];
102
- for (const key in metricData) {
103
- const y = rollingWindow(metricData[key].y, sliderValue);
104
- const x = metricData[key].x.slice(0, y.length);
105
- const trace = {
106
- x: x,
107
- y: y,
108
- type: 'scatter',
109
- mode: 'lines',
110
- line: {
111
- width: 2.5
112
- },
113
- name: metricData[key].label
114
- };
115
- traces.push(trace);
 
116
  }
 
117
  let minX = Math.min(...traces.flatMap(trace => trace.x));
118
  let maxX = Math.max(...traces.flatMap(trace => trace.x));
119
  const width = plot.parentElement.offsetWidth;
@@ -150,7 +152,7 @@ const getSliderMax = (data) => {
150
  return 30;
151
  }
152
 
153
- const createPlottingElements = (plotElement, data, defaultMetric, defaultWindowSize) => {
154
  // Create plot
155
  const plot = document.createElement('figure');
156
  const controls = document.createElement('div');
@@ -160,7 +162,7 @@ const createPlottingElements = (plotElement, data, defaultMetric, defaultWindowS
160
  plotElement.appendChild(controls);
161
 
162
 
163
- const metricOptions = Object.keys(data);
164
  // Dropdown
165
  const dropdownLabel = document.createElement('label');
166
  dropdownLabel.textContent = 'Metric:';
@@ -173,6 +175,8 @@ const createPlottingElements = (plotElement, data, defaultMetric, defaultWindowS
173
  dropdownContainer.appendChild(dropdown);
174
  controls.appendChild(dropdownContainer);
175
 
 
 
176
  // Slider
177
  const sliderLabel = document.createElement('label');
178
  sliderLabel.textContent = 'Rolling window:';
 
1
  const TASK_ID_TO_NAME = {
2
  'agg_score': 'Aggregate Score',
3
+ 'commonsense_qa/acc_norm': 'Commonsense QA',
4
+ 'hellaswag/acc_norm': 'HellaSwag',
5
+ 'openbookqa/acc_norm': 'OpenBook QA',
6
  'piqa/acc_norm': 'PIQA',
 
7
  'winogrande/acc_norm': 'WinoGrande',
8
  'arc/acc_norm': 'ARC',
9
  'mmlu/acc_norm': 'MMLU'
 
81
  plotElements.forEach(async (plotElement) => {
82
  const plotName = plotElement.id.replace('plot-', '');
83
  const data = await fetch(`data/plots/${plotName}.json`).then((response) => response.json());
84
+ const {dropdown, slider, plot} = createPlottingElements(plotElement, data.data ?? data.traces, data.defaultMetric ?? "agg_score", data.defaultWindowSize ?? 0, data.createSlider ?? 1);
85
  plot.id = `graph-${plotName}`;
86
  dropdown.addEventListener('change', () => updatePlot(dropdown, slider));
87
  let timeoutId;
88
  // Debounce the slider
89
+ if (slider)
90
+ slider.addEventListener('input', () => {
91
+ clearTimeout(timeoutId);
92
+ timeoutId = setTimeout(() => {
93
+ updatePlot(dropdown, slider);
94
+ }, 500);
95
+ });
96
 
97
  function updatePlot(dropdown, slider) {
98
  const metric = dropdown.value;
99
+ const sliderValue = parseInt(slider?.value ?? 0);
100
+ const traces = "traces" in data ? data.traces[metric] : [];
101
+ if (!("traces" in data)) {
102
+ const metricData = data.data[metric];
103
+ for (const key in metricData) {
104
+ const y = rollingWindow(metricData[key].y, sliderValue);
105
+ const x = metricData[key].x.slice(0, y.length);
106
+ const trace = {
107
+ x: x,
108
+ y: y,
109
+ type: 'scatter',
110
+ mode: 'lines',
111
+ line: {
112
+ width: 2.5
113
+ },
114
+ name: metricData[key].label
115
+ };
116
+ traces.push(trace);
117
  }
118
+ }
119
  let minX = Math.min(...traces.flatMap(trace => trace.x));
120
  let maxX = Math.max(...traces.flatMap(trace => trace.x));
121
  const width = plot.parentElement.offsetWidth;
 
152
  return 30;
153
  }
154
 
155
+ const createPlottingElements = (plotElement, data, defaultMetric, defaultWindowSize, createSlider) => {
156
  // Create plot
157
  const plot = document.createElement('figure');
158
  const controls = document.createElement('div');
 
162
  plotElement.appendChild(controls);
163
 
164
 
165
+ const metricOptions = Object.keys(data).filter(metric => metric in TASK_ID_TO_NAME);
166
  // Dropdown
167
  const dropdownLabel = document.createElement('label');
168
  dropdownLabel.textContent = 'Metric:';
 
175
  dropdownContainer.appendChild(dropdown);
176
  controls.appendChild(dropdownContainer);
177
 
178
+ if (!createSlider)
179
+ return {dropdown, undefined, plot};
180
  // Slider
181
  const sliderLabel = document.createElement('label');
182
  sliderLabel.textContent = 'Rolling window:';