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

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +52 -40
index.html CHANGED
@@ -140,46 +140,58 @@
140
  </section>
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
 
185
 
 
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