def test_dame_nameapi_gender_list_method_returns_correct_result(self): g = DameNameapi() gl = g.gender_list() if (g.config['DEFAULT']['nameapi'] == 'yes'): self.assertEqual(gl, [ 1, 1, 1, 1, 2, 1, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1 ]) self.assertEqual(len(gl), 21) self.assertEqual(g.females, 3) self.assertEqual(g.males, 16) self.assertEqual(g.unknown, 2)
gl = ds.gender_list(path=args.csv) print("Gender list: " + str(gl)) 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)