Chapter Quiz#

Here you can find all the quizzes from the lessons in this chapter. Try to solve them to understand how well you have learned the concepts.

1.1 A Brief History of NLP#

Which one of the following tasks is not about NLP?

  1. Forecasting the stock market leveraging business news articles.

  2. Classifying which emails should go in the spam folder.

  3. Translating natural language into SQL queries.

  4. Detecting fires from satellite images.

Is it possible today to automatically generate newspaper articles that are hardly distinguishable from those written by human writers? True or False.

What’s the goal of a language model?

  1. Classifying the language of a text.

  2. Learning the distribution of the words in a language.

  3. Detecting whether a text is grammatically correct or not.

  4. Containing all the rules needed to generate correct texts in a language.

What was the first task faced in the history of NLP?

  1. Machine translation.

  2. Text generation.

  3. Text classification.

  4. Text similarity.

What are the AI Winters?

  1. Moments when artificial intelligence research funds were exhausted due to economic crises.

  2. Periods in which the research on artificial intelligence didn’t achieve significant advances.

  3. A period of reduced funding and interest in the AI technology, typically alternating with moments of hype.

What’s the name of the programs designed to mimic human experts in specific domains, such as medicine or law?

  1. Symbolic Experts.

  2. Domain Programs.

  3. Domain Experts.

  4. Expert Systems.

What are word embeddings?

  1. Vectors representing words, such that semantically similar words are represented by similar vectors.

  2. Vectors used to compress the meaning of a text in sequence-to-sequence problems.

  3. A mechanism that made neural networks more efficient, leading to the birth of the Transformer neural network.

What is a Transformer in NLP?

  1. A particular type of neural network that leverages attention mechanisms.

  2. A particular type of neural network that leverages ontologies.

  3. A particular language model that can be fine-tuned for specific tasks.

Which of the following is not a reason for the recent boom of NLP.

  1. The advances in machine learning algorithms.

  2. The development of powerful computational resources.

  3. The development of large expert systems with hand-written rules.

  4. The increasing availability of text data from around the internet.

  5. The development of frameworks for developing neural networks.

1.2 What Tasks Can I Solve with NLP Today?#

Select the example that is not about text classification.

  1. Detecting the language of a text.

  2. Classifying a tweet as containing or not containing obscene text.

  3. Translating a sentence from English to Italian.

  4. Labeling a Git issue as “Improvement proposal”.

Select the example that is not about text classification.

  1. Getting the most similar document to my search query.

  2. Detecting spam emails.

  3. Categorizing news articles into a known taxonomy of categories.

  4. Automatically filtering tweets about climate disasters.

Choose the option that best describes the goal of a semantic search engine.

  1. Matching words in the queries with words in the documents semantically by assigning appropriate weights to words.

  2. Retrieving and ranking all types of documents (texts, images, etc) that are relevant to a query.

  3. Looking for the documents most relevant to a query, going beyond text-matching and taking semantics into account (typically with word embeddings).

What are two common types of Question Answering models?

  1. Extractive and Generative.

  2. Generative and Multimodal.

  3. Chatbot-based and Personal Assistant-based.

What’s the name of the depicted NLP task?

../_images/ner_quiz.png
  1. Relation Extraction.

  2. Named-Entity Recognition.

  3. Keyword and Keyphrases Extraction.

What do nodes and edges in a Knowledge Graph typically represent?

  1. Nodes represent relationships, and edges represent entities.

  2. Nodes represent words, and edges represent semantic relationships between the words.

  3. Nodes represent entities, and edges represent relationships between the entities.

What are two possible names of the task that transcribes speech into text? (2 correct answers)

  1. Automatic Speech Transcription.

  2. Speech-to-Text.

  3. Automatic Speech Recognition.

1.3 How It Started: Grammars and Why Human Language Is Hard for Computers#

What is a grammar?

  1. A set of rules for forming well-structured sentences in a language.

  2. A set of rules for estimating the probability of each word in a language.

  3. A set of rules describing the meaning of the sentences in a language.

How are groups of synonyms called in WordNet?

  1. Synonym groups.

  2. Synsets.

  3. Homonyms.

What’s the name of a popular Python library that provides a simple interface to the WordNet lexical database?

  1. NLTK.

  2. WordNetAPI.

  3. PythonNLP.

What is tokenization in NLP?

  1. The process of splitting text into tokens, which are usually individual words but they can be also single characters or subwords.

  2. The process of inferring tokens from text, such as noun phrase, verb phrase, noun, adjective, etc.

  3. The process of solving ambiguities in sentences, linking words to their meanings in lexical databases.

What are two common tokenization functions from NLTK?

  1. token_split and sentence_split

  2. word_split and sentence_split

  3. word_tokenize and sent_tokenize

Why is it hard to deal with natural language with grammars?

  1. Because it’s computationally intractable.

  2. Because grammars are hard to define.

  3. Because of aspects like ambiguity, the need for contextual information, and idioms.

1.4 Statistical Approaches and Text Classification with N-grams#

What is text vectorization?

  1. The process of converting text into an unordered set of words.

  2. The process of converting text into a numerical vector that most machine learning models can understand.

  3. The process of converting text into vectors of words that are easier to use by machine learning models.

What does the ngram_range parameter of the CountVectorizer class specify?

  1. The minimum and maximum number of n-grams to be extracted by the vectorizer.

  2. The regular expression used for tokenization.

  3. The lower and upper boundary of the range of n-values for different n-grams to be extracted.

What is a sparse matrix?

  1. A matrix in which most of the elements are zero.

  2. A matrix with few rows and columns.

  3. A matrix with low rank.

