A developer is building a text classification model to organize legal contracts. The documents contain a vast vocabulary with specialized jargon and numerous synonyms (e.g., "attorney", "counselor", "counsel", "lawyer"). Which text representation model will best capture the semantic relationships between these terms to improve classifier performance?
Select an answer to reveal the explanation.
Short Explanation
Imagine you're building a system to sort legal documents, and one contract uses "attorney" while another uses "lawyer". If you use traditional methods like Bag-of-Words or One-Hot encoding, the computer treats those as unrelated strings and can't tell they mean the same thing. Dense word embeddings like Word2Vec or GloVe map words by semantic context, placing related terms close together so your classifier generalizes better.
Full Explanation
In text classification, capturing semantic similarity is critical when dealing with domain-specific jargon and synonyms. Pre-trained dense word embeddings, such as Word2Vec or GloVe, represent words as dense, low-dimensional vectors in a continuous vector space, typically 100 to 300 dimensions. These models are trained on large corpora to place semantically similar words near one another in this space. For a classifier, this means that even if a training document contains "attorney" and a test document contains "lawyer," the model can utilize the proximity of their vectors to make accurate predictions. One-Hot Encoding represents words as sparse, high-dimensional vectors where only one index is 1 and all others are 0. The dot product between any two distinct word vectors is always 0, meaning it cannot capture any semantic relationship between synonyms. Bag-of-Words and Term Frequency-Inverse Document Frequency are vocabulary-dependent sparse models. They represent documents by word counts or statistical weights, treating each word as an independent feature. They do not model word semantic similarity, making them less effective at generalizing across different synonyms.