How to use the N-gram Generator
- 1. Paste textAdd a document, reviews or any text.
- 2. Set n and typeChoose the n-gram size and words or characters.
- 3. Get the listSee the most frequent n-grams and download them as CSV.
What an n-gram is
An n-gram is a run of n items in a row. With words, "to be or not to be" has five bigrams (n = 2): to be, be or, or not, not to and to be again. The tool counts each one, so the top line reads to be (2). A text with k words has k − n + 1 word n-grams in total.
Character n-grams slide over letters instead. The word "data" gives the character bigrams da, at and ta. They are handy for spotting spelling variants, detecting languages and matching names that are typed differently.
Uses in SEO, marketing and NLP
- SEO and content: find the two- and three-word phrases a page actually repeats, and compare them with the search terms you want to rank for.
- Review mining: bigrams like "late delivery" or "great support" show what customers talk about.
- Language models: classic models predicted the next word from the previous n − 1 words.
- Features: scikit-learn's
CountVectorizer(ngram_range=(1, 2))adds bigrams as model features.
Words are lowercased and punctuation is dropped first, so "Data," and "data" match. Remove stopwords before running if you only want meaningful phrases; the text preprocessing tool does that. Check single-word frequency with the keyword density checker.
Frequently asked questions
What is the difference between a bigram and a trigram?
A bigram has two items in a row, a trigram has three. Set n to 2 or 3.
Is there a text limit?
There is no fixed limit, but very large texts may be slow in older phones. Everything runs on your device.
Is the N-gram Generator free?
Yes, the N-gram Generator is free. The first time you see your first result, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.