8000 GitHub - raxrock/Preditext
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

raxrock/Preditext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 PrediText

PrediText is a simple LSTM-based next-word prediction tool. It uses a TensorFlow/Keras LSTM network to learn word sequences and predict the next word in a sentence.

🚀 Project Structure

PrediText/ ├── data/ │ └── trainingdata.txt # Your text corpus ├── keras_next_word_model.h5 # Saved trained model ├── next_word_pred.py # Main training & prediction script ├── test_env.py. # Quick check for Python & packages ├── requirements.txt # Pip dependencies ├── README.md # Project documentation └── .vscode/ └── settings.json # (Optional) VS Code Python config

✅ Requirements

This project uses: • Python 3.10+ • numpy • matplotlib • nltk • tensorflow • keras

All dependencies are listed in requirements.txt.

⚙️ Setup

1️⃣ Create & activate a virtual environment

With Conda (recommended):

conda create -n preditext python=3.10 conda activate preditext

Or with venv:

python3 -m venv venv source venv/bin/activate

2️⃣ Install dependencies

pip install -r requirements.txt

🧪 Test your environment

Run:

python test_env.py

✅ This checks: • Python version • numpy, matplotlib, nltk, tensorflow, keras • Downloads punkt for NLTK tokenization

📚 Train the model

Edit data/trainingdata.txt with your own training text. Run:

python next_word_pred.py

This will: • Load & tokenize your text • Build the LSTM model • Train it • Save it as keras_next_word_model.h5 • Plot training accuracy & loss • Predict next words for test sentences

✨ Example output

Input: 'The quick brown fox jumps' Predicted next words:

  1. over (confidence: 0.2345)
  2. around (confidence: 0.1034)
  3. through (confidence: 0.0987)

📝 Notes

✅ This project is for demonstration & learning. ✅ For better results, use a larger training corpus and experiment with embeddings & improved sampling.

📧 Author

Rakshith KK Built with 💡, Python, and a lot of patience

Happy predicting! 🚀✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0