kleytondacosta commited on
Commit
f23ac5b
·
verified ·
1 Parent(s): 3a63b53

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +92 -46
index.html CHANGED
@@ -140,61 +140,107 @@
140
  </section>
141
 
142
 
 
 
 
143
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/papaparse.min.js"></script>
144
 
145
- <div id="table-container"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  <script>
148
- const task = 'binary_classification';
149
- const stage = 'preprocessing';
150
- const csvUrl = `https://huggingface.co/datasets/holistic-ai/bias_mitigation_benchmark/resolve/main/benchmark_${task}_${stage}.csv`;
151
-
152
- // Function to fetch and process the CSV data
153
- fetch(csvUrl)
154
- .then(response => response.text())
155
- .then(csvData => {
156
- Papa.parse(csvData, {
157
- header: true,
158
- complete: function(results) {
159
- const data = results.data;
160
-
161
- // Get the headers
162
- const headers = results.meta.fields;
163
-
164
- // Create table
165
- const table = document.createElement('table');
166
- table.border = '1';
167
-
168
- // Create header row
169
- const headerRow = document.createElement('tr');
170
- headers.forEach(headerText => {
171
- const th = document.createElement('th');
172
- th.appendChild(document.createTextNode(headerText));
173
- headerRow.appendChild(th);
174
- });
175
- table.appendChild(headerRow);
176
-
177
- // Add data rows
178
- data.forEach(rowData => {
179
- const row = document.createElement('tr');
180
- headers.forEach(header => {
181
- const td = document.createElement('td');
182
- td.appendChild(document.createTextNode(rowData[header]));
183
- row.appendChild(td);
 
 
 
 
 
 
 
 
 
 
 
184
  });
185
- table.appendChild(row);
186
- });
187
-
188
- // Add table to the container
189
- document.getElementById('table-container').appendChild(table);
190
- }
191
- });
192
- })
193
- .catch(error => console.error(error));
 
 
 
 
 
 
 
194
  </script>
195
 
196
 
197
 
 
198
  <section class="section" id="BibTeX">
199
  <div class="container is-max-desktop content">
200
  <h2 class="title">BibTeX</h2>
 
140
  </section>
141
 
142
 
143
+ <!-- Include Bulma CSS -->
144
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
145
+
146
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/papaparse.min.js"></script>
147
 
148
+ <div class="container">
149
+ <div class="field is-grouped is-grouped-multiline">
150
+ <div class="control">
151
+ <div class="select">
152
+ <select id="task-select">
153
+ <option value="binary_classification">Binary Classification</option>
154
+ <option value="multiclass_classification">Multiclass Classification</option>
155
+ <option value="regression">Regression</option>
156
+ <option value="clustering">Clustering</option>
157
+ </select>
158
+ </div>
159
+ </div>
160
+ <div class="control">
161
+ <div class="select">
162
+ <select id="stage-select">
163
+ <option value="preprocessing">Preprocessing</option>
164
+ <option value="inprocessing">Inprocessing</option>
165
+ <option value="postprocessing">Postprocessing</option>
166
+ </select>
167
+ </div>
168
+ </div>
169
+ </div>
170
+
171
+ <div id="table-container"></div>
172
+ </div>
173
 
174
  <script>
175
+ function loadTable() {
176
+ const taskSelect = document.getElementById('task-select');
177
+ const stageSelect = document.getElementById('stage-select');
178
+ const task = taskSelect.value;
179
+ const stage = stageSelect.value;
180
+ const csvUrl = `https://huggingface.co/datasets/holistic-ai/bias_mitigation_benchmark/resolve/main/benchmark_${task}_${stage}.csv`;
181
+
182
+ // Clear previous table
183
+ document.getElementById('table-container').innerHTML = '';
184
+
185
+ // Fetch and process the CSV data
186
+ fetch(csvUrl)
187
+ .then(response => response.text())
188
+ .then(csvData => {
189
+ Papa.parse(csvData, {
190
+ header: true,
191
+ complete: function(results) {
192
+ const data = results.data;
193
+
194
+ // Get the headers
195
+ const headers = results.meta.fields;
196
+
197
+ // Create table
198
+ const table = document.createElement('table');
199
+ table.className = 'table is-striped is-hoverable is-fullwidth';
200
+
201
+ // Create header row
202
+ const thead = document.createElement('thead');
203
+ const headerRow = document.createElement('tr');
204
+ headers.forEach(headerText => {
205
+ const th = document.createElement('th');
206
+ th.appendChild(document.createTextNode(headerText));
207
+ headerRow.appendChild(th);
208
+ });
209
+ thead.appendChild(headerRow);
210
+ table.appendChild(thead);
211
+
212
+ // Add data rows
213
+ const tbody = document.createElement('tbody');
214
+ data.forEach(rowData => {
215
+ const row = document.createElement('tr');
216
+ headers.forEach(header => {
217
+ const td = document.createElement('td');
218
+ td.appendChild(document.createTextNode(rowData[header]));
219
+ row.appendChild(td);
220
+ });
221
+ tbody.appendChild(row);
222
  });
223
+ table.appendChild(tbody);
224
+
225
+ // Add table to the container
226
+ document.getElementById('table-container').appendChild(table);
227
+ }
228
+ });
229
+ })
230
+ .catch(error => console.error(error));
231
+ }
232
+
233
+ // Load table on page load
234
+ loadTable();
235
+
236
+ // Add event listeners to selectors
237
+ document.getElementById('task-select').addEventListener('change', loadTable);
238
+ document.getElementById('stage-select').addEventListener('change', loadTable);
239
  </script>
240
 
241
 
242
 
243
+
244
  <section class="section" id="BibTeX">
245
  <div class="container is-max-desktop content">
246
  <h2 class="title">BibTeX</h2>