A simple Python program that generates text using a trigram model.
β
Trains on any text file
β
Uses trigrams to predict words
β
Generates random but structured text
β
Supports file import/export
-
Clone the repo:
git clone https://github.com/yourusername/TrigramTextGen.git cd TrigramTextGen -
Install the requirements:
pip install -r requirements.txt
-
Run the program:
python main.py
- Import a file β Load text data from a CSV or TXT file.
- Export processed text β Extract and save relevant content.
- Train a trigram model β Learn word sequences from the text.
- Generate text β Predict the next words based on probabilities.
- Output random yet structured text! π
> 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!