SlideShare a Scribd company logo
1 of 30
Natural Language Generation
CS224n Natural Language Processing with Deep Learning
- Lecture 15 -
UOS STAT NLP Study
Changdae Oh
2021. 02. 15
1
Topics
1. Recap : LMs & Decoding algorithms
2. NLG tasks and neural approaches to them
3. NLG Evaluation and difficulties
4. Trends & Future
2
Topics
1. Recap : LMs & Decoding algorithms
2. NLG tasks and neural approaches to them
3. NLG Evaluation and difficulties
4. Trends & Future
3
4
Recap : LMs & Decoding algorithms
Natural Language Generation
Recap
Language Modeling
Any setting in which
we generate new text.
subcomponent of :
- Machine Translation
- Dialogue
- Storytelling
- Image captioning
…
Conditional Language Modeling • Machine Translation
• Summarization
• Dialogue
5
Recap : LMs & Decoding algorithms
Decoding Algorithms
: Used to determine the text generated from your language model
Greedy decoding
• Lack of backtracking
Exhaustive search
• infeasible
Beam search
• Stable and feasible !
In lecture 8.
Beam search
• Aims to find a high-probability
-> tracking multiple seq. at once
• K(beam size) most probable hypotheses
- Small k : ungrammatical, incorrect
- Larger k : reduce errors,
expensive,
decreases BLEU score,
make generic/irrelevant text
6
Recap : LMs & Decoding algorithms
Sampling-based decoding
https://www.mdpi.com/2078-2489/11/5/255/htm
• On each step t, randomly sample from the (truncated)probability distribution
• In Top-n sampling(restricted sampling),
increase n – more diverse/risky
decrease n – more generic/safe
More efficient than any other algorithm
7
Recap : LMs & Decoding algorithms
Softmax temperature
Tau : 0.5 Tau : 1 Tau : 5
uniform
spiky
Similar to
scaled dot-product attention
In transformer
https://3months.tistory.com/491
Topics
1. Recap : LMs & Decoding algorithms
2. NLG tasks and neural approaches to them
3. NLG Evaluation and difficulties
4. Trends & Future
8
9
NLG tasks and neural approaches to them
Summarization
single-doc
Given input text x, write a summary y
which is shorter and contains the main information of x.
Multi-doc
Few sentence -> headline
Paragraph -> summary
News article -> summary
Manual -> summary
Wiki -> simple wiki
news -> for children
10
NLG tasks and neural approaches to them
Extractive summarization
 Easy
 Select
 Restrictive
Abstractive summarization
 Difficult
 Generative
 flexible
11
NLG tasks and neural approaches to them
pre-neural summarization  Mostly extractive
1. Content selection
2. Information ordering
3. Sentence realization
: Choose important sentences
: Make sequence
: Refine the sequence of sentences
Pipeline
* Sentence Scoring
* graph-based algorithms
12
NLG tasks and neural approaches to them
Summarization evaluation : ROUGE
1. No brevity penalty
2. Based on recall , not precision (BLEU)
3. Scoring separately for each n-gram
n-gram Co-Occurrence Statistics (n-gram recall between gen. and ref.)
Count the number of overlapping units such as
n-gram, word sequences, and word pairs
between generated texts and reference
summaries
https://www.aclweb.org/anthology/W04-1013/
BLEU
13
NLG tasks and neural approaches to them
Neural summarization
1. Copying well
2. Hierarchical / multi-level attention
3. Global / high-level content selection
4. RL approach
5. Resurrecting pre-neural ideas
Lots more developments
• 2015. See “Abstractive Summarization” as translation task
• Standard seq2seq with attention
14
NLG tasks and neural approaches to them
Copy mechanisms
ordinary seq2seq+attention system bad at copying over details(rare words & OOV) correctly
15
NLG tasks and neural approaches to them
Pointer-Generator Networks
- Pointer-generator network
: facilitate Copying words from the source text via pointing
-> improve accuracy and handling of OOV words
- Coverage vector
: use to track and control coverage of the source document
-> remarkably effective for eliminating repetition
16
NLG tasks and neural approaches to them
Use attention to both attending and re-phrasing !!
Pointer-generator network
* Soft switch to choose between generating a word
from the vocab or copying a word from the inputs
 The final distribution is a mixture of
