Git Product home page Git Product logo

limerick_generation's Introduction

How to Run

1. Set up Environment

Skip to Section 2 if you have Pytorch 1.4 and Gensim 3.8.1 installed on a Python 3.8 environment.

  1. Download and install Anaconda
  2. Start Anaconda Prompt
  3. Change directory to where the pytorch_env.yml file is.
  4. Open the pytorch_env.yml, change the first line name and last line prefix of the file to your preferred name and location.
  5. Install the environment using conda env create -f pytorch_env.yml
  6. Activate the environment conda activate pytorch_env (update the command according to the name you specified in step 4, if you made changes).

2. Generate Limericks

  1. Make sure you are in the directory limerick. (Change directory using cd limerick if you just completed the last step of setting up).

  2. 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.

  3. 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)? >>> 
    
    • Enter Y to generate limerick:

      cmd_ui_limerick_sample

    • Enter S to generate limerick and predicted sound tokens:

      cmd_ui_limerick_n_sound_sample

    • Enter N to exit the program.

limerick_generation's People

Contributors

toukenize avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.