This project implements a simple name generation model using bigram probabilities. It learns the likelihood of one character following another based on a dataset of names and generates new names by sampling from these learned probabilities.
- Learns character bigrams (pairs of characters) from a dataset of names.
- Generates random names by sampling from the learned bigram probabilities.
- Trains a basic neural network to refine bigram probabilities using gradient descent.
- Visualizes bigram frequency matrix and training loss.
- Delimiter: The
.character is used as a delimiter to mark the start and end of each name. - Bigram Model: Probabilities of character pairs are learned to generate realistic-sounding names.
- Python 3.x
- PyTorch
- Matplotlib
-
Clone the repository:
git clone https://github.com/its-nott-me/Bigram.git
-
Install dependencies:
pip install torch matplotlib torch
- Run the Jupyter notebook
bigram.ipynbto explore the code. - The notebook will guide you through the steps of downloading the data, building the model, training it, and generating new names.
This project is licensed under the MIT License.