kleytondacosta commited on
Commit
742836b
·
verified ·
1 Parent(s): 4772b09

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +33 -79
index.html CHANGED
@@ -141,90 +141,44 @@
141
 
142
 
143
  <section class="section">
144
- <div class="container is-max-desktop">
145
- <div class="columns is-centered">
146
- <div class="column">
147
- <div class="content">
148
- <h2 class="title is-3">Filtered Dataset Table</h2>
149
- <p>
150
- Use the filters below to load the dataset based on task and stage.
151
- </p>
152
- <!-- Filters -->
153
- <div class="filters">
154
- <label for="task">Task:</label>
155
- <select id="task" onchange="updateTable()">
156
- <option value="binary_classification">Binary Classification</option>
157
- </select>
158
- <label for="stage">Stage:</label>
159
- <select id="stage" onchange="updateTable()">
160
- <option value="preprocessing">Preprocessing</option>
161
- </select>
162
- </div>
163
-
164
- <!-- Table -->
165
- <table id="datasetTable" class="table is-striped">
166
- <thead>
167
- <tr id="tableHeader"></tr>
168
- </thead>
169
- <tbody id="tableBody"></tbody>
170
- </table>
171
- </div>
172
- </div>
173
- </div>
174
  </div>
175
  </section>
176
 
177
- <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
178
- <script>
179
- async function fetchDataset(task, stage) {
180
- const datasetURL = `https://huggingface.co/datasets/holistic-ai/bias_mitigation_benchmark/resolve/main/benchmark_${task}_${stage}.csv`;
181
- try {
182
- const response = await fetch(datasetURL);
183
- if (!response.ok) {
184
- throw new Error(`HTTP error! Status: ${response.status}`);
185
- }
186
- const text = await response.text();
187
- return Papa.parse(text, { header: true }).data;
188
- } catch (error) {
189
- console.error("Failed to fetch dataset:", error);
190
- alert("Failed to load dataset. Please check the console for details.");
191
- return [];
192
- }
193
  }
194
-
195
- async function updateTable() {
196
- const task = document.getElementById('task').value;
197
- const stage = document.getElementById('stage').value;
198
- const dataset = await fetchDataset(task, stage);
199
-
200
- if (dataset.length === 0) {
201
- document.getElementById('tableHeader').innerHTML = "<th>No data available</th>";
202
- document.getElementById('tableBody').innerHTML = "<tr><td>No data</td></tr>";
203
- return;
204
- }
205
-
206
- const headers = Object.keys(dataset[0]);
207
- const tableHeader = document.getElementById('tableHeader');
208
- tableHeader.innerHTML = ""; // Clear existing headers
209
- headers.forEach(header => {
210
- const th = document.createElement('th');
211
- th.textContent = header;
212
- tableHeader.appendChild(th);
213
- });
214
-
215
- const tableBody = document.getElementById('tableBody');
216
- tableBody.innerHTML = ""; // Clear existing rows
217
- dataset.forEach(row => {
218
- const tr = document.createElement('tr');
219
- headers.forEach(header => {
220
- const td = document.createElement('td');
221
- td.textContent = row[header];
222
- tr.appendChild(td);
223
- });
224
- tableBody.appendChild(tr);
225
- });
226
  }
227
- </script>
228
 
229
 
230
 
 
141
 
142
 
143
  <section class="section">
144
+ <div class="container">
145
+ <table class="table is-striped is-hoverable is-fullwidth">
146
+ <thead>
147
+ <tr>
148
+ <th>Task</th>
149
+ <th>Stage</th>
150
+ <th>Download Link</th>
151
+ </tr>
152
+ </thead>
153
+ <tbody>
154
+ <tr>
155
+ <td>Binary Classification</td>
156
+ <td>Preprocessing</td>
157
+ <td><a href="https://huggingface.co/datasets/holistic-ai/bias_mitigation_benchmark/resolve/main/benchmark_binary_classification_preprocessing.csv">Download CSV</a></td>
158
+ </tr>
159
+ <!-- Additional rows can be added here -->
160
+ </tbody>
161
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
162
  </div>
163
  </section>
164
 
165
+ <style>
166
+ .table {
167
+ width: 100%;
168
+ margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
170
+ .table th, .table td {
171
+ padding: 10px;
172
+ text-align: center;
173
+ }
174
+ .table a {
175
+ color: #3273dc;
176
+ text-decoration: none;
177
+ }
178
+ .table a:hover {
179
+ text-decoration: underline;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
+ </style>
182
 
183
 
184