The Play Generator is a text generation model built using TensorFlow and Keras, trained on the works of William Shakespeare. This model utilizes a character-based approach to generate text that mimics the style of Shakespearean plays.
- Downloads and preprocesses Shakespeare's text data.
- Encodes characters into integers for model training.
- Creates training examples and targets for the model.
- Builds a recurrent neural network (RNN) using LSTM layers.
- Implements a custom loss function for training.
- Saves model checkpoints during training.
- Generates text based on a user-provided starting string.
- Python 3.x
- TensorFlow
- Keras
- NumPy
- Other dependencies as specified in the code
- The model is trained for 50 epochs on the Shakespeare dataset. You can adjust the number of epochs in the training section of the notebook.
- After training, you can generate text by providing a starting string. The model will produce a continuation of the text in the style of Shakespeare.
inp = input("Type a starting string: ")
print(generate_text(model, inp))
- The model saves checkpoints during training, allowing you to resume training or load a pre-trained model.
- Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.
- Inspired by the works of William Shakespeare.
- Utilizes TensorFlow and Keras for deep learning.