Names-dataset print score

Viewed 17

I'm not sure if anyone has any experience using the names-dataset library (https://github.com/philipperemy/name-dataset)? I've been trying to input a list of first names, and then output the guesses about the gender and nationality, and the score.

I've succeeded at exporting the gender and nationality using the code below, but can't figure out how to do the same for the score. Does anyone have any suggestions?

ndres = []
for i in firstnames:
    ndres.append([i, NameWrapper(nd.search(i)).describe])

ndres_name = []
ndres_gender = []
ndres_nation = [] 
for i in ndres:
    ndres_name.append(i[0])
    l = i[1].split()
    try:
        ndres_gender.append(l[0])
    except:
        ndres_gender.append("NA")
    try:
        ndres_nation.append(l[1])
    except:
        ndres_nation.append("NA")
0 Answers
Related