0
0
NLPml~20 mins

NLP applications in real world - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
NLP Real World Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Which NLP application is best suited for automatically summarizing long documents?

Imagine you have a very long article and want a short summary that captures the main points. Which NLP application would you use?

AText Summarization
BMachine Translation
CNamed Entity Recognition (NER)
DSentiment Analysis
Attempts:
2 left
💡 Hint

Think about which task reduces text length while keeping important info.

Predict Output
intermediate
2:00remaining
What is the output of this sentiment analysis code snippet?

Given the code below that uses a simple rule-based sentiment check, what will be the printed output?

NLP
text = "I love sunny days but hate the rain."
positive_words = ['love', 'happy', 'joy']
negative_words = ['hate', 'sad', 'angry']
score = 0
for word in text.lower().split():
    if word in positive_words:
        score += 1
    elif word in negative_words:
        score -= 1
if score > 0:
    print('Positive')
elif score < 0:
    print('Negative')
else:
    print('Neutral')
ANegative
BNeutral
CPositive
DSyntaxError
Attempts:
2 left
💡 Hint

Count how many positive and negative words appear exactly in the list.

Model Choice
advanced
2:00remaining
Which model type is most appropriate for real-time speech-to-text transcription?

You want to convert spoken words into text instantly during a live conversation. Which model type is best suited?

ARecurrent Neural Network (RNN) with attention
BTransformer-based sequence-to-sequence model
CK-Means clustering
DConvolutional Neural Network (CNN) for image classification
Attempts:
2 left
💡 Hint

Consider models that handle sequences and context well for language tasks.

Metrics
advanced
2:00remaining
Which metric is most suitable to evaluate a machine translation system?

You built a system that translates English sentences to French. Which metric should you use to measure how good the translations are?

AAccuracy
BMean Squared Error
CBLEU score
DF1 score
Attempts:
2 left
💡 Hint

Think about metrics that compare generated text to reference translations.

🔧 Debug
expert
3:00remaining
What error does this code raise when running a named entity recognition (NER) pipeline?

Consider this Python code using a popular NLP library to extract named entities. What error will it raise?

NLP
from transformers import pipeline
ner = pipeline('ner')
text = "Apple is looking at buying U.K. startup for $1 billion"
results = ner(text, aggregation_strategy='simple')
print(results)
ATypeError: pipeline() got an unexpected keyword argument 'aggregation_strategy'
BValueError: aggregation_strategy must be one of ['none', 'simple']
CRuntimeError: Model weights not found
DNo error, prints list of entities
Attempts:
2 left
💡 Hint

Check if the 'aggregation_strategy' argument is valid for the current transformers version.