What does the lowercase parameter of the CountVectorizer class specify?

  1. Whether or not to convert all characters to lowercase before tokenizing.

  2. Whether or not to convert all characters to lowercase after tokenizing.

  3. To check if the input text is already lowercase.

What do the max_df and min_df parameters of the CountVectorizer class specify?

  1. To ignore terms that have a document frequency respectively lower and higher than the two parameters.

  2. To consider only terms that have a document frequency respectively higher and lower than the two parameters.

  3. To ignore terms that have a document frequency respectively higher and lower than the two parameters.

What does the max_feature parameter of the CountVectorizer class specify?

  1. To build a vocabulary that only considers the top max_features ordered by importance for predicting the label.

  2. To build a vocabulary that only considers the top max_features ordered by term frequency across the corpus.

  3. To build a vocabulary that only considers the bottom max_features ordered by term frequency across the corpus.

What is a bag of words representation?

  1. A representation where text is represented as the set of its words, disregarding word order but considering grammar.

  2. A representation where text is represented as the set of its words, disregarding grammar and even word order but keeping multiplicity.

  3. A representation where text is represented as the ordered list of its words, disregarding grammar but keeping multiplicity.

1.5 Stemming, Lemmatization, Stopwords, POS Tagging#

What do we mean by inflection when talking about natural languages?

  1. It’s the modification of a word to express different grammatical categories such as tense, case, and gender.

  2. It’s the modification of a word over time to express different meanings.

  3. It’s the tone of voice of a specific word relative to its context.

Which of the following reduces words always to a base-form which is an existing word?

  1. Stemming.

  2. Lemmatization.

Which of the following can leverage context to find the correct base form of a word?

  1. Stemming.

  2. Lemmatization.

Which of the following is typically faster?

  1. Stemming.

  2. Lemmatization.

What’s the name of the nltk stemmer class typically used for stemming in languages other than English?

  1. ForeignStemmer.

  2. WinterStemmer.

  3. SnowballStemmer

What’s the name of the function typically used in nltk for extracting the part-of-speech of each token in a text?

  1. nltk.pos_tag.

  2. nltk.lemmatize.

  3. nltk.get_stopwords.

1.9 Representing Texts as Vectors: TF-IDF#

Choose the option that best describes the Zipf’s law.

  1. It states that, given some corpus of natural language utterances, the frequency of any word is inversely proportional to its rank in the frequency table.

  2. It states that, given some corpus of natural language utterances, the frequency of any word is directly proportional to its rank in the frequency table.

  3. It states that, given some corpus of natural language utterances, the frequency of any word is inversely proportional to its number of occurrences in the corpus.

Stopwords are the words that, in a typical corpus, have the…

  1. Most occurrences.

  2. Least occurrences.

What does the acronym TF-IDF stand for?

  1. Term Frequency - Inverse Document Factor

  2. Term Factor - Inverse Document Factor

  3. Term Frequency - Inverse Document Frequency

The TF term of TF-IDF is directly proportional to…

  1. The number of times a word appears in all the documents in the corpus

  2. The number of times a word appears in a document

  3. The number of documents in the corpus

The IDF term of TF-IDF is inversely proportional to…

  1. The frequency of a word in a specific document

  2. The document frequency of a word across a collection of documents

  3. The number of documents in the corpus

As a consequence of TF-IDF:

  1. Rare words have high scores, common words have low scores

  2. Common words have high scores, rare words have low scores

1.12 Representing Texts as Vectors: Word Embeddings#

What are word embeddings?

  1. A type of word representation with numerical vectors that allows words with similar meanings to have a similar representation.

  2. A vectorized representation of words obtained with one-hot encoding

  3. A type of word representation with sparse word vectors that allows words with similar meanings to have a similar representation.

What is a common distinction between word embedding models?

  1. Context-dependent and context-independent word embeddings.

  2. Numerical and word-based embeddings.

  3. Attention-dependent and attention-independent word embeddings.

Choose the option that better describes the ELMO and CoVe models.

  1. Context-independent word embeddings.

  2. Context-dependent and RNN-based word embeddings.

  3. Context-dependent and Transformer-based word embeddings.

Choose the option that better describes the Word2Vec, GloVe and FastText models.

  1. Context-independent word embeddings.

  2. Context-dependent and RNN-based word embeddings.

  3. Context-dependent and Transformer-based word embeddings.

Choose the option that better describes the BERT, XLM, RoBERTa and ALBERT models.

  1. Context-independent word embeddings.

  2. Context-dependent and RNN-based word embeddings.

  3. Context-dependent and Transformer-based word embeddings.

Choose the correct option.

  1. Word embeddings models are often finetuned models that can be retrained for specific use cases.

  2. Word embeddings models must be trained from scratch for each specific use case.

  3. Word embeddings models are often pre-trained models that can be finetuned for specific use cases.

Choose the correct option.

  1. Sentence embeddings models compute an embedding representation of a sentence by averaging the vectors of the words composing the sentence.

  2. Sentence embeddings models can compute an embedding representation of both individual words and sentences out of the box.

Choose the correct option.

  1. The latest embedding models are always better than the previous ones in all the tasks.

  2. When choosing an embedding model, it’s better to look at benchmarks to find the best ones for your specific task.

Questions and Feedbacks#

Have questions about this lesson? Would you like to exchange ideas? Or would you like to point out something that needs to be corrected? Join the NLPlanet Discord server and interact with the community! There’s a specific channel for this course called practical-nlp-nlplanet.