Update index.html
Browse files- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
<script>
|
148 |
-
|
149 |
-
const
|
150 |
-
const
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
const
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
});
|
185 |
-
table.appendChild(
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
}
|
191 |
-
})
|
192 |
-
|
193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|