Spaces:
Sleeping
Sleeping
Actual gender model options
Browse files
app.py
CHANGED
@@ -32,9 +32,13 @@ class References(object):
|
|
32 |
self.raw_results.loc[len(self.raw_results.index)] = [name.first, name.last, paper['title']]
|
33 |
|
34 |
def infer_ethnicity(self):
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
|
39 |
for i in self.raw_results['Most Likely Ethnicity']:
|
40 |
self.ethnicity_results[i] = self.ethnicity_results.get(i, 0) + 1
|
|
|
32 |
self.raw_results.loc[len(self.raw_results.index)] = [name.first, name.last, paper['title']]
|
33 |
|
34 |
def infer_ethnicity(self):
|
35 |
+
if gender_model == "ethnicolr - census data":
|
36 |
+
other = ethnicolr.pred_census_ln(self.raw_results, 'Last Name', 2010)
|
37 |
+
self.raw_results['Most Likely Ethnicity'] = other['race']
|
38 |
+
elif gender_model == "ethnicolr - wikipedia data":
|
39 |
+
other = ethnicolr.pred_wiki_name(self.raw_results, 'Last Name', 'First Name')
|
40 |
+
self.raw_results['Most Likely Ethnicity'] = other['true_race']
|
41 |
+
|
42 |
|
43 |
for i in self.raw_results['Most Likely Ethnicity']:
|
44 |
self.ethnicity_results[i] = self.ethnicity_results.get(i, 0) + 1
|