Skip to Section 2 if you have Pytorch 1.4 and Gensim 3.8.1 installed on a Python 3.8 environment.
- Download and install
Anaconda
- Start
Anaconda Prompt
- Change directory to where the
pytorch_env.yml
file is. - Open the
pytorch_env.yml
, change the first linename
and last lineprefix
of the file to your preferred name and location. - Install the environment using
conda env create -f pytorch_env.yml
- Activate the environment
conda activate pytorch_env
(update the command according to the name you specified in step 4, if you made changes).
-
Make sure you are in the directory
limerick
. (Change directory usingcd limerick
if you just completed the last step of setting up). -
Run the script
generate.py
. Flag options:Flag Options Description --model contx_gru, conv_gru* Select model for limerick generation. --temp Default = 1.0 Specify the temperature for generation. --dropout Default = 0.0 Specify the dropout rate before the final dense layer. Example Script :
python generate.py --model conv_gru --temp 1.0 --dropout 0.5
*Convolutional GRU performs better than Contextual GRU, as highlighted in the report.
-
The necessary files and specified model will be loaded, followed by a display of an interactive command prompt interface, like this:
Successfully loaded vocab & special tokens Successfully loaded sound to vocab lookup Successfully loaded vocab to sound lookup Successfully loaded vocab to syllable lookup Successfully loaded model conv_gru Generate a limerick (Y - Yes, S - Yes w Sound Tokens, N - No)? >>>