Natural Language Processing
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary goal of natural language processing?
What is the primary goal of natural language processing?
84 questions
- 1
What is the primary goal of natural language processing?
- A
To ensure that every sentence has exactly one interpretation
- B
To replace all structured programming with spoken commands
- C
To enable computers to work with human natural languages
- D
To make computers communicate only through numerical symbols
Correct answer
CTo enable computers to work with human natural languages
Explanation
Natural language processing focuses on enabling computers to understand, analyze, generate, and otherwise work with languages such as English.
- A
- 2
Which task involves producing a shorter representation of a long text?
- A
Text classification
- B
Machine translation
- C
Information extraction
- D
Automatic summarization
Correct answer
DAutomatic summarization
Explanation
Automatic summarization creates a shorter representation that preserves important information from a longer text.
- A
- 3
Which natural language processing task extracts relevant facts or details from text?
- A
Question answering
- B
Automatic summarization
- C
Information extraction
- D
Sentiment generation
Correct answer
CInformation extraction
Explanation
Information extraction identifies and pulls relevant facts or details from a text.
- A
- 4
What is the purpose of machine translation?
- A
To assign a positive or negative label to a text
- B
To identify the grammatical structure of a sentence
- C
To divide a sentence into individual words
- D
To convert text from one natural language into another
Correct answer
DTo convert text from one natural language into another
Explanation
Machine translation converts text from one language to another, such as translating English into French.
- A
- 5
What does text classification do?
- A
It generates a syntax tree for every possible sentence
- B
It replaces every word with a synonym
- C
It translates text into a different language
- D
It assigns text to a category or label
Correct answer
DIt assigns text to a category or label
Explanation
Text classification assigns a label to text, such as spam or inbox, or positive or negative.
- A
- 6
Which example best illustrates question answering in natural language processing?
- A
Replacing every English word with a French dictionary entry
- B
Sorting emails according to their sender addresses
- C
Generating an answer after receiving the question about a capital city
- D
Counting how many words appear in a document
Correct answer
CGenerating an answer after receiving the question about a capital city
Explanation
Question answering requires a system to interpret an input question and generate an appropriate textual response.
- A
- 7
Why is natural language difficult for computers to understand?
- A
It follows exactly the same rules in every human language
- B
It contains no recurring patterns that computers can analyze
- C
It contains substantial nuance, complexity, and ambiguity
- D
It uses only visual information rather than symbolic information
Correct answer
CIt contains substantial nuance, complexity, and ambiguity
Explanation
Natural language is challenging because its structure and meaning can be nuanced, complex, and ambiguous.
- A
- 8
What does syntax concern in natural language?
- A
The frequency of words in a training corpus
- B
The structure and arrangement of language
- C
The emotional attitude expressed by a speaker
- D
The numerical representation of each word
Correct answer
BThe structure and arrangement of language
Explanation
Syntax concerns how words are organized into structurally valid sentences and phrases.
- A
- 9
Why is the sentence Just before nine o'clock Sherlock Holmes stepped briskly into the room syntactically valid?
- A
Every word in it has exactly one possible meaning
- B
Its words are arranged into a coherent grammatical structure
- C
Its meaning can be determined without considering word order
- D
It contains only words that occur frequently in English
Correct answer
BIts words are arranged into a coherent grammatical structure
Explanation
The sentence is syntactically valid because its words are arranged in a well-formed grammatical structure.
- A
- 10
What is wrong with the sequence Just before Sherlock Holmes nine o'clock stepped briskly the room?
- A
It contains words that cannot appear in any English sentence
- B
Its words do not form a logically well-structured sentence
- C
It has a valid structure but lacks any recognizable vocabulary
- D
It expresses two different meanings through valid structures
Correct answer
BIts words do not form a logically well-structured sentence
Explanation
Although the sequence contains valid English words, their arrangement does not form a syntactically well-formed sentence.
- A
- 11
What makes the sentence I saw the man on the mountain with a telescope ambiguous?
- A
The sentence can only be interpreted as describing a mountain
- B
The word telescope has no meaning outside of scientific writing
- C
The telescope may belong to the speaker or to the man
- D
The sentence contains no nouns or verbs to establish a structure
Correct answer
CThe telescope may belong to the speaker or to the man
Explanation
The prepositional phrase with a telescope can modify the speaker's seeing or the man, producing different interpretations.
- A
- 12
What does semantics concern in natural language?
- A
The meaning of words and sentences
- B
The physical location where language is produced
- C
The order in which training examples are presented
- D
The number of words in each sentence
Correct answer
AThe meaning of words and sentences
Explanation
Semantics concerns what words and sentences mean, rather than merely how they are structured.
- A
- 13
What relationship exists between the two sentences Just before nine o'clock Sherlock Holmes stepped briskly into the room and A few minutes before nine, Sherlock Holmes walked quickly into the room?
- A
They are both syntactically invalid because they contain adverbs
- B
They use unrelated vocabulary and describe unrelated events
- C
They differ syntactically but have essentially similar meanings
- D
They have identical syntax but completely opposite meanings
Correct answer
CThey differ syntactically but have essentially similar meanings
Explanation
The sentences use different wording and structure but communicate essentially the same event.
- A
- 14
What does the sentence Colorless green ideas sleep furiously demonstrate?
- A
A sentence cannot be syntactically valid unless it is factual
- B
Natural language has no distinction between syntax and semantics
- C
A sentence can be syntactically valid but semantically meaningless
- D
Adjectives cannot modify nouns in natural English
Correct answer
CA sentence can be syntactically valid but semantically meaningless
Explanation
The sentence has a grammatical structure, but its combined meaning is not coherent or meaningful.
- A
- 15
What is a formal grammar?
- A
A database containing every sentence that speakers have used
- B
A system of rules for generating sentences in a language
- C
A probability distribution over the emotional content of text
- D
A numerical vector assigned to each word in a vocabulary
Correct answer
BA system of rules for generating sentences in a language
Explanation
A formal grammar specifies rules that can be used to generate or analyze the structures of sentences.
- A
- 16
What distinguishes a context-free grammar in the described approach?
- A
It classifies every sentence only by its sentiment
- B
It generates sentences without using any symbolic categories
- C
It determines word meanings solely from surrounding documents
- D
It uses rewriting rules to expand nonterminal symbols
Correct answer
DIt uses rewriting rules to expand nonterminal symbols
Explanation
A context-free grammar uses rules that rewrite nonterminal symbols into other symbols or terminal words.
- A
- 17
In a context-free grammar, what is a terminal symbol?
- A
A hidden state passed between neural network computations
- B
A grammatical category that must be expanded into a phrase
- C
A final word that requires no further generation
- D
A probability assigned to a possible sentence structure
Correct answer
CA final word that requires no further generation
Explanation
Terminal symbols are the final words produced by the grammar; once generated, they require no further expansion.
- A
- 18
What is the role of a nonterminal symbol such as N, V, or D?
- A
It stores the probability of a sentence being meaningful
- B
It represents a word that cannot be replaced or expanded
- C
It represents a grammatical category that can generate other symbols
- D
It records the position of a word in a sentence
Correct answer
CIt represents a grammatical category that can generate other symbols
Explanation
Nonterminals represent categories such as noun, verb, or determiner and are expanded using grammar rules.
- A
- 19
Which set contains only examples of determiners in the described grammar?
- A
Saw, walked, and stepped
- B
Wide, briskly, and quickly
- C
She, city, and car
- D
The, a, and an
Correct answer
DThe, a, and an
Explanation
Determiners include words such as the, a, and an.
- A
- 20
What does the rewriting rule NP arrow N bar D N mean?
- A
A noun phrase can be a noun or a determiner followed by a noun
- B
A noun phrase must contain exactly three terminal words
- C
A determiner can be replaced by either a noun or a verb
- D
A noun must always be followed by a determiner and a noun
Correct answer
AA noun phrase can be a noun or a determiner followed by a noun
Explanation
The rule allows an NP to expand either directly to N or to D followed by N, such as she or the city.
- A
- 21
Which phrase is generated as a noun phrase under the rule NP arrow N bar D N?
- A
The city
- B
The walked
- C
Saw quickly
- D
City briskly
Correct answer
AThe city
Explanation
The city consists of a determiner followed by a noun, so it can be generated as an NP.
- A
- 22
What does the rule VP arrow V bar V NP allow a grammar to generate?
- A
A verb phrase that is either a verb or a verb followed by a noun phrase
- B
A noun phrase that consists of a determiner and an adjective
- C
A sentence that contains a prepositional phrase but no verb
- D
A verb phrase that must contain two verbs and no nouns
Correct answer
AA verb phrase that is either a verb or a verb followed by a noun phrase
Explanation
The rule allows verb phrases such as walked, which is V, and saw the city, which is V followed by NP.
- A
- 23
How is a sentence defined in the basic grammar described?
- A
As any sequence containing at least three words
- B
As a noun phrase followed by a verb phrase
- C
As an adjective phrase followed by a noun
- D
As a verb followed by a determiner
Correct answer
BAs a noun phrase followed by a verb phrase
Explanation
The grammar defines a sentence as an NP followed by a VP.
- A
- 24
What does NLTK provide in the context of the lesson?
- A
A method that guarantees every generated sentence is meaningful
- B
A replacement for all Python neural network libraries
- C
Tools for processing language and parsing context-free grammars
- D
A fixed vocabulary containing every valid English sentence
Correct answer
CTools for processing language and parsing context-free grammars
Explanation
NLTK, the Natural Language Toolkit, provides features for natural language processing, including context-free grammar parsing.
- A
- 25
Why can the more complex grammar produce multiple parse trees for she saw the dog with the binoculars?
- A
The prepositional phrase can modify either the dog or the act of seeing
- B
The grammar treats every noun as both a verb and a determiner
- C
The sentence contains two unrelated terminal vocabularies
- D
The parser randomly changes the order of words before analysis
Correct answer
AThe prepositional phrase can modify either the dog or the act of seeing
Explanation
The phrase with the binoculars may describe the dog or modify saw, corresponding to the two interpretations.
- A
- 26
What is a major limitation of manually specifying a formal grammar for English?
- A
Formal grammars cannot represent nouns, verbs, or determiners
- B
Formal grammars always ignore the order of words in a sentence
- C
Formal grammars can generate only sentences containing one word
- D
Writing rules for every possible sentence is difficult and labor-intensive
Correct answer
DWriting rules for every possible sentence is difficult and labor-intensive
Explanation
English is highly complex, so manually writing enough rules to cover every possible sentence would require substantial effort.
- A
- 27
What is an n-gram?
- A
A collection of n unrelated words selected from a document
- B
A vector with n dimensions representing one word's meaning
- C
A contiguous sequence of n items from a text sample
- D
A grammatical rule containing exactly n nonterminal symbols
Correct answer
CA contiguous sequence of n items from a text sample
Explanation
An n-gram is a contiguous sequence of n items, such as characters or words, from a text.
- A
- 28
What is a trigram?
- A
A grammar containing exactly three rewriting rules
- B
A vector containing three binary features for each word
- C
An n-gram containing three randomly selected sentences
- D
An n-gram containing three consecutive items
Correct answer
DAn n-gram containing three consecutive items
Explanation
A trigram is an n-gram where n=3, meaning it contains three consecutive items.
- A
- 29
Which sequence is a trigram from the example passage?
- A
Often have I
- B
The room stepped briskly
- C
Often and
- D
Have Sherlock Holmes I
Correct answer
AOften have I
Explanation
Often have I contains three consecutive words and is therefore a trigram.
- A
- 30
What can a corpus of trigrams help a computer learn?
- A
Which words have identical meanings regardless of context
- B
Which three-word sequences commonly occur together
- C
Which documents were written by the same individual
- D
Which sentence structures are logically impossible in every language
Correct answer
BWhich three-word sequences commonly occur together
Explanation
Counting trigrams in a corpus reveals which sequences of three words commonly appear next to one another.
- A
- 31
What is tokenization?
- A
Splitting a sequence of characters into smaller pieces such as words
- B
Converting each word directly into a grammatical parse tree
- C
Assigning a sentiment label to every sentence in a corpus
- D
Reordering words so that every sentence becomes grammatical
Correct answer
ASplitting a sequence of characters into smaller pieces such as words
Explanation
Tokenization divides text into pieces, such as individual words, that can then be analyzed.
- A
- 32
What is a bigram?
- A
An n-gram containing two separate paragraphs
- B
A pair of vectors representing one word's positive and negative meanings
- C
A grammar rule with two possible sentence meanings
- D
An n-gram containing two consecutive items
Correct answer
DAn n-gram containing two consecutive items
Explanation
A bigram is an n-gram where n=2, so it contains two consecutive items.
- A
- 33
How does a Markov chain support statistical language generation?
- A
It predicts a next value using preceding values
- B
It determines the grammatical category of a word without training data
- C
It guarantees that every generated sentence is semantically meaningful
- D
It translates each input word independently into another language
Correct answer
AIt predicts a next value using preceding values
Explanation
A Markov chain uses previous values to predict a subsequent value; in language, this can mean predicting the next word from prior words.
- A
- 34
Why might sentences generated by a language Markov chain fail to make sense?
- A
They are produced only from formal grammar rules
- B
They may follow statistical word patterns without capturing meaning
- C
They contain no words that appeared in the input corpus
- D
They are always generated without using any training text
Correct answer
BThey may follow statistical word patterns without capturing meaning
Explanation
A Markov model can reproduce statistical patterns from its data while lacking a genuine understanding of sentence meaning.
- A
- 35
What is text classification in the context of email filtering?
- A
Determining whether an email belongs in the inbox or spam
- B
Compressing an email into a shorter summary
- C
Translating an email into the recipient's language
- D
Identifying the grammatical parse tree of an email
Correct answer
ADetermining whether an email belongs in the inbox or spam
Explanation
Email filtering is a text classification task in which messages are labeled, for example, as inbox or spam.
- A
- 36
What is sentiment analysis designed to determine?
- A
Whether text contains a noun phrase followed by a verb phrase
- B
Whether text expresses a positive or negative sentiment
- C
Whether text contains exactly one occurrence of each word
- D
Whether text was originally written in English or French
Correct answer
BWhether text expresses a positive or negative sentiment
Explanation
Sentiment analysis classifies text according to attitudes such as positive or negative sentiment.
- A
- 37
Which words from the example reviews are most strongly associated with positive sentiment?
- A
Broke, cheap, and flimsy
- B
Loved, fun, and best
- C
After, days, and kind
- D
Product, games, and grandson
Correct answer
BLoved, fun, and best
Explanation
Words such as loved, fun, and best were identified as indicators of positive reviews.
- A
- 38
What is the central simplification of the bag-of-words model?
- A
It represents text as an unordered collection of words
- B
It represents only the first and last words of each sentence
- C
It represents word order using a recurrent hidden state
- D
It represents every text as a single grammatical production rule
Correct answer
AIt represents text as an unordered collection of words
Explanation
The bag-of-words model ignores word order and treats text as an unordered collection of its words.
- A
- 39
What information does the bag-of-words model discard?
- A
The sequence and ordering of words
- B
The distinction between positive and negative labels
- C
The number of training examples in each class
- D
The identity of every word in the text
Correct answer
AThe sequence and ordering of words
Explanation
Because it treats words as unordered, the model discards information about which word came first, second, or third.
- A
- 40
What is the Naive assumption in a Naive Bayes text classifier?
- A
Words are treated as conditionally independent given the class
- B
The training set is assumed to contain no rare words
- C
Word order is assumed to determine sentiment perfectly
- D
Every word occurs equally often in positive and negative texts
Correct answer
AWords are treated as conditionally independent given the class
Explanation
Naive Bayes assumes that the words are independent of one another once the sentiment class is known, even though this is often not strictly true.
- A
- 41
How is the prior probability of a positive review estimated from labeled training data?
- A
By dividing the number of positive reviews by the total number of reviews
- B
By counting how many positive words occur in the longest review
- C
By multiplying the probabilities of all words in the positive reviews
- D
By dividing the number of words in positive reviews by the vocabulary size
Correct answer
ABy dividing the number of positive reviews by the total number of reviews
Explanation
The prior probability of a positive review is estimated as the proportion of training samples labeled positive.
- A
- 42
How is the conditional probability of loved given a positive review estimated?
- A
By dividing positive reviews by the total number of vocabulary words
- B
By multiplying the probability of loved by the probability of positive
- C
By dividing positive reviews containing loved by all positive reviews
- D
By dividing all reviews containing loved by the number of negative reviews
Correct answer
CBy dividing positive reviews containing loved by all positive reviews
Explanation
The conditional probability is estimated by counting positive samples containing loved and dividing by the total number of positive samples.
- A
- 43
Why can the denominator in Bayes' rule be omitted when comparing positive and negative classes?
- A
It represents the number of words and is already included in tokenization
- B
It is the same evidence probability for both class comparisons
- C
It is guaranteed to be larger than every numerator
- D
It is always equal to zero for text classification problems
Correct answer
BIt is the same evidence probability for both class comparisons
Explanation
The probability of the observed words is common to both class calculations, so the unnormalized class scores can be compared and normalized afterward.
- A
- 44
What problem occurs when a word never appears in any positive training example?
- A
The negative class score becomes automatically equal to one
- B
The word is removed from every negative and positive review
- C
The classifier becomes unable to tokenize any future review
- D
The positive class score becomes zero when probabilities are multiplied
Correct answer
DThe positive class score becomes zero when probabilities are multiplied
Explanation
A zero conditional probability for one word makes the entire product for that class equal to zero.
- A
- 45
How does Laplace smoothing address unseen words?
- A
It adds one to each count so that probabilities do not become zero
- B
It assigns every class exactly the same final probability
- C
It reverses the order of words before calculating their probabilities
- D
It removes every word that appears only once in the training data
Correct answer
AIt adds one to each count so that probabilities do not become zero
Explanation
Laplace smoothing adds one to counts, effectively pretending each possible value has been observed once more and preventing zero probabilities.
- A
- 46
What is the purpose of normalizing the positive and negative Naive Bayes scores?
- A
To convert the unnormalized scores into probabilities that sum to one
- B
To remove the conditional independence assumption from the model
- C
To convert the text back from a bag into its original word order
- D
To ensure that all words have the same frequency in the corpus
Correct answer
ATo convert the unnormalized scores into probabilities that sum to one
Explanation
The class products are proportional scores rather than a probability distribution, so normalization makes their total equal to one.
- A
- 47
What is a one-hot representation of a word?
- A
A vector containing the word's frequency in every document
- B
A vector with one 1 and zeros in all other positions
- C
A vector containing one nonzero value for every synonym
- D
A vector whose values represent the word's surrounding context
Correct answer
BA vector with one 1 and zeros in all other positions
Explanation
In a one-hot representation, each word receives a distinct vector with a single 1 and all remaining entries equal to zero.
- A
- 48
Why do one-hot vectors become problematic for large vocabularies?
- A
They become very long because each word needs a distinct position
- B
They cannot represent any word that appears more than once
- C
They require every word to have the same semantic meaning
- D
They cannot be used as input to a neural network
Correct answer
AThey become very long because each word needs a distinct position
Explanation
A vocabulary of thousands of words requires vectors with thousands of positions, making the representations large and inefficient.
- A
- 49
Why do one-hot vectors poorly represent semantic similarity?
- A
One-hot vectors preserve too much information about word order
- B
Similar words are always assigned identical vectors
- C
One-hot vectors encode only the grammatical structure of sentences
- D
Similar words receive entirely different vectors
Correct answer
DSimilar words receive entirely different vectors
Explanation
Words such as wrote and authored receive different one-hot positions even though their meanings are similar.
- A
- 50
What is a distributed representation?
- A
A representation that removes all contextual information from a word
- B
A representation in which meaning is spread across multiple vector values
- C
A representation in which every word receives a single unique binary position
- D
A representation that stores only the number of times a word appears
Correct answer
BA representation in which meaning is spread across multiple vector values
Explanation
Distributed representations encode meaning across multiple values, allowing semantically similar words to have similar vectors.
- A
- 51
What principle motivates representing words according to their surrounding words?
- A
Words with similar spellings must always have identical meanings
- B
Words appearing in similar contexts tend to have related meanings
- C
Words occurring in different languages cannot share semantic relationships
- D
Words can be understood accurately without considering surrounding text
Correct answer
BWords appearing in similar contexts tend to have related meanings
Explanation
The context-based principle suggests that a word's meaning can be inferred from the company it keeps.
- A
- 52
Why might breakfast, lunch, and dinner receive similar vectors in a context-based model?
- A
They can occur in similar contexts, such as the blank in For blank he ate
- B
They occur only in sentences with identical word order
- C
They are all represented by the same one-hot vocabulary position
- D
They always have the same spelling and grammatical suffix
Correct answer
AThey can occur in similar contexts, such as the blank in For blank he ate
Explanation
Because these words can fill similar contextual roles, a model may learn that they have related meanings.
- A
- 53
What does the word2vec model learn?
- A
Vector representations based on the contexts in which words appear
- B
A complete manually written grammar for every English sentence
- C
A fixed translation table that ignores surrounding words
- D
A classification label for every document in the training corpus
Correct answer
AVector representations based on the contexts in which words appear
Explanation
Word2vec learns word vectors from contextual patterns, placing words with similar usage near one another.
- A
- 54
If the distance between book and novel is smaller than the distance between book and breakfast, what does that suggest?
- A
The model represents breakfast and book as synonyms
- B
The model has determined that breakfast cannot occur near book
- C
The model represents book and novel as more semantically similar
- D
The model has assigned book and novel unrelated vocabulary positions
Correct answer
CThe model represents book and novel as more semantically similar
Explanation
A smaller vector distance indicates that the model considers the meanings or usage patterns of book and novel more similar.
- A
- 55
What relationship is illustrated by the vector operation woman plus king minus man producing a vector near queen?
- A
Word vectors can capture relationships as well as similarity
- B
One-hot vectors always produce exact dictionary definitions
- C
Word vectors can represent only word frequency and not meaning
- D
The model translates every word by replacing its final letter
Correct answer
AWord vectors can capture relationships as well as similarity
Explanation
The operation suggests that vector arithmetic can encode a relationship such as the gendered counterpart of a royal role.
- A
- 56
Why are word vectors useful as inputs to neural networks?
- A
They eliminate the need for training data in language tasks
- B
They convert words into numerical vectors that neural networks can process
- C
They guarantee that the neural network will understand every sentence
- D
They force all words in a sentence to have identical representations
Correct answer
BThey convert words into numerical vectors that neural networks can process
Explanation
Neural networks process numerical inputs, so word vectors provide a numeric representation of language data.
- A
- 57
Why is translating a sentence more difficult for a basic fixed-size neural network than translating one word?
- A
A sentence contains no information about word order
- B
Words cannot be represented numerically, while sentences can
- C
Neural networks can produce only numerical outputs rather than words
- D
Sentences have variable lengths, while the network expects fixed-size input and output
Correct answer
DSentences have variable lengths, while the network expects fixed-size input and output
Explanation
A sentence or paragraph may contain different numbers of words, creating a variable-length sequence problem for fixed-size networks.
- A
- 58
What is the defining sequence-related feature of a recurrent neural network?
- A
It represents every word with a one-hot vector and stops there
- B
It processes every input word independently without retaining state
- C
It uses only the final output word to determine the input sequence
- D
It passes a hidden state from one processing step to the next
Correct answer
DIt passes a hidden state from one processing step to the next
Explanation
An RNN maintains information in a hidden state and passes that state between successive processing steps.
- A
- 59
What happens in an encoder-decoder architecture for sequence tasks?
- A
An encoder transforms the input into hidden information that a decoder uses to generate output
- B
The encoder and decoder independently translate each word without sequence information
- C
A decoder labels each input word before the encoder reads the sentence
- D
A single fixed dictionary replaces both the input and output sequences
Correct answer
AAn encoder transforms the input into hidden information that a decoder uses to generate output
Explanation
The encoder captures the input sequence in hidden state information, and the decoder uses it to produce the output sequence.
- A
- 60
Why are special start or end tokens used in sequence decoding?
- A
They allow the model to ignore all previously generated words
- B
They signal when generation begins or when the output sequence is complete
- C
They identify which input words have positive sentiment
- D
They convert every word into a one-hot representation
Correct answer
BThey signal when generation begins or when the output sequence is complete
Explanation
Special tokens indicate sequence boundaries, including when the model should stop producing output.
- A
- 61
What is a major weakness of compressing a long input sequence into one final hidden state?
- A
The state necessarily contains too many separate output languages
- B
The single state may not preserve all information needed for a long sequence
- C
The process removes the need to model word order
- D
The decoder cannot generate more than one word from any state
Correct answer
BThe single state may not preserve all information needed for a long sequence
Explanation
As the input grows, it becomes increasingly difficult for one hidden state to retain all relevant information.
- A
- 62
What is the central purpose of an attention mechanism?
- A
To remove all hidden states before the decoder begins
- B
To determine which input values are most relevant when generating the next output
- C
To replace every neural network layer with a grammar rule
- D
To ensure that every input word receives exactly the same importance
Correct answer
BTo determine which input values are most relevant when generating the next output
Explanation
Attention allows the model to focus selectively on the input information most useful for generating a particular output token.
- A
- 63
When answering What is the capital of Massachusetts, which words might receive especially high attention while generating Boston?
- A
The first two punctuation marks
- B
What and is
- C
Every word with exactly equal attention
- D
Capital and Massachusetts
Correct answer
DCapital and Massachusetts
Explanation
Capital and Massachusetts are especially relevant to determining that the answer should be Boston.
- A
- 64
How can an attention-based context vector be calculated?
- A
By averaging all vectors equally regardless of their relevance
- B
By selecting the longest input word and discarding the rest
- C
By replacing every vector with a one-hot class label
- D
By taking a weighted combination of hidden-state vectors
Correct answer
DBy taking a weighted combination of hidden-state vectors
Explanation
The model weights hidden-state vectors by their attention scores and combines them into a context vector.
- A
- 65
What do attention scores indicate?
- A
How relevant particular input values are for the current generation step
- B
The exact probability that an entire sentence is meaningful
- C
Whether each word is grammatically a noun or a verb
- D
How many characters are contained in each input word
Correct answer
AHow relevant particular input values are for the current generation step
Explanation
Attention scores quantify how important each input representation is for generating a particular output token.
- A
- 66
How can attention scores be computed?
- A
They are determined solely by alphabetical order
- B
They are always equal to the number of words in the input
- C
They can be obtained only by manually writing a grammar rule
- D
They can be calculated using vector comparisons or a learned neural network
Correct answer
DThey can be calculated using vector comparisons or a learned neural network
Explanation
Possible methods include a dot product between vectors or a neural network trained to calculate attention values.
- A
- 67
What does an attention visualization in machine translation typically show?
- A
Which source-language words the model emphasizes for each target-language word
- B
Which target words were removed because they were grammatically invalid
- C
How many training documents were written in each language
- D
The exact dictionary definition of every translated word
Correct answer
AWhich source-language words the model emphasizes for each target-language word
Explanation
Attention visualizations show correspondences between source words and the target words being generated.
- A
- 68
Why can recurrent neural networks be difficult to parallelize?
- A
The network cannot accept numerical vectors as input
- B
Each step processes a different language and needs a separate dictionary
- C
The model must generate all possible sentences before training
- D
Each step depends on the hidden state produced by the previous step
Correct answer
DEach step depends on the hidden state produced by the previous step
Explanation
Because each RNN computation depends on the prior hidden state, the steps must largely occur in sequence.
- A
- 69
What is a major motivation for the Transformer architecture?
- A
It eliminates the need to represent words as numerical vectors
- B
It enables more parallel processing of input words than recurrent models
- C
It guarantees that generated text has correct semantics
- D
It limits all input sequences to a single fixed length
Correct answer
BIt enables more parallel processing of input words than recurrent models
Explanation
Transformers were motivated in part by the difficulty of parallelizing recurrent processing, especially for large datasets and models.
- A
- 70
How does a Transformer initially process input words differently from an RNN encoder?
- A
It converts the whole sentence into one manually selected grammar rule
- B
It can process the words independently and in parallel
- C
It must pass each word through the previous word's hidden state
- D
It processes only the final word and reconstructs the rest afterward
Correct answer
BIt can process the words independently and in parallel
Explanation
Transformer processing allows each input word to pass through corresponding computations without waiting for the preceding word.
- A
- 71
What information is lost if a Transformer processes words independently without an additional mechanism?
- A
The ability to process words in parallel
- B
The ordering and positional information of the words
- C
The identity of the words themselves
- D
The possibility of using attention between words
Correct answer
BThe ordering and positional information of the words
Explanation
Independent processing does not inherently reveal whether a word is first, second, or later in the sentence.
- A
- 72
What is the purpose of positional encoding in a Transformer?
- A
To assign a sentiment label to each word before attention is applied
- B
To prevent the model from processing words in parallel
- C
To provide information about where each word occurs in the sequence
- D
To ensure that every word has a unique dictionary definition
Correct answer
CTo provide information about where each word occurs in the sequence
Explanation
Positional encoding adds a vector describing a word's position so the model can use both word identity and order.
- A
- 73
What does self-attention allow an input word to do in a Transformer encoder?
- A
Attend only to words that appear after it in the output sequence
- B
Generate a complete translated paragraph without a decoder
- C
Ignore all surrounding words and preserve only its dictionary meaning
- D
Use other input words to determine its contextual representation
Correct answer
DUse other input words to determine its contextual representation
Explanation
Self-attention lets each input word consider other input words so its representation reflects context.
- A
- 74
Why is context important when encoding a word?
- A
Every word has the same meaning in every possible sentence
- B
Context is needed only to calculate the word's spelling
- C
Context prevents the model from learning relationships between words
- D
The interpretation of a word can depend on the other words around it
Correct answer
DThe interpretation of a word can depend on the other words around it
Explanation
A word's meaning or interpretation may change depending on how it is used with surrounding words.
- A
- 75
What is multi-headed attention?
- A
Using attention only on the first and last words of a sentence
- B
Using multiple unrelated encoders that never share input information
- C
Using one attention score for every possible language
- D
Using multiple attention heads that can focus on different aspects of the input
Correct answer
DUsing multiple attention heads that can focus on different aspects of the input
Explanation
Multi-headed attention allows different attention heads to learn and focus on different relationships or facets of the input.
- A
- 76
Why may Transformer attention and feed-forward layers be repeated?
- A
Repeating them is required to restore the original word order manually
- B
Repeating them removes the need for any training data
- C
Repeating them ensures that every word receives a one-hot vector
- D
Repeating them can help the model learn deeper patterns and representations
Correct answer
DRepeating them can help the model learn deeper patterns and representations
Explanation
Stacking layers supports deeper representations and allows the model to learn more complex patterns in text.
- A
- 77
What additional attention operation is typically included in a Transformer decoder?
- A
Attention from output processing to the encoded input representations
- B
Attention from every input word to an unrelated external vocabulary
- C
Attention that converts all output words into grammatical categories
- D
Attention that ignores previously generated output words
Correct answer
AAttention from output processing to the encoded input representations
Explanation
In addition to decoder self-attention, the decoder attends to encoder representations to determine which input information matters for the next output.
- A
- 78
Why does a Transformer decoder use self-attention over previous output words?
- A
Self-attention guarantees that the next word will be factually correct
- B
The decoder cannot access any encoded input representations
- C
Previous output words provide the positional encodings for the input sentence
- D
Previously generated words help determine the next output word
Correct answer
DPreviously generated words help determine the next output word
Explanation
The decoder uses previously generated output words to maintain coherence and determine what should come next.
- A
- 79
Which statement best compares Transformer variants?
- A
Transformers differ only in vocabulary size and never in architecture
- B
Some use only an encoder, some only a decoder, and others combine components
- C
Every Transformer excludes attention and relies exclusively on recurrence
- D
Every Transformer must use exactly one encoder and two decoders
Correct answer
BSome use only an encoder, some only a decoder, and others combine components
Explanation
Different Transformer models may use encoder-only, decoder-only, or encoder-decoder configurations, while retaining attention-based principles.
- A
- 80
Which progression best summarizes the major AI areas discussed in the course?
- A
Syntax, spelling, punctuation, translation, compression, databases, and graphics
- B
Sorting, encryption, operating systems, networking, compilers, graphics, and robotics
- C
Search, knowledge, probability, optimization, machine learning, neural networks, and language
- D
Databases, recursion, memory management, rendering, hardware, files, and web design
Correct answer
CSearch, knowledge, probability, optimization, machine learning, neural networks, and language
Explanation
The course covered search, knowledge representation, probability, optimization, machine learning, neural networks, and natural language processing.
- A
- 81
What is the general role of optimization in artificial intelligence?
- A
It seeks to maximize or minimize an objective function
- B
It guarantees that uncertain information becomes certain
- C
It stores facts without using any numerical objective
- D
It converts every natural language sentence into a parse tree
Correct answer
AIt seeks to maximize or minimize an objective function
Explanation
Many AI problems can be framed as maximizing or minimizing a function according to a chosen objective.
- A
- 82
What is the defining idea of machine learning?
- A
Avoiding numerical representations of input information
- B
Learning patterns from data to perform a task
- C
Writing every possible solution explicitly by hand
- D
Using only logical rules and never using examples
Correct answer
BLearning patterns from data to perform a task
Explanation
Machine learning uses training data to learn patterns that support predictions or task performance.
- A
- 83
How are neural network weights used during learning?
- A
They are updated using training data to improve input-to-output predictions
- B
They are fixed before training and determine every output permanently
- C
They store only the positions of words in a sentence
- D
They replace the need for any input or output representation
Correct answer
AThey are updated using training data to improve input-to-output predictions
Explanation
Training updates the network's weights so it can more accurately map inputs to desired outputs.
- A
- 84
Why is natural language processing a particularly challenging AI area?
- A
Natural language always has one fixed interpretation for each sentence
- B
Natural language combines complex structure with ambiguity in meaning
- C
Natural language contains no patterns that statistical models can learn
- D
Natural language can be represented only through physical gestures
Correct answer
BNatural language combines complex structure with ambiguity in meaning
Explanation
Language presents challenges involving syntax, semantics, context, ambiguity, variable-length sequences, and meaning.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.