def create_vocab(): DBHelperMethod.connect_to_db() dataset = DBHelperMethod.load_data_set() chars = dp.load_nn_input_dataset_string(dataset[:, [0, 6]]) vocab, vocab_inv = dp.build_vocab(chars) return vocab, vocab_inv, chars, dataset
def get_testing_data(): DBHelperMethod.connect_to_db() training_dataset = DBHelperMethod.load_dataset_by_type("testing") x = dp.load_nn_input_dataset_string(training_dataset[:, [0, 6]]) y = dp.load_nn_labels_dataset_string(training_dataset[:, [0, 1]]) return x, y
def load_testing_data(): Dp.establish_db_connection() testing_dataset = Dp.load_dataset_by_type("testing") x = Dp.load_nn_input_dataset_string(testing_dataset[:, [0, 6]]) y = Dp.load_nn_labels_dataset_string(testing_dataset[:, [0, 1]]) sent_num, sen_len = Dp.load_nn_seq_lengths(testing_dataset[:, [3]]) sentences_padded, vocabulary, vocabulary_inv = Dp.pad_sentences(x, sen_len, 4, 10) return sentences_padded, y, vocabulary, vocabulary_inv
def load_testing_data(): dp.establish_db_connection() testing_dataset = dp.load_testing_dataset() x = dp.load_nn_input_dataset_string(testing_dataset[:, [0, 6]]) y = dp.load_nn_labels_dataset_string(testing_dataset[:, [0, 1]]) sent_num, sen_len = dp.load_nn_seq_lengths(testing_dataset[:, [3]]) sentences_padded, vocabulary, vocabulary_inv = dp.pad_sentences(x, sen_len, 4, 10) testing_words = np.take(testing_dataset, 4, axis=1) input_testing_letters = np.take(testing_dataset, 0, axis=1) op_testing_letters = np.take(testing_dataset, 5, axis=1) sent_num = np.take(testing_dataset, 3, axis=1) letters_loc = np.take(testing_dataset, 6, axis=1) undiac_word = np.take(testing_dataset, 7, axis=1) return sentences_padded, y, vocabulary, vocabulary_inv, testing_words, input_testing_letters, op_testing_letters,\ sent_num, letters_loc, undiac_word
def load_testing_data(): dp.establish_db_connection() testing_dataset = DBHelperMethod.load_dataset_by_type("testing") #testing_dataset = DBHelperMethod.load_dataset_by_type_and_sentence_number_for_testing_purpose("testing", 2838) x = dp.load_nn_input_dataset_string(testing_dataset[:, [0, 6]]) y = dp.load_nn_labels_dataset_string(testing_dataset[:, [0, 1]]) sent_num, sen_len = dp.load_nn_seq_lengths(testing_dataset[:, [3]]) sentences_padded, vocabulary, vocabulary_inv = dp.pad_sentences1( x, sen_len, req_char_index, window_size) testing_words = np.take(testing_dataset, 4, axis=1) input_testing_letters = np.take(testing_dataset, 0, axis=1) op_testing_letters = np.take(testing_dataset, 5, axis=1) sent_num = np.take(testing_dataset, 3, axis=1) letters_loc = np.take(testing_dataset, 6, axis=1) undiac_word = np.take(testing_dataset, 7, axis=1) return sentences_padded, y, vocabulary, vocabulary_inv, testing_words, input_testing_letters, op_testing_letters,\ sent_num, letters_loc, undiac_word