April 2017
Beginner to intermediate
358 pages
9h 30m
English
One of the simplest but highly effective models is to simply count each word in the dataset. We create a matrix, where each row represents a document in our dataset and each column represents a word. The value of the cell is the frequency of that word in the document. This is known as the bag-of-words model.
Here's an excerpt from The Lord of the Rings, J.R.R. Tolkien:
Three Rings for the Elven-kings under the sky,
Seven for the Dwarf-lords in halls of stone, Nine for Mortal Men, doomed to die,
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie.
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
In the Land of Mordor where the ...
Read now
Unlock full access