def test_dame_nameapi_guess_list_method_returns_correct_result(self): g = DameNameapi() if (g.config['DEFAULT']['nameapi'] == 'yes'): self.assertEqual([ 'male', 'male', 'male', 'male', 'male', 'male', 'female', 'female', 'male', 'male', 'male', 'male', 'male', 'male', 'neutral', 'male', 'male', 'male', 'female', 'male', 'male' ], g.guess_list(path="files/names/partial.csv", binary=False)) self.assertEqual([ 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1 ], g.guess_list(path="files/names/partial.csv", binary=True))
sl = ds.guess_list(path=args.csv, binary=True) print("Guess list: " +str(sl)) sexmachine_accuracy = ds.accuracy_score_dame(gl,sl) print("Sexmachine accuracy: %s" % sexmachine_accuracy) dga = DameGenderApi() print("################### GenderApi!!") gl = dga.gender_list(pat=args.csv) print("Gender list: " + str(gl)) dna = DameNameapi() print("################### Nameapi!!") gl = dna.gender_list(path=args.csv) print("Gender list: " + str(gl)) sl = dna.guess_list(path=args.csv, binary=True) print("Guess list: " +str(sl)) nameapi_accuracy = dna.accuracy_score_dame(gl,sl) print("Nameapi accuracy: %s" % nameapi_accuracy) elif (args.api == "namsor"): dn = DameNamsor() print("################### Namsor!!") gl = dn.gender_list(path=args.csv) print("Gender list: " + str(gl)) sl = dn.guess_list(path=args.csv, binary=True) print("Guess list: " +str(sl)) namsor_accuracy = dn.accuracy_score_dame(gl, sl) print("Namsor accuracy: %s" % namsor_accuracy) elif (args.api == "genderize"):