0
0
NLPml~20 mins

Abstractive summarization in NLP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Abstractive Summarization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main difference between extractive and abstractive summarization?

Choose the option that best describes how abstractive summarization differs from extractive summarization.

AAbstractive summarization copies sentences verbatim, while extractive summarization paraphrases the content.
BAbstractive summarization only selects the longest sentences, while extractive summarization selects the shortest sentences.
CAbstractive summarization generates new sentences that capture the meaning, while extractive summarization selects existing sentences from the text.
DAbstractive summarization uses keyword matching, while extractive summarization uses neural networks.
Attempts:
2 left
💡 Hint

Think about whether the summary is created by copying or by generating new text.

Predict Output
intermediate
2:00remaining
Output of a simple abstractive summarization model

Given the following Python code using Hugging Face's transformers library, what is the output summary?

NLP
from transformers import pipeline
summarizer = pipeline('summarization')
text = "The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower. The tower is 324 meters tall and was completed in 1889."
summary = summarizer(text, max_length=30, min_length=10, do_sample=False)
print(summary[0]['summary_text'])
AThe Eiffel Tower is a 324-meter tall wrought-iron lattice tower in Paris, built by Gustave Eiffel's company and completed in 1889.
BThe Eiffel Tower is a famous tower in France named after Gustave Eiffel.
CThe Eiffel Tower was built in 1889 and is located in Paris.
DThe Eiffel Tower is a tall tower built by Gustave Eiffel.
Attempts:
2 left
💡 Hint

Look for the most detailed and complete summary that fits the length constraints.

Hyperparameter
advanced
1:30remaining
Effect of changing max_length in abstractive summarization

In an abstractive summarization model, what is the effect of increasing the max_length parameter during generation?

AThe model will generate summaries faster.
BThe summary will be shorter and more concise.
CThe model will ignore the input text and generate random text.
DThe summary will generally be longer and may include more details.
Attempts:
2 left
💡 Hint

Think about what controlling the maximum length of output text means for the summary size.

Metrics
advanced
1:30remaining
Which metric is most suitable for evaluating abstractive summarization quality?

Choose the metric that best measures how well an abstractive summarization model captures the meaning of the original text.

AMean Squared Error, measuring numeric differences between summary and original text.
BROUGE score, which compares overlap of n-grams between generated and reference summaries.
CBLEU score, which is only used for machine translation.
DAccuracy, measuring exact word matches between summary and original text.
Attempts:
2 left
💡 Hint

Think about a metric that compares summaries based on overlapping phrases.

🔧 Debug
expert
2:30remaining
Why does this abstractive summarization model output repetitive text?

Consider this code snippet using a pretrained summarization model:

from transformers import pipeline
summarizer = pipeline('summarization')
text = "Deep learning models are powerful. Deep learning models are powerful. Deep learning models are powerful."
summary = summarizer(text, max_length=20, min_length=5, do_sample=False)
print(summary[0]['summary_text'])

The output is: "Deep learning models are powerful. Deep learning models are powerful. Deep learning models are powerful." What is the most likely cause?

AThe model is overfitting and repeating phrases because of lack of diversity in generation settings.
BThe input text is too short, so the model repeats it to fill the summary length.
CThe model is not pretrained for summarization and outputs input text verbatim.
DThe max_length parameter is too large, causing repetition.
Attempts:
2 left
💡 Hint

Consider how generation parameters affect repetition in output.