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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started