N-Gram Language Models (Mini Project 3)

- Understand what n-grams are and how they model language with simple probabilities - Implement bigram and trigram extraction using sliding windows over character sequences - Construct frequency dictionaries and normalize into probability matrices - Sample random text using bigram and trigram models to generate synthetic sequences - Evaluate model quality using entropy, character diversity, and negative log likelihood (NLL) - One-hot encode inputs and build PyTorch models for bigram and trigram neural networks - Train models with cross-entropy loss and monitor training dynamics - Compare classical vs. neural models in terms of coherence, prediction accuracy, and generalization