the generation distribution and the
copying distribution
 Cov vector is a distribution over the
source document words that has been
covered
 To avoid repeatedly attending to the
same locations, add covloss term
Coverage mechanism
Coverage vector :
17
NLG tasks and neural approaches to them
 Copy too much
: what should be an abstractive system collapses to a mostly extractive system.
 Bad at overall content selection, especially if the input document is long
Problem of copying mechanisms
Note,
Solution
 Pre-neural summarization had separate stages for content selection and surface realization.
 Standard seq2seq summarization system, two stages are mixed in together
 Bottom-up summarization
 Better overall content selection strategy.
 Less copying of long sequences (more abstractive output.
18
NLG tasks and neural approaches to them
Bottom-up summarization
Use attention masks to limit the
available selection of the
pointer-generator model.
 Content selection stage : neural sequence-tagging model (binary labeling)
 Bottom-up attention stage (apply a mask)
qi is calculated as
by sequence tagging LSTM
19
NLG tasks and neural approaches to them
Summarization via Reinforcement Learning
 Directly optimize ROUGE via RL
 Only RL model - Higher ROUGE but Lower human judgement score.
Objective Evaluation
20
NLG tasks and neural approaches to them
Dialogue
 Task-oriented dialogue
 Social dialogue
Pre- and post- neural dialogue
 Rule based, use predefined templates, or retrieve
 open-ended freeform dialogue system (seq2seq-based)
deficiency
 Genericness
 Irrelevant
 Repetition
 Lack of context
 Lack of consistent persona
21
NLG tasks and neural approaches to them
Irrelevant response
 Generic
 Unrelated subject
Genericness response
 Upweight rare words during beam search
 Use sampling decoding algorithms
 Condition the decoder on additional content
 Train a retrieve-and-refine model rather than a
generate-from-scratch model
Repetition problem
 Block repeating n-grams during beam search
 Use coverage mechanism
 Define a new objective
to discourage repetition
Lack of consistent persona
 Persona embeddings
 PersonaChat (Dataset)
22
NLG tasks and neural approaches to them
Storytelling Given Image / brief writing prompt / story so far
• There was no paired data to learn from.
- Use a common sentence-encoding space
1. Using image captioning dataset, learn a mapping from images to the
skip-thought encodings of their captions
2. Train a RNN-LM to decode a skip-thought vector to the text
3. Put the two components together
skip-thought vectors
 Highly generic sentence representations
 Sentence level skip-gram method
23
NLG tasks and neural approaches to them
Challenges in storytelling
• Fluent, but are meandering, with no coherent plot
• Because LMs model sequences of words. Stories are sequences of events.
- Events and the causality structure between them
- characters, personalities, motivations, relationships …
- State of the world
- Narrative structure
- Good storytelling principles
consider
Event2event story generation
https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/17046/15769
Topics
1. Recap : LMs & Decoding algorithms
2. NLG tasks and neural approaches to them
3. NLG Evaluation and difficulties
4. Trends & Future
24
25
NLG Evaluation and difficulties
• Not ideal for machine translation
• Even worse for summarization, dialogue (more open-ended)
- Perplexity?
: doesn’t tell about generation
- Word embedding based?
* compare the similarity of the
word embeddings !
doesn’t correlate well with
human judgments
Word overlap based metrics
- BLEU, ROUGE, METEOR, F1, …
Other automatic metrics
26
NLG Evaluation and difficulties
• There are no automatic metrics to adequately capture overall quality.
- Fluency
- Correct style
- Diversity
- Relevance to input
- Length and repetition
- task-specific metrics (compression rate for summarization)
But we can define more focused(specific) automatic metrics
To capture particular aspects of generated text
They can hep us track some important qualities
27
NLG Evaluation and difficulties
Separates out the important factors that contribute to overall chatbot quality
Topics
1. Recap : LMs & Decoding algorithms
2. NLG tasks and neural approaches to them
3. NLG Evaluation and difficulties
4. Trends & Future
28
29
Trends & Future
• Incorporating discrete latent variables into NLG
• Alternatives to strict left-to-right generation (Parallel generation)
• Alternative to maximum likelihood training with teacher forcing
- The more open-ended, the harder –
- Aim Specific improvement!
- Improving the LM -> improve generation quality
- Look at your output
NLG seems like one of the wildest parts remaining..
Trends in NLG(2019)
Practical tips
- You need an automatic metric
- Human eval : as focused as possible
- Reproducibility is a huge problem
- can be very frustrating. But also very funny
30
Changdae Oh
bnormal16@naver.com
https://velog.io/@changdaeoh
https://github.com/changdaeoh

More Related Content

What's hot

IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...IRJET Journal
 
AINL 2016: Castro, Lopez, Cavalcante, Couto
AINL 2016: Castro, Lopez, Cavalcante, CoutoAINL 2016: Castro, Lopez, Cavalcante, Couto
AINL 2016: Castro, Lopez, Cavalcante, CoutoLidia Pivovarova
 
Thinking about nlp
Thinking about nlpThinking about nlp
Thinking about nlpPan Xiaotong
 
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...[Paper Reading] Supervised Learning of Universal Sentence Representations fro...
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...Hiroki Shimanaka
 
Natural Language Processing - Research and Application Trends
Natural Language Processing - Research and Application TrendsNatural Language Processing - Research and Application Trends
Natural Language Processing - Research and Application TrendsShreyas Suresh Rao
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4DigiGurukul
 
Deep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersDeep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersRoelof Pieters
 
seq2seq learning for end-to-end dialogue systems
seq2seq learning for end-to-end dialogue systemsseq2seq learning for end-to-end dialogue systems
seq2seq learning for end-to-end dialogue systemsJordy Van Landeghem
 
[KDD 2018 tutorial] End to-end goal-oriented question answering systems
[KDD 2018 tutorial] End to-end goal-oriented question answering systems[KDD 2018 tutorial] End to-end goal-oriented question answering systems
[KDD 2018 tutorial] End to-end goal-oriented question answering systemsQi He
 
Deep Learning for NLP Applications
Deep Learning for NLP ApplicationsDeep Learning for NLP Applications
Deep Learning for NLP ApplicationsSamiur Rahman
 
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systemsQi He
 
Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Dhruv Gohil
 
A neural probabilistic language model
A neural probabilistic language modelA neural probabilistic language model
A neural probabilistic language modelc sharada
 
Introduction to natural language processing, history and origin
Introduction to natural language processing, history and originIntroduction to natural language processing, history and origin
Introduction to natural language processing, history and originShubhankar Mohan
 
Turkish language modeling using BERT
Turkish language modeling using BERTTurkish language modeling using BERT
Turkish language modeling using BERTAbdurrahimDerric
 
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate HelpdeskDeep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate HelpdeskSaurabh Saxena
 
Information Retrieval with Deep Learning
Information Retrieval with Deep LearningInformation Retrieval with Deep Learning
Information Retrieval with Deep LearningAdam Gibson
 
Deep Learning in practice : Speech recognition and beyond - Meetup
Deep Learning in practice : Speech recognition and beyond - MeetupDeep Learning in practice : Speech recognition and beyond - Meetup
Deep Learning in practice : Speech recognition and beyond - MeetupLINAGORA
 

What's hot (20)

IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
 
AINL 2016: Castro, Lopez, Cavalcante, Couto
AINL 2016: Castro, Lopez, Cavalcante, CoutoAINL 2016: Castro, Lopez, Cavalcante, Couto
AINL 2016: Castro, Lopez, Cavalcante, Couto
 
Thinking about nlp
Thinking about nlpThinking about nlp
Thinking about nlp
 
NLP Bootcamp
NLP BootcampNLP Bootcamp
NLP Bootcamp
 
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...[Paper Reading] Supervised Learning of Universal Sentence Representations fro...
[Paper Reading] Supervised Learning of Universal Sentence Representations fro...
 
Natural Language Processing - Research and Application Trends
Natural Language Processing - Research and Application TrendsNatural Language Processing - Research and Application Trends
Natural Language Processing - Research and Application Trends
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
 
Deep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ersDeep Learning, an interactive introduction for NLP-ers
Deep Learning, an interactive introduction for NLP-ers
 
seq2seq learning for end-to-end dialogue systems
seq2seq learning for end-to-end dialogue systemsseq2seq learning for end-to-end dialogue systems
seq2seq learning for end-to-end dialogue systems
 
[KDD 2018 tutorial] End to-end goal-oriented question answering systems
[KDD 2018 tutorial] End to-end goal-oriented question answering systems[KDD 2018 tutorial] End to-end goal-oriented question answering systems
[KDD 2018 tutorial] End to-end goal-oriented question answering systems
 
Deep Learning for NLP Applications
Deep Learning for NLP ApplicationsDeep Learning for NLP Applications
Deep Learning for NLP Applications
 
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems
[AAAI 2019 tutorial] End-to-end goal-oriented question answering systems
 
Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical Nautral Langauge Processing - Basics / Non Technical
Nautral Langauge Processing - Basics / Non Technical
 
A neural probabilistic language model
A neural probabilistic language modelA neural probabilistic language model
A neural probabilistic language model
 
Introduction to natural language processing, history and origin
Introduction to natural language processing, history and originIntroduction to natural language processing, history and origin
Introduction to natural language processing, history and origin
 
DNN Model Interpretability
DNN Model InterpretabilityDNN Model Interpretability
DNN Model Interpretability
 
Turkish language modeling using BERT
Turkish language modeling using BERTTurkish language modeling using BERT
Turkish language modeling using BERT
 
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate HelpdeskDeep Learning Enabled Question Answering System to Automate Corporate Helpdesk
Deep Learning Enabled Question Answering System to Automate Corporate Helpdesk
 
Information Retrieval with Deep Learning
Information Retrieval with Deep LearningInformation Retrieval with Deep Learning
Information Retrieval with Deep Learning
 
Deep Learning in practice : Speech recognition and beyond - Meetup
Deep Learning in practice : Speech recognition and beyond - MeetupDeep Learning in practice : Speech recognition and beyond - Meetup
Deep Learning in practice : Speech recognition and beyond - Meetup
 

Similar to Natural Language Generation / Stanford cs224n 2019w lecture 15 Review

Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...
Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...
Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...Association for Computational Linguistics
 
GPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersGPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersYoung Seok Kim
 
Natural Language Processing Advancements By Deep Learning: A Survey
Natural Language Processing Advancements By Deep Learning: A SurveyNatural Language Processing Advancements By Deep Learning: A Survey
Natural Language Processing Advancements By Deep Learning: A SurveyRimzim Thube
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Saurabh Kaushik
 
Automatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksAutomatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksJinho Choi
 
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Fwdays
 
ODSC East: Effective Transfer Learning for NLP
ODSC East: Effective Transfer Learning for NLPODSC East: Effective Transfer Learning for NLP
ODSC East: Effective Transfer Learning for NLPindico data
 
[Paper Reading] Unsupervised Learning of Sentence Embeddings using Compositi...
[Paper Reading]  Unsupervised Learning of Sentence Embeddings using Compositi...[Paper Reading]  Unsupervised Learning of Sentence Embeddings using Compositi...
[Paper Reading] Unsupervised Learning of Sentence Embeddings using Compositi...Hiroki Shimanaka
 
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRFEnd-to-end sequence labeling via bi-directional LSTM-CNNs-CRF
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRFJayavardhan Reddy Peddamail
 
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...Sharmila Sathish
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniquesiosrjce
 
Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Fwdays
 
An NLP-based architecture for the autocompletion of partial domain models
An NLP-based architecture for the autocompletion of partial domain modelsAn NLP-based architecture for the autocompletion of partial domain models
An NLP-based architecture for the autocompletion of partial domain modelsLola Burgueño
 
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...kevig
 
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...ijnlc
 

Similar to Natural Language Generation / Stanford cs224n 2019w lecture 15 Review (20)

Text summarization
Text summarization Text summarization
Text summarization
 
team10.ppt.pptx
team10.ppt.pptxteam10.ppt.pptx
team10.ppt.pptx
 
Deep Learning for Machine Translation
Deep Learning for Machine TranslationDeep Learning for Machine Translation
Deep Learning for Machine Translation
 
Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...
Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...
Abigail See - 2017 - Get To The Point: Summarization with Pointer-Generator N...
 
GPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersGPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask Learners
 
Natural Language Processing Advancements By Deep Learning: A Survey
Natural Language Processing Advancements By Deep Learning: A SurveyNatural Language Processing Advancements By Deep Learning: A Survey
Natural Language Processing Advancements By Deep Learning: A Survey
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
 
Aspects of NLP Practice
Aspects of NLP PracticeAspects of NLP Practice
Aspects of NLP Practice
 
Automatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural NetworksAutomatic Personality Prediction with Attention-based Neural Networks
Automatic Personality Prediction with Attention-based Neural Networks
 
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
Thomas Wolf "An Introduction to Transfer Learning and Hugging Face"
 
ODSC East: Effective Transfer Learning for NLP
ODSC East: Effective Transfer Learning for NLPODSC East: Effective Transfer Learning for NLP
ODSC East: Effective Transfer Learning for NLP
 
[Paper Reading] Unsupervised Learning of Sentence Embeddings using Compositi...
[Paper Reading]  Unsupervised Learning of Sentence Embeddings using Compositi...[Paper Reading]  Unsupervised Learning of Sentence Embeddings using Compositi...
[Paper Reading] Unsupervised Learning of Sentence Embeddings using Compositi...
 
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRFEnd-to-end sequence labeling via bi-directional LSTM-CNNs-CRF
End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF
 
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
Feature Extraction and Analysis of Natural Language Processing for Deep Learn...
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniques
 
D017232729
D017232729D017232729
D017232729
 
Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"
 
An NLP-based architecture for the autocompletion of partial domain models
An NLP-based architecture for the autocompletion of partial domain modelsAn NLP-based architecture for the autocompletion of partial domain models
An NLP-based architecture for the autocompletion of partial domain models
 
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
 
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
BIDIRECTIONAL LONG SHORT-TERM MEMORY (BILSTM)WITH CONDITIONAL RANDOM FIELDS (...
 

Recently uploaded

Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptxanandsmhk
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxAleenaTreesaSaji
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfSwapnil Therkar
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRDelhi Call girls
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxAArockiyaNisha
 

Recently uploaded (20)

Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptx
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
 
The Philosophy of Science
The Philosophy of ScienceThe Philosophy of Science
The Philosophy of Science
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
 

Natural Language Generation / Stanford cs224n 2019w lecture 15 Review

  • 1. Natural Language Generation CS224n Natural Language Processing with Deep Learning - Lecture 15 - UOS STAT NLP Study Changdae Oh 2021. 02. 15 1
  • 2. Topics 1. Recap : LMs & Decoding algorithms 2. NLG tasks and neural approaches to them 3. NLG Evaluation and difficulties 4. Trends & Future 2
  • 3. Topics 1. Recap : LMs & Decoding algorithms 2. NLG tasks and neural approaches to them 3. NLG Evaluation and difficulties 4. Trends & Future 3
  • 4. 4 Recap : LMs & Decoding algorithms Natural Language Generation Recap Language Modeling Any setting in which we generate new text. subcomponent of : - Machine Translation - Dialogue - Storytelling - Image captioning … Conditional Language Modeling • Machine Translation • Summarization • Dialogue
  • 5. 5 Recap : LMs & Decoding algorithms Decoding Algorithms : Used to determine the text generated from your language model Greedy decoding • Lack of backtracking Exhaustive search • infeasible Beam search • Stable and feasible ! In lecture 8. Beam search • Aims to find a high-probability -> tracking multiple seq. at once • K(beam size) most probable hypotheses - Small k : ungrammatical, incorrect - Larger k : reduce errors, expensive, decreases BLEU score, make generic/irrelevant text
  • 6. 6 Recap : LMs & Decoding algorithms Sampling-based decoding https://www.mdpi.com/2078-2489/11/5/255/htm • On each step t, randomly sample from the (truncated)probability distribution • In Top-n sampling(restricted sampling), increase n – more diverse/risky decrease n – more generic/safe More efficient than any other algorithm
  • 7. 7 Recap : LMs & Decoding algorithms Softmax temperature Tau : 0.5 Tau : 1 Tau : 5 uniform spiky Similar to scaled dot-product attention In transformer https://3months.tistory.com/491
  • 8. Topics 1. Recap : LMs & Decoding algorithms 2. NLG tasks and neural approaches to them 3. NLG Evaluation and difficulties 4. Trends & Future 8
  • 9. 9 NLG tasks and neural approaches to them Summarization single-doc Given input text x, write a summary y which is shorter and contains the main information of x. Multi-doc Few sentence -> headline Paragraph -> summary News article -> summary Manual -> summary Wiki -> simple wiki news -> for children
  • 10. 10 NLG tasks and neural approaches to them Extractive summarization  Easy  Select  Restrictive Abstractive summarization  Difficult  Generative  flexible
  • 11. 11 NLG tasks and neural approaches to them pre-neural summarization  Mostly extractive 1. Content selection 2. Information ordering 3. Sentence realization : Choose important sentences : Make sequence : Refine the sequence of sentences Pipeline * Sentence Scoring * graph-based algorithms
  • 12. 12 NLG tasks and neural approaches to them Summarization evaluation : ROUGE 1. No brevity penalty 2. Based on recall , not precision (BLEU) 3. Scoring separately for each n-gram n-gram Co-Occurrence Statistics (n-gram recall between gen. and ref.) Count the number of overlapping units such as n-gram, word sequences, and word pairs between generated texts and reference summaries https://www.aclweb.org/anthology/W04-1013/ BLEU
  • 13. 13 NLG tasks and neural approaches to them Neural summarization 1. Copying well 2. Hierarchical / multi-level attention 3. Global / high-level content selection 4. RL approach 5. Resurrecting pre-neural ideas Lots more developments • 2015. See “Abstractive Summarization” as translation task • Standard seq2seq with attention
  • 14. 14 NLG tasks and neural approaches to them Copy mechanisms ordinary seq2seq+attention system bad at copying over details(rare words & OOV) correctly
  • 15. 15 NLG tasks and neural approaches to them Pointer-Generator Networks - Pointer-generator network : facilitate Copying words from the source text via pointing -> improve accuracy and handling of OOV words - Coverage vector : use to track and control coverage of the source document -> remarkably effective for eliminating repetition
  • 16. 16 NLG tasks and neural approaches to them Use attention to both attending and re-phrasing !! Pointer-generator network * Soft switch to choose between generating a word from the vocab or copying a word from the inputs  The final distribution is a mixture of the generation distribution and the copying distribution  Cov vector is a distribution over the source document words that has been covered  To avoid repeatedly attending to the same locations, add covloss term Coverage mechanism Coverage vector :
  • 17. 17 NLG tasks and neural approaches to them  Copy too much : what should be an abstractive system collapses to a mostly extractive system.  Bad at overall content selection, especially if the input document is long Problem of copying mechanisms Note, Solution  Pre-neural summarization had separate stages for content selection and surface realization.  Standard seq2seq summarization system, two stages are mixed in together  Bottom-up summarization  Better overall content selection strategy.  Less copying of long sequences (more abstractive output.
  • 18. 18 NLG tasks and neural approaches to them Bottom-up summarization Use attention masks to limit the available selection of the pointer-generator model.  Content selection stage : neural sequence-tagging model (binary labeling)  Bottom-up attention stage (apply a mask) qi is calculated as by sequence tagging LSTM
  • 19. 19 NLG tasks and neural approaches to them Summarization via Reinforcement Learning  Directly optimize ROUGE via RL  Only RL model - Higher ROUGE but Lower human judgement score. Objective Evaluation
  • 20. 20 NLG tasks and neural approaches to them Dialogue  Task-oriented dialogue  Social dialogue Pre- and post- neural dialogue  Rule based, use predefined templates, or retrieve  open-ended freeform dialogue system (seq2seq-based) deficiency  Genericness  Irrelevant  Repetition  Lack of context  Lack of consistent persona
  • 21. 21 NLG tasks and neural approaches to them Irrelevant response  Generic  Unrelated subject Genericness response  Upweight rare words during beam search  Use sampling decoding algorithms  Condition the decoder on additional content  Train a retrieve-and-refine model rather than a generate-from-scratch model Repetition problem  Block repeating n-grams during beam search  Use coverage mechanism  Define a new objective to discourage repetition Lack of consistent persona  Persona embeddings  PersonaChat (Dataset)
  • 22. 22 NLG tasks and neural approaches to them Storytelling Given Image / brief writing prompt / story so far • There was no paired data to learn from. - Use a common sentence-encoding space 1. Using image captioning dataset, learn a mapping from images to the skip-thought encodings of their captions 2. Train a RNN-LM to decode a skip-thought vector to the text 3. Put the two components together skip-thought vectors  Highly generic sentence representations  Sentence level skip-gram method
  • 23. 23 NLG tasks and neural approaches to them Challenges in storytelling • Fluent, but are meandering, with no coherent plot • Because LMs model sequences of words. Stories are sequences of events. - Events and the causality structure between them - characters, personalities, motivations, relationships … - State of the world - Narrative structure - Good storytelling principles consider Event2event story generation https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/17046/15769
  • 24. Topics 1. Recap : LMs & Decoding algorithms 2. NLG tasks and neural approaches to them 3. NLG Evaluation and difficulties 4. Trends & Future 24
  • 25. 25 NLG Evaluation and difficulties • Not ideal for machine translation • Even worse for summarization, dialogue (more open-ended) - Perplexity? : doesn’t tell about generation - Word embedding based? * compare the similarity of the word embeddings ! doesn’t correlate well with human judgments Word overlap based metrics - BLEU, ROUGE, METEOR, F1, … Other automatic metrics
  • 26. 26 NLG Evaluation and difficulties • There are no automatic metrics to adequately capture overall quality. - Fluency - Correct style - Diversity - Relevance to input - Length and repetition - task-specific metrics (compression rate for summarization) But we can define more focused(specific) automatic metrics To capture particular aspects of generated text They can hep us track some important qualities
  • 27. 27 NLG Evaluation and difficulties Separates out the important factors that contribute to overall chatbot quality
  • 28. Topics 1. Recap : LMs & Decoding algorithms 2. NLG tasks and neural approaches to them 3. NLG Evaluation and difficulties 4. Trends & Future 28
  • 29. 29 Trends & Future • Incorporating discrete latent variables into NLG • Alternatives to strict left-to-right generation (Parallel generation) • Alternative to maximum likelihood training with teacher forcing - The more open-ended, the harder – - Aim Specific improvement! - Improving the LM -> improve generation quality - Look at your output NLG seems like one of the wildest parts remaining.. Trends in NLG(2019) Practical tips - You need an automatic metric - Human eval : as focused as possible - Reproducibility is a huge problem - can be very frustrating. But also very funny