A language model assigns probabilities to word sequences. It can use preceding words to predict what comes next. Large language models (LLMs) process natural-language inputs for tasks such as answering questions and summarizing documents; applications can access generative-AI capabilities through an API. section 7.11 section 7.3
An n-gram is a simple probabilistic language model. It estimates the probability of the next word from the previous n − 1 words, using how often that sequence occurs in a text corpus. A bigram uses one preceding word; a trigram uses two. N-grams also turn text into feature vectors for further analysis. They illustrate sequence-based prediction without describing how an LLM works internally. section 7.11
Change the amount of context
For “It is raining heavily,” a unigram treats each word separately, a bigram considers pairs, and a trigram considers groups of three. Increasing n changes which preceding words the model can use to predict the next one. section 7.11
For an application, start with the language task rather than the model name. An LLM API may suit document summarization, answers drawn from documents or websites, or customer support. Text still needs a numerical representation for mathematical analysis; preprocessing and representation choices remain important when building a text-data workflow. section 7.3 section 7.20


































































