1 of 19

How To Create Magical Data Products Using Sequence to Sequence Models

Hamel Husain

2 of 19

About Me

  • Currently ML Research @Github
    • ML On Code, NLP�
  • Previously @Airbnb, DataRobot, Consulting

3 of 19

Why Am I Giving This Talk?

  • Moving to Portland. I want to meet you!
  • I think Seq2Seq models are useful and magical.
  • Goals:
    • Reduce fear
    • Motivate you to learn more (this blog, etc.)
    • Teach you seq2seq models.

4 of 19

Prerequisites For Seq2Seq

  • Have a PhD.
  • Really Good At Math. (only high school level)
  • Comfortable writing code.
  • Some prior experience with DL & RNNs

5 of 19

Seq2Seq often reserved for advanced topics

Andrew Ng’s deeplearning.ai

Jeremy Howard’s Fast.AI

But …. People give up before reaching this point. Only if they knew what they were missing!

6 of 19

Are you sure about math?

You don’t need lots of math right away. Think of different type of layers as APIs.

API: expects specific input, give you an output.

This way of thinking can help reduce fear of deep learning. May not work for everyone, but worked for me.

7 of 19

[‘this’, ‘is’, ‘a’, ‘sequence’]

[3, 2, 1, 5]

RNN

[0.1, 0.4]

Represent data numerically

*RNN expects a sequence as input

Returns latent features of sequence.

*There is an embedding step I skipped. Just giving you high-level intuition.

RNNs: APIs For Extracting Features From Sequences

Keras documentation

8 of 19

CNNs: APIs For Extracting Features From Spatial Data

CNN

Represent data numerically

Extracts latent features.

CNN expects data as spatial input. 1D, 2D, 3D, etc.

Keras documentation

9 of 19

What was the point of the last two slides?

Cannot teach your RNNs or CNNs in this talk.

Give you a way of thinking as you approach this subject so you can reduce fear.

Allow you to keep moving if you get stuck. Its ok to focus on high level intuition at first.

10 of 19

Seq2Seq Models : Machine Translation

This is the magical part! Extracts features from the input sequence.

11 of 19

Thinking of layers as APIs…. I really meant it.

Don’t try to read these. It’s just meant to show that I mentally think of layers as APIs, and it works for me. This is what I did before I got started on this project.

12 of 19

Github Issue Summarization

13 of 19

14 of 19

You can build/try it yourself! Including an end to end example.

I will provide an easy way to find these links at end of talk!

  • Live demo

  • Blog

15 of 19

More Magic

  • Summarization of Code

  • Semantic Search of Code

16 of 19

17 of 19

More Magic

  • Summarization of Code

  • Semantic Search of Code

18 of 19

19 of 19

All materials related to this presentation available here:

hamel.io