Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def translate(input_text):
- encoder_our_text = np.zeros(
- (1, max_encoder_seq_length, num_encoder_tokens), dtype="float32"
- )
- for t, char in enumerate(input_text):
- encoder_our_text[0, t, input_token_index[char]] = 1.0
- encoder_our_text[0, t + 1 :, input_token_index[" "]] = 1.0
- print(encoder_our_text)
- print(input_seq)
- decoded_sentence = decode_sequence(encoder_our_text)
- print("-")
- print("Input sentence:", input_text)
- print("Decoded sentence:", decoded_sentence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement