NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language...

12
Timothy Liu, 24 March 2020 [email protected] http://bit.ly/hpcai_nlp_intro NLP/BERT in 10 mins

Transcript of NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language...

Page 1: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

Timothy Liu, 24 March 2020

[email protected]://bit.ly/hpcai_nlp_intro

NLP/BERT in 10 mins

Page 2: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

2

1. Introduction to Natural Language Processing (NLP)

2. Transformer Networks

3. Transfer Learning with BERT

Outline

NLP/BERT in 10 mins

Page 3: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

3

Natural Language Processing (NLP)

Language Understanding for Computers

Natural Language Processing is a field of computer science that aims to:

1. Allow computers to understand and process large amounts of text

2. Enable closer, more natural interactions between human and computers

NLP also generates useful ideas for related fields that involve sequences (e.g. genomics)

Page 4: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

4

Natural Language Processing (NLP)

Example Task: Text Classification

EMAIL

EMAIL

EMAIL

NLPMODEL

SPAM

PROMOTION

SOCIAL

Page 5: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

5

Natural Language Processing (NLP)

Using Deep Learning to Build Powerful Models

ENCODER

Input Data

INTERNAL REPRESENTATION

DENSE DENSE DENSE DENSE

0.01 0.97 0.01 0.01

Page 6: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

6

Transformer Networks

Powerful, non-recurrent DL model for sequence modelling

Attention Is All You Need (Vaswani et al., 2017)

Page 7: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

7

Transformer Networks

Powerful, non-recurrent DL model for sequence modelling

Calculate “attention score” from pairwise comparisons between tokens,

then do weighted combination of token representations

Input Sequence

Attention Output

Page 8: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

8

BERT

Bidirectional Encoder Representations from Transformers

BERT is a Transformer model that:

• Builds upon initial ideas from Attention is All You Need (Vaswani, 2017) paper

• Designed to learn powerful methods of encoding representations from text

• Demonstrated state-of-the-art results on many NLP problems in many languages

Page 9: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

9

BERT

Bidirectional Encoder Representations from Transformers

BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (Devlin et al., 2018)

Pre-trainingon large corpus

Fine-tuningon task-specific corpus

Page 10: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

10

BERT

Bidirectional Encoder Representations from Transformers

BERT-BASE12-layer

768-hidden12-heads

110M parameters

BERT-LARGE24-layer

1024-hidden16-heads

340M parameters

Page 11: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

11

Natural Language Processing (NLP)

Example Task: Text Classification

EMAIL

EMAIL

EMAIL

BERT MODEL

SPAM

PROMOTION

SOCIAL

Page 12: NLP/BERT in 10 mins - HPC Advisory Council...Natural Language Processing (NLP) Language Understanding for Computers Natural Language Processing is a field of computer science that

Timothy Liu, 24 March 2020

[email protected]://bit.ly/hpcai_nlp_intro

NLP/BERT in 10 mins