Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Quantitative Finance · Begrippenlijst

Wat is Tokenisation, bag of words, n-gram, tf-idf?

Ook bekend als: tokenisation · bag of words · n-gram · term frequency--inverse document frequency

Definition 13.1 Machine Learning for Markets · Hoofdstuk 13 — Text: From Bag of Words to Embeddings

Tokenisation splits a text into units (words, word pieces, punctuation), usually after normalising case. A bag of words represents a document by the counts of its tokens, forgetting their order. An n-gram is a sequence of nn consecutive tokens; bags of n-grams keep some order. Term frequency–inverse document frequency (tf-idf) weights the count of term ww in document dd by log⁡(N/nw)\log(N/n_w), where nwn_w of the NN documents contain ww, so that words found everywhere count for little; the rows are then scaled to unit length.

Lees in het hoofdstuk →