Neural Translation with Pytorch GTC 2017 JEREMY HOWARD @JEREMYPHOWARD
I’m assuming some knowledge of… Python Jupyter Numpy Word RNNs vectors Some review today
course.fast.ai
https://github.com/ jph00/part2
Our destination https://github.com/ jph00/part2
Data source Created by Chris Callison-Burch Crawled millions of web pages Used 'a set of simple heuristics’ • Transform French URLs onto English URLs • i.e. replacing "fr" with "en" and about 40 other hand-written rules Assume that these documents are translations of each other
The dataset – just the questions
Tokenizing Because we are translating at word level, we need to tokenize the text first. There are many tokenizers available, but we found we got best results using these simple heuristics.
Final preprocessing result
Unrolled stacked RNNs for sequences Input Hidden Hidden Output Hidden Hidden word 3 input word 2 input Output Hidden Input word 1 input
Equivalent recursive diagram Repeat for 1 n-1 char n input Repeat for 1 n-1 Initialize to zeros Initialize to zeros
This and following 3 slides thanks to Chris Manning (Stanford) https://simons.berkeley.edu/talks/christopher-manning-2017-3-27
* Equation from: “Grammar as a Foreign Language”
Beam search Quelle est la population du Canada ? Que le en Quoi les pour What is canada 's population ?
Neural Translation with Pytorch GTC 2017 JEREMY HOWARD @JEREMYPHOWARD
Recommend
More recommend