Skip to content

its-nott-me/Bigram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Name Generator with Bigram Probabilities

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.

Features:

  • 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.

Key Concepts:

  • 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.

Requirements:

  • Python 3.x
  • PyTorch
  • Matplotlib

Installation:

  1. Clone the repository:

    git clone https://github.com/its-nott-me/Bigram.git
  2. Install dependencies:

    pip install torch matplotlib torch

Usage:

  1. Run the Jupyter notebook bigram.ipynb to explore the code.
  2. The notebook will guide you through the steps of downloading the data, building the model, training it, and generating new names.

License:

This project is licensed under the MIT License.

About

A simple name generation model based on bigram probabilities, the model learns the frequency distribution of character pairs (bigrams) and uses these probabilities to generate realistic-sounding names.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors