N-Grams are a way of looking at a sequence of words (like a sentence) and splitting it up into smaller chunks. For example, if you had a sentence: "Hello world," you could split it into two "grams": "hello" and "world." An n-gram is when you look at multiple chunks of words, instead of just two. For example, an n-gram with n =3 would look at the sentence "Hello world" like this: "Hello world". The 3 chunks of words are "Hello", "world", and "Hello world".
N-grams are used a lot in Natural Language Processing (NLP) because they help computers understand the context of a sentence. For example, if a computer saw the sentence "Bob went to school", it could understand that Bob IS the subject and school IS the object. This kind of understanding is important for things like machine translation and speech recognition.
In n-gram generation, a computer looks at a sequence of words and finds n-grams of that sequence. For example, if we had a sentence: "I went to the store", we could find the n-grams with n =3, like this: "I went to", "went to the", and "to the store". In this example, we found 3 n-grams.