X

NLP – Bag of Words

Bag of Words

A bag of words is a particular representation model used to simplify the contents of a selection of text. The bag of words model omits grammar and word order but is interested in the number of occurrences of words within the text.

Example: –

"John likes to watch movies. Mary likes movies too"

The resulting bag of words representation as a dictionary:

{
'John': 1,
'likes':2,
'to':1
'watch': 1,
'movies': 2,
'Mary': 1,
'too': 1
}

 

Categories: Short Notes
Jamaley Hussain: Hello, I am Jamaley. I did my graduation from StaffordShire University UK . Fortunately, I find myself quite passionate about Computers and Technology.
Related Post