nerdexam
Amazon

MLS-C01 · Question #35

A term frequency-inverse document frequency (tf-idf) matrix using both unigrams and bigrams is built from a text corpus consisting of the following two sentences: 1. Please call the number below. 2…

The correct answer is A. (2, 16). There are 2 sentences, 8 unique unigrams, and 8 unique bigrams, so the result would be (2,16). The phrases are “Please call the number below” and “Please do not call us.” Each word individually (unigram) is “Please,” “call,” ”the,” ”number,” “below,” “do,” “not,” and “us.” The…

Modeling

Question

A term frequency-inverse document frequency (tf-idf) matrix using both unigrams and bigrams is built from a text corpus consisting of the following two sentences: 1. Please call the number below. 2. Please do not call us. What are the dimensions of the tf-idf matrix?

Options

  • A(2, 16)
  • B(2, 8)
  • C(2, 10)
  • D(8, 10)

How the community answered

(33 responses)
  • A
    85% (28)
  • B
    9% (3)
  • C
    3% (1)
  • D
    3% (1)

Explanation

There are 2 sentences, 8 unique unigrams, and 8 unique bigrams, so the result would be (2,16). The phrases are “Please call the number below” and “Please do not call us.” Each word individually (unigram) is “Please,” “call,” ”the,” ”number,” “below,” “do,” “not,” and “us.” The unique bigrams are “Please call,” “call the,” ”the number,” “number below,” “Please do,” “do not,” “not call,” and “call us.”

Topics

#TF-IDF#Text Representation#Feature Engineering#NLP

Community Discussion

No community discussion yet for this question.

Full MLS-C01 Practice