Question: Q1 Consider this code: count_vect = CountVectorizer(ngram_range=(1,2)) tfidf_vect = TfidfVectorizer(ngram_range=(1,2)) mat1 = count_vect.fit_transform(corpus) mat2 = tfidf_vect.fit_transform(corpus) Select all correct statements: Group of answer choices a

Q1 Consider this code: count_vect = CountVectorizer(ngram_range=(1,2))

tfidf_vect = TfidfVectorizer(ngram_range=(1,2))

mat1 = count_vect.fit_transform(corpus)

mat2 = tfidf_vect.fit_transform(corpus) Select all correct statements:

Group of answer choices

a - mat1 and mat2 have the same number of columns

b - mat1[i,j] is zero if and only if mat2[i,j] is zero, for each element i,j in the matrices

c - mat1 and mat2 have the same number of rows

d - mat1[i,j] is one if and only if mat2[i,j] is one, for each element i,j in the matrices

Q2 If we only use unigrams, these two documents have the same bag-of-words representation:

Document 1: The dog bit the cat that ate the mouse Document 2: The mouse bit the cat that ate the dog

True or False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!