kleytondacosta commited on
Commit
32f609d
·
verified ·
1 Parent(s): f1c6d9b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +79 -12
index.html CHANGED
@@ -142,28 +142,95 @@
142
 
143
  <section class="section">
144
  <div class="container is-max-desktop">
145
-
146
  <div class="columns is-centered">
147
-
148
- <!-- Visual Effects. -->
149
  <div class="column">
150
  <div class="content">
151
- <h2 class="title is-3">Visual Effects</h2>
152
  <p>
153
- Using <i>nerfies</i> you can create fun visual effects. This Dolly zoom effect
154
- would be impossible without nerfies since it would require going through a wall.
155
  </p>
156
- <video id="dollyzoom" autoplay controls muted loop playsinline height="100%">
157
- <source src="./static/videos/dollyzoom-stacked.mp4"
158
- type="video/mp4">
159
- </video>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  </div>
161
  </div>
162
- <!--/ Visual Effects. -->
163
-
164
  </div>
165
  </section>
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  <section class="section" id="BibTeX">
169
  <div class="container is-max-desktop content">
 
142
 
143
  <section class="section">
144
  <div class="container is-max-desktop">
 
145
  <div class="columns is-centered">
146
+ <!-- Table and Filters Section -->
 
147
  <div class="column">
148
  <div class="content">
149
+ <h2 class="title is-3">Filtered Dataset Table</h2>
150
  <p>
151
+ Use the filters below to select a dataset view by task and stage. Each combination returns a filtered Hugging Face dataset.
 
152
  </p>
153
+ <!-- Filters -->
154
+ <div class="filters">
155
+ <label for="task">Task:</label>
156
+ <select id="task" onchange="updateTable()">
157
+ <option value="binary_classification">Binary Classification</option>
158
+ <!-- Add more task options if needed -->
159
+ </select>
160
+ <label for="stage">Stage:</label>
161
+ <select id="stage" onchange="updateTable()">
162
+ <option value="preprocessing">Preprocessing</option>
163
+ <!-- Add more stage options if needed -->
164
+ </select>
165
+ </div>
166
+ <!--/ Filters -->
167
+
168
+ <!-- Table -->
169
+ <table id="datasetTable" class="table is-striped">
170
+ <thead>
171
+ <tr id="tableHeader">
172
+ <!-- Table headers will be dynamically populated -->
173
+ </tr>
174
+ </thead>
175
+ <tbody id="tableBody">
176
+ <!-- Table rows will be dynamically populated -->
177
+ </tbody>
178
+ </table>
179
+ <!--/ Table -->
180
  </div>
181
  </div>
182
+ </div>
 
183
  </div>
184
  </section>
185
 
186
+ <script>
187
+ async function fetchDataset(task, stage) {
188
+ // Create URL based on the selected task and stage
189
+ const datasetURL = `https://huggingface.co/datasets/holistic-ai/bias_mitigation_benchmark/resolve/main/benchmark_${task}_${stage}.csv`;
190
+
191
+ const response = await fetch(datasetURL);
192
+ const text = await response.text();
193
+
194
+ // Parse CSV text into a format suitable for the table
195
+ const data = Papa.parse(text, { header: true }); // Use PapaParse library for CSV parsing
196
+ return data.data;
197
+ }
198
+
199
+ async function updateTable() {
200
+ const task = document.getElementById('task').value;
201
+ const stage = document.getElementById('stage').value;
202
+
203
+ // Fetch dataset based on current filter values
204
+ const dataset = await fetchDataset(task, stage);
205
+
206
+ // Populate table headers
207
+ const tableHeader = document.getElementById('tableHeader');
208
+ tableHeader.innerHTML = ''; // Clear existing headers
209
+ const headers = Object.keys(dataset[0] || {});
210
+ headers.forEach(column => {
211
+ const th = document.createElement('th');
212
+ th.textContent = column;
213
+ tableHeader.appendChild(th);
214
+ });
215
+
216
+ // Populate table rows
217
+ const tableBody = document.getElementById('tableBody');
218
+ tableBody.innerHTML = ''; // Clear existing rows
219
+ dataset.forEach(row => {
220
+ const tr = document.createElement('tr');
221
+ headers.forEach(column => {
222
+ const td = document.createElement('td');
223
+ td.textContent = row[column];
224
+ tr.appendChild(td);
225
+ });
226
+ tableBody.appendChild(tr);
227
+ });
228
+ }
229
+ </script>
230
+
231
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
232
+
233
+
234
 
235
  <section class="section" id="BibTeX">
236
  <div class="container is-max-desktop content">