Lesson resources
- Lesson video
- Lesson 13 video timeline
- Powerpoint presentation
- French Word2Vec embeddings from Jean-Philippe Fauconnier
- French-English corpus (2.3GB)
- More translation corpus downloads
Links from class
- Viterbi and beam search tutorial
- Cyclical Learning rate callback for Keras
- Cycle GANs (turn horses into zebras!)
- Chris Manning’s talk at the Simons’ Institute, Representations for Language: From Word Embeddings to Sentence Meanings
- distill.pub post on augmented rnns
Other
Auto-generating a .py when saving a .ipynb
This can make version control easier.
To do this, append the following script to your ~/.jupyter/jupyter_notebook_config.py
import io
import os
from notebook.utils import to_api_path
_script_exporter = None
def script_post_save(model, os_path, contents_manager, **kwargs):
"""convert notebooks to Python script after save with nbconvert
replaces `ipython notebook --script`
"""
from nbconvert.exporters.script import ScriptExporter
if model['type'] != 'notebook':
return
global _script_exporter
if _script_exporter is None:
_script_exporter = ScriptExporter(parent=contents_manager)
log = contents_manager.log
# save .py file
base, ext = os.path.splitext(os_path)
script, resources = _script_exporter.from_filename(os_path)
script_fname = base + resources.get('output_extension', '.txt')
log.info("Saving script /%s", to_api_path(script_fname, contents_manager.root_dir))
with io.open(script_fname, 'w', encoding='utf-8') as f:
f.write(script)
c.FileContentsManager.post_save_hook = script_post_save
Append this script instead if you also want an HTML file generated.