0
0
NLPml~20 mins

Extractive summarization in NLP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Extractive Summarization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main goal of extractive summarization?
Choose the best description of extractive summarization.
AGenerating a summary by selecting important sentences directly from the original text.
BCreating new sentences that paraphrase the original text to form a summary.
CTranslating the original text into another language before summarizing.
DRemoving all stop words and punctuation to shorten the text.
Attempts:
2 left
💡 Hint
Think about whether the summary uses original sentences or new ones.
Predict Output
intermediate
2:00remaining
Output of sentence scoring in extractive summarization
What is the output of this code that scores sentences by word frequency?
NLP
text = "Machine learning is fun. Learning machines can improve. Fun machines learn fast."
words = text.lower().replace('.', '').split()
freq = {}
for w in words:
    freq[w] = freq.get(w, 0) + 1
sentences = text.split('. ')
scores = {}
for s in sentences:
    score = 0
    for word in s.lower().split():
        score += freq.get(word, 0)
    scores[s] = score
print(scores)
ASyntaxError due to missing colon in for loop
B{'Machine learning is fun': 9, 'Learning machines can improve': 8, 'Fun machines learn fast.': 8}
C{'Machine learning is fun': 7, 'Learning machines can improve': 7, 'Fun machines learn fast.': 7}
D{'Machine learning is fun': 6, 'Learning machines can improve': 6, 'Fun machines learn fast.': 5}
Attempts:
2 left
💡 Hint
Count how many times each word appears and sum for each sentence.
Model Choice
advanced
1:30remaining
Best model type for extractive summarization on long documents
Which model is best suited for extractive summarization of very long documents?
AA convolutional neural network designed for image classification.
BA simple logistic regression model using bag-of-words features.
CA transformer model with a long input window like Longformer or BigBird.
DA recurrent neural network without attention mechanisms.
Attempts:
2 left
💡 Hint
Consider models that handle long text efficiently.
Metrics
advanced
1:30remaining
Which metric best evaluates extractive summarization quality?
Choose the metric that best measures how well an extractive summary matches a human summary.
ABLEU score used mainly for machine translation.
BROUGE score, which compares overlapping n-grams between summaries.
CAccuracy of a classification model on sentiment labels.
DMean Squared Error between summary word counts.
Attempts:
2 left
💡 Hint
Think about metrics that compare text overlap.
🔧 Debug
expert
2:00remaining
Why does this extractive summarization code produce empty summary?
Given the code below, why does the summary list remain empty after execution?
NLP
text = "AI is transforming industries. It helps automate tasks."
sentences = text.split('. ')
summary = []
for s in sentences:
    if 'machine' in s.lower():
        summary.append(s)
print(summary)
ABecause none of the sentences contain the word 'machine', so the condition is never true.
BBecause the split method removes the last sentence, leaving summary empty.
CBecause the summary list is overwritten inside the loop instead of appended.
DBecause the print statement is outside the loop and summary is not defined globally.
Attempts:
2 left
💡 Hint
Check the condition inside the loop and the text content.