These representations become the key to making a model understand the essence of different sentences. ![]() Hence, if the vocab matrix columns are in the order of I, have, a, dog, you, and cat, the first sentence (“I have a dog”) representation becomes 1,1,1,1,0,0, while the second sentence (“You have a cat”) representation becomes 0,1,1,0,1,1. For example, “I have a dog” has 4 of the 6 words available in the vocabulary, so we will turn on the bits for the existing words and turn off the bits for the words that don’t exist in the sentence. Now we have 6 columns representing each word in the vocabulary.Įach sentence is now represented as a combination of all the words in the vocabulary. Our sentences have a combined word count of 8, but since we have 2 words ( have, a) repeating, the total vocabulary size becomes 6. We have two sentences “I have a dog” and “You have a cat.” First, we grab all the words present in our current vocabulary and create a representation matrix where each column is dedicated to one of the words, as seen in Figure 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |