Skip to Main Content
Python Artificial Intelligence Projects for Beginners
book

Python Artificial Intelligence Projects for Beginners

by Dr. Joshua Eckroth
July 2018
Beginner content levelBeginner
162 pages
3h 25m
English
Packt Publishing
Content preview from Python Artificial Intelligence Projects for Beginners

Bag of words

The bag-of-words model does exactly we want that is to convert the phrases or sentences and counts the number of times a similar word appears. In the world of computer science, a bag refers to a data structure that keeps track of objects like an array or list does, but in such cases the order does not matter and if an object appears more than once, we just keep track of the count rather we keep repeating them.

For example, consider the first phrase from the previous diagram, it has a bag of words that contents words such as channel, with one occurrence, plz, with one occurrence, subscribe, two occurrences, and so on. Then, we would collect all these counts in a vector, where one vector per phrase or sentence or document, depending ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Artificial Intelligence with Python

Artificial Intelligence with Python

Prateek Joshi

Publisher Resources

ISBN: 9781789539462Supplemental Content