This is a small NLP project I did to get started with NLP. It is based on the tensorflow shakespeak dataset and once trained can generate new text in shakespear's writing style.
To use this model, you need to clone this repository to your local machine. You can do this by executing the following command:
git clone https://github.com/your-username/repository-name.git
Make sure you have Git installed on your machine before running the command.
-
After cloning the repository, navigate to the project directory.
-
Run the Jupyter Notebook file
text_generation_shakespeare_rnn.ipynb
. This notebook contains the code for training the model. -
Follow the instructions in the notebook to train the model. Once the training is complete, the trained model will be saved in the same folder.
-
Open the file
flaskfrontend.py
in your preferred code editor. -
Make sure you have Flask installed on your machine. If not, you can install it by running the following command:
pip install flask
-
Run the flaskfrontend.py file. The Flask application will start running on
localhost
with port5000
.
The Flask application will start running on localhost
with port 5000
.
-
Open your web browser and navigate to
localhost:5000
. -
Use the frontend interface to make predictions using the trained model. Follow the instructions provided on the webpage to input the necessary data and get predictions.
Note: Ensure that the model has been trained and saved before making predictions. If not, please refer to the "Model Training" section.
This project is licensed under the MIT License. Feel free to modify and distribute this code as per the terms of the license.