Exemplo n.º 1
0
def get_average_hand_checked(hand_checked_list):
	averaged_hand_checked = {}
	for vowel in VOWELS:
		f1, f2, f3, b1, b2, b3 = [], [], [], [], [] ,[]
		for hand_checked in hand_checked_list:
			if vowel in hand_checked and hand_checked[vowel] != [None, None, None, None, None, None]:
				f1.append(float(hand_checked[vowel][0]))
				f2.append(float(hand_checked[vowel][1]))
				f3.append(float(hand_checked[vowel][2]))
				b1.append(hand_checked[vowel][3])
				b2.append(hand_checked[vowel][4])
				b3.append(hand_checked[vowel][5])
		F1, F2, F3, B1, B2, B3 = get_mean(f1), get_mean(f2), get_mean(f3), get_mean(b1), get_mean(b2), get_mean(b3)
		if vowel in hand_checked and hand_checked[vowel] != [None, None, None, None, None, None]:
			formants = [F1, F2, F3, B1, B2, B3]
			averaged_hand_checked[vowel] = formants
	return averaged_hand_checked
Exemplo n.º 2
0
def get_average_hand_checked(hand_checked_list):
	averaged_hand_checked = {}
	for vowel in VOWELS:
		f1, f2, f3, b1, b2, b3 = [], [], [], [], [] ,[]
		for hand_checked in hand_checked_list:
			if vowel in hand_checked and hand_checked[vowel] != [None, None, None, None, None, None]:
				f1.append(float(hand_checked[vowel][0]))
				f2.append(float(hand_checked[vowel][1]))
				f3.append(float(hand_checked[vowel][2]))
				b1.append(hand_checked[vowel][3])
				b2.append(hand_checked[vowel][4])
				b3.append(hand_checked[vowel][5])
		F1, F2, F3, B1, B2, B3 = get_mean(f1), get_mean(f2), get_mean(f3), get_mean(b1), get_mean(b2), get_mean(b3)
		if vowel in hand_checked and hand_checked[vowel] != [None, None, None, None, None, None]:
			formants = [F1, F2, F3, B1, B2, B3]
			averaged_hand_checked[vowel] = formants
	return averaged_hand_checked
def get_avg_error(vowel_differences):
	avg_error = {}
	for meta, values in vowel_differences.items():
		vowel_class = meta[0][-1]
		if vowel_class not in avg_error:
			avg_error[vowel_class] = {}
			avg_error[vowel_class]['F1'] = []
			avg_error[vowel_class]['F2'] = []
			avg_error[vowel_class]['F3'] = []
		avg_error[vowel_class]['F1'].append(values[0])
		avg_error[vowel_class]['F2'].append(values[1])
		avg_error[vowel_class]['F3'].append(values[2])

	for vowel_class, values in avg_error.items():
		values['F1'] = get_mean(values['F1'])
		values['F2'] = get_mean(values['F2'])
		values['F3'] = get_mean(values['F3'])

	return avg_error
def get_avg_error(vowel_differences):
    avg_error = {}
    for meta, values in vowel_differences.items():
        vowel_class = meta[0][-1]
        if vowel_class not in avg_error:
            avg_error[vowel_class] = {}
            avg_error[vowel_class]['F1'] = []
            avg_error[vowel_class]['F2'] = []
            avg_error[vowel_class]['F3'] = []
        avg_error[vowel_class]['F1'].append(values[0])
        avg_error[vowel_class]['F2'].append(values[1])
        avg_error[vowel_class]['F3'].append(values[2])

    for vowel_class, values in avg_error.items():
        values['F1'] = get_mean(values['F1'])
        values['F2'] = get_mean(values['F2'])
        values['F3'] = get_mean(values['F3'])

    return avg_error
Exemplo n.º 5
0
			avg_error[vowel_class]['F1'] = []
			avg_error[vowel_class]['F2'] = []
			avg_error[vowel_class]['F3'] = []
			avg_error[vowel_class]['B1'] = []
			avg_error[vowel_class]['B2'] = []
			avg_error[vowel_class]['B3'] = []
		avg_error[vowel_class]['F1'].append(values[0])
		avg_error[vowel_class]['F2'].append(values[1])
		avg_error[vowel_class]['F3'].append(values[2])
		avg_error[vowel_class]['B1'].append(values[3])
		avg_error[vowel_class]['B2'].append(values[4])
		avg_error[vowel_class]['B3'].append(values[5])

	#print("intermediate:", avg_error)
	for vowel_class, values in avg_error.items():
		values['F1'] = get_mean(values['F1'])
		values['F2'] = get_mean(values['F2'])
		values['F3'] = get_mean(values['F3'])
		values['B1'] = get_mean(values['B1'])
		values['B2'] = get_mean(values['B2'])
		values['B3'] = get_mean(values['B3'])

	print()
	print("Average errors per vowel:")
	print(avg_error)




	# Write to a file
	csv_columns = ['Computer','Date','Corpus', 'Algorithm type', 'Total time']
Exemplo n.º 6
0
			avg_error[vowel_class]['F1'] = []
			avg_error[vowel_class]['F2'] = []
			avg_error[vowel_class]['F3'] = []
			avg_error[vowel_class]['B1'] = []
			avg_error[vowel_class]['B2'] = []
			avg_error[vowel_class]['B3'] = []
		avg_error[vowel_class]['F1'].append(values[0])
		avg_error[vowel_class]['F2'].append(values[1])
		avg_error[vowel_class]['F3'].append(values[2])
		avg_error[vowel_class]['B1'].append(values[3])
		avg_error[vowel_class]['B2'].append(values[4])
		avg_error[vowel_class]['B3'].append(values[5])

	#print("intermediate:", avg_error)
	for vowel_class, values in avg_error.items():
		values['F1'] = get_mean(values['F1'])
		values['F2'] = get_mean(values['F2'])
		values['F3'] = get_mean(values['F3'])
		values['B1'] = get_mean(values['B1'])
		values['B2'] = get_mean(values['B2'])
		values['B3'] = get_mean(values['B3'])

	print()
	print("Average errors per vowel:")
	print(avg_error)




	# Write to a file
	csv_columns = ['Computer','Date','Corpus', 'Algorithm type', "remove_short", "nIterations", 'Total time']