PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #90
You need to train a natural language model to perform text classification on product descriptions that contain millions of examples and 100,000 unique words. You want to preprocess the words…
The correct answer is B. Identify word embeddings from a pre-trained model, and use the embeddings in your model. One-hot encoding (A) with 100,000 unique words produces extremely sparse, high-dimensional vectors that are computationally expensive and carry no semantic meaning. Assigning arbitrary numerical values (D) implies a false ordinal relationship between words. Sorting by frequency…
Question
Options
- ACreate a hot-encoding of words, and feed the encodings into your model.
- BIdentify word embeddings from a pre-trained model, and use the embeddings in your model.
- CSort the words by frequency of occurrence, and use the frequencies as the encodings in your
- DAssign a numerical value to each word from 1 to 100,000 and feed the values as inputs in your
How the community answered
(33 responses)- A3% (1)
- B85% (28)
- C3% (1)
- D9% (3)
Explanation
One-hot encoding (A) with 100,000 unique words produces extremely sparse, high-dimensional vectors that are computationally expensive and carry no semantic meaning. Assigning arbitrary numerical values (D) implies a false ordinal relationship between words. Sorting by frequency and using frequencies (C) encodes only commonality, not meaning. Pre-trained word embeddings (B), such as Word2Vec or GloVe, map each word to a dense, low-dimensional vector (e.g., 300 dimensions) where semantically similar words are geometrically close. These embeddings are especially well-suited for RNNs because they provide meaningful numerical input representations that the network can process sequentially, and leveraging pre-trained embeddings avoids training from scratch on the full vocabulary.
Topics
Community Discussion
No community discussion yet for this question.