Actions

A Bag of Words

From Algolit

Revision as of 12:44, 25 October 2017 by Gijs (talk | contribs) (Created page with "The bag-of-words model reads a text as a collection of words. While processing a text the model discards word order, punctuation and possibly conjugations. The model transform...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The bag-of-words model reads a text as a collection of words. While processing a text the model discards word order, punctuation and possibly conjugations. The model transforms the text into a unique list of words used in the text, or quite literally a bag of words.

This model is often used to understand the subject of a text by recognizing the important words, or to measure the similarities of texts by comparing their bags of words.

To make the model more informative the occurrences or frequency of words are counted, to be able to compare texts of various lengths this absolute count can be made relative.

To understand the importance of a word in a single text relative to the importance of the word in a collection of texts the TF-IDF can be used, where the frequency of a word in a single text is divided by the average frequency of the word in the collection.