expected_indices = y_test.argmax(axis=1) labels = dp.get_label_table() nn_labels = labels[nn_indices] nn_labels = np.take(nn_labels, 1, axis=1) expected_labels = labels[expected_indices] expected_labels = np.take(expected_labels, 1, axis=1) if len(nn_labels) == len(expected_labels) and len(nn_labels) == len( ip_letters): pass else: raise Exception("mismatch in number of elements in the array") nn_op_letters = dp.concatenate_char_and_diacritization( ip_letters, nn_labels) expected_op_letters = op_letters list_of_sentence_numbers = DBHelperMethod.get_list_of_sentence_numbers_by( 'testing') list_of_all_words_and_sent_num = get_all_undiac_words('testing') current_sentence_counter = 0 counter = 0 start_range = 0 end_range = 0 all_sentences = DBHelperMethod.get_all_sentences_by('testing') for sentence_number in list_of_sentence_numbers: #sentence_number = 2838 print("we will begin processing in sentence number:", sentence_number) indices_of_selected_sentence = np.where(
expected_indices.append(each_char_in_seq.argmax()) labels = dp.get_label_table() nn_labels = labels[nn_indices] nn_labels = np.take(nn_labels, 1, axis=1) expected_labels = labels[expected_indices] expected_labels = np.take(expected_labels, 1, axis=1) if len(nn_labels) == len( expected_labels): # and len(nn_labels) == len(ip_letters): pass else: raise Exception("mismatch in number of elements in the array") nn_op_letters = dp.concatenate_char_and_diacritization( ip_letters, nn_labels) expected_op_letters = op_letters list_of_sentence_numbers = DBHelperMethod.get_list_of_sentence_numbers_by( 'testing') list_of_all_words_and_sent_num = get_all_undiac_words('testing') current_sentence_counter = 0 counter = 0 start_range = 0 end_range = 0 all_sentences = DBHelperMethod.get_all_sentences_by('testing') for sentence_number in list_of_sentence_numbers: # sentence_number = 3228 pad_counter = 0 print("we will begin processing in sentence number:", sentence_number)