0
0
NLPml~10 mins

Lexicon-based approaches (VADER) in NLP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the VADER sentiment analyzer from NLTK.

NLP
from nltk.sentiment.vader import [1]
Drag options to blanks, or click blank then click option'
ASentimentIntensityAnalyzer
BSentimentAnalyzer
CVaderAnalyzer
DSentimentScore
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names like SentimentAnalyzer or VaderAnalyzer.
2fill in blank
medium

Complete the code to create an instance of the VADER sentiment analyzer.

NLP
analyzer = [1]()
Drag options to blanks, or click blank then click option'
AVaderSentiment
BSentimentIntensityAnalyzer
CSentimentAnalyzer
DVaderAnalyzer
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to instantiate classes that don't exist like VaderSentiment.
3fill in blank
hard

Fix the error in the code to get the sentiment scores for the text.

NLP
scores = analyzer.[1]('I love learning AI!')
Drag options to blanks, or click blank then click option'
Apolarity_scores
Bscore
Csentiment_score
Dget_scores
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like score or get_scores.
4fill in blank
hard

Complete the code to extract the compound score from the sentiment scores dictionary.

NLP
compound_score = scores['[1]']
Drag options to blanks, or click blank then click option'
A[
B]
Ccompound
Dscore
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of brackets or wrong keys like 'score'.
5fill in blank
hard

Complete the code to create a dictionary comprehension that maps sentences to their compound sentiment scores.

NLP
sentence_scores = {sentence: analyzer.[1](sentence)['compound'] for sentence in sentences}
Drag options to blanks, or click blank then click option'
A:
Bpolarity_scores
C[
D]
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong separators or missing brackets for dictionary access.