May 2020
Intermediate to advanced
404 pages
10h 52m
English
We will now create two different vectorizers one is for users and the other for products. We will need these vectorizers in place to determine the similarity between the requirements of the users and what the reviews tell us about any given product. First, we will create the vectorizer for users and display its shape:
user_vectorizer = TfidfVectorizer(tokenizer = WordPunctTokenizer().tokenize, max_features=1000)user_vectors = user_vectorizer.fit_transform(user_df['Text'])user_vectors.shape
Then, we will create the vectorizer for products:
product_vectorizer = TfidfVectorizer(tokenizer = WordPunctTokenizer().tokenize, max_features=1000)product_vectors = product_vectorizer.fit_transform(product_df['Text']) ...
Read now
Unlock full access