exercises_thushv_dot_com
exercises_thushv_dot_com copied to clipboard
Sentence formatting in nmt_tutorial.ipynb
Hi @thushv89 ,
Thanks for your tutorial on neural machine translation. I am a newbie to this field and getting stuck in the data pre-processing part of the code.
def split_to_tokens(sent,is_source): #sent = sent.replace('-',' ') sent = sent.replace(',',' ,') sent = sent.replace('.',' .') sent = sent.replace('\n',' ') sent_toks = sent.split(' ')
Can you explain me this part? Why have you replaced newline character with a space . Shouldn't that be denoting end of sentence (
Also, why should target sentences start and end from ?
Thanks a lot!