Skip to content

TrigramTextGen is a Python text generator that uses trigrams to create realistic sentences based on input text. It supports custom datasets, randomized text generation, and file import/export.

License

Notifications You must be signed in to change notification settings

undependable/TrigramTextGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrigramTextGen

A simple Python program that generates text using a trigram model.

πŸ“Œ Features

βœ… Trains on any text file
βœ… Uses trigrams to predict words
βœ… Generates random but structured text
βœ… Supports file import/export

πŸš€ Installation

  1. Clone the repo:

    git clone https://github.com/yourusername/TrigramTextGen.git
    cd TrigramTextGen
  2. Install the requirements:

    pip install -r requirements.txt
  3. Run the program:

    python main.py

πŸ”§ How It Works

  1. Import a file – Load text data from a CSV or TXT file.
  2. Export processed text – Extract and save relevant content.
  3. Train a trigram model – Learn word sequences from the text.
  4. Generate text – Predict the next words based on probabilities.
  5. Output random yet structured text! πŸš€

πŸ–₯️ Example Usage

> python main.py
1. Import file
2. Export file
3. Generate text
4. Quit
> 1
Input file name: my_data.csv
> 3
Type an output file: processed_data.txt
This keeps things **clear, short, and beginner-friendly** while covering everything important!

About

TrigramTextGen is a Python text generator that uses trigrams to create realistic sentences based on input text. It supports custom datasets, randomized text generation, and file import/export.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages