A “bag of words” is a representation of the words in a phrase or passage, irrespective of order.For example, bag of words represents the following three phrases identically:
Each word is mapped to an index in a sparse vector, where the vector has an index for every word in the vocabulary. For example, the phrase the dog jumps is mapped into a feature vector with non-zero values at the three indices corresponding to the words the, dog, and jumps. The non-zero value can be any of the following:
The post What is bag of words in Machine Learning? appeared first on Data Science PR. Originally from Machine Learning & AI – Data Science PR https://ift.tt/37KxoF4
0 Comments
Leave a Reply. |