-
-
Save amankharwal/80c79d6b80533db6cf185c9f3799b1c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lines=lines[lines['length_eng_sentence']<=20] | |
lines=lines[lines['length_hin_sentence']<=20] | |
max_length_src=max(lines['length_hin_sentence']) | |
max_length_tar=max(lines['length_eng_sentence']) | |
input_words = sorted(list(all_eng_words)) | |
target_words = sorted(list(all_hindi_words)) | |
num_encoder_tokens = len(all_eng_words) | |
num_decoder_tokens = len(all_hindi_words) | |
num_encoder_tokens, num_decoder_tokens | |
num_decoder_tokens += 1 #for zero padding | |
input_token_index = dict([(word, i+1) for i, word in enumerate(input_words)]) | |
target_token_index = dict([(word, i+1) for i, word in enumerate(target_words)]) | |
reverse_input_char_index = dict((i, word) for word, i in input_token_index.items()) | |
reverse_target_char_index = dict((i, word) for word, i in target_token_index.items()) | |
lines = shuffle(lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment