-
Notifications
You must be signed in to change notification settings - Fork 0
/
old.html
402 lines (331 loc) · 17.2 KB
/
old.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
crossorigin="anonymous"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<title>Cite Diversely</title>
<style>
#spinner { display:none; }
body.busy .spinner { display:inline-block !important; }
</style>
</head>
<body data-spy="scroll" data-target=".navpills" data-offset="100">
<!--<nav class="navpills nav-justified sticky-top navbar-expand-lg navbar-dark bg-dark">-->
<!-- <ul class="navbar-nav mr-auto justify-content-center">-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="#home">Home</a>-->
<!-- </li>-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="#why">Why?</a>-->
<!-- </li>-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="#thetool">Estimate</a>-->
<!-- </li>-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="#faq">FAQ</a>-->
<!-- </li>-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="#contribute">Contribute</a>-->
<!-- </li>-->
<!-- </ul>-->
<!--</nav>-->
<div id="home" class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Cite Diversely</h1>
<p class="lead">Estimate the diversity of the references you use</p>
</div>
</div>
<div id="why" class="container mt-5 mb-5">
<h2>Why Is This Important?</h2>
<p>Simply put, many people often cite people that are like them. This is a problem because academia has historically been white male dominated, leading to the suppression of marginalized voices. If your citations are biased towards people who look like you, then you are missing out on high-quality work.</p>
<p>Its important to note that using this site is not a replacement for truly being diligent and engaged in citing diverse voices. Rather, this site is just a place to start, and hopefully the first step in your journey of citing more diversely. To learn more about your duty to dismantle institutional oppression through your citation practices, read up here:</p>
<ul>
<li><a href="https://www.citeblackwomencollective.org">Cite Black Women</a></li>
<li><a href="https://www.insidehighered.com/advice/2018/04/27/racial-exclusions-scholarly-citations-opinion">The Racial Politics of Citation</a></li>
<li><a href="https://blog.mahabali.me/writing/inclusive-citation-how-diverse-are-your-references/">Inclusive Citation: How Diverse Are Your References?</a></li>
</ul>
</div>
<div class="container mt-5 mb-5" id="thetool">
<h2>Evaluate Your References</h2>
<p>Copy and paste the contents of your bibtex file below and we will do our best to evaluate the gender and ethnicity of the people you cite (note that this is a best guess only).</p>
<form>
<div class="form-group">
<label for="abstract"></label>
<textarea class="form-control" id="abstract" rows="20"></textarea>
</div>
<button id="submit" class="btn btn-primary">
<span id="spinner" class="spinner spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Submit
</button>
</form>
<div class="row">
<div id="gender_piechart" class="col"></div>
</div>
<div class="row">
<div id="ethnicity_piechart" class="col"></div>
</div>
<div class="row">
<div id="full_table" class="col"></div>
</div>
<div class="row">
<div id="recommendations" class="col"></div>
</div>
</div>
<div id="faq" class="container mt-5 mb-5">
<h2>Frequently Asked Questions</h2>
<div id="accordion">
<div class="card">
<div class="card-header">
<a class="card-link" data-toggle="collapse" href="#collapseOne">
Can I still use this even if I don't use LaTeX?
</a>
</div>
<div id="collapseOne" class="collapse show" data-parent="#accordion">
<div class="card-body">
If you don't directly use LaTeX, you can still export a bibtex file. There are instructions on how to do so for <a href="https://blog.mendeley.com/2011/10/25/howto-use-mendeley-to-create-citations-using-latex-and-bibtex/">Mendeley</a>, <a href="https://libguides.usask.ca/c.php?g=218034&p=1458583">EndNote</a>, and <a href="https://libguides.usask.ca/c.php?g=218034&p=1446406">Zotero</a>.
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<a class="collapsed card-link" data-toggle="collapse" href="#collapseTwo">
Why are so many of my references in the "unable to determine" category?
</a>
</div>
<div id="collapseTwo" class="collapse" data-parent="#accordion">
<div class="card-body">
Some common reasons why authors are placed in the "unable to determine" category include: uncommon last name (fewer than 100 instances in the 2010 US Census), and first names in your bibtex are initials only.
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<a class="collapsed card-link" data-toggle="collapse" href="#collapseThree">
How does this actually work?
</a>
</div>
<div id="collapseThree" class="collapse" data-parent="#accordion">
<div class="card-body">
To infer gender we use the first names of the authors you cite and run them through <a href="https://pypi.org/project/gender-guesser/">this library</a>, which is admittedly Euro-centric. To infer ethnicity we do a lookup by last name using the <a href="https://www.census.gov/data/developers/data-sets/surnames.html">2010 US census data</a>. The backend calculations are all done with <a href="https://github.com/cite-diversely/backend">this GitHub repo</a>, and this site is hosted in <a href="https://github.com/cite-diversely/cite-diversely.github.io">this Github repo</a>.
</div>
</div>
</div>
</div>
</div>
<div id="contribute" class="container mt-5 mb-5">
<h2>Contribute</h2>
<p>Do you want to help out? <a href="mailto:[email protected]">Send me an email</a> or contribute to the <a href="https://github.com/cite-diversely/backend">backend</a> or <a href="https://github.com/cite-diversely/cite-diversely.github.io">frontend</a> on GitHub.</p>
</div>
<footer class="page-footer font-small text-center py-3 text-light bg-dark">
© 2020 Chris McComb, powered by GitHub and Azure.
</footer>
<script>
// Set the default text
var textAreas = document.getElementsByTagName('textarea');
textAreas[0].value = "@article{Raina2019,\n" +
" author = {Raina, Ayush and McComb, Christopher and Cagan, Jonathan},\n" +
" title = {Learning to Design From Humans: Imitating Human Designers Through Deep Learning},\n" +
" journal = {Journal of Mechanical Design},\n" +
" volume = {141},\n" +
" number = {11},\n" +
" year = {2019},\n" +
" month = {09},\n" +
" issn = {1050-0472},\n" +
" doi = {10.1115/1.4044256}\n" +
"}\n" +
"\n" +
"@article{Williams2019,\n" +
" author = {Williams, Glen and Meisel, Nicholas A. and Simpson, Timothy W. and McComb, Christopher},\n" +
" title = {Design Repository Effectiveness for 3D Convolutional Neural Networks: Application to Additive Manufacturing},\n" +
" journal = {Journal of Mechanical Design},\n" +
" volume = {141},\n" +
" number = {11},\n" +
" year = {2019},\n" +
" month = {09},\n" +
" issn = {1050-0472},\n" +
" doi = {10.1115/1.4044199}\n" +
"}\n"
google.charts.load('current', {'packages':['corechart']});
function drawCharts(results) {
console.log(results)
console.log(results.male)
var gender_data = google.visualization.arrayToDataTable([
['Gender', 'Count'],
['Likely Male', results.male + results.mostly_male],
['Hard to Tell', results.andy],
['Likely Female', results.female + results.mostly_female],
['Unable to Determine', results.unknown]
]);
var gender_options = {
title: 'Gender Composition of References',
pieHole: 0.4
};
var gender_chart = new google.visualization.PieChart(document.getElementById('gender_piechart'));
gender_chart.draw(gender_data, gender_options);
var ethnicity_data = google.visualization.arrayToDataTable([
['Ethnicity', 'Count'],
['Likely White', results.pctwhite],
['Likely Black', results.pctblack],
['Likely Asian or Pacific Islander', results.pctapi],
['Likely American Indian or Alaskan Native', results.pctaian],
['Likely Multiple Races', results.pct2prace],
['Likely Hispanic', results.pcthispanic],
['Unable to Determine', results.race_unknown]
]);
var ethnicity_options = {
title: 'Race/Ethnicity Composition of References',
pieHole: 0.4
};
var ethnicity_chart = new google.visualization.PieChart(document.getElementById('ethnicity_piechart'));
ethnicity_chart.draw(ethnicity_data, ethnicity_options);
}
function drawTable(results) {
// Clear table
$("#full_table").empty()
// Add header row
let table = '<table class="table">' +
'<thead>' +
'<tr>' +
'<th scope="col">#</th>' +
'<th scope="col">First Name</th>' +
'<th scope="col">Last Name</th>' +
'<th scope="col">Estimated Ethnicity</th>' +
'<th scope="col">Estimated Gender</th>' +
'</tr>' +
'</thead>' +
'<tbody>';
// Clean up race and gender
for (let idx = 0; idx < results.most_likely_gender.length; idx++) {
if (results.most_likely_gender[idx] === 'male' || results.most_likely_gender[idx] === 'mostly_male') {
results.most_likely_gender[idx] = 'Likely Male';
} else if (results.most_likely_gender[idx] === 'female' || results.most_likely_gender[idx] === 'mostly_female') {
results.most_likely_gender[idx] = 'Likely Female';
} else if (results.most_likely_gender[idx] === 'unknown') {
results.most_likely_gender[idx] = 'Unable to Determine';
} else if (results.most_likely_gender[idx] === 'andy') {
results.most_likely_gender[idx] = 'Hard to Tell';
}
}
for (let idx = 0; idx < results.most_likely_race.length; idx++) {
if (results.most_likely_race[idx] === 'pctwhite') {
results.most_likely_race[idx] = 'Likely White';
} else if (results.most_likely_race[idx] === 'pctblack') {
results.most_likely_race[idx] = 'Likely Black';
} else if (results.most_likely_race[idx] === 'pctapi') {
results.most_likely_race[idx] = 'Likely Asian or Pacific Islander';
} else if (results.most_likely_race[idx] === 'pctaian') {
results.most_likely_race[idx] = 'Likely American Indian or Alaskan Native';
} else if (results.most_likely_race[idx] === 'pct2prace') {
results.most_likely_race[idx] = 'Likely Multiple Races';
} else if (results.most_likely_race[idx] === 'pcthispanic') {
results.most_likely_race[idx] = 'Likely Hispanic';
} else if (results.most_likely_race[idx] === 'race_unknown') {
results.most_likely_race[idx] = 'Unable to Determine';
}
}
// Make table contents
for (let idx = 0; idx < results.last_name.length; idx++) {
let race_cell_class = 'default';
let gender_cell_class = 'default';
if (results.most_likely_gender[idx] === 'Unable to Determine') {
gender_cell_class ='table-warning';
}
if (results.most_likely_race[idx] === 'Unable to Determine' ) {
race_cell_class ='table-warning';
}
if (results.most_likely_gender[idx] === 'Unable to Determine' && results.most_likely_race[idx] === 'Unable to Determine' ) {
race_cell_class ='table-danger';
gender_cell_class ='table-danger';
}
table = table + '<tr class="default">' +
'<th scope="row">' + (idx+1) + '</th>' +
'<td>' + results.first_name[idx] + '</td>' +
'<td>' + results.last_name[idx] + '</td>' +
'<td class="' + race_cell_class + '">' + results.most_likely_race[idx] + '</td>' +
'<td class="' + gender_cell_class + '">' + results.most_likely_gender[idx] + '</td>' +
'</tr>'
}
// Close table
table = table + '</tbody></table>';
$("#full_table").append(table);
}
function makeRecommendations(results) {
// Clear recommendations
$("#recommendations").empty()
let recs = "<p>Here are a few papers (likely by minority authors) that you might want to consider:</p><ul>"
for (let idx=0; idx < Math.min(results.recs.length, 5); idx++) {
recs = recs + "<li><a href='" + results.recs[idx].id + "'>" + results.recs[idx].title + "</a></li>";
}
recs = recs + "</ul>"
$("#recommendations").append(recs);
}
function get_data(event) {
$('body').addClass('busy');
$('#submit').prop('disabled', true);
event.preventDefault();
// Get the details
let abstract = $("#abstract").val();
let url_to_call = ''
if (location.hostname === "localhost") {
url_to_call = 'http://localhost:7071/api/HttpTrigger1';
} else {
url_to_call = 'https://cite-diversely.azurewebsites.net/api/HttpTrigger1?code=zAcXELp0HdNQ0b2opMuc//d5CjTu297bQU2dyJnYaIYdaYDP3XVipg==';
}
$.ajax({
url: url_to_call,
type: "POST",
// data: '{name: "' + abstract + '"}',
data: abstract,
success: function (results) {
$('#submit').prop('disabled', false);
$('body').removeClass('busy');
$("#thetool").prepend("<div class=\"alert alert-success alert-dismissible fixed-top\">\n" +
" <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n" +
" <strong>Success!</strong> Your bibtex has been evaluated.\n" +
" </div>");
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
});
}, 2000);
$("#gender_piechart").height(400);
$("#ethnicity_piechart").height(400);
$('html, body').animate({
scrollTop: $('#gender_piechart').offset().top
}, 500);
console.log(results)
drawCharts(results);
drawTable(results);
// makeRecommendations(results);
},
error: function (results) {
$('#submit').prop('disabled', false);
$('body').removeClass('busy');
$("#thetool").prepend("<div class=\"alert alert-danger alert-dismissible fixed-top\">\n" +
" <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n" +
" <strong>Oops!</strong> Something went wrong.\n<code>" + JSON.stringify(results) + "</code>" +
" </div>");
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
});
}, 10000);
}
});
}
$("#submit").on('click', get_data)
</script>
</body>
</html>