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 graduated from Staffordshire University and have always been passionate about Computers, Technology, and Generative AI. Currently, I work as a Senior Data Scientist (AI/ML) and I’m also the founder of TechJunkGigs, a platform dedicated to helping programming students with tutorials on Machine Learning, Data Science, Python, LLM, RAG, Generative AI, and NLP. What started as a blog has now evolved into a valuable resource for students, and I'm committed to sharing knowledge to help them stay updated with industry trends
Related